TurnStream typedef

TurnStream = ({Future<AgentOutput> output, Stream<AgentStreamChunk> stream})

The streamed result of a single turn: incremental stream chunks plus an output future for the final, non-throwing AgentOutput (failures resolve with finishReason: 'failed').

Implementation

typedef TurnStream = ({
  Stream<AgentStreamChunk> stream,
  Future<AgentOutput> output,
});