Function: processMastraStream()
processMastraStream(
options):Promise<void>
Parse Mastra agent SSE (data: … lines) and invoke onChunk per event.
Mirrors @mastra/client-js’s internal reader without the
processChatResponse_vNext side channel that throws when a resumed
approve-tool-call stream emits tool-result without a new tool-call.
Parameters
Section titled “Parameters”options
Section titled “options”onChunk
Section titled “onChunk”(chunk) => void | Promise<void>
signal?
Section titled “signal?”AbortSignal
stream
Section titled “stream”ReadableStream<Uint8Array<ArrayBufferLike>>
Returns
Section titled “Returns”Promise<void>