Skip to main content

Function: isDoneEvent()

isDoneEvent(event): event is { agent_id: string; duration_ms: number; error?: { code: string; message: string; stack?: string }; final_state?: Record<string, unknown>; iteration_count?: number; parent_agent_id?: string; reason: "error" | "turn_yielded" | "out_of_iterations" | "max_tokens_reached" | "interrupted" | "no_applicable_tools" | "max_depth_reached" | "graceful_shutdown"; timestamp: number; tokens_used?: number; type: "done" }

Defined in: packages/core/src/stream-segments/utils.ts:12

Type guard for DoneEvent

Parameters

event

BaleybotStreamEvent

Returns

event is { agent_id: string; duration_ms: number; error?: { code: string; message: string; stack?: string }; final_state?: Record<string, unknown>; iteration_count?: number; parent_agent_id?: string; reason: "error" | "turn_yielded" | "out_of_iterations" | "max_tokens_reached" | "interrupted" | "no_applicable_tools" | "max_depth_reached" | "graceful_shutdown"; timestamp: number; tokens_used?: number; type: "done" }