Skip to content

ToolStreamUpdateEvent

Defined in: src/hooks/events.ts:698

Event triggered for each streaming progress event from a tool during execution. Wraps a ToolStreamEvent with invocation context, keeping the tool authoring interface unchanged — tools construct ToolStreamEvent without knowledge of agents or hooks, and the agent layer wraps them at the boundary.

Consistent with ModelStreamUpdateEvent which wraps model streaming events the same way.

new ToolStreamUpdateEvent(data): ToolStreamUpdateEvent;

Defined in: src/hooks/events.ts:704

ParameterType
data{ agent: LocalAgent; event: ToolStreamEvent; invocationState: InvocationState; } & HookableEventData

ToolStreamUpdateEvent

HookableEvent.constructor

readonly invocationContext?: InvocationContext;

Defined in: src/hooks/events.ts:100

The request this event belongs to (undefined outside one); pass it to InvokeOptions.invocationContext to join it.

HookableEvent.invocationContext


readonly type: "toolStreamUpdateEvent";

Defined in: src/hooks/events.ts:699


readonly agent: LocalAgent;

Defined in: src/hooks/events.ts:700


readonly event: ToolStreamEvent;

Defined in: src/hooks/events.ts:701


readonly invocationState: InvocationState;

Defined in: src/hooks/events.ts:702

toJSON(): Pick<ToolStreamUpdateEvent, "type" | "event">;

Defined in: src/hooks/events.ts:717

Serializes for wire transport, excluding the agent reference and invocationState. Called automatically by JSON.stringify().

Pick<ToolStreamUpdateEvent, "type" | "event">