# `Jido.Chat.Markdown.StreamRenderer`
[🔗](https://github.com/agentjido/jido_chat/blob/v1.2.0/lib/jido/chat/markdown/stream_renderer.ex#L1)

Builds safe Markdown snapshots from an incremental, provider-independent stream.

The renderer keeps the original text. `push/2` can return a repaired snapshot for
an in-progress edit. `flush/1` returns stable final Markdown and keeps complete,
supported Markdown exact. Possible table headers and partial table rows are held
until their structure is known.

# `t`

```elixir
@type t() :: %Jido.Chat.Markdown.StreamRenderer{
  exact_snapshot?: boolean(),
  parts: [iodata()],
  snapshot: String.t() | nil
}
```

# `append`

```elixir
@spec append(t(), term()) :: t()
```

Adds one chunk without calculating a partial snapshot.

# `flush`

```elixir
@spec flush(t()) :: String.t() | nil
```

Returns stable final Markdown, or nil when there is no visible text.

# `new`

```elixir
@spec new() :: t()
```

Creates an empty streaming Markdown renderer.

# `push`

```elixir
@spec push(t(), term()) :: {t(), String.t() | nil}
```

Adds one text or structured stream chunk and returns a changed safe snapshot.

# `render`

```elixir
@spec render(Enumerable.t()) :: String.t() | nil
```

Renders a finite stream to its exact final Markdown fallback.

# `snapshot`

```elixir
@spec snapshot(t()) :: String.t() | nil
```

Returns the current safe replacement snapshot without changing state.

---

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