Skip to main content

Module main_loop

Module main_loop 

Source
Expand description

TUI main event loop — connects oxicode’s AgentSession to vtcode-ui’s InlineSession protocol and a ratatui rendering backend.

Structs§

EphemeralTip
A short-lived contextual tip banner (grok-build ephemeral tips parity). Shown as one line above the composer for a bounded number of render ticks, then auto-dismissed.
ModalConfirmation
A y/n/x confirmation dialog (grok-build ModalConfirmation parity). Rendered centered on top of everything else; the input thread routes y → confirm, n → decline (when offered), x/Esc → cancel.
OverlayListItem
One item rendered inside a list overlay. Mirrors InlineListItem but is a value type owned by the TUI (the input thread reads/writes these fields directly via the parking_lot::Mutex<RenderState>).
OverlaySearchState
Search-bar state for an overlay. None value means search is disabled.
OverlaySecureInput
Secure (masked) single-line input state carried by an overlay. Only present when the original OverlayRequest::Modal carried a secure_prompt. The input thread mutates editor while the overlay is open; on Enter it submits OverlaySubmission::SecureInput carrying the editor’s text. The real secret never leaves the editor — the renderer paints the value via a TextElement whose display is the mask.
OverlayState
Overlay modal/list state — materialised by apply_command when an InlineCommand::ShowOverlay arrives. The input thread mutates selected / search while the overlay is open and reads the same fields when forwarding OverlayEvents.
RenderState
SearchState
In-transcript search state.
SlashPopup
Slash-command autocomplete popup state, managed by the input thread and read by the render loop. The popup is open when the input buffer starts with / and contains no space (i.e. the user is still typing the command token, not its arguments).
SlashPopupItem
One filtered entry in the /-command autocomplete popup.
Tui
Terminal wrapper with deterministic enter / exit / Drop semantics.

Enums§

ConfirmationAction
The action bound to a ModalConfirmation — dispatched on y/Enter.
SecureInputOrigin
Where a secure prompt came from. The SecureInput overlay has just one payload (the text); the origin discriminates the post-commit follow-up so the user gets a contextual flow instead of a generic “saved” line.

Functions§

run_tui
Run the new oxicode-vtui powered TUI. Returns once the user exits or the session is shut down.