tui

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootMenuOwner MenuOwnerID = "root"

	GlobalActionHelp GlobalActionID = "help"
	GlobalActionQuit GlobalActionID = "quit"
)

Variables

View Source
var (
	ErrInvalidMenuSnapshot = errors.New("invalid menu snapshot")
	ErrStaleMenuAction     = errors.New("stale menu action reference")
	ErrUnknownMenuAction   = errors.New("unknown menu action reference")
	ErrAmbiguousMenuKey    = errors.New("ambiguous menu shortcut")
	ErrMenuActionMismatch  = errors.New("menu action ownership or identity mismatch")
	ErrMenuItemDisabled    = errors.New("menu item is disabled")
	ErrMenuItemNotAction   = errors.New("menu item is not actionable")
	ErrMenuHandlerMissing  = errors.New("menu action handler is missing")
)

Functions

func AvailableHeight added in v0.0.4

func AvailableHeight(totalHeight, overhead int) int

AvailableHeight subtracts screen-owned overhead and clamps the result.

func CalculateDynamicElementHeight added in v0.0.4

func CalculateDynamicElementHeight(totalHeight int, helpLines int, staticLines int, hasBorder bool) int

CalculateDynamicElementHeight computes a safe height inside a child model's root-allocated content region. helpLines is retained for local, non-root help embedded inside a component such as a dialog.

func CalculatePaneWidths added in v0.0.4

func CalculatePaneWidths(totalWidth, paneCount, reservedWidth int) []int

CalculatePaneWidths divides the usable content width without returning negative dimensions. reservedWidth includes borders, margins, joins, or other horizontal cells owned by the caller.

func ClampIndex added in v0.0.4

func ClampIndex(index, itemCount int) int

ClampIndex keeps a selection valid for a collection, returning zero for an empty collection.

func ClampViewportOffset added in v0.0.4

func ClampViewportOffset(offset, selected, itemCount, visibleCount int) int

ClampViewportOffset keeps a selected item visible and the resulting offset within the collection's valid range.

func FirstMenuSelection added in v0.0.4

func FirstMenuSelection(snapshot MenuSnapshot) (MenuCategoryID, MenuItemID, bool)

FirstMenuSelection returns the first category with a selectable action.

func LayoutPaneCount added in v0.0.4

func LayoutPaneCount(mode LayoutMode, logicalContentCount int) int

LayoutPaneCount caps a screen's logical content count to the number of panes supported by the current mode.

func MoveMenuCategory added in v0.0.4

func MoveMenuCategory(snapshot MenuSnapshot, categoryID MenuCategoryID, itemID MenuItemID, delta int) (MenuCategoryID, MenuItemID, bool)

MoveMenuCategory wraps across categories containing selectable actions.

func MoveMenuItem added in v0.0.4

func MoveMenuItem(snapshot MenuSnapshot, categoryID MenuCategoryID, itemID MenuItemID, delta int) (MenuCategoryID, MenuItemID, bool)

MoveMenuItem wraps through the selected category's declared action order, including nested descendants.

func ReconcileMenuSelection added in v0.0.4

func ReconcileMenuSelection(previous, current MenuSnapshot, categoryID MenuCategoryID, itemID MenuItemID) (MenuCategoryID, MenuItemID, bool)

ReconcileMenuSelection preserves stable IDs when possible, otherwise it chooses the minimum declaration-index distance. Equal distances prefer the earlier declaration.

func RenderBoundedBlocks added in v0.0.4

func RenderBoundedBlocks(blocks []FormBlock, focusedIndex int, boxHeight int, spacing string, helpText string, errorMsg string) string

RenderBoundedBlocks calculates window capacity and joins visible blocks for form views.

func RenderClosedMenuBar added in v0.0.4

func RenderClosedMenuBar(styles Styles, snapshot MenuSnapshot, width int, menuAvailable bool) string

RenderClosedMenuBar renders the permanent one-row action bar. Navigation and primary actions come from semantic menu data; presentation labels never participate in routing. Mandatory entries collapse to their accelerator before any primary action is omitted.

func RenderOpenMenu added in v0.0.4

func RenderOpenMenu(styles Styles, snapshot MenuSnapshot, categoryID MenuCategoryID, itemID MenuItemID, width, height int) string

RenderOpenMenu renders complete menu rows in a bounded window. The selected disabled action remains visible and selectable, while its reason is rendered as presentation-only text.

func RenderPlanDiff added in v0.0.4

func RenderPlanDiff(diff config.PlanDiff, width int) string

RenderPlanDiff formats a PlanDiff into a clear, structured visual diff for terminal display.

func RenderTree added in v0.0.4

func RenderTree(plans []config.Plan, milestones []config.Milestone, st *config.State, opts TreeOptions) string

RenderTree generates a terminal-friendly string representation of the planning hierarchy.

func ResolveMilestoneTemplate

func ResolveMilestoneTemplate() (string, error)

ResolveMilestoneTemplate resolves the template for milestone spec markdown.

func ViewportRangeLabel added in v0.0.4

func ViewportRangeLabel(result ViewportResult) string

ViewportRangeLabel formats the effective visible range using one-based row numbers while keeping an empty viewport at the truthful zero range.

Types

type Accelerator added in v0.0.4

type Accelerator struct {
	ID      AcceleratorID
	Display string
}

Accelerator separates semantic shortcut identity from its rendered form. Neither field participates in activation dispatch.

type AcceleratorID added in v0.0.4

type AcceleratorID string

type AgentGroupsModel

type AgentGroupsModel struct {
	Groups                []config.AgentGroup // Merged agent groups lists
	AvailableAgents       []config.Agent      // Discovered dynamic agents list
	SelectedGroupIdx      int
	SelectedAgentIdx      int
	AvailableAgentIdx     int
	FocusCol              int // 0: Groups List, 1: Pipeline Agents list, 2: Available Agents list, 3: Naming Group
	NewGroupName          string
	NewGroupInput         textinput.Model
	SavePrompt            bool
	Width                 int
	Height                int
	Styles                Styles
	ErrorMsg              string
	SuccessMsg            string
	HasChanges            bool
	GroupScrollOffset     int
	PipelineScrollOffset  int
	AvailableScrollOffset int
}

AgentGroupsModel manages viewing, editing, and sorting agent pipeline groups.

func NewAgentGroupsModel

func NewAgentGroupsModel(styles Styles) AgentGroupsModel

NewAgentGroupsModel instantiates a new AgentGroupsModel.

func (*AgentGroupsModel) ClampScrollOffsets

func (m *AgentGroupsModel) ClampScrollOffsets()

func (AgentGroupsModel) Init

func (m AgentGroupsModel) Init() tea.Cmd

func (AgentGroupsModel) Update

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

func (AgentGroupsModel) View

func (m AgentGroupsModel) View() string

type BriefingDetailData added in v0.0.4

type BriefingDetailData struct {
	Plan     config.Plan
	Briefing config.Briefing
}

BriefingDetailData holds context for viewing Briefing details.

type BriefingDetailsModel added in v0.0.4

type BriefingDetailsModel struct {
	Plan         config.Plan
	Briefing     config.Briefing
	LinkedMS     *config.Milestone
	History      []config.MilestoneCycleLog
	Width        int
	Height       int
	ScrollOffset int
	Styles       Styles
}

