Documentation
¶
Overview ¶
Package tui implements the BubbleTea terminal UI for Cortex.
Following BubbleTea patterns: - Screen constants as iota - Single Model struct holds ALL state - Update() with type switch - Per-screen key handlers returning (tea.Model, tea.Cmd) - Vim keys (j/k) for navigation - PrevScreen for back navigation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Observations *sqlitestore.Store
Sessions *session.Store
Search *search.Store
Graph *graphstore.Store
Scoring *scoringstore.Store
Entities *entitystore.Store
App *app.App
Config *config.Config
Version string
}
Deps bundles all store dependencies for the TUI.
type Model ¶
type Model struct {
Version string
Screen Screen
PrevScreen Screen
PrevCursor int
Width int
Height int
Cursor int
Scroll int
// Update notification
UpdateResult *update.Result
// Error display
ErrorMsg string
// Dashboard
Stats *combinedStats
// Search
SearchInput textinput.Model
SearchQuery string
SearchResults []*domain.SearchResult
// Recent observations
RecentObservations []*domain.Observation
// Observation detail (enriched with Cortex data)
SelectedObservation *domain.Observation
DetailScore *domain.ImportanceScore
DetailEntities []*domain.EntityLink
DetailEdges []*domain.Edge
DetailScroll int
// Timeline
TimelineFocus *domain.Observation
TimelineBefore []*domain.Observation
TimelineAfter []*domain.Observation
// Sessions
Sessions []*session.SessionStats
SelectedSessionIdx int
SessionObservations []*domain.Observation
SessionDetailScroll int
// Graph (Cortex-exclusive)
GraphObservations []*domain.Observation
GraphEdges []*domain.Edge
GraphRootID int64
// Archive (Cortex-exclusive)
ArchivedObservations []*domain.Observation
// Health (Cortex-exclusive)
HealthStale []*domain.Observation
HealthOrphans []*domain.Observation
HealthEdgeCount int
HealthObsCount int
HealthCandidates []healthCandidate
// Setup
SetupAgents []setup.Agent
SetupResult *setup.Result
SetupInstalling bool
SetupInstallingName string
SetupDone bool
SetupError string
SetupAllowlistPrompt bool
SetupAllowlistApplied bool
SetupAllowlistError string
SetupSpinner spinner.Model
// Embedding config
EmbCfgProvider int // 0=none, 1=ollama, 2=openai
EmbCfgModel textinput.Model // model name input
EmbCfgVector bool // vector search toggle
EmbCfgAutoStart bool // auto-start Ollama toggle
EmbCfgFocusField int // focused field (0=provider, 1=model, 2=vector, 3=autostart, 4=save)
EmbCfgSaving bool
EmbCfgSaved bool
EmbCfgError string
EmbCfgOllamaRunning bool
EmbCfgOllamaHasModel bool
EmbCfgOllamaChecked bool // true after status check completes
EmbCfgPulling bool
EmbCfgStarting bool
EmbCfgSpinner spinner.Model
// contains filtered or unexported fields
}
Model holds the TUI state.
Click to show internal directories.
Click to hide internal directories.