# `SmolBox.Wire.SSE`
[🔗](https://github.com/hfiguera/smolbox/blob/v0.1.3/lib/smolbox/wire/sse.ex#L1)

Incremental parser for the pinned SmolVM exec SSE protocol.

stdout/stderr are plain lossy UTF-8 data; only exit/error payloads are JSON.
Unknown additive events and keepalives are ignored. An exit is required for
successful completion. Terminal duplicates and output after exit are errors.
Frames and incoming chunks have explicit byte limits; no mailbox is involved.

# `event`

```elixir
@type event() ::
  {:stdout, String.t()}
  | {:stderr, String.t()}
  | {:exit, integer()}
  | {:error, :remote}
```

# `t`

```elixir
@type t() :: %SmolBox.Wire.SSE{
  buffer: binary(),
  data: [binary()],
  event: binary(),
  frame_bytes: non_neg_integer(),
  max_chunk_bytes: pos_integer(),
  max_frame_bytes: pos_integer(),
  terminal: :exit | :error | nil
}
```

# `feed`

```elixir
@spec feed(t(), binary()) :: {:ok, t(), [event()]} | {:error, SmolBox.Error.t()}
```

Consume a bounded chunk; incomplete UTF-8 is retained until the frame is complete.

# `finish`

```elixir
@spec finish(t()) :: :ok | {:error, SmolBox.Error.t()}
```

EOF is successful only after a complete exit event with no unfinished frame.

---

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