agent2agentSourceA2ABindingsRest

class Rest

Rack middleware implementing the A2A HTTP+JSON/REST protocol binding.

Extracts the HTTP verb, path, and request body/params into env keys. Calls downstream. On return, wraps env["a2a.result"] into a REST response with content-type application/a2a+json.

Streaming operations: When the handler sets env["a2a.stream"] to an SSE::Stream (which is a Protocol::HTTP::Body::Readable), Falcon streams it natively — no wrapping, no #each conversion, true async with backpressure.