BriefingDetailsModel handles rendering details for a specific Briefing.

func NewBriefingDetailsModel added in v0.0.4

func NewBriefingDetailsModel(styles Styles) BriefingDetailsModel

NewBriefingDetailsModel creates a BriefingDetailsModel instance.

func (BriefingDetailsModel) Init added in v0.0.4

func (m BriefingDetailsModel) Init() tea.Cmd

func (BriefingDetailsModel) Update added in v0.0.4

func (BriefingDetailsModel) View added in v0.0.4

func (m BriefingDetailsModel) View() string

type BriefingOrigin added in v0.0.4

type BriefingOrigin struct {
	PlanID          string
	BriefingID      string
	MilestoneID     string
	Mode            string
	QueuePosition   int
	QueueTotal      int
	DependencyState string
	PlanRun         bool
}

BriefingOrigin identifies the one planning item that launched a normal Milestone cycle. It is intentionally kept out of executor.RunOptions.

type ChangeScreenMsg

type ChangeScreenMsg struct {
	Screen       Screen
	Data         interface{}
	ReturnScreen Screen
	ReturnData   interface{}
}

ChangeScreenMsg is sent to switch views.

type CompactTabVariant added in v0.0.4

type CompactTabVariant uint8

CompactTabVariant describes only a tab's visual treatment. Screen models remain responsible for deciding which tab is selected or focused.

const (
	CompactTabInactive CompactTabVariant = iota
	CompactTabActive
	CompactTabFocused
)

type CreateMilestoneFromBriefingData added in v0.0.4

type CreateMilestoneFromBriefingData struct {
	Plan        config.Plan
	Briefing    config.Briefing
	ContextText string
}

CreateMilestoneFromBriefingData is an immutable navigation snapshot used to prefill the selected Briefing in the existing create-milestone workflow.

type CreateMilestoneModel

type CreateMilestoneModel struct {
	Mode             CreateScreenMode
	RunMilestone     config.Milestone
	RunRunnerLLM     string
	RunRunnerMode    string
	RunNoBranch      bool
	RunGroup         config.AgentGroup
	RunSingleID      string
	RunWorkflow      WorkflowKind
	RunIsResume      bool
	NextID           string
	TitleInput       textinput.Model
	GoalInput        textarea.Model
	Spinner          spinner.Model
	RunnerType       string
	DefaultLLM       string
	CreateBranch     bool
	GitBranchPrefix  string
	Loading          bool
	Logs             []string
	FocusIndex       int
	Width            int
	Height           int
	Styles           Styles
	ErrorMsg         string
	DraftWarning     string
	RestoreDraft     *MilestoneFormDraft
	DraftSaving      bool
	PendingDraft     *MilestoneFormDraft
	DraftFlushArmed  bool
	Form             FormModel
	ParentPlanID     string
	ParentBriefingID string
	ReturnScreen     Screen
	ReturnData       interface{}
}

CreateMilestoneModel handles the form for creating a new milestone.

func NewCreateMilestoneModel

func NewCreateMilestoneModel(styles Styles) CreateMilestoneModel

NewCreateMilestoneModel instantiates the creation form model.

func (CreateMilestoneModel) BeginDraftRestore added in v0.0.4

func (m CreateMilestoneModel) BeginDraftRestore() tea.Cmd

BeginDraftRestore loads an ordinary creation draft after entry defaults are applied.

func (CreateMilestoneModel) Init

func (m CreateMilestoneModel) Init() tea.Cmd

Init triggers cursor blink.

func (CreateMilestoneModel) Update

Update handles input fields, tab navigation and form submission/cancellation.

func (CreateMilestoneModel) View

func (m CreateMilestoneModel) View() string

View draws the creation form layout.

type CreateMilestoneMsg

type CreateMilestoneMsg struct {
	ID                 string
	Title              string
	Goal               string
	AcceptanceCriteria []string
	Checks             []string
	RunnerType         string
	CreateBranch       bool
	ParentPlanID       string
	ParentBriefingID   string
}

CreateMilestoneMsg is sent when submitting the form to create a new milestone.

type CreatePlanModel added in v0.0.4

type CreatePlanModel struct {
	NextID                 string
	RequestedID            string
	GenerationTargetAbsent bool
	GenerationExistingIDs  map[string]bool
	GenerationEntries      map[string]bool
	IDInput                textinput.Model
	TitleInput             textinput.Model
	ObjectiveInput         textarea.Model
	RunnerType             string
	DefaultLLM             string
	CreateBranch           bool
	Loading                bool
	Logs                   []string
	Spinner                spinner.Model
	Form                   FormModel
	FocusIndex             int
	Width                  int
	Height                 int
	Styles                 Styles
	ErrorMsg               string
	DraftWarning           string
	RestoreDraft           *PlanFormDraft
	DraftSaving            bool
	PendingDraft           *PlanFormDraft
}

CreatePlanModel is the focused, planning-only Plan creation form.

func NewCreatePlanModel added in v0.0.4

func NewCreatePlanModel(styles Styles) CreatePlanModel

NewCreatePlanModel initializes all required Plan inputs.

func (CreatePlanModel) BeginDraftRestore added in v0.0.4

func (m CreatePlanModel) BeginDraftRestore() tea.Cmd

BeginDraftRestore loads the Plan draft after entry defaults are applied.

func (CreatePlanModel) Init added in v0.0.4

func (m CreatePlanModel) Init() tea.Cmd

func (CreatePlanModel) Update added in v0.0.4

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

func (CreatePlanModel) View added in v0.0.4

func (m CreatePlanModel) View() string

type CreatePlanMsg added in v0.0.4

type CreatePlanMsg struct {
	ID           string
	Title        string
	Objective    string
	RunnerType   string
	CreateBranch bool
}

CreatePlanMsg requests persistence of the currently completed Plan form.

type CreateScreenMode

type CreateScreenMode int
const (
	ModeCreateMilestone CreateScreenMode = iota
	ModeCycleNote
)

type DashboardModel

type DashboardModel struct {
	Table           table.Model
	Config          *config.Config
	State           *config.State
	Planning        *config.PlanningState
	ShowPlannerTree bool
	Width           int
	Height          int
	Styles          Styles
}

DashboardModel manages the main dashboard table displaying all milestones.

func NewDashboardModel

func NewDashboardModel(cfg *config.Config, state *config.State, styles Styles) DashboardModel

NewDashboardModel creates and returns a new DashboardModel with initial columns.

func (DashboardModel) Init

func (m DashboardModel) Init() tea.Cmd

Init initializes the sub-model.

func (*DashboardModel) SelectMilestone

func (m *DashboardModel) SelectMilestone(id string)

SelectMilestone selects the row in the table matching the given milestone ID.

func (DashboardModel) Update

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

Update handles resizing, navigation and milestone status updates/logging.

func (DashboardModel) View

func (m DashboardModel) View() string

View outputs only the screen's core content. RootModel owns command help.

type DeleteCycleMsg

type DeleteCycleMsg struct {
	MilestoneID string
	CycleNumber int
}

type DeleteMilestoneMsg

type DeleteMilestoneMsg struct {
	MilestoneID string
}

type DeletePlanModel added in v0.0.4

