# `AgentSessionManager.Rendering`
[🔗](https://github.com/nshkrdotcom/agent_session_manager/blob/v0.8.0/lib/agent_session_manager/rendering.ex#L1)

Renders agent session event streams through a pluggable renderer and sink pipeline.

This module is the main entry point for rendering. It wires a renderer (which
formats events into text) to one or more sinks (which write text to destinations).

## Usage

    # Render to terminal with compact format
    Rendering.stream(event_stream,
      renderer: {Renderers.Compact, []},
      sinks: [{Sinks.TTY, []}]
    )

    # Render to terminal + log file + JSONL
    Rendering.stream(event_stream,
      renderer: {Renderers.Verbose, []},
      sinks: [
        {Sinks.TTY, []},
        {Sinks.File, [path: "session.log"]},
        {Sinks.JSONL, [path: "events.jsonl"]}
      ]
    )

    # Programmatic: forward events via callback
    Rendering.stream(event_stream,
      renderer: {Renderers.Passthrough, []},
      sinks: [{Sinks.Callback, [callback: &handle_event/1]}]
    )

# `opts`

```elixir
@type opts() :: [renderer: renderer_spec(), sinks: [sink_spec()]]
```

# `renderer_spec`

```elixir
@type renderer_spec() :: {module(), AgentSessionManager.Rendering.Renderer.opts()}
```

# `sink_spec`

```elixir
@type sink_spec() :: {module(), AgentSessionManager.Rendering.Sink.opts()}
```

# `stream`

```elixir
@spec stream(Enumerable.t(), opts()) :: :ok | {:error, term()}
```

Consume an event stream, rendering each event and writing to all sinks.

Returns `:ok` on success or `{:error, reason}` on failure.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
