class RubyLLM::AgUI::SSEWriter

Writes AG-UI events to any IO-like stream as Server-Sent Events.

The stream is whatever the host is writing a response to: a Rack response body, an ActionController::Live response, a socket, a StringIO in a test. The gem does not own the transport, so it does not open connections, buffer frames or choose how a host relays a background job to a client. What it does own is the ordering and the framing of the events it writes.

A dead stream is reported as a TransportError and the writer stays closed. The reason is a transport truncation, not a run outcome: it is never evidence that the work finished, succeeded or was cancelled.