type DeletePlanModel struct {
	Plan         config.Plan
	ReturnScreen Screen
	ConfirmInput textinput.Model
	FocusIndex   int
	Width        int
	Height       int
	Styles       Styles
	ErrorMsg     string
	Form         FormModel
}

DeletePlanModel requires the exact Plan ID before emitting a delete request.

func NewDeletePlanModel added in v0.0.4

func NewDeletePlanModel(plan config.Plan, returnScreen Screen, styles Styles) DeletePlanModel

NewDeletePlanModel initializes a typed confirmation for plan.

func (DeletePlanModel) Init added in v0.0.4

func (m DeletePlanModel) Init() tea.Cmd

func (DeletePlanModel) Update added in v0.0.4

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

func (DeletePlanModel) View added in v0.0.4

func (m DeletePlanModel) View() string

type DeletePlanMsg added in v0.0.4

type DeletePlanMsg struct {
	Plan         config.Plan
	ReturnScreen Screen
}

DeletePlanMsg requests deletion after the user entered the exact Plan ID.

type DetailsModel

type DetailsModel struct {
	Milestone                    config.Milestone
	ReturnScreen                 Screen
	ReturnData                   interface{}
	History                      []config.MilestoneCycleLog
	Width                        int
	Height                       int
	Styles                       Styles
	ShowAgentSelector            bool
	SelectedAgentIdx             int
	Agents                       []config.Agent
	ShowHistoryTab               bool
	LLM                          string
	Mode                         string
	BranchChange                 bool
	Groups                       []config.AgentGroup
	SelectedGroupIdx             int
	ScrollOffset                 int // Details scroll offset
	HistoryScrollOffset          int // History scroll offset
	HistoryListScrollOffset      int // Cycle selector scroll offset
	AgentScrollOffset            int // Agent Selector scroll offset
	RecommendationScore          int
	AgentInstructionsUpdateScore int
	HistorySelectedIdx           int
	ConfirmDeleteMilestone       bool
	ConfirmDeleteCycle           bool
	ShowInstructionDiff          bool
	InstructionReviewStatus      map[int]string
}

DetailsModel handles rendering the detail specs and historical log timeline for a milestone.

func NewDetailsModel

func NewDetailsModel(styles Styles) DetailsModel

NewDetailsModel creates a DetailsModel instance.

func (DetailsModel) Init

func (m DetailsModel) Init() tea.Cmd

Init initializes the details sub-model.

func (DetailsModel) Update

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

Update handles screen adjustments and quick actions like toggling status and work logging.

func (DetailsModel) View

func (m DetailsModel) View() string

View structures a responsive split-screen displaying details and chronological cycle history.

type FormBlock added in v0.0.4

type FormBlock struct {
	FocusIndices []int
	Content      string
}

FormBlock represents a logical section in a scrollable or bounded form view.

type FormControlState added in v0.0.4

type FormControlState struct {
	Focused  bool
	Disabled bool
	Error    string
}

FormControlState describes presentation-only state for a shared form control. Validation and workflow decisions remain owned by the screen.

type FormFieldBinding added in v0.0.4

type FormFieldBinding struct {
	FocusIndex int
	Kind       FormFieldKind
	// ControlIndex identifies the concrete control in the matching slice passed
	// to SyncFocus. This keeps forms with multiple controls of the same kind
	// from focusing every control at once.
	ControlIndex int
	Enabled      bool
}

FormFieldBinding defines a field's focus index and control type within a form.

type FormFieldKind added in v0.0.4

type FormFieldKind int

FormFieldKind specifies the input control or custom role for a form field.

const (
	FormFieldTextInput FormFieldKind = iota
	FormFieldTextArea
	FormFieldCustom
	FormFieldButton
)

type FormModel added in v0.0.4

type FormModel struct {
	FocusIndex int
	FocusOrder []int
	Width      int
	Height     int
	Styles     Styles
	ErrorMsg   string
	Bindings   []FormFieldBinding
}

FormModel manages common form state, field navigation, keyboard/mouse event handling, layout sizing, and error/help rendering across TUI creation forms.

func NewFormModel added in v0.0.4

func NewFormModel(styles Styles) FormModel

NewFormModel initializes a reusable form component with styles and default dimensions.

func (*FormModel) ActiveFocusOrder added in v0.0.4

func (f *FormModel) ActiveFocusOrder() []int

ActiveFocusOrder returns enabled bindings in the declared focus order.

func (*FormModel) BindButton added in v0.0.4

func (f *FormModel) BindButton(focusIndex int)

BindButton registers a form action button at the specified focus index.

func (*FormModel) BindCustom added in v0.0.4

func (f *FormModel) BindCustom(focusIndex int)

BindCustom registers a custom interactive element at the specified focus index.

func (*FormModel) BindTextArea added in v0.0.4

func (f *FormModel) BindTextArea(focusIndex int)

BindTextArea registers a textarea field at the specified focus index.

func (*FormModel) BindTextAreaAt added in v0.0.4

func (f *FormModel) BindTextAreaAt(focusIndex, controlIndex int)

BindTextAreaAt registers a textarea and its index in the SyncFocus area slice.

func (*FormModel) BindTextInput added in v0.0.4

func (f *FormModel) BindTextInput(focusIndex int)

BindTextInput registers a text input field at the specified focus index.

func (*FormModel) BindTextInputAt added in v0.0.4

func (f *FormModel) BindTextInputAt(focusIndex, controlIndex int)

BindTextInputAt registers a text input and its index in the SyncFocus input slice.

func (*FormModel) BindingEnabled added in v0.0.4

func (f *FormModel) BindingEnabled(focusIndex int) bool

BindingEnabled reports whether a declared control participates in traversal.

func (*FormModel) ControlState added in v0.0.4

func (f *FormModel) ControlState(focusIndex int, validation string) FormControlState

ControlState derives focus and disabled presentation from the same binding state used by traversal.

func (*FormModel) HandleMouseMsg added in v0.0.4

func (f *FormModel) HandleMouseMsg(msg tea.MouseMsg, area *textarea.Model) (tea.Cmd, bool)

HandleMouseMsg handles mouse wheel scrolling for the specified textarea field when focused.

func (*FormModel) HandleWindowSize added in v0.0.4

func (f *FormModel) HandleWindowSize(msg tea.WindowSizeMsg)

HandleWindowSize updates form dimensions with safe TTY / non-TTY fallbacks.

func (*FormModel) IsTextAreaFocused added in v0.0.4

func (f *FormModel) IsTextAreaFocused() bool

IsTextAreaFocused returns true if the active FocusIndex is bound to a textarea.

func (*FormModel) IsTextInputFocused added in v0.0.4

func (f *FormModel) IsTextInputFocused() bool

IsTextInputFocused returns true if the active FocusIndex is bound to a text input.

func (*FormModel) NextFocus added in v0.0.4

func (f *FormModel) NextFocus() tea.Cmd

NextFocus advances focus through the enabled declared bindings with wraparound.

func (*FormModel) NextFocusForOrder added in v0.0.4

func (f *FormModel) NextFocusForOrder(order []int) tea.Cmd

NextFocusForOrder advances focus using a specified custom focus order slice.

func (*FormModel) PreviousFocus added in v0.0.4

