You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SDK provides agent.stream() (async iterator) and event.toJSON() (serialization), but no server-side transport helpers.
Every developer building a chat UI writes the same ~20 lines of SSE boilerplate:
Set response headers (Content-Type: text/event-stream, Cache-Control: no-cache)
Iterate agent.stream() events
Check 3 levels of nesting to extract text deltas
Format as data: {...}\n\n lines
Handle errors gracefully
Call res.end()
This is the most common integration pattern for TypeScript agents, and every consumer reinvents it.
Proposed Solution
Server-side transport helpers, similar to what the Vercel AI SDK provides:
result.pipeTextStreamToResponse(res) — pipes text directly to an Express response
result.pipeUIMessageStreamToResponse(res) — pipes structured events (text deltas, tool calls, reasoning) with a defined SSE protocol
result.toDataStreamResponse() — returns a Web Response for edge/serverless runtimes
They also define a "Data Stream Protocol" — a standard SSE format with typed events (text-delta, tool-call, tool-result, reasoning-start, etc.) so frontends know exactly what to expect.
Problem Statement
The SDK provides
agent.stream()(async iterator) andevent.toJSON()(serialization), but no server-side transport helpers.Every developer building a chat UI writes the same ~20 lines of SSE boilerplate:
Content-Type: text/event-stream,Cache-Control: no-cache)agent.stream()eventsdata: {...}\n\nlinesres.end()This is the most common integration pattern for TypeScript agents, and every consumer reinvents it.
Proposed Solution
Server-side transport helpers, similar to what the Vercel AI SDK provides:
result.pipeTextStreamToResponse(res)— pipes text directly to an Express responseresult.pipeUIMessageStreamToResponse(res)— pipes structured events (text deltas, tool calls, reasoning) with a defined SSE protocolresult.toDataStreamResponse()— returns a Web Response for edge/serverless runtimesThey also define a "Data Stream Protocol" — a standard SSE format with typed events (
text-delta,tool-call,tool-result,reasoning-start, etc.) so frontends know exactly what to expect.Vercel AI SDK docs for reference:
For Strands, even a minimal helper would eliminate the most common boilerplate:
Use Case
Building an Express.js SSE endpoint for a chat UI where you need to:
Currently requires ~20 lines of boilerplate per endpoint, including the 3-level event nesting check from #1030.
Alternatives Solutions
@strands-agents/sdk/a2a/express) exists but only serves the A2A protocol, not general SSE streaming to frontendsAdditional Context
JSON.stringify(event)and dumps everything — it doesn't show selective extraction for a real chat UI