tui

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 77 Imported by: 0

Documentation

Overview

Package tui is the agent TUI: bubbletea v2 + ultraviolet, built around the code runner (zkit/agent/runner). It is a single tea.Model that paints panes onto a uv.ScreenBuffer via Draw(scr, area); panes are imperative structs the root draws directly, with no per-pane Update loop. Runner events arrive as tea messages via the teasink event spine and land in the run timeline.

Index

Constants

This section is empty.

Variables

View Source
var ErrCheckpointConflict = errors.New("checkpoint conflict")
View Source
var ErrCheckpointNotFound = errors.New("checkpoint not found")

Functions

func RunFn

func RunFn(ctx context.Context, l *engine.LiveRunner, prompt string) tea.Cmd

RunFn is the UI.SetRunFn handler: it adapts the charm-free engine.LiveRunner.RunTurn into a tea.Cmd. A setup failure surfaces as turnSetupFailedMsg; a finished turn surfaces as liveTurnFinishedMsg. The turn runs off the Update loop, and streaming output reaches the timeline through the sink's pump. It is a package func, not a method, because RunFn must live in the TUI (it returns a tea.Cmd) while LiveRunner lives in the engine.

func RunFnWithAttachments added in v0.2.0

func RunFnWithAttachments(ctx context.Context, l *engine.LiveRunner, prompt string, attachments []llm.ContentPart) tea.Cmd

func UseTheme

func UseTheme(t theme.Theme)

UseTheme sets the active colour theme for all subsequent draws and bumps the theme generation so colour-baking caches re-render.

Types

type Checkpoints

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

func NewCheckpoints

func NewCheckpoints(workspaceDir string) *Checkpoints

func (*Checkpoints) CheckpointForTurn

func (c *Checkpoints) CheckpointForTurn(turnID string) (TurnCheckpoint, bool)

func (*Checkpoints) CompleteTurn

func (c *Checkpoints) CompleteTurn(turnID string, at time.Time)

func (*Checkpoints) PlanRestoreFile

func (c *Checkpoints) PlanRestoreFile(turnID, path string) (RollbackPlan, error)

func (*Checkpoints) PlanRestoreTurn

func (c *Checkpoints) PlanRestoreTurn(turnID string) (RollbackPlan, error)

func (*Checkpoints) RecordMutation

func (c *Checkpoints) RecordMutation(m WorkingSetMutation, before []byte, beforeMissing bool, after []byte, afterMissing bool)

func (*Checkpoints) RestoreFile

func (c *Checkpoints) RestoreFile(turnID, path string) error

func (*Checkpoints) RestoreTurn

func (c *Checkpoints) RestoreTurn(turnID string) error

func (*Checkpoints) SetWorkspaceDir

func (c *Checkpoints) SetWorkspaceDir(workspaceDir string)

func (*Checkpoints) StartTurn

func (c *Checkpoints) StartTurn(turnID string, turnOrdinal int, at time.Time)

func (*Checkpoints) Turns

func (c *Checkpoints) Turns() []TurnCheckpoint

type EventRing

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

EventRing is a fixed-capacity circular buffer of recent runner events. It is safe for single-goroutine use (the TUI Update loop).

func NewEventRing

func NewEventRing(capacity int) *EventRing

NewEventRing returns an empty ring with the given capacity.

func (*EventRing) Add

func (r *EventRing) Add(e EventRingEntry)

Add pushes an entry onto the ring, evicting the oldest entry when full.

func (*EventRing) Snapshot

func (r *EventRing) Snapshot() []EventRingEntry

Snapshot returns a copy of all entries in insertion order (oldest first).

type EventRingEntry

type EventRingEntry struct {
	Kind   string
	Detail string
	At     time.Time
}

EventRingEntry is one recorded runner event with a timestamp and a brief human-readable kind/detail pair.

type FileCheckpoint

type FileCheckpoint struct {
	Path      string
	Before    FileImage
	After     FileImage
	Mutations int
	Additions int
	Deletions int
}

type FileImage

type FileImage struct {
	Content []byte
	Missing bool
}

type Focusable

type Focusable interface {
	Pane

	// Focused reports whether this pane currently holds keyboard focus.
	Focused() bool

	// Focus is called when the pane gains keyboard focus.
	Focus()

	// Blur is called when the pane loses keyboard focus.
	Blur()
}

