Skip to main content

Module session_driver

Module session_driver 

Source
Expand description

Transport-agnostic session driver — the “only the transport differs” boundary.

A driver bundles the two things a TUI needs from its backend:

  1. a stream of normalized events (DriverEvent / UiEvent), and
  2. a command sink (DriverCommand).

The remote client (RemoteDriver) implements this over TCP JSON-RPC. The local interactive host drives the same rendering path via map_agent_event (its own in-process AgentEvent stream → UiEvent). Because both sides speak UiEvent, they render through the same crate::transcript_view::TranscriptView.

Structs§

DriverStatus
A snapshot of backend session state for the chrome (header / footer / retry).
LocalDriver
A SessionDriver backed by an in-process harness lane: it turns the lane’s broadcast::Receiver<AgentEvent> into DriverEvents and maps DriverCommands onto the lane. Additive — the interactive TUI can adopt it without changing the rich local operations it performs through the lane directly.
RemoteDriver
A SessionDriver backed by a remote rpi --server over TCP JSON-RPC.

Enums§

DriverCommand
A command the TUI sends to its backend.
DriverEvent
An item pushed from a driver to the TUI.

Traits§

SessionDriver
A backend the TUI can drive: it yields DriverEvents and accepts DriverCommands. Both the in-process host and the remote client implement it, so the transcript render layer above is transport-agnostic.

Functions§

assistant_blocks
Provider-free assistant block projection (text / thinking / decoded image), in document order.
assistant_tool_calls
Finalized tool calls in an assistant message (placeholder calls with an empty name are skipped).
map_agent_event
Project an in-process AgentEvent into the shared UiEvent. Returns None for events with no transcript effect.
map_remote_event
Project a wire RemoteEvent into the shared UiEvent.