Skip to content

Interface: AgentStreamEvent

@providerprotocol/agents


@providerprotocol/agents / index / 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.)
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 ?? '');
}
}
}

source: "uap" | "upp"

Defined in: src/execution/types.ts:242

Event source: ‘uap’ for agent-level, ‘upp’ for LLM-level


optional uap: object

Defined in: src/execution/types.ts:245

Present when source === ‘uap’ - contains agent lifecycle event data

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


optional upp: StreamEvent

Defined in: src/execution/types.ts:257

Present when source === ‘upp’ - contains LLM stream event