func (f *FormModel) PreviousFocus() tea.Cmd

PreviousFocus reverses focus through the enabled declared bindings with wraparound.

func (*FormModel) PreviousFocusForOrder added in v0.0.4

func (f *FormModel) PreviousFocusForOrder(order []int) tea.Cmd

PreviousFocusForOrder reverses focus using a specified custom focus order slice.

func (*FormModel) RenderButton added in v0.0.4

func (f *FormModel) RenderButton(index int, label string, isSelectedRowStyle bool) string

RenderButton returns formatted button markup using default selection or subtle styling.

func (*FormModel) RenderButtonState added in v0.0.4

func (f *FormModel) RenderButtonState(focusIndex int, label string) string

RenderButtonState renders one action from shared semantic styles.

func (*FormModel) RenderButtonWithStyles added in v0.0.4

func (f *FormModel) RenderButtonWithStyles(index int, label string, focusedStyle, blurredStyle lipgloss.Style) string

RenderButtonWithStyles returns formatted button markup based on whether it holds focus.

func (*FormModel) RenderControlLabel added in v0.0.4

func (f *FormModel) RenderControlLabel(label string, state FormControlState) string

RenderControlLabel renders a consistent focus, disabled, and validation marker without owning any workflow validation rule.

func (*FormModel) RenderError added in v0.0.4

func (f *FormModel) RenderError() string

RenderError returns the formatted error string if ErrorMsg is non-empty.

func (*FormModel) RenderHelp added in v0.0.4

func (f *FormModel) RenderHelp(keys []string) string

RenderHelp returns the formatted command help line bounded by form width.

func (*FormModel) RenderRadioGroup added in v0.0.4

func (f *FormModel) RenderRadioGroup(focusIndex int, label string, options []FormRadioOption, validation string) string

RenderRadioGroup renders terminal-compatible choices with semantic focus, selection, disabled, and validation states.

func (*FormModel) RenderRadioOptions added in v0.0.4

func (f *FormModel) RenderRadioOptions(options []FormRadioOption, state FormControlState) string

RenderRadioOptions renders just the choices for layouts that place the shared control label on the same line.

func (*FormModel) RenderTextControl added in v0.0.4

func (f *FormModel) RenderTextControl(focusIndex int, label, value, validation string) string

RenderTextControl renders a text input or textarea value under its semantic label. The concrete bubbles control continues to own editing and scrolling.

func (*FormModel) RenderValidation added in v0.0.4

func (f *FormModel) RenderValidation(focusIndex int, message string) string

RenderValidation associates visible, non-color-only feedback with a control.

func (*FormModel) ScrollTextAreaDown added in v0.0.4

func (f *FormModel) ScrollTextAreaDown(area *textarea.Model) tea.Cmd

ScrollTextAreaDown moves the cursor down by the height of the specified textarea.

func (*FormModel) ScrollTextAreaUp added in v0.0.4

func (f *FormModel) ScrollTextAreaUp(area *textarea.Model) tea.Cmd

ScrollTextAreaUp moves the cursor up by the height of the specified textarea.

func (*FormModel) SetBindingEnabled added in v0.0.4

func (f *FormModel) SetBindingEnabled(focusIndex int, enabled bool)

SetBindingEnabled includes or excludes a binding from shared focus traversal.

func (*FormModel) SetEnabledFocusOrder added in v0.0.4

func (f *FormModel) SetEnabledFocusOrder(order []int)

SetEnabledFocusOrder enables exactly the bindings present in order.

func (*FormModel) SyncFocus added in v0.0.4

func (f *FormModel) SyncFocus(inputs []*textinput.Model, areas []*textarea.Model) tea.Cmd

SyncFocus updates focus state across provided text input and textarea controls.

func (*FormModel) UpdateFocus added in v0.0.4

func (f *FormModel) UpdateFocus() tea.Cmd

UpdateFocus returns a focus command assuming inputs manage their own blur/focus.

type FormRadioOption added in v0.0.4

type FormRadioOption struct {
	Label    string
	Selected bool
	Disabled bool
}

FormRadioOption is one shared radio-group choice.

type GlobalActionID added in v0.0.4

type GlobalActionID string
type GlobalMenuActionHandler interface {
	HandleGlobalMenuAction(GlobalActionID) (tea.Cmd, error)
}

type HeaderModel added in v0.0.4

type HeaderModel struct {
	ProductTitle     string
	ScreenTitle      string
	ScreenTitleStyle lipgloss.Style
	Width            int
	// contains filtered or unexported fields
}

HeaderModel renders the shared application brand and contextual screen tab. Product styling is intentionally sourced only from Styles.AppTitle; callers can vary the contextual title style without changing the Cyclestone brand.

func NewHeaderModel added in v0.0.4

func NewHeaderModel(styles Styles, width int, productTitle, screenTitle string, screenTitleStyle lipgloss.Style) HeaderModel

NewHeaderModel constructs a header using the permanent application brand style and the caller-selected contextual title style.

func (HeaderModel) View added in v0.0.4

func (m HeaderModel) View() string

View renders exactly two display lines. The contextual tab and divider are recomputed from Width on every call so terminal resizes cannot leave stale spacing or title truncation behind.

type KeyClass added in v0.0.4

type KeyClass uint8

KeyClass identifies keys that participate in the shared root routing contract. Screen-specific shortcuts remain owned by the active child model.

const (
	KeyOther KeyClass = iota
	KeyForceQuit
	KeyQuit
	KeyEscape
	KeyBackspace
	KeyMenuToggle
)

func ClassifyKey added in v0.0.4

func ClassifyKey(msg tea.KeyMsg) KeyClass

ClassifyKey gives RootModel and child ownership tests one typed interpretation of application-level keys.

type LayoutMode added in v0.0.4

type LayoutMode uint8

LayoutMode describes the presentation capacity of a root-allocated child viewport. Screens decide which of their own panes or tabs occupy that capacity.

const (
	LayoutCompact LayoutMode = iota
	LayoutStandard
	LayoutWide
)

func ClassifyLayout added in v0.0.4

func ClassifyLayout(width, height int) LayoutMode

ClassifyLayout classifies root-delivered child dimensions. Invalid and tiny dimensions fail closed to Compact.

type LogCycleResultMsg

type LogCycleResultMsg struct {
	MilestoneID string
	Branch      string
	CommitHash  string
	Timestamp   string
}

LogCycleResultMsg is sent asynchronously when a work cycle is completed and Git info is fetched.

type MenuAction struct {
	Owner    MenuActionOwner
	OwnerID  MenuOwnerID
	GlobalID GlobalActionID
	ScreenID ScreenActionID
}

MenuAction identifies both the handler owner and its typed action. Exactly one of GlobalID and ScreenID is populated by the constructors.

func GlobalMenuAction(id GlobalActionID) MenuAction

func ScreenMenuAction added in v0.0.4

func ScreenMenuAction(owner MenuOwnerID, id ScreenActionID) MenuAction
type MenuActionOwner uint8

MenuActionOwner keeps global and contextual action namespaces distinct even when their underlying strings happen to match.

