Documentation
¶
Overview ¶
Package tui is `otag tui`: a full-screen view of projects, tasks and runs with a live preview of the selected agent's pane. State comes from the database, never from the screen; the TUI itself only reads it. Actions go through the CLI's own command code, handed in as Options.Call, so the import direction stays cli → tui.
Design: docs/TUI.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root model. Update is pure apart from the Cmds it returns: every database, tmux or backend call runs in a Cmd.
func (*Model) Init ¶
Init starts the periodic jobs. Each is a one-shot tick that reschedules itself once its result arrives, so nothing piles up while the event loop is busy.
type Options ¶
type Options struct {
DB *db.DB // the same handle the backend uses
Tmux *tmux.Client // otag's socket (paths.TmuxSocket / TmuxConf)
Getenv func(string) string
DataDir string
Project string // initial selection (--project, else the project of the cwd)
// Call runs a mutation through the CLI command table, with --json and the given
// --request-id, never cancelled once started.
Call func(ctx context.Context, args ...string) Outcome
// Text runs a read command and returns its human output (Details, Stats).
Text func(ctx context.Context, args ...string) (string, error)
// Environ is the environment an attach runs with (default os.Environ).
Environ func() []string
// Unconfigured: otag has no registry yet; the empty tree points to `otag init`.
Unconfigured bool
// AddDir is the git repository the TUI was started in, when no project uses it:
// the empty tree offers it and key a runs `otag project add` for it.
AddDir string
}
Options wire the TUI to otag.
type Outcome ¶
type Outcome struct {
Data any // res.data exactly as --json would carry it
Human string // the human output: toast and Log text
Err *apperr.Error // code, message, retryable
}
Outcome is the result of Options.Call.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package attach plans the TUI's full-screen attach to an agent's window (docs/TUI.md "Full-screen attach"): a nested tmux client of otag's server run with tea.ExecProcess, or, inside the user's own tmux, a full-screen display-popup that runs that client.
|
Package attach plans the TUI's full-screen attach to an agent's window (docs/TUI.md "Full-screen attach"): a nested tmux client of otag's server run with tea.ExecProcess, or, inside the user's own tmux, a full-screen display-popup that runs that client. |
|
Package data reads what the TUI shows: an immutable Snapshot taken in one read transaction, a Watcher that notices commits made by any other connection, and pane liveness.
|
Package data reads what the TUI shows: an immutable Snapshot taken in one read transaction, a Watcher that notices commits made by any other connection, and pane liveness. |
|
Package fixture is a hand-built data.Snapshot for the TUI's unit and golden tests: every row kind, at a fixed time.
|
Package fixture is a hand-built data.Snapshot for the TUI's unit and golden tests: every row kind, at a fixed time. |
|
Package form is the TUI's dialog kit: text fields, text areas, selects, checkboxes, pick lists, read-only notes and buttons.
|
Package form is the TUI's dialog kit: text fields, text areas, selects, checkboxes, pick lists, read-only notes and buttons. |
|
Package preview holds the TUI's view of one agent pane: the last capture, sanitized to text and SGR colours, cropped to the preview's size, with a live (follow) mode and a scroll-locked history mode.
|
Package preview holds the TUI's view of one agent pane: the last capture, sanitized to text and SGR colours, cropped to the preview's size, with a live (follow) mode and a scroll-locked history mode. |
|
Package style holds the TUI's colours, status glyphs and small text helpers.
|
Package style holds the TUI's colours, status glyphs and small text helpers. |
|
Package tabs renders the right-hand tabs other than the preview: Needs and Inbox as items with inline actions, and the text of Details and Stats.
|
Package tabs renders the right-hand tabs other than the preview: Needs and Inbox as items with inline actions, and the text of Details and Stats. |
|
Package tree flattens a data.Snapshot into the rows of the TUI's left pane: projects, their coordinator, the "Ready to deliver" group, tasks by attention, review tasks under the task they review, and runs under their task.
|
Package tree flattens a data.Snapshot into the rows of the TUI's left pane: projects, their coordinator, the "Ready to deliver" group, tasks by attention, review tasks under the task they review, and runs under their task. |
|
Package tuitest builds isolated otag environments for the TUI's tests: a temporary database, config and data dir, a private tmux socket, and the fake harness.
|
Package tuitest builds isolated otag environments for the TUI's tests: a temporary database, config and data dir, a private tmux socket, and the fake harness. |
|
pastecheck
command
Command pastecheck is a test stand-in for an agent's input box with paste detection, the way Claude and Codex judge it: in raw mode, an Enter that arrives in the same read as text, or less than a threshold after the last text, is part of a paste and becomes a newline; only an Enter on its own submits.
|
Command pastecheck is a test stand-in for an agent's input box with paste detection, the way Claude and Codex judge it: in raw mode, an Enter that arrives in the same read as text, or less than a threshold after the last text, is part of a paste and becomes a newline; only an Enter on its own submits. |
|
Package typing is the TUI's typing mode (docs/TUI.md "Typing mode"): key events encoded for `tmux send-keys`, and the sender that delivers them to an agent's pane one tmux command per key, in order, holding Enter back until the agent can no longer take it for part of a paste.
|
Package typing is the TUI's typing mode (docs/TUI.md "Typing mode"): key events encoded for `tmux send-keys`, and the sender that delivers them to an agent's pane one tmux command per key, in order, holding Enter back until the agent can no longer take it for part of a paste. |
|
Package wizard is otag's setup wizard (`otag init`, bare `otag` on a fresh machine, and the confirm step of `otag project add`): a short sequence of form pages built with the TUI's dialog kit (internal/tui/form) and theme.
|
Package wizard is otag's setup wizard (`otag init`, bare `otag` on a fresh machine, and the confirm step of `otag project add`): a short sequence of form pages built with the TUI's dialog kit (internal/tui/form) and theme. |