Adapter from aws_event_stream's classified frames to the Converse envelope
ReqManagedAgents.AgentCore.Converse.parse/1 consumes.
Framing, CRC verification, header parsing, :message-type classification, and
Bedrock payload unwrap all live in AWSEventStream (the published binary
vnd.amazon.eventstream codec). This module owns only the AgentCore-specific
shaping of the classified frames:
{:event, type, payload}->%{type => payload}(the Converse envelope), orpayloadas-is when the frame carries no:event-type.{:exception, type, payload}/{:error, code, message}->%{"__stream_error__" => %{"type" => …, "message" => …}}, so a server-side close (e.g. a ConverseStream ValidationException) surfaces as a distinct error rather than a silent terminal.ReqManagedAgents.AgentCore'sstream_error/1reads this shape.- malformed frames / payloads -> dropped (the prior recovery posture).
decode/1's {[map()], binary()} contract and incremental (chunked-buffer)
semantics are preserved exactly — AWSEventStream.JSON.decode/1 is itself
incremental, buffering an incomplete trailing frame as remainder.