AgentSessionManager.Rendering.Renderers.StudioRenderer (AgentSessionManager v0.8.0)

Copy Markdown View Source

CLI-grade interactive renderer for agent session events.

Produces human-readable terminal output with:

  • Status indicators during tool execution (static symbol)
  • Tool call summaries instead of raw JSON output
  • Clean text streaming blocks with indentation
  • Visual separation between reasoning and tool actions

Designed to match the output quality of Claude Code and Codex CLIs.

Display Modes

Three verbosity levels for tool output:

  • :summary (default) — One-line summary per tool call
  • :preview — Summary + last 3 lines of output
  • :full — Complete tool output with prefix

Options

  • :color — Enable ANSI color output. Default true.
  • :tool_output — Tool output verbosity. Default :summary.
  • :indent — Base indentation (spaces). Default 2.
  • :tty — Override TTY detection. Default: auto-detect via :io.columns/0.

Output Format

 claude-sonnet-4-5 session started

  I'll implement the PubSub integration. Let me start by
  reading the existing sink modules.

 Reading lib/rendering/sink.ex
 Read lib/rendering/sink.ex (72 lines)
 Wrote test/pubsub_sink_test.exs (138 lines)

  Now running the tests.

 Running: mix test test/pubsub_test.exs
 Ran: mix test test/pubsub_test.exs (exit 0, 156 chars, 3.2s)

 Session complete (end_turn)  847/312 tokens, 14 tools

Summary

Types

state()

@type state() :: %{
  color: boolean(),
  tool_output: :summary | :preview | :full,
  show_spinner: boolean(),
  indent: non_neg_integer(),
  is_tty: boolean(),
  phase: :idle | :text | :tool,
  current_tool: map() | nil,
  tool_count: non_neg_integer(),
  event_count: non_neg_integer(),
  total_input_tokens: non_neg_integer(),
  total_output_tokens: non_neg_integer()
}