Type alias LoopEvent

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;
}

Discriminated union of all events emitted by LoopController.execute. Consumers can switch on event.type to handle each case.

Type declaration

  • type: "text_delta"
  • content: string

Type declaration

Type declaration

Type declaration

  • type: "tool_error"
  • toolName: string
  • error: string

Type declaration

  • type: "max_iterations_reached"
  • iteration: number

Type declaration

  • type: "loop_complete"
  • totalIterations: number