Documentation
¶
Overview ¶
Package pages implements the individual pages for the Lango Cockpit TUI.
Index ¶
- type ApprovalsPage
- func (m *ApprovalsPage) Activate() tea.Cmd
- func (m *ApprovalsPage) Deactivate()
- func (m *ApprovalsPage) Init() tea.Cmd
- func (m *ApprovalsPage) ShortHelp() []key.Binding
- func (m *ApprovalsPage) Title() string
- func (m *ApprovalsPage) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *ApprovalsPage) View() string
- type SessionsPage
- func (p *SessionsPage) Activate() tea.Cmd
- func (p *SessionsPage) Deactivate()
- func (p *SessionsPage) Init() tea.Cmd
- func (p *SessionsPage) ShortHelp() []key.Binding
- func (p *SessionsPage) Title() string
- func (p *SessionsPage) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (p *SessionsPage) View() string
- type SettingsPage
- func (m *SettingsPage) Activate() tea.Cmd
- func (m *SettingsPage) Deactivate()
- func (m *SettingsPage) Init() tea.Cmd
- func (m *SettingsPage) ShortHelp() []key.Binding
- func (m *SettingsPage) Title() string
- func (m *SettingsPage) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *SettingsPage) View() string
- type StatusPage
- type TaskActioner
- type TaskInfo
- type TaskLister
- type TasksPage
- type ToolsPage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApprovalsPage ¶
type ApprovalsPage struct {
// contains filtered or unexported fields
}
ApprovalsPage displays approval history and active grants.
func NewApprovalsPage ¶
func NewApprovalsPage(history *approval.HistoryStore, grants *approval.GrantStore) *ApprovalsPage
NewApprovalsPage creates a new ApprovalsPage. Both stores may be nil.
func (*ApprovalsPage) Activate ¶
func (m *ApprovalsPage) Activate() tea.Cmd
Activate starts periodic data refresh.
func (*ApprovalsPage) Deactivate ¶
func (m *ApprovalsPage) Deactivate()
Deactivate stops the tick loop.
func (*ApprovalsPage) ShortHelp ¶
func (m *ApprovalsPage) ShortHelp() []key.Binding
ShortHelp returns context-sensitive key bindings for the help bar.
func (*ApprovalsPage) Title ¶
func (m *ApprovalsPage) Title() string
Title returns the page tab label.
func (*ApprovalsPage) View ¶
func (m *ApprovalsPage) View() string
View renders the approvals page with history and grants sections.
type SessionsPage ¶
type SessionsPage struct {
// contains filtered or unexported fields
}
SessionsPage displays sessions from Store.ListSessions() with cursor navigation. Each entry shows the session key and relative time since last update.
func NewSessionsPage ¶
func NewSessionsPage( listFn func(ctx context.Context) ([]session.SessionSummary, error), ) *SessionsPage
NewSessionsPage creates a SessionsPage. listFn is called on Activate to populate the session list.
func (*SessionsPage) Activate ¶
func (p *SessionsPage) Activate() tea.Cmd
Activate is called when the page becomes active. It fires an async command to load sessions.
func (*SessionsPage) Deactivate ¶
func (p *SessionsPage) Deactivate()
Deactivate is called when the page loses focus.
func (*SessionsPage) Init ¶
func (p *SessionsPage) Init() tea.Cmd
Init satisfies tea.Model. No initial command is needed.
func (*SessionsPage) ShortHelp ¶
func (p *SessionsPage) ShortHelp() []key.Binding
ShortHelp returns context-sensitive keybindings for the help bar.
func (*SessionsPage) Title ¶
func (p *SessionsPage) Title() string
Title returns the page tab label.
type SettingsPage ¶
type SettingsPage struct {
// contains filtered or unexported fields
}
SettingsPage embeds a settings.Editor in the cockpit. Save operations use the OnSave callback instead of quitting.
func NewSettingsPage ¶
func NewSettingsPage( cfg *config.Config, store *configstore.Store, profileName string, ) *SettingsPage
NewSettingsPage creates a SettingsPage with an embedded Editor. The save callback persists to ConfigStore without exiting the TUI.
func (*SettingsPage) Activate ¶
func (m *SettingsPage) Activate() tea.Cmd
Activate is a no-op — the editor is always ready.
func (*SettingsPage) ShortHelp ¶
func (m *SettingsPage) ShortHelp() []key.Binding
ShortHelp returns key bindings for the help bar.
func (*SettingsPage) Title ¶
func (m *SettingsPage) Title() string
Title returns the page tab label.
func (*SettingsPage) View ¶
func (m *SettingsPage) View() string
View delegates rendering to the embedded Editor.
type StatusPage ¶
type StatusPage struct {
// contains filtered or unexported fields
}
StatusPage displays feature status and system metrics.
func NewStatusPage ¶
func NewStatusPage( statusProvider func() []types.FeatureStatus, collector *observability.MetricsCollector, cfg *config.Config, ) *StatusPage
NewStatusPage creates a new StatusPage.
statusProvider is called periodically to fetch current feature statuses, avoiding a direct import of internal/app.
func (*StatusPage) Activate ¶
func (m *StatusPage) Activate() tea.Cmd
Activate starts periodic metric collection.
func (*StatusPage) Init ¶
func (m *StatusPage) Init() tea.Cmd
Init satisfies tea.Model but does nothing; ticks start on Activate.
func (*StatusPage) ShortHelp ¶
func (m *StatusPage) ShortHelp() []key.Binding
ShortHelp returns key bindings for the help bar (none — read-only page).
type TaskActioner ¶
type TaskActioner interface {
CancelTask(id string) error
RetryTask(ctx context.Context, id string) error
}
TaskActioner provides cancel and retry operations for background tasks.
type TaskInfo ¶
type TaskInfo struct {
ID string
Prompt string
Status string
Elapsed time.Duration
Result string // completion result text
Error string // error message if failed
OriginChannel string // originating channel (e.g. "telegram", "slack")
TokensUsed int // token count for this task
}
TaskInfo holds summary info about a background task for display.
type TaskLister ¶
type TaskLister interface {
ListTasks() []TaskInfo
}
TaskLister provides the list of background tasks.
type TasksPage ¶
type TasksPage struct {
// contains filtered or unexported fields
}
TasksPage displays background tasks in a table view.
func NewTasksPage ¶
func NewTasksPage(lister TaskLister, actioner TaskActioner) *TasksPage
NewTasksPage creates a new TasksPage. lister and actioner may be nil.
type ToolsPage ¶
type ToolsPage struct {
// contains filtered or unexported fields
}
ToolsPage is a read-only catalog browser that lists tool categories on the left and tool details for the selected category on the right.
func NewToolsPage ¶
func NewToolsPage(catalog *toolcatalog.Catalog) *ToolsPage
NewToolsPage creates a ToolsPage backed by the given catalog.