Focusable is a Pane that can receive keyboard focus. The shell tracks which pane is focused and routes KeyPressMsg, PasteMsg, and ClipboardMsg to it first (before falling back to broadcast).

Focus/Blur are called by the shell during focus transitions. Panes use Focused() to decide whether to render a cursor, selection highlight, or other focus-dependent chrome.

type InspectorSnapshot

type InspectorSnapshot struct {
	// Tools is the tool roster that would be registered for the next turn.
	Tools []tools.ToolSpec
	// PlanMode is whether the runner is in PLAN mode.
	PlanMode bool
	// PromptSystem is the rendered system prompt for the current mode.
	PromptSystem string
	// PromptStack records neutral prompt-fragment accounting for inspection.
	PromptStack prompts.Stack
	// PromptSource is the active prompt body source selected by live resolution.
	PromptSource string
	// PromptPreferencesSource is the additive preferences source, when present.
	PromptPreferencesSource string
	// PromptResolutionMode identifies embedded or explicit override resolution.
	PromptResolutionMode home.PromptResolutionMode
	// Errors are non-fatal snapshot/render issues surfaced in the inspector.
	Errors []string
	// Guardrails is a summary of guardrail configuration.
	Guardrails string
	// Processes lists background bash processes tracked by the live ProcessManager.
	Processes []code.ProcessInfo
	// MCPServers lists configured/running MCP servers (names only, redacted).
	MCPServers []string
	// EventLog contains recent runner events from the session.
	EventLog []EventRingEntry
	// Skills is the loaded skill catalog for the workspace.
	Skills []catalog.Skill
	// Agents is the loaded agent catalog for the workspace.
	Agents []catalog.Agent
	// Hooks is the loaded command-hook catalog for the workspace — what the
	// next turn's hook guardrail arms.
	Hooks []catalog.Hook
	// ToolSurface is the exact post-gate surface from the latest top-level
	// request. Zero before the first iteration completes.
	ToolSurface runner.ToolSurface
}

InspectorSnapshot holds a read-only view of the runner's current state, built on demand without starting a run or mutating persistent registries.

func BuildInspectorSnapshot

func BuildInspectorSnapshot(session *Session, live *engine.LiveRunner, catalog *engine.RuntimeCatalog) InspectorSnapshot

BuildInspectorSnapshot builds a read-only snapshot of the runner's state for the inspector overlay. It does not start a run or mutate persistent state.

type Launch

type Launch struct {
	EnvFile       string
	AgentName     string
	Resume        bool
	Headless      bool
	Prompt        string // pre-resolved in Main from --prompt-file/--prompt-text
	MaxIter       int
	PprofAddr     string
	TraceFile     string
	PromptProfile engine.PromptProfile
	ReportFile    string
}

Launch implements zapp.Program[*Zarlcode]. Flag values are parsed in zarlcode.Main and threaded through here so Create/Run never touch the flag package — they read intent off the struct.

func (Launch) Create

func (p Launch) Create(ctx context.Context, app *zapp.App[*Zarlcode]) (*Zarlcode, error)

Create wires the application against the workspace (the launch cwd): optional .env, file-only logging (the alt-screen owns stdout), shared ~/.zarlcode settings + provider, the bubbletea model, and the live runner. Long-lived resources are registered with app.AddCloser so the harness closes them deterministically on exit.

func (Launch) Name

func (Launch) Name() string

Name identifies the program to the zapp harness (errors, signals).

func (Launch) Run

func (p Launch) Run(ctx context.Context, _ *zapp.App[*Zarlcode], z *Zarlcode) int

Run drives the application. --headless runs one task to completion and returns its exit code (no TUI). Otherwise it starts the bubbletea v2 loop, then persists the resumable session.

type PRInfo

type PRInfo struct {
	Number int
	Title  string
	URL    string
	State  string // OPEN / MERGED / CLOSED, as reported by gh
	Draft  bool
}

PRInfo is the at-a-glance view of the open GitHub PR for the active branch, rendered in the cockpit's workspace card. Populated asynchronously by fetchPRCmd; nil means "no PR, gh unavailable, or not yet resolved".

type Pane

type Pane interface {
	// Draw paints the pane's content into scr within area. The shell
	// guarantees area is non-empty and clipped to the screen.
	Draw(scr uv.Screen, area uv.Rectangle)

	// Update handles a message intended for this pane. Returns a command
	// the shell should execute, or nil when the message was not consumed.
	Update(msg tea.Msg) tea.Cmd
}

