Class: ResultProcessor
Mastra output processor that trims the bulky, redundant payload fields off targeted outbound stream frames.
Mastra emits step / finish / tool-result frames whose payloads
echo the full tool output / result / assistant messages /
response - data the chat client already received inline and
doesn’t need re-sent. This processor empties those keys on the
targeted frame types so the outbound SSE stream stays lean;
every other frame passes through untouched.
Implements
Section titled “Implements”Processor
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ResultProcessor():
ResultProcessor
Returns
Section titled “Returns”ResultProcessor
Properties
Section titled “Properties”id:
string="result-processor"
Implementation of
Section titled “Implementation of”Processor.id
processDataParts
Section titled “processDataParts”processDataParts:
boolean=true
When true, this processor will also receive data-* chunks in processOutputStream. Default: false.
Implementation of
Section titled “Implementation of”Processor.processDataParts
Methods
Section titled “Methods”processOutputStream()
Section titled “processOutputStream()”processOutputStream(
__namedParameters):Promise<any>
Process output stream chunks with built-in state management This allows processors to accumulate chunks and make decisions based on larger context Return null or undefined to skip emitting the part
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”any
Returns
Section titled “Returns”Promise<any>
Implementation of
Section titled “Implementation of”Processor.processOutputStream