Expand description
Transport-agnostic transcript rendering.
This is the shared render layer behind unification (“only the transport
differs”): both the local interactive TUI (driven by in-process
AgentEvents) and the remote client (driven by wire RemoteEvents) build
their transcript from the same pi-tui components — an
AssistantMessageComponent per assistant message, a
ToolExecutionComponent per tool call, a BashExecutionComponent per
bash run, and user bubbles. Each side maps its native event stream into the
provider-free UiEvent enum and feeds it to TranscriptView; the view
holds the live component maps and updates them in place.
Keeping this provider-free (only pi-tui + serde_json::Value) is what lets
the local host and the remote client share it without dragging rpi_agent
types into the client.
Structs§
- Transcript
View - The retained transcript: the same component maps the local
TuiStateholds, so a streaming assistant message and each tool/bash panel are updated in place rather than rebuilt per event. - UiTool
Call - A tool call visible in an assistant message snapshot, normalized to plain
data so both the local (
rpi_ai::Content::ToolCall) and the wire ({"type":"toolCall",…}) shapes map onto it.
Enums§
- UiEvent
- A normalized transcript event. Both the local
AgentEventstream and the remoteRemoteEventstream are projected into this enum before rendering.
Functions§
- assistant_
blocks_ from_ value - Map a wire/local assistant message’s content blocks into the provider-free
AssistantBlocklist the shared component renders (text + thinking + decoded image blocks, in document order). - skill_
tool_ name - The skill name when
tool_nameis areadof aSKILL.mdfile (theSKILL.mdparent directory’s basename), elseNone. A skill read renders as upstream’s[skill] <name>box. - tool_
calls_ from_ value - Extract the finalized tool calls (
type: "toolCall") from an assistant message value, in document order. - tool_
result_ requests_ markdown - Whether a tool result opts into markdown rendering of its body
(
details.markdown = true). - tool_
result_ text - Text out of a wire tool-result payload (
{content:[{type:"text",text}]}).
Type Aliases§
- Markdown
Transformer - A sync
Fn(&str) -> Stringapplied to raw assistant markdown. Kept as a trait object so this crate stays free of any plugin types.