const (
	MenuActionOwnerUnknown MenuActionOwner = iota
	MenuActionOwnerGlobal
	MenuActionOwnerScreen
)
type MenuActionReference struct {
	Revision   MenuRevision
	CategoryID MenuCategoryID
	ItemID     MenuItemID
	Action     MenuAction
}

MenuActionReference captures the stable identity of one action in one snapshot. Keeping the expected action identity in the reference prevents a reused item ID from silently dispatching a different action.

type MenuActivationResult struct {
	Status         MenuActivationStatus
	DisabledReason string
	Err            error
}

MenuActivationResult exposes rejection details without invoking a handler.

func DispatchMenuAction added in v0.0.4

DispatchMenuAction re-describes the current menu before resolution and dispatches only the typed action namespace declared by the resolved item.

type MenuActivationStatus uint8
const (
	MenuActivationRejected MenuActivationStatus = iota
	MenuActivationActivated
)
type MenuCategory struct {
	ID       MenuCategoryID
	Label    string
	Role     MenuSemanticRole
	Priority ResponsivePriority
	Items    []MenuItem
}

MenuCategory describes one ordered top-level grouping.

type MenuCategoryID string
type MenuInteractionContext struct {
	Screen         Screen
	Pane           int
	Focus          int
	Selection      int
	Selection2     int
	Selection3     int
	Viewport       int
	Viewport2      int
	Viewport3      int
	Viewport4      int
	MenuOpen       bool
	MenuCategoryID MenuCategoryID
	MenuItemID     MenuItemID
}

MenuInteractionContext is the root-owned, nonrecursive capture of the active route's interaction coordinates. It intentionally excludes workflow data, dimensions, request state, timers, and status messages.

type MenuItem struct {
	ID             MenuItemID
	Kind           MenuItemKind
	Action         MenuAction
	Label          string
	CompactLabel   string
	Accelerator    Accelerator
	Enabled        bool
	DisabledReason string
	Role           MenuSemanticRole
	Priority       ResponsivePriority
	Children       []MenuItem
}

MenuItem describes one ordered menu node. Children retain their declared order and may be empty. Workflow eligibility remains owner supplied.

func ItemsByResponsivePriority added in v0.0.4

func ItemsByResponsivePriority(items []MenuItem) []MenuItem

ItemsByResponsivePriority returns a stable copy ordered from highest to lowest priority. It never changes declaration order for equal priorities.

type MenuItemID string

func SelectableMenuItems added in v0.0.4

func SelectableMenuItems(category MenuCategory) []MenuItemID

SelectableMenuItems returns action nodes in declared depth-first order. Disabled actions remain selectable so their owner-provided reason can be presented; group and status nodes are never cursor targets.

type MenuItemKind uint8
const (
	MenuItemAction MenuItemKind = iota
	MenuItemGroup
	MenuItemStatus
)
type MenuOwnerID string
type MenuPresentationMode uint8
const (
	MenuPresentationBase MenuPresentationMode = iota
	// MenuPresentationReplacement means Categories replace, rather than append
	// to, the base menu while a transient owner is active.
	MenuPresentationReplacement
)
type MenuRevision struct {
	// contains filtered or unexported fields
}

MenuRevision is an opaque, owner-issued identity for one menu snapshot. Owners must issue a new revision whenever activation eligibility, ownership, or presentation mode changes. Dispatchers compare it; they never derive it from labels, accelerators, or slice positions.

func NewMenuRevision added in v0.0.4

func NewMenuRevision(value string) MenuRevision

NewMenuRevision creates a revision token. The value is deliberately hidden after construction so consumers cannot interpret it as menu state.

type MenuSemanticRole uint8
const (
	MenuRoleDefault MenuSemanticRole = iota
	MenuRolePrimary
	MenuRoleNavigation
	MenuRoleDestructive
	MenuRoleStatus
)
type MenuShortcut struct {
	Key        string
	CategoryID MenuCategoryID
	ItemID     MenuItemID
}

MenuShortcut binds an input identity to a typed menu item. Display text is deliberately absent: rendered accelerator labels never drive dispatch.

type MenuSnapshot struct {
	Revision   MenuRevision
	Mode       MenuPresentationMode
	Categories []MenuCategory
	Shortcuts  []MenuShortcut
}

MenuSnapshot is the complete authoritative menu description for a revision.

func (s MenuSnapshot) ActionReference(categoryID MenuCategoryID, itemID MenuItemID) (MenuActionReference, error)

ActionReference returns a reference for an action node, including disabled actions so attempted activation can report the owner's disabled reason.

func (s MenuSnapshot) ShortcutReference(key string) (MenuActionReference, error)

ShortcutReference resolves a normalized key through explicit shortcut declarations. Ambiguous matches fail closed.

func (s MenuSnapshot) Validate() error

Validate rejects ambiguous identities and prevents status/group entries from acquiring executable behavior. Item IDs are unique within their category, including nested descendants, because references use category/item identity.

type MilestoneFormDraft added in v0.0.4

type MilestoneFormDraft struct {
	Title        string `json:"title"`
	Goal         string `json:"goal"`
	RunnerType   string `json:"runner_type"`
	CreateBranch bool   `json:"create_branch"`
}

MilestoneFormDraft is the complete editable state of ordinary Milestone Creation.

type PlanContinuation added in v0.0.4

type PlanContinuation struct {
	NextMilestone *config.Milestone
	NextOrigin    BriefingOrigin
	Message       string
}

PlanContinuation describes the next durable Plan-run transition after a cycle.

type PlanDetailsModel added in v0.0.4

type PlanDetailsModel struct {
	Plan   config.Plan
	Table  table.Model
	Config *config.Config
	State  *config.State
	Width  int
	Height int
	Styles Styles
}

PlanDetailsModel manages the detailed view of a Plan and its Briefings table.

func NewPlanDetailsModel added in v0.0.4

func NewPlanDetailsModel(cfg *config.Config, state *config.State, styles Styles) PlanDetailsModel

NewPlanDetailsModel creates and initializes a PlanDetailsModel.

func (PlanDetailsModel) Init added in v0.0.4

func (m PlanDetailsModel) Init() tea.Cmd

func (PlanDetailsModel) Update added in v0.0.4

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

func (*PlanDetailsModel) UpdateTableRows added in v0.0.4

func (m *PlanDetailsModel) UpdateTableRows()

UpdateTableRows populates the Briefings table for the selected Plan.

func (PlanDetailsModel) View added in v0.0.4

func (m PlanDetailsModel) View() string

type PlanFormDraft added in v0.0.4

type PlanFormDraft struct {
	ID           string `json:"id"`
	Title        string `json:"title"`
	Objective    string `json:"objective"`
	RunnerType   string `json:"runner_type"`
	CreateBranch bool   `json:"create_branch"`
}

PlanFormDraft is the complete editable state of Plan Creation.

type PlansModel added in v0.0.4

type PlansModel struct {
	Table    table.Model
	Config   *config.Config
	State    *config.State
	Planning *config.PlanningState
	Width    int
	Height   int
	Styles   Styles
}

PlansModel manages the flat table listing of all Plans in the TUI.

func NewPlansModel added in v0.0.4

func NewPlansModel(cfg *config.Config, state *config.State, planning *config.PlanningState, styles Styles) PlansModel

NewPlansModel creates and initializes a PlansModel.

func (PlansModel) Init added in v0.0.4