Pane is a rectangular region of the screen that handles its own rendering and event dispatch. A pane returns nil from Update when a message isn't for it, letting the shell try the next pane in priority order.

Panes do not implement tea.Model. They are driven imperatively by the shell: the shell computes the pane's bounds from the layout, calls Draw with that rectangle, and routes messages through Update.

type RollbackFilePlan

type RollbackFilePlan struct {
	Path     string
	Action   string
	Conflict bool
}

type RollbackPlan

type RollbackPlan struct {
	TurnID   string
	Path     string
	Files    []RollbackFilePlan
	Conflict bool
}

type RunState

type RunState struct {
	// --- live run (reset each top-level turn) ---
	Running bool
	// contains filtered or unexported fields
}

RunState is the cockpit model: the live summary of the current top-level run plus the session-cumulative accounting (tokens, cost, tools, compaction, per-turn history) the sidebar and dashboard render. It is folded from runner events in handleRunnerMsg — every field here is set from a teasink message, never derived at the call site.

func (*RunState) RestoreUsage

func (s *RunState) RestoreUsage(snap SessionUsageSnapshot)

RestoreUsage seeds the session rollup from a persisted snapshot so a resumed session's cockpit reflects the tokens it already spent. Live counters are untouched; the next turn accumulates on top.

func (*RunState) UsageSnapshot

func (s *RunState) UsageSnapshot() SessionUsageSnapshot

UsageSnapshot captures the session rollup for persistence.

type Session

type Session struct {
	// Workspace identity.
	Workspace    string  // ~-shortened display path
	WorkspaceDir string  // real path for file operations
	Branch       string  // git branch, or ""
	PR           *PRInfo // open GitHub PR for Branch, or nil until resolved

	// Active provider/model display state.
	Provider string
	Model    string

	// Provider specs for repoint detection after settings change.
	ProvFallback engine.ProviderSpec // env-derived default
	ProvSpec     engine.ProviderSpec // currently-pointed selection
	// Model list cache — populated by async fetch, read by quick pick and
	// settings dialog. Keyed by provider name.
	ModelCache map[string][]string

	// Persisted session identity.
	StartedAt time.Time // when this TUI session launched
	ID        string    // persisted session id, empty until first save
	Label     string
	CreatedAt time.Time

	// Runtime modes and telemetry.
	PlanMode           bool // PLAN mode (shift+tab): read-only tools, planning prompt
	CockpitExpanded    bool // full-width dashboard (ctrl+l)
	StateSidebarHidden bool // temporary shell preference toggled with ctrl+b
	Run                RunState

	// User preferences loaded from the settings store.
	ConfirmQuit bool

	// AutoCompact mirrors the compaction_mode setting: true (default) means the
	// runner auto-compacts; false means manual, so the cockpit warns near the
	// trigger instead. compactWarned latches the one-shot warning so it fires
	// once per crossing rather than every iteration.
	AutoCompact bool

	// Transient notification — shown at the right of the status bar.
	Toast     string
	ToastTone toastTone
	ToastAt   time.Time

	// Plan is the latest structured plan from update_plan. The plan overlay
	// (ctrl+p) and transcript plan notices read this.
	Plan code.Plan

	// WorkingSet records file mutations observed during this TUI session.
	WorkingSet *WorkingSet

	// Checkpoints records per-turn pre-images for changed files so a later UI can
	// offer rollback without asking the runner to own TUI-shaped state.
	Checkpoints *Checkpoints

	// EventLog holds a ring of the most recent runner events for inspector
	// debugging.
	EventLog *EventRing

	// LastToolResult holds the most recent tool's Result (any) for rich
	// rendering by the timeline pane.
	LastToolResult any

	// LastToolEffects holds the most recent tool's typed Effects, replacing
	// the old firstEffectSummary string flattening.
	LastToolEffects []tools.Effect

	// LastParentToolCallID is the ParentToolCallID from the most recent
	// ConversationStarted/Completed, linking sub-agents to their spawn call.
	LastParentToolCallID string

	// LastAgentName is the AgentName from ConversationStarted.
	LastAgentName string

	// PendingSkillNames tracks skill_load ToolStartedMsg parameters by ToolID
	// so skill names can be surfaced when the tool completes.
	PendingSkillNames map[string]string

	// SkipStartedPrompt suppresses the ConversationStarted user row for a
	// queued input already rendered while the previous turn was live.
	SkipStartedPrompt string
	// contains filtered or unexported fields
}

