Documentation
¶
Overview ¶
Package controller provides UI-agnostic business logic for aimux. It orchestrates exports, session management, and agent coordination without depending on any TUI framework. Both the Bubble Tea TUI and a future web UI import this package.
Index ¶
- func BulkDeleteSessions(sessions []history.Session) (int, error)
- func DeleteSession(s history.Session) error
- func FilterHidden(agents []agent.Agent, hidden map[string]bool) []agent.Agent
- type ActionInput
- type Controller
- type ExportContext
- type ExportResult
- type Navigator
- type TraceInput
- type ViewType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BulkDeleteSessions ¶
BulkDeleteSessions removes multiple sessions, returning the count of successfully deleted sessions and the first error encountered.
func DeleteSession ¶
DeleteSession removes a session's JSONL file and its sidecar .meta.json.
Types ¶
type ActionInput ¶
ActionInput is a tool invocation within a trace turn.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller owns the business logic and state that is shared across all UI frontends. It does NOT import bubbletea or lipgloss.
func New ¶
func New(cfg config.Config) *Controller
New creates a new Controller with the given configuration.
func (*Controller) ExportJSONL ¶
func (c *Controller) ExportJSONL(ctx ExportContext) (ExportResult, error)
ExportJSONL exports trace turns and session metadata to a JSONL file. Returns the file path and turn count on success.
func (*Controller) ExportOTEL ¶
func (c *Controller) ExportOTEL(ctx ExportContext) (ExportResult, error)
ExportOTEL exports trace turns and session metadata as OTLP/HTTP spans. Returns the endpoint URL and turn count on success.
type ExportContext ¶
type ExportContext struct {
SessionID string
SessionFile string // path to session JSONL (for loading .meta.json)
ProviderName string
Turns []TraceInput
EvalStore *evaluation.Store
}
ExportContext holds the runtime context needed for an export operation. The UI layer populates this from its active state (which trace is open, which session file is loaded, etc.).
type ExportResult ¶
type ExportResult struct {
Path string // file path (JSONL) or endpoint URL (OTEL)
Count int // number of turns exported
}
ExportResult holds the outcome of an export operation.
type Navigator ¶
type Navigator struct {
}
Navigator manages the view navigation state machine. It tracks which view is active, breadcrumbs, and zoom/split state.
func NewNavigator ¶
func NewNavigator() *Navigator
NewNavigator creates a Navigator in the default state (agents view).
func (*Navigator) EnterZoom ¶
func (n *Navigator) EnterZoom()
EnterZoom enters zoomed session mode with split view.
func (*Navigator) ExitZoom ¶
ExitZoom implements hierarchical back navigation: fullscreen -> split view -> main view. Returns true if fully exited zoom (back to main), false if returned to split.
func (*Navigator) NavigateBack ¶
func (n *Navigator) NavigateBack()
NavigateBack returns to the agents view.
func (*Navigator) NavigateTo ¶
NavigateTo switches to a new view with a breadcrumb label.
func (*Navigator) ToggleSplit ¶
func (n *Navigator) ToggleSplit()
ToggleSplit toggles between split and full-screen mode.
func (*Navigator) ToggleSplitFocus ¶
func (n *Navigator) ToggleSplitFocus()
ToggleSplitFocus switches focus between "trace" and "session" panes.
type TraceInput ¶
type TraceInput struct {
Number int
Timestamp string // RFC3339
UserText string
OutputText string
Actions []ActionInput
TokensIn int64
TokensOut int64
CostUSD float64
DurationMs int64
Model string
}
TraceInput is the subset of trace.Turn fields needed for export, avoiding a direct dependency on the trace package's full type (which includes rendering-specific fields).
func TurnsToInputs ¶
func TurnsToInputs(turns []trace.Turn) []TraceInput
TurnsToInputs converts trace.Turn slices to the UI-agnostic TraceInput format. Called by the UI layer before passing data to the controller.