func (m PlansModel) Init() tea.Cmd

func (*PlansModel) SelectPlan added in v0.0.4

func (m *PlansModel) SelectPlan(planID string)

SelectPlan moves the table cursor to planID when that Plan is visible.

func (PlansModel) Update added in v0.0.4

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

func (*PlansModel) UpdateTableRows added in v0.0.4

func (m *PlansModel) UpdateTableRows()

UpdateTableRows populates the table content from m.Planning.

func (PlansModel) View added in v0.0.4

func (m PlansModel) View() string

type PreflightModel

type PreflightModel struct {
	Request            StartCycleMsg
	Milestone          config.Milestone
	State              *config.State
	ConfigPath         string
	StatePath          string
	Width              int
	Height             int
	FocusIndex         int
	ScrollOffset       int
	Styles             Styles
	Settings           config.Settings
	Pipeline           []config.Agent
	MissingAgents      []string
	Repos              []git.RepoStatusSummary
	Issues             []preflightIssue
	InstructionSources []instructionSourceStatus
	// contains filtered or unexported fields
}

PreflightModel renders the non-mutating workflow review that must be confirmed before RootModel receives StartCycleMsg for executor startup.

func NewPreflightModel

func NewPreflightModel(styles Styles) PreflightModel

func (PreflightModel) BlockerReason added in v0.0.4

func (m PreflightModel) BlockerReason() string

BlockerReason returns a concise menu-safe summary derived from the same ordered issues that make confirmation unavailable.

func (PreflightModel) HasBlockers

func (m PreflightModel) HasBlockers() bool

func (PreflightModel) Init

func (m PreflightModel) Init() tea.Cmd

func (*PreflightModel) Load

func (m *PreflightModel) Load(req StartCycleMsg, state *config.State, configPath, statePath string)

func (PreflightModel) Update

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

func (PreflightModel) View

func (m PreflightModel) View() string

type ResponsivePriority added in v0.0.4

type ResponsivePriority int

ResponsivePriority uses larger values for entries that should survive tighter layouts first. Equal values preserve declaration order.

type RootModel

type RootModel struct {
	ActiveScreen            Screen
	Dashboard               DashboardModel
	Details                 DetailsModel
	Runner                  RunnerModel
	CreateMilestone         CreateMilestoneModel
	Preflight               PreflightModel
	Settings                SettingsModel
	AgentGroups             AgentGroupsModel
	Setup                   SetupWizardModel
	Plans                   PlansModel
	PlanDetails             PlanDetailsModel
	BriefingDetails         BriefingDetailsModel
	CreatePlan              CreatePlanModel
	DeletePlan              DeletePlanModel
	Width                   int
	Height                  int
	Config                  *config.Config
	State                   *config.State
	ConfigPath              string
	StatePath               string
	NoBranchChange          bool
	Unrestricted            bool
	Styles                  Styles
	StatusMsg               string
	StatusSeverity          StatusSeverity
	StatusTime              time.Time
	LastScheduledStatusTime time.Time
	MenuOpen                bool
	MenuCategoryID          MenuCategoryID
	MenuItemID              MenuItemID
	MenuSnapshot            MenuSnapshot
	PreMenuContext          *MenuInteractionContext
	TransientContext        *MenuInteractionContext
	TransientOwnerID        MenuOwnerID
	PendingTransientContext *MenuInteractionContext
	MissingConfig           bool
	InitConfigError         string
	PendingCycle            *StartCycleMsg
	BriefingOrigin          BriefingOrigin

	PlanCycleStarter  func(BriefingOrigin) error
	PlanCycleFinisher func(BriefingOrigin, string, string, error) (PlanContinuation, error)

	// CycleExecutor runs an ordinary Milestone cycle. It defaults to the shared
	// executor and permits deterministic local integration tests without a live runner.
	CycleExecutor func(context.Context, config.Milestone, []config.Agent, executor.RunOptions, *config.State, chan tea.Msg)
	// contains filtered or unexported fields
}

RootModel is the top-level Bubble Tea model containing application state.

func NewRootModel

func NewRootModel(cfg *config.Config, state *config.State, configPath, statePath string, noBranchChange, unrestricted, disableBold, disableRoundedBorders bool) RootModel

NewRootModel constructs the RootModel and initializes its sub-models.

func (*RootModel) ActivateMenuAction added in v0.0.4

func (m *RootModel) ActivateMenuAction(describer ScreenMenuDescriber, screen ScreenMenuActionHandler, ref MenuActionReference) (tea.Cmd, MenuActivationResult)

ActivateMenuAction is the production ownership boundary: RootModel handles global IDs and delegates contextual IDs only to the supplied screen owner.

func (RootModel) DescribeMenu added in v0.0.4

func (m RootModel) DescribeMenu() MenuSnapshot

DescribeMenu is the authoritative production descriptor for the active route. Declarations are explicit; contextual help and Accelerator.Display are presentation-only and are never parsed to create dispatch bindings.

func (*RootModel) HandleGlobalMenuAction added in v0.0.4

func (m *RootModel) HandleGlobalMenuAction(action GlobalActionID) (tea.Cmd, error)

HandleGlobalMenuAction directly handles the typed global actions. Help is a no-op today because contextual help is already persistently root-rendered; Quit returns Bubble Tea's ordinary quit command.

func (*RootModel) HandleScreenMenuAction added in v0.0.4

func (m *RootModel) HandleScreenMenuAction(action ScreenActionID) (tea.Cmd, error)

HandleScreenMenuAction dispatches a validated semantic action. Focus-sensitive actions call their screen-owned operation directly; the remaining actions use explicit action-to-handler mappings and never derive behavior from display accelerators or the currently selected menu binding.

func (RootModel) Init

func (m RootModel) Init() tea.Cmd

Init initializes the Bubble Tea program.

func (*RootModel) MenuOwnerID added in v0.0.4

func (m *RootModel) MenuOwnerID() MenuOwnerID

func (*RootModel) QueueBriefingCycle added in v0.0.4

func (m *RootModel) QueueBriefingCycle(milestone config.Milestone, origin BriefingOrigin)

QueueBriefingCycle opens the existing preflight for one resolved ordinary Milestone when the TUI starts from `briefing execute`.

func (*RootModel) QueuePlanCycle added in v0.0.4

func (m *RootModel) QueuePlanCycle(milestone config.Milestone, origin BriefingOrigin)

QueuePlanCycle queues an ordinary Milestone while retaining immutable Plan context.

func (RootModel) Update

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

Update routes messages to the active sub-model and processes global/async actions.

func (RootModel) View

func (m RootModel) View() string

View constructs the overall user interface layout.

type RunnerModel

