Documentation
¶
Overview ¶
Package tui implements the KonaReef terminal interface.
Index ¶
- Variables
- func RunVerify(src string, strict bool, disclosurePolicy string) error
- type AgentsModel
- func (m AgentsModel) Init() tea.Cmd
- func (m AgentsModel) IsCapturingInput() bool
- func (m AgentsModel) KeyHints() string
- func (m AgentsModel) SelectedAgent() (api.Agent, bool)
- func (m *AgentsModel) SetSize(w, h int)
- func (m AgentsModel) Update(msg tea.Msg) (AgentsModel, tea.Cmd)
- func (m AgentsModel) View() string
- type App
- type BudgetModel
- type InspectorModel
- func (m *InspectorModel) AppendComplete(result string)
- func (m *InspectorModel) AppendCost(sats int64)
- func (m *InspectorModel) AppendError(message string)
- func (m *InspectorModel) AppendStream(data string)
- func (m *InspectorModel) AppendToolCall(tool string)
- func (m InspectorModel) HasAgent() bool
- func (m InspectorModel) Init() tea.Cmd
- func (m InspectorModel) KeyHints() string
- func (m *InspectorModel) SetAgent(id string) tea.Cmd
- func (m *InspectorModel) SetSize(w, h int)
- func (m InspectorModel) Update(msg tea.Msg) (InspectorModel, tea.Cmd)
- func (m InspectorModel) View() string
- type StatusBar
- type VerifyModel
Constants ¶
This section is empty.
Variables ¶
var ( ColorUltramarine = lipgloss.Color("#0A1F3D") ColorCerulean = lipgloss.Color("#4EA5D9") ColorLobsterRed = lipgloss.Color("#E63946") ColorTurquoise = lipgloss.Color("#40E0D0") ColorInk = lipgloss.Color("#E6F1FF") ColorMuted = lipgloss.Color("#6B7C93") ColorGreen = lipgloss.Color("#2ECC71") ColorRed = lipgloss.Color("#E74C3C") )
KonaReef dark-mode palette — matches the konareef.ai hero illustration.
var ( TitleStyle = lipgloss.NewStyle(). Foreground(ColorCerulean). Bold(true). MarginBottom(1) SubtitleStyle = lipgloss.NewStyle(). Foreground(ColorMuted). Italic(true). MarginBottom(1) CursorStyle = lipgloss.NewStyle(). Foreground(ColorLobsterRed). Bold(true) RunningNameStyle = lipgloss.NewStyle(). Foreground(ColorInk) StoppedNameStyle = lipgloss.NewStyle(). Foreground(ColorMuted). Faint(true) RunningDotStyle = lipgloss.NewStyle(). Foreground(ColorTurquoise) StoppedDotStyle = lipgloss.NewStyle(). Foreground(ColorMuted) HelpStyle = lipgloss.NewStyle(). Foreground(ColorMuted). Italic(true). MarginTop(1) BoxStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorCerulean). Background(ColorUltramarine). Padding(1, 3) // Tab bar styles. ActiveTabStyle = lipgloss.NewStyle(). Foreground(ColorCerulean). Bold(true). Underline(true) InactiveTabStyle = lipgloss.NewStyle(). Foreground(ColorMuted) // Status bar styles. StatusBarStyle = lipgloss.NewStyle(). Foreground(ColorMuted). MarginTop(1) ConnectedStyle = lipgloss.NewStyle(). Foreground(ColorGreen) DisconnectedStyle = lipgloss.NewStyle(). Foreground(ColorRed) // Error and flash styles. ErrorStyle = lipgloss.NewStyle(). Foreground(ColorRed) FlashStyle = lipgloss.NewStyle(). Foreground(ColorTurquoise) )
Functions ¶
func RunVerify ¶
RunVerify computes the verify outcome for src and runs the standalone verify TUI. strict applies the v1 --strict attestation requirement; disclosurePolicy ("", "C", or "D") applies the --disclosure-policy assertion before rendering (fail-closed on mismatch). It is the entry point wired into `konareef verify --tui`.
RunVerify preserves the headless verify exit contract: it returns a non-nil error (so `runVerify` exits 1) when the FINAL model state — the outcome as last re-verified by the user — has a load error or any divergence. A TUI runtime error takes precedence over the verdict.
Types ¶
type AgentsModel ¶
type AgentsModel struct {
// contains filtered or unexported fields
}
AgentsModel displays the agent list with navigation and spawn/kill actions.
func NewAgentsModel ¶
func NewAgentsModel(client *api.Client) AgentsModel
NewAgentsModel creates an AgentsModel wired to the given API client.
func (AgentsModel) IsCapturingInput ¶
func (m AgentsModel) IsCapturingInput() bool
IsCapturingInput returns true when the model is showing an inline text prompt (spawn task input, etc.) and Enter should NOT be intercepted by the parent App for tab navigation.
func (AgentsModel) KeyHints ¶
func (m AgentsModel) KeyHints() string
KeyHints returns contextual help for the status bar.
func (AgentsModel) SelectedAgent ¶
func (m AgentsModel) SelectedAgent() (api.Agent, bool)
SelectedAgent returns the agent under the cursor, if any.
func (*AgentsModel) SetSize ¶
func (m *AgentsModel) SetSize(w, h int)
SetSize stores terminal dimensions for layout.
func (AgentsModel) Update ¶
func (m AgentsModel) Update(msg tea.Msg) (AgentsModel, tea.Cmd)
Update handles messages for the agents view.
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the root Bubble Tea model that owns sub-models and tab switching.
func NewApp ¶
NewApp creates the root model wired to the given reef-core client and an optional WebSocket client (may be nil if no session token is available).
type BudgetModel ¶
type BudgetModel struct {
// contains filtered or unexported fields
}
BudgetModel displays the pod-wide budget summary.
func NewBudgetModel ¶
func NewBudgetModel(client *api.Client) BudgetModel
NewBudgetModel creates a BudgetModel wired to the given API client.
func (*BudgetModel) ApplyCost ¶
func (m *BudgetModel) ApplyCost(agentID string, sats int64)
ApplyCost applies a pod-wide cost delta from the PodEventsChannel agent_cost event. It mutates the currently-cached budget optimistically so the Budget tab updates between REST polls; the next budgetFetchedMsg reconciles any drift with the server snapshot.
If no budget has been fetched yet (m.budget == nil) the delta is dropped — the subsequent fetch will include the already-recorded spend.
func (BudgetModel) KeyHints ¶
func (m BudgetModel) KeyHints() string
KeyHints returns contextual help for the status bar.
func (*BudgetModel) SetSize ¶
func (m *BudgetModel) SetSize(w, h int)
SetSize stores terminal dimensions for layout.
func (BudgetModel) Update ¶
func (m BudgetModel) Update(msg tea.Msg) (BudgetModel, tea.Cmd)
Update handles budget messages.
type InspectorModel ¶
type InspectorModel struct {
// contains filtered or unexported fields
}
InspectorModel shows detail for a single agent with live output + actions.
func NewInspectorModel ¶
func NewInspectorModel(client *api.Client) InspectorModel
NewInspectorModel creates an empty inspector. Call SetAgent to load one.
func (*InspectorModel) AppendComplete ¶
func (m *InspectorModel) AppendComplete(result string)
AppendComplete adds a completion event to the live log.
func (*InspectorModel) AppendCost ¶
func (m *InspectorModel) AppendCost(sats int64)
AppendCost adds a cost event to the live log.
func (*InspectorModel) AppendError ¶
func (m *InspectorModel) AppendError(message string)
AppendError adds an error event to the live log.
func (*InspectorModel) AppendStream ¶
func (m *InspectorModel) AppendStream(data string)
AppendStream adds streaming text to the live log. Streaming chunks are appended to the last line (no newline per chunk).
func (*InspectorModel) AppendToolCall ¶
func (m *InspectorModel) AppendToolCall(tool string)
AppendToolCall adds a tool call event to the live log.
func (InspectorModel) HasAgent ¶
func (m InspectorModel) HasAgent() bool
HasAgent returns true if an agent is loaded.
func (InspectorModel) Init ¶
func (m InspectorModel) Init() tea.Cmd
Init returns nil — SetAgent triggers the initial fetch.
func (InspectorModel) KeyHints ¶
func (m InspectorModel) KeyHints() string
KeyHints returns contextual help for the status bar.
func (*InspectorModel) SetAgent ¶
func (m *InspectorModel) SetAgent(id string) tea.Cmd
SetAgent switches the inspector to a new agent and triggers a fetch.
func (*InspectorModel) SetSize ¶
func (m *InspectorModel) SetSize(w, h int)
SetSize stores terminal dimensions.
func (InspectorModel) Update ¶
func (m InspectorModel) Update(msg tea.Msg) (InspectorModel, tea.Cmd)
Update handles inspector messages.
func (InspectorModel) View ¶
func (m InspectorModel) View() string
View renders the agent detail + output log.
type StatusBar ¶
type StatusBar struct {
// contains filtered or unexported fields
}
StatusBar renders connection state, active tab, and contextual key hints.
func NewStatusBar ¶
func NewStatusBar() StatusBar
NewStatusBar creates a StatusBar with default state.
func (*StatusBar) ClearFlash ¶
func (s *StatusBar) ClearFlash()
ClearFlash removes the flash message.
func (*StatusBar) SetConnected ¶
SetConnected updates the REST connection indicator.
func (*StatusBar) SetWsConnected ¶
SetWsConnected updates the WebSocket connection indicator.
type VerifyModel ¶
type VerifyModel struct {
// contains filtered or unexported fields
}
VerifyModel is the standalone verify screen.
func (VerifyModel) Init ¶
func (m VerifyModel) Init() tea.Cmd
Init implements tea.Model. No async work on start — the outcome is computed before the program runs.
func (VerifyModel) View ¶
func (m VerifyModel) View() string
View renders the verify screen with a scroll window and a key-hint footer.