Session holds the shared mutable state that runner events update and multiple panes read. It replaces the 15+ scattered fields on the old UI struct, giving each pane a single source of truth for workspace identity, run progress, plan state, and user preferences.

The shell owns the Session; panes receive a pointer in Draw so they can read live state without holding their own copies. Runner events flow through handleRunnerMsg, which delegates state changes to Session mutation methods; panes then re-render on the next frame from the updated session.

func NewSession

func NewSession(workspace, workspaceDir, branch string) *Session

NewSession returns a Session with sensible defaults.

func (*Session) ActiveProviderSpec

func (s *Session) ActiveProviderSpec() engine.ProviderSpec

func (*Session) ApplyModelPricing

func (s *Session) ApplyModelPricing(model string)

func (*Session) ApplyProviderCostBasis

func (s *Session) ApplyProviderCostBasis(spec engine.ProviderSpec)

func (*Session) CacheModels

func (s *Session) CacheModels(provider string, models []string)

func (*Session) ClearIdentity

func (s *Session) ClearIdentity()

func (*Session) EnsureIdentity

func (s *Session) EnsureIdentity(id string, now time.Time)

func (*Session) ProviderContext

func (s *Session) ProviderContext() (engine.ProviderSpec, engine.ProviderSpec)

func (*Session) SetActiveModel

func (s *Session) SetActiveModel(model string)

func (*Session) SetActiveProviderSpec

func (s *Session) SetActiveProviderSpec(spec engine.ProviderSpec)

func (*Session) SetCockpitExpanded

func (s *Session) SetCockpitExpanded(expanded bool)

func (*Session) SetConfirmQuit

func (s *Session) SetConfirmQuit(confirm bool)

func (*Session) SetContextWindow

func (s *Session) SetContextWindow(tokens int)

func (*Session) SetErrorToast

func (s *Session) SetErrorToast(msg string)

func (*Session) SetIdentity

func (s *Session) SetIdentity(id, label string, createdAt time.Time)

func (*Session) SetModelMeta

func (s *Session) SetModelMeta(m modelMeta)

SetModelMeta wires the registry-backed resolver and refreshes the basis. Called once when settings open; nil leaves the cost basis at its defaults.

func (*Session) SetPressureConfig

func (s *Session) SetPressureConfig(window, reserve int)

func (*Session) SetPricing

func (s *Session) SetPricing(inPer1k, outPer1k float64)

func (*Session) SetProviderContext

func (s *Session) SetProviderContext(fallback, current engine.ProviderSpec)

func (*Session) SetProviderDisplay

func (s *Session) SetProviderDisplay(name string)

func (*Session) SetSkipStartedPrompt

func (s *Session) SetSkipStartedPrompt(prompt string)

func (*Session) SetSuccessToast

func (s *Session) SetSuccessToast(msg string)

func (*Session) SetToast

func (s *Session) SetToast(msg string)

SetToast records a status-bar notification with an expiry timestamp. The tone is inferred for existing callers so legacy "✓ ..." / "✗ ..." messages still render with semantic colours.

func (*Session) SetToastTone

func (s *Session) SetToastTone(msg string, tone toastTone)

func (*Session) SetWorkspace

func (s *Session) SetWorkspace(root, model string)

func (*Session) ToastExpiryCmd

func (s *Session) ToastExpiryCmd() tea.Cmd

ToastExpiryCmd returns a command that wakes the Update loop when the current toast is due to expire. Returns nil when no toast is active.

func (*Session) TogglePlanMode

func (s *Session) TogglePlanMode() bool

type SessionUsageSnapshot

type SessionUsageSnapshot struct {
	Turns           int            `json:"turns"`
	ToolCalls       int            `json:"tool_calls"`
	In              int            `json:"in"`
	Out             int            `json:"out"`
	Cached          int            `json:"cached"`
	InParent        int            `json:"in_parent"`
	OutParent       int            `json:"out_parent"`
	CachedParent    int            `json:"cached_parent"`
	CostUSD         float64        `json:"cost_usd,omitempty"`
	CostParentUSD   float64        `json:"cost_parent_usd,omitempty"`
	CacheSavedUSD   float64        `json:"cache_saved_usd,omitempty"`
	NestedCompleted int            `json:"nested_completed,omitempty"`
	NestedFailed    int            `json:"nested_failed,omitempty"`
	NestedDuration  time.Duration  `json:"nested_duration,omitempty"`
	NestedTools     map[string]int `json:"nested_tools,omitempty"`
}