type RunnerModel struct {
	Milestone           config.Milestone
	Pipeline            []config.Agent
	AgentStates         map[string]string // agent.ID -> status: "pending", "running", "success", "failed"
	AgentStartedAt      map[string]time.Time
	AgentElapsed        map[string]time.Duration
	Logs                []string
	StatusEvents        []string
	Spinner             spinner.Model
	Width               int
	Height              int
	Styles              Styles
	Ctx                 context.Context
	CancelFunc          context.CancelFunc
	Status              string
	CycleStatus         string
	CycleNumber         int
	ActiveAgentID       string
	ActivePhase         string
	Runner              string
	Model               string
	Mode                string
	OutputFile          string
	LatestCommand       string
	LatestToolCall      string
	ModelCalls          int
	ToolCalls           int
	EstimatedTokens     int
	PromptTokens        int
	CompletionTokens    int
	MaxModelCalls       int
	MaxTokenBudget      int
	StopOrDoneReason    string
	LastError           string
	NextSuggestedAction string
	FinalVerdict        string
	StartedAt           time.Time
	FinishedAt          time.Time
	Error               error
	Finished            bool
	CancelRequested     bool
	ReportFile          string
	ActiveTab           RunnerTab
	Workflow            WorkflowKind
	ReturnScreen        Screen
	PlanContext         string
	// contains filtered or unexported fields
}

RunnerModel manages the run status screen.

func NewRunnerModel

func NewRunnerModel(styles Styles) RunnerModel

NewRunnerModel instantiates a new RunnerModel.

func (RunnerModel) Init

func (m RunnerModel) Init() tea.Cmd

Init triggers the spinner animation.

func (RunnerModel) Update

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

Update processes execution messages, windows resize, and key cancellations.

func (RunnerModel) View

func (m RunnerModel) View() string

View draws the spinner, agent status lists, and console log output tail.

type RunnerTab

type RunnerTab int

RunnerTab represents a tab in the runner view when resolution is small.

const (
	RunnerTabLog  RunnerTab = 0
	RunnerTabPlan RunnerTab = 1
)

type Screen

type Screen int

Screen identifies the currently active UI view.

const (
	ScreenDashboard Screen = iota
	ScreenDetails
	ScreenRunner
	ScreenCreateMilestone
	ScreenPreflight
	ScreenSettings
	ScreenAgentGroups
	ScreenSetup
	ScreenPlans
	ScreenPlanDetails
	ScreenBriefingDetails
	ScreenCreatePlan
	ScreenDeletePlan
)

type ScreenActionID added in v0.0.4

type ScreenActionID string

type ScreenMenuActionHandler added in v0.0.4

type ScreenMenuActionHandler interface {
	MenuOwnerID() MenuOwnerID
	HandleScreenMenuAction(ScreenActionID) (tea.Cmd, error)
}

ScreenMenuActionHandler keeps validation, mutation, navigation, and command creation with the screen that owns the contextual action.

type ScreenMenuDescriber added in v0.0.4

type ScreenMenuDescriber interface {
	DescribeMenu() MenuSnapshot
}

ScreenMenuDescriber is the narrow read boundary implemented by a participating screen or transient owner.

type SettingsModel

type SettingsModel struct {
	Scope              string // "global" or "project"
	GlobalDraft        config.Settings
	ProjectDraft       config.Settings
	GlobalOriginal     config.Settings
	ProjectOriginal    config.Settings
	ShowDiscardPrompt  bool
	DiscardQuit        bool
	FocusIndex         int
	ActiveGroup        int
	SelectedGroup      int
	GroupScrollOffset  int
	DetailScrollOffset int
	Width              int
	Height             int
	Styles             Styles
	ErrorMsg           string
	SuccessMsg         string
	Form               FormModel

	CacheTTLInput                   textinput.Model
	MaxHandoffInput                 textinput.Model
	MaxCallsInput                   textinput.Model
	TokenBudgetInput                textinput.Model
	LLMInputInput                   textinput.Model
	MaxRetainedConversationMsgInput textinput.Model

	OllamaCodexModelInput       textinput.Model
	AgyModelInput               textinput.Model
	AgyPrintTimeoutInput        textinput.Model
	DefaultGitBranchPrefixInput textinput.Model
	AuthorPrefixInput           textinput.Model
}

SettingsModel handles editing and saving configurations.

func NewSettingsModel

func NewSettingsModel(styles Styles) SettingsModel

NewSettingsModel instantiates the settings model.

func (SettingsModel) HasUnsavedChanges

func (m SettingsModel) HasUnsavedChanges() bool

func (SettingsModel) Init

func (m SettingsModel) Init() tea.Cmd

func (SettingsModel) IsTextInputFocused

func (m SettingsModel) IsTextInputFocused() bool

func (SettingsModel) Update

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

func (SettingsModel) View

func (m SettingsModel) View() string

type SettingsSavedMsg

type SettingsSavedMsg struct {
	Scope string
}

SettingsSavedMsg is sent when settings are saved successfully.

type SetupCompletedMsg

type SetupCompletedMsg struct {
	ConfigPath  string
	StatePath   string
	MilestoneID string
}

type SetupWizardModel

type SetupWizardModel struct {
	// ConfigPath and StatePath are startup-owned paths displayed as read-only setup details.
	ConfigPath string
	StatePath  string
	// GlobalSettings holds the resolved global settings used to preview the
	// effective value of any field set to "inherit" on the init screen.
	GlobalSettings      config.Settings
	AuthorPrefixInput   textinput.Model
	MilestoneIDInput    textinput.Model
	MilestoneTitleInput textinput.Model
	MilestoneGoalInput  textarea.Model
	MilestoneCriteria   textarea.Model
	Runners             []runnerAvailability
	Runner              string
	// RunnerInherit, SafetyInherit, and BranchesInherit mirror the settings
	// screen "inherit" option: when true the corresponding project setting is
	// saved empty/nil so it resolves from the global settings at merge time.
	RunnerInherit           bool
	Unrestricted            bool
	SafetyInherit           bool
	UnrestrictedAck         bool
	AutoBranches            bool
	BranchesInherit         bool
	CreateAgentInstructions bool
	AgentInstructions       textarea.Model
	CreateFirst             bool
	IsGitWorktree           bool
	FocusIndex              int
	Width                   int
	Height                  int
	Styles                  Styles
	ErrorMsg                string
	Form                    FormModel
}

func NewSetupWizardModel

func NewSetupWizardModel(configPath, statePath string, styles Styles) SetupWizardModel

func (SetupWizardModel) Init

func (m SetupWizardModel) Init() tea.Cmd

func (SetupWizardModel) Update

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

func (SetupWizardModel) View

func (m SetupWizardModel) View() string

type ShowDeleteMilestoneMsg

type ShowDeleteMilestoneMsg struct {
	Milestone config.Milestone
}

type ShowDeletePlanMsg added in v0.0.4

type ShowDeletePlanMsg struct {
	Plan         config.Plan
	ReturnScreen Screen
}

ShowDeletePlanMsg opens a confirmation screen for one selected Plan.

type StartCycleMsg

type StartCycleMsg struct {
	Milestone      config.Milestone
	SingleAgentID  string
	RunnerLLM      string
	RunnerMode     string
	NoBranchChange bool
	Group          config.AgentGroup
	Note           string
	Workflow       WorkflowKind
	BriefingOrigin BriefingOrigin
	IsResume       bool
}

StartCycleMsg is sent when triggering a run.

type StatusSeverity added in v0.0.4

type StatusSeverity uint8

StatusSeverity is explicit transient-status presentation state. Producers assign it when creating a status; rendering never infers semantics from text.

const (
	StatusInfo StatusSeverity = iota
	StatusSuccess
	StatusWarning
	StatusError
)

type Styles

