# `Pixir.Provider.SSEDecoder`
[🔗](https://github.com/Ranvier-Technologies/pixir/blob/main/lib/pixir/provider/sse_decoder.ex#L1)

Incremental, bounded WHATWG event-stream framing for the portable Open Responses
HTTP/SSE profile.

This module owns framing only. `Pixir.Provider` owns JSON reduction, strict
`event:`/body-`type` agreement, and terminal interpretation. The decoder never
includes payload bytes in errors or diagnostics. It is deliberately selected only
for `open_responses`; the accepted ChatGPT/Codex compatibility reducer remains
separate.

# `frame`

```elixir
@type frame() :: %{event: String.t() | nil, data: binary(), ordinal: pos_integer()}
```

A framed data payload. `event` is nil when no event field was supplied.

# `t`

```elixir
@opaque t()
```

Opaque incremental decoder state.

# `feed`

```elixir
@spec feed(t(), binary()) ::
  {:ok, t(), [frame() | :done]} | {:error, t(), [frame() | :done], map()}
```

Feed one arbitrary transport chunk and return zero or more ordered frames.

# `finish`

```elixir
@spec finish(t()) :: {:ok, t(), [frame() | :done], map()} | {:error, t(), map()}
```

Finish framing, discarding any pending non-dispatched event per WHATWG.

# `max_event_bytes`

```elixir
@spec max_event_bytes() :: pos_integer()
```

Maximum accepted bytes in one undecoded event, including framing.

# `new`

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

Create an empty strict decoder.

---

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