LoopEvent: { type: "text_delta"; content: string; } | { type: "tool_call_request"; toolCalls: LoopToolCallRequest[]; } | { type: "tool_result"; toolName: string; result: LoopToolCallResult; } | { type: "tool_error"; toolName: string; error: string; } | { type: "max_iterations_reached"; iteration: number; } | { type: "loop_complete"; totalIterations: number; } Type declaration
type: "text_delta"
content: string
Type declaration
type: "tool_call_request"
Type declaration
type: "tool_result"
toolName: string
Type declaration
type: "tool_error"
toolName: string
error: string
Type declaration
type: "max_iterations_reached"
iteration: number
Type declaration
type: "loop_complete"
totalIterations: number
Discriminated union of all events emitted by LoopController.execute. Consumers can switch on
event.typeto handle each case.