type Styles struct {
	NoBold           bool
	Theme            Theme
	AppTitle         lipgloss.Style
	AppSubtitle      lipgloss.Style
	HeaderTabDefault lipgloss.Style
	HeaderTabWarning lipgloss.Style
	HeaderTabSuccess lipgloss.Style
	HeaderTabError   lipgloss.Style
	HeaderDivider    lipgloss.Style
	ActiveBorder     lipgloss.Style
	InactiveBorder   lipgloss.Style
	SuccessText      lipgloss.Style
	WarningText      lipgloss.Style
	ErrorText        lipgloss.Style
	AccentText       lipgloss.Style
	SubtleText       lipgloss.Style
	TableHeader      lipgloss.Style
	TableSelectedRow lipgloss.Style
	ListSelectedRow  lipgloss.Style

	// Layout and Card styles
	Box          lipgloss.Style
	ErrorBox     lipgloss.Style
	Surface      lipgloss.Style
	Hero         lipgloss.Style
	InfoCard     lipgloss.Style
	StatCard     lipgloss.Style
	DetailHeader lipgloss.Style
	DetailLabel  lipgloss.Style
	DetailValue  lipgloss.Style
	SectionTitle lipgloss.Style
	CommandKey   lipgloss.Style
	HelpStyle    lipgloss.Style
	Spinner      lipgloss.Style

	// Custom status tags
	TodoTag         lipgloss.Style
	InProgressTag   lipgloss.Style
	DoneTag         lipgloss.Style
	Footer          lipgloss.Style
	FocusedInput    lipgloss.Style
	BlurredInput    lipgloss.Style
	DisabledInput   lipgloss.Style
	ControlLabel    lipgloss.Style
	FocusedLabel    lipgloss.Style
	DisabledLabel   lipgloss.Style
	FocusedButton   lipgloss.Style
	BlurredButton   lipgloss.Style
	DisabledButton  lipgloss.Style
	MenuBar         lipgloss.Style
	MenuCategory    lipgloss.Style
	MenuItem        lipgloss.Style
	MenuSelected    lipgloss.Style
	MenuDisabled    lipgloss.Style
	MenuDestructive lipgloss.Style

	// Glyphs
	GlyphPointer         string
	GlyphBullet          string
	GlyphCheck           string
	GlyphCross           string
	GlyphWarning         string
	GlyphInfo            string
	GlyphSuccess         string
	GlyphDiamond         string
	GlyphBulletSubtle    string
	GlyphViewportUp      string
	GlyphViewportDown    string
	GlyphRadioSelected   string
	GlyphRadioUnselected string
	GlyphMenuSelected    string
	GlyphMenuSeparator   string
}

Styles defines all the lipgloss styles used across the TUI components.

func DefaultStyles

func DefaultStyles(disableBold bool, disableRoundedBorders bool) Styles

DefaultStyles returns a pre-configured set of styles with a modern developer UI palette.

func (Styles) CompactTabStyle added in v0.0.4

func (s Styles) CompactTabStyle(variant CompactTabVariant) lipgloss.Style

CompactTabStyle returns a shared style for a caller-selected tab variant. Padding preserves the established compact tab widths.

func (Styles) RenderCompactTab added in v0.0.4

func (s Styles) RenderCompactTab(label string, variant CompactTabVariant) string

RenderCompactTab renders a label without inspecting or mutating model state.

func (Styles) RenderError

func (s Styles) RenderError(msg string) string

RenderError returns error text with standard glyph and consistent formatting

func (Styles) RenderInfo

func (s Styles) RenderInfo(msg string) string

RenderInfo returns info/accent text with standard glyph and consistent formatting

func (Styles) RenderSuccess

func (s Styles) RenderSuccess(msg string) string

RenderSuccess returns success text with standard glyph and consistent formatting

func (Styles) RenderWarning

func (s Styles) RenderWarning(msg string) string

RenderWarning returns warning text with standard glyph and consistent formatting

func (Styles) ViewportCues added in v0.0.4

func (s Styles) ViewportCues() ViewportCues

ViewportCues returns terminal-compatible, presentation-only overflow rows.

type Theme added in v0.0.4

Theme is the semantic, presentation-only color palette used by the TUI. Each color carries an exact true-color, ANSI-256, and ANSI-16 value so Lip Gloss can select a readable fallback without guessing how a hex value should degrade on a limited-color terminal.

func DefaultTheme added in v0.0.4

func DefaultTheme() Theme

DefaultTheme returns Cyclestone's shared high-contrast palette. ANSI-16 fallbacks are deliberately distinct by semantic role: active blue (4/12), focused cyan (6/14), inactive gray (8/7), disabled white/gray (7/8), success green (2/10), warning yellow (3/11), and error red (1/9). Values before and after each slash are for light and dark terminal backgrounds respectively.

type TreeOptions added in v0.0.4

type TreeOptions struct {
	PlanID   string // If non-empty, filter tree to only this plan ID.
	UseASCII bool   // If true, force ASCII tree branch glyphs (|--, \--, |, " "). Auto-detected if TERM_PROGRAM == "vscode".
	MaxWidth int    // If > 0, truncate node text to fit within MaxWidth columns.
	Styled   bool   // If true, apply LipGloss styling. Default false (plain text for CLI).
	Styles   Styles // LipGloss styles to use if Styled is true.
}

TreeOptions configures rendering behavior for planning hierarchy trees.

type UpdateMilestoneMsg

type UpdateMilestoneMsg struct {
	MilestoneID string
	Action      string // e.g., "cycle_logged", "status_changed"
	Status      string // optional
}

UpdateMilestoneMsg is sent to log actions or transitions on milestones.

type ViewportCues added in v0.0.4

type ViewportCues struct {
	Above string
	Below string
}

ViewportCues supplies presentation-only rows for content above and below a viewport. Callers choose glyphs and styling so rendering remains independent of terminal environment policy.

type ViewportResult added in v0.0.4

type ViewportResult struct {
	Lines           []string
	EffectiveOffset int
	VisibleStart    int
	VisibleEnd      int
	TotalLines      int
	ContentCapacity int
	OverflowAbove   bool
	OverflowBelow   bool
}

ViewportResult contains rendered rows and the effective content window. VisibleStart and VisibleEnd form a zero-based, half-open content range.

func RenderRangedViewport added in v0.0.4

func RenderRangedViewport(lines []string, requestedOffset, width, height int, cues ViewportCues) ViewportResult

RenderRangedViewport reserves the final row for visible-range metadata and uses the remaining rows for content and overflow cues.

func RenderViewport added in v0.0.4

func RenderViewport(lines []string, requestedOffset, width, height int, cues ViewportCues) ViewportResult

RenderViewport renders caller-owned lines into the supplied inner viewport. It does not modify lines or requestedOffset. Cue rows consume viewport height; when a one-row viewport is between the top and bottom, the below cue wins so forward overflow remains discoverable.

type WorkflowKind added in v0.0.3

type WorkflowKind string
const (
	WorkflowCycle                       WorkflowKind = ""
	WorkflowAgentInstructionsRepository WorkflowKind = "agent-instructions-repository"
	WorkflowAgentInstructionsMilestone  WorkflowKind = "agent-instructions-milestone"
)

Jump to

Keyboard shortcuts

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