type TurnCheckpoint

type TurnCheckpoint struct {
	TurnID      string
	TurnOrdinal int
	StartedAt   time.Time
	CompletedAt time.Time
	Files       map[string]FileCheckpoint
}

type UI

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

UI is the sole bubbletea v2 model. Per-pane state lives in imperative sub-structs the root drives directly; they do not implement tea.Model.

func New

func New() *UI

New constructs the v2 UI model. The cockpit gauge defaults to the live runner's context window so the fill fraction is meaningful from the first turn even before the consumer overrides it.

func (*UI) ActivateIntro

func (m *UI) ActivateIntro(ctx context.Context)

func (*UI) Draw

func (m *UI) Draw(scr uv.Screen, _ uv.Rectangle)

Draw paints the pane rectangles onto scr. area is the clip region (the full screen); per-pane geometry comes from m.layout.

func (*UI) Init

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

Init implements tea.Model. Non-critical startup work runs as Bubble Tea commands so the first frame is not blocked by external services.

func (*UI) SaveSession

func (m *UI) SaveSession(ctx context.Context) error

func (*UI) SetContextWindow

func (m *UI) SetContextWindow(tokens int)

SetContextWindow overrides the cockpit gauge's denominator (the model's usable context window, in tokens). Defaults to the live runner's window.

func (*UI) SetLiveRunner

func (m *UI) SetLiveRunner(l *engine.LiveRunner)

SetLiveRunner wires the live runner as the prompt handler AND keeps a reference so a provider change in the settings overlay can re-point it mid-session (see maybeRepoint).

func (*UI) SetPressureConfig

func (m *UI) SetPressureConfig(window, reserve int)

SetPressureConfig records the compaction pressure threshold (window - reserve) so the context bar can draw a marker at the trigger point and the headline can show "compact at ~Xk". Pass window=0 to hide the pressure indicator.

func (*UI) SetPricing

func (m *UI) SetPricing(inPer1k, outPer1k float64)

SetPricing overrides the cockpit's per-1k (input, output) USD token price. Use it when the exact rate is known and the name-matched default is wrong or missing.

func (*UI) SetProvider

func (m *UI) SetProvider(name string)

SetProvider records the active provider name (e.g. "llamacpp", "anthropic") for the cockpit's identity section, and whether it's a local/unmetered backend (drives the COST label). Empty hides the provider row.

func (*UI) SetProviderContext

func (m *UI) SetProviderContext(fallback, current engine.ProviderSpec)

SetProviderContext records the env-derived fallback spec and the currently active spec, so the settings overlay can detect a provider change and re-point the live runner on close.

func (*UI) SetRunFn

func (m *UI) SetRunFn(fn func(prompt string) tea.Cmd)

SetRunFn wires the live-run launcher invoked when the user submits a prompt. The standalone cmd sets this after building the runner factory.

func (*UI) SetSettings

func (m *UI) SetSettings(s *engine.Settings)

SetSettings wires the persistence handle so the settings overlay (ctrl+s) can read and write preferences. Nil leaves the overlay unavailable. Also resolves the confirm_quit setting.

func (*UI) SetStartupFailure added in v0.1.3

func (m *UI) SetStartupFailure(wsRoot, title, err string)

func (*UI) SetWorkspace

func (m *UI) SetWorkspace(root, model string)

SetWorkspace sets the workspace path (~-shortened), git branch (if any), and model name. The workspace/branch render in the state sidebar; the model also appears in the timeline title. Resolving the model name seeds the cockpit's best-effort token pricing (overridable via SetPricing).

func (*UI) Update

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

Update implements tea.Model. Resize recomputes the layout rects; esc stops a running turn while ctrl+c handles quitting. Runner events (teasink messages) are handled here too.

func (*UI) View

func (m *UI) View() tea.View

View implements tea.Model. It allocates a screen buffer, paints the pane rects into it via Draw, and hands the flattened content back to bubbletea. Alt-screen and mouse mode are set on the View — bubbletea v2 has no WithAltScreen program option; per-View fields replace it.

