Interface: AgentStreamEvent
@providerprotocol/agents / index / AgentStreamEvent
Interface: AgentStreamEvent
Section titled “Interface: AgentStreamEvent”Defined in: src/execution/types.ts:240
Agent stream event that wraps both UAP and UPP events.
During streaming execution, events from two sources are emitted:
uap: High-level agent lifecycle events (step start/end, reasoning, etc.)upp: Low-level LLM stream events (text deltas, tool call deltas, etc.)
Example
Section titled “Example”const stream = agent.stream('Count to 5');
for await (const event of stream) { if (event.source === 'uap') { console.log(`Agent event: ${event.uap?.type}`); } else if (event.source === 'upp') { if (event.upp?.type === 'text_delta') { process.stdout.write(event.upp.delta.text ?? ''); } }}Properties
Section titled “Properties”source
Section titled “source”source:
"uap"|"upp"
Defined in: src/execution/types.ts:242
Event source: ‘uap’ for agent-level, ‘upp’ for LLM-level
optionaluap:object
Defined in: src/execution/types.ts:245
Present when source === ‘uap’ - contains agent lifecycle event data
agentId
Section titled “agentId”agentId:
string
The agent ID emitting this event
data:
Record<string,unknown>
Event-specific data payload
step:
number
The current step number (1-indexed)
type:
UAPEventType
The type of UAP event
optionalupp:StreamEvent
Defined in: src/execution/types.ts:257
Present when source === ‘upp’ - contains LLM stream event