Documentation / guides
Integration
Connect the TUI to Harness sessions, fixed workspace metadata, restore decisions, and durable session stores.
The TUI integrates at three narrow boundaries. Harness supplies a session.SessionController and event contract. The application supplies synchronous workspace and access-profile metadata. A session store supplies a durable event replayer when the screen needs a cold repaint or gap repair. Each owner remains explicit.
Integration boundary
%%{init: {"theme":"dark"}}%%
flowchart TD
R[Application composition root] --> H[Harness Rig and session]
R --> W[Workspace and fixed access profile]
R --> D[Session store]
H --> A[sessionadapter.Adapter]
D --> A
W --> T[tui.WithSessionPresentation]
A --> S[tui.Screen]
T --> S
S --> E[events and gate replies]
The adapter does not instantiate the Rig or call restore by itself. The composition root performs session creation or restore, then wraps the resulting controller. The TUI renders what the session contract publishes and what the consumer explicitly presents.
Harness and restore
Harness Sessions and Gates shows sessionadapter.NewWithReplay, sessionadapter.Restore, and the restore.Decider wiring used before Bubble Tea starts. It also explains the gate coordinates that keep permission replies on the correct loop.
Workspace metadata
Workspaces and Session Presentation documents SessionPresentation, the fixed profile badge, pre-gate diagnostics, and resumed-session refresh. The TUI displays workspace context. It does not grant access or mutate the active profile.
Durable replay
Session Stores and Durable Replay documents the ReplayOpener interface, journal sequence recovery, and the difference between New, NewWithReplay, and Restore.
For the capabilities being rendered, read Tools and Harness.