type WorkingSet

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

WorkingSet records file mutations observed during this TUI session. It is a local, in-memory read model for future panes; persistence and rendering stay outside this type.

func NewWorkingSet

func NewWorkingSet(workspaceDir string) *WorkingSet

NewWorkingSet returns an empty working-set model for workspaceDir.

func (*WorkingSet) CompleteTurn

func (w *WorkingSet) CompleteTurn(turnID string)

CompleteTurn clears active attribution once the top-level runner turn ends.

func (*WorkingSet) DiffBodies

func (w *WorkingSet) DiffBodies() map[string]string

DiffBodies returns the latest unified-diff body per changed file. This is the persistable shape stored in a session's diff_bodies_json so the Files dock and diff viewer repopulate on -continue. Nil when nothing changed.

func (*WorkingSet) FilesChangedForTurn

func (w *WorkingSet) FilesChangedForTurn(turnID string) []WorkingSetFile

FilesChangedForTurn returns one coalesced summary per file changed during the given turn, ordered by first mutation within that turn.

func (*WorkingSet) FilesChangedThisSession

func (w *WorkingSet) FilesChangedThisSession() []WorkingSetFile

FilesChangedThisSession returns one coalesced summary per changed file, ordered by first mutation in the session.

func (*WorkingSet) MutationsForFile

func (w *WorkingSet) MutationsForFile(path string) []WorkingSetMutation

MutationsForFile returns the full per-mutation history for path.

func (*WorkingSet) MutationsForTurn

func (w *WorkingSet) MutationsForTurn(turnID string) []WorkingSetMutation

MutationsForTurn returns the full per-mutation history for turnID.

func (*WorkingSet) MutationsThisSession

func (w *WorkingSet) MutationsThisSession() []WorkingSetMutation

MutationsThisSession returns the full per-mutation history for the session.

func (*WorkingSet) RecordDiff

func (w *WorkingSet) RecordDiff(path, diff string) WorkingSetMutation

RecordDiff stores one file mutation using the current time.

func (*WorkingSet) RestoreDiffBodies

func (w *WorkingSet) RestoreDiffBodies(bodies map[string]string, at time.Time)

RestoreDiffBodies replays persisted diff bodies into an empty working set so the Files dock and diff viewer reflect the resumed session. Each path becomes a single mutation outside any turn; counts are recomputed from the body. Paths are replayed in sorted order so the dock ordering is deterministic across restores.

func (*WorkingSet) SetWorkspaceDir

func (w *WorkingSet) SetWorkspaceDir(workspaceDir string)

SetWorkspaceDir updates the root used to normalize absolute paths into workspace-relative paths. Existing mutations keep the path recorded at the time they were observed.

func (*WorkingSet) StartTurn

func (w *WorkingSet) StartTurn(turnID string) int

StartTurn marks a top-level runner turn as the active attribution target for subsequent diffs.

func (*WorkingSet) TurnsChangedThisSession

func (w *WorkingSet) TurnsChangedThisSession() []WorkingSetTurn

TurnsChangedThisSession returns one summary per turn that changed files, ordered by the first mutation observed in each turn. Diffs observed outside a top-level turn are intentionally excluded because they have no turn identity.

type WorkingSetFile

type WorkingSetFile struct {
	Path           string
	FirstChangedAt time.Time
	LastChangedAt  time.Time
	Additions      int
	Deletions      int
	Mutations      int
}

WorkingSetFile is the coalesced session or turn summary for one changed file.

type WorkingSetMutation

type WorkingSetMutation struct {
	Path            string
	Diff            string
	TurnID          string
	TurnOrdinal     int
	ChangedAt       time.Time
	MutationOrdinal int
	Additions       int
	Deletions       int
}

WorkingSetMutation is one recorded file mutation and the turn it belongs to.

type WorkingSetTurn

type WorkingSetTurn struct {
	ID             string
	Ordinal        int
	FirstChangedAt time.Time
	LastChangedAt  time.Time
	Files          int
	Mutations      int
	Additions      int
	Deletions      int
}

WorkingSetTurn is the coalesced summary for files changed during one turn.

type Zarlcode

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

Zarlcode is the running application: workspace, settings, the live runner, and the bubbletea model. It's the typed instance carried by the zapp lifecycle harness — Launch.Create wires it (registering closers with the app), Launch.Run drives it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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