import { z } from 'zod'; import { Agent } from './agent'; import { RunItem, RunToolApprovalItem } from './items'; import type { ModelResponse, ModelSettings } from './model'; import { RunContext } from './runContext'; import { type ReasoningItemIdPolicy } from './runner/items'; import { AgentToolUseTracker } from './runner/toolUseTracker'; import { NextStep } from './runner/steps'; import type { ProcessedResponse } from './runner/types'; import type { AgentSpanData, Span } from './tracing/spans'; import { Usage } from './usage'; import { Trace } from './tracing/traces'; import * as protocol from './types/protocol'; import { AgentInputItem, UnknownContext } from './types'; import type { InputGuardrailResult, OutputGuardrailResult } from './guardrail'; import type { ToolInputGuardrailResult, ToolOutputGuardrailResult } from './toolGuardrail'; import { Tool } from './tool'; import type { AgentToolInvocation } from './agentToolInvocation'; /** * The schema version of the serialized run state. This is used to ensure that the serialized * run state is compatible with the current version of the SDK. * If anything in this schema changes, the version will have to be incremented. * * Version history. * - 1.0: Initial serialized RunState schema. * - 1.1: Adds optional currentTurnInProgress, conversationId, and previousResponseId fields, * plus broader tool_call_output_item rawItem variants for non-function tools. Older 1.0 * payloads remain readable but resumes may lack mid-turn or server-managed context precision. * - 1.2: Adds pendingAgentToolRuns for nested agent tool resumption. * - 1.3: Adds computer tool approval items to serialized tool_approval_item unions. * - 1.4: Adds optional toolInput to serialized run context. * - 1.5: Adds optional reasoningItemIdPolicy to preserve reasoning input policy across resume. * - 1.6: Adds optional requestId to serialized model responses. * - 1.7: Adds optional approval rejection messages. * - 1.8: Adds tool search item variants, batched computer actions, and GA computer tool * aliasing to serialized run state payloads. */ export declare const CURRENT_SCHEMA_VERSION: "1.8"; type ContextOverrideStrategy = 'merge' | 'replace'; declare const serializedSpanBase: z.ZodObject<{ object: z.ZodLiteral<"trace.span">; id: z.ZodString; trace_id: z.ZodString; parent_id: z.ZodNullable; started_at: z.ZodNullable; ended_at: z.ZodNullable; error: z.ZodNullable>; }, z.core.$strip>>; span_data: z.ZodRecord; }, z.core.$strip>; type SerializedSpanType = z.infer & { previous_span?: SerializedSpanType; }; export declare const SerializedRunState: z.ZodObject<{ $schemaVersion: z.ZodEnum<{ "1.0": "1.0"; 1.1: "1.1"; 1.2: "1.2"; 1.3: "1.3"; 1.4: "1.4"; 1.5: "1.5"; 1.6: "1.6"; 1.7: "1.7"; 1.8: "1.8"; }>; currentTurn: z.ZodNumber; currentAgent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; originalInput: z.ZodUnion<[z.ZodString, z.ZodArray>; id: z.ZodOptional; type: z.ZodOptional>; role: z.ZodLiteral<"user">; content: z.ZodUnion<[z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_image">; image: z.ZodOptional]>>; detail: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_file">; file: z.ZodOptional]>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>]>>; filename: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"audio">; audio: z.ZodUnion<[z.ZodString, z.ZodObject<{ id: z.ZodString; }, z.core.$strip>]>; format: z.ZodOptional>; transcript: z.ZodOptional>; }, z.core.$strip>], "type">>, z.ZodString]>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodOptional>; role: z.ZodLiteral<"assistant">; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; content: z.ZodArray>; type: z.ZodLiteral<"output_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"refusal">; refusal: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"audio">; audio: z.ZodUnion<[z.ZodString, z.ZodObject<{ id: z.ZodString; }, z.core.$strip>]>; format: z.ZodOptional>; transcript: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodString; }, z.core.$strip>], "type">>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodOptional>; role: z.ZodLiteral<"system">; content: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_call">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; arguments: z.ZodUnknown; status: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_output">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; status: z.ZodOptional; tools: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"hosted_tool_call">; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call">; callId: z.ZodString; name: z.ZodString; namespace: z.ZodOptional; status: z.ZodOptional>; arguments: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; action: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>; actions: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call">; callId: z.ZodString; status: z.ZodOptional>; action: z.ZodObject<{ commands: z.ZodArray; timeoutMs: z.ZodOptional; maxOutputLength: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; }>; operation: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"create_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"update_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"delete_file">; path: z.ZodString; }, z.core.$strip>], "type">; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call_result">; name: z.ZodString; namespace: z.ZodOptional; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; output: z.ZodUnion>; type: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodOptional, Uint8Array>]>; mediaType: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ fileId: z.ZodString; }, z.core.$strip>]>]>>; detail: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"file">; file: z.ZodUnion, Uint8Array>]>; mediaType: z.ZodString; filename: z.ZodString; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>]>; }, z.core.$strip>], "type">, z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_image">; image: z.ZodOptional]>>; detail: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_file">; file: z.ZodOptional]>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>]>>; filename: z.ZodOptional; }, z.core.$strip>], "type">>]>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call_result">; callId: z.ZodString; output: z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"computer_screenshot">; data: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call_output">; callId: z.ZodString; maxOutputLength: z.ZodOptional; output: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"exit">; exitCode: z.ZodNullable; }, z.core.$strip>], "type">; }, z.core.$loose>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call_output">; callId: z.ZodString; status: z.ZodEnum<{ completed: "completed"; failed: "failed"; }>; output: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"reasoning">; content: z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>>; rawContent: z.ZodOptional>; type: z.ZodLiteral<"reasoning_text">; text: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"compaction">; encrypted_content: z.ZodString; id: z.ZodOptional; created_by: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"unknown">; }, z.core.$strip>]>>]>; modelResponses: z.ZodArray>>; outputTokensDetails: z.ZodOptional>>; requestUsageEntries: z.ZodOptional>; outputTokensDetails: z.ZodOptional>; endpoint: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; output: z.ZodArray>; id: z.ZodOptional; type: z.ZodOptional>; role: z.ZodLiteral<"assistant">; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; content: z.ZodArray>; type: z.ZodLiteral<"output_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"refusal">; refusal: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"audio">; audio: z.ZodUnion<[z.ZodString, z.ZodObject<{ id: z.ZodString; }, z.core.$strip>]>; format: z.ZodOptional>; transcript: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodString; }, z.core.$strip>], "type">>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_call">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; arguments: z.ZodUnknown; status: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_output">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; status: z.ZodOptional; tools: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"hosted_tool_call">; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call">; callId: z.ZodString; name: z.ZodString; namespace: z.ZodOptional; status: z.ZodOptional>; arguments: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; action: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>; actions: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call">; callId: z.ZodString; status: z.ZodOptional>; action: z.ZodObject<{ commands: z.ZodArray; timeoutMs: z.ZodOptional; maxOutputLength: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; }>; operation: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"create_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"update_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"delete_file">; path: z.ZodString; }, z.core.$strip>], "type">; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call_result">; name: z.ZodString; namespace: z.ZodOptional; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; output: z.ZodUnion>; type: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodOptional, Uint8Array>]>; mediaType: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ fileId: z.ZodString; }, z.core.$strip>]>]>>; detail: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"file">; file: z.ZodUnion, Uint8Array>]>; mediaType: z.ZodString; filename: z.ZodString; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>]>; }, z.core.$strip>], "type">, z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_image">; image: z.ZodOptional]>>; detail: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_file">; file: z.ZodOptional]>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>]>>; filename: z.ZodOptional; }, z.core.$strip>], "type">>]>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call_output">; callId: z.ZodString; maxOutputLength: z.ZodOptional; output: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"exit">; exitCode: z.ZodNullable; }, z.core.$strip>], "type">; }, z.core.$loose>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call_output">; callId: z.ZodString; status: z.ZodEnum<{ completed: "completed"; failed: "failed"; }>; output: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"reasoning">; content: z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>>; rawContent: z.ZodOptional>; type: z.ZodLiteral<"reasoning_text">; text: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"compaction">; encrypted_content: z.ZodString; id: z.ZodOptional; created_by: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"unknown">; }, z.core.$strip>], "type">>; responseId: z.ZodOptional; requestId: z.ZodOptional; providerData: z.ZodOptional>; }, z.core.$strip>>; context: z.ZodObject<{ usage: z.ZodObject<{ requests: z.ZodNumber; inputTokens: z.ZodNumber; outputTokens: z.ZodNumber; totalTokens: z.ZodNumber; inputTokensDetails: z.ZodOptional>>; outputTokensDetails: z.ZodOptional>>; requestUsageEntries: z.ZodOptional>; outputTokensDetails: z.ZodOptional>; endpoint: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; approvals: z.ZodRecord, z.ZodBoolean]>; rejected: z.ZodUnion<[z.ZodArray, z.ZodBoolean]>; messages: z.ZodOptional>; stickyRejectMessage: z.ZodOptional; }, z.core.$strip>>; context: z.ZodRecord; toolInput: z.ZodOptional; }, z.core.$strip>; toolUseTracker: z.ZodRecord>; maxTurns: z.ZodNumber; currentAgentSpan: z.ZodOptional>>>; noActiveAgentRun: z.ZodBoolean; inputGuardrailResults: z.ZodArray; name: z.ZodString; }, z.core.$strip>; output: z.ZodObject<{ tripwireTriggered: z.ZodBoolean; outputInfo: z.ZodAny; }, z.core.$strip>; }, z.core.$strip>>; outputGuardrailResults: z.ZodArray; name: z.ZodString; }, z.core.$strip>; agentOutput: z.ZodAny; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; output: z.ZodObject<{ tripwireTriggered: z.ZodBoolean; outputInfo: z.ZodAny; }, z.core.$strip>; }, z.core.$strip>>; toolInputGuardrailResults: z.ZodDefault; }, z.core.$strip>; output: z.ZodObject<{ outputInfo: z.ZodOptional; behavior: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"allow">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"rejectContent">; message: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"throwException">; }, z.core.$strip>], "type">; }, z.core.$strip>; }, z.core.$strip>>>>; toolOutputGuardrailResults: z.ZodDefault; }, z.core.$strip>; output: z.ZodObject<{ outputInfo: z.ZodOptional; behavior: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"allow">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"rejectContent">; message: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"throwException">; }, z.core.$strip>], "type">; }, z.core.$strip>; }, z.core.$strip>>>>; currentTurnInProgress: z.ZodOptional; currentStep: z.ZodOptional; newAgent: z.ZodAny; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"next_step_final_output">; output: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"next_step_run_again">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"next_step_interruption">; data: z.ZodRecord; }, z.core.$strip>], "type">>; lastModelResponse: z.ZodOptional>>; outputTokensDetails: z.ZodOptional>>; requestUsageEntries: z.ZodOptional>; outputTokensDetails: z.ZodOptional>; endpoint: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; output: z.ZodArray>; id: z.ZodOptional; type: z.ZodOptional>; role: z.ZodLiteral<"assistant">; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; content: z.ZodArray>; type: z.ZodLiteral<"output_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"refusal">; refusal: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"audio">; audio: z.ZodUnion<[z.ZodString, z.ZodObject<{ id: z.ZodString; }, z.core.$strip>]>; format: z.ZodOptional>; transcript: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodString; }, z.core.$strip>], "type">>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_call">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; arguments: z.ZodUnknown; status: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_output">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; status: z.ZodOptional; tools: z.ZodArray>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"hosted_tool_call">; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call">; callId: z.ZodString; name: z.ZodString; namespace: z.ZodOptional; status: z.ZodOptional>; arguments: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; action: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>; actions: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call">; callId: z.ZodString; status: z.ZodOptional>; action: z.ZodObject<{ commands: z.ZodArray; timeoutMs: z.ZodOptional; maxOutputLength: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; }>; operation: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"create_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"update_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"delete_file">; path: z.ZodString; }, z.core.$strip>], "type">; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call_result">; name: z.ZodString; namespace: z.ZodOptional; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; output: z.ZodUnion>; type: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodOptional, Uint8Array>]>; mediaType: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ fileId: z.ZodString; }, z.core.$strip>]>]>>; detail: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"file">; file: z.ZodUnion, Uint8Array>]>; mediaType: z.ZodString; filename: z.ZodString; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>]>; }, z.core.$strip>], "type">, z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_image">; image: z.ZodOptional]>>; detail: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_file">; file: z.ZodOptional]>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>]>>; filename: z.ZodOptional; }, z.core.$strip>], "type">>]>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call_output">; callId: z.ZodString; maxOutputLength: z.ZodOptional; output: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"exit">; exitCode: z.ZodNullable; }, z.core.$strip>], "type">; }, z.core.$loose>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call_output">; callId: z.ZodString; status: z.ZodEnum<{ completed: "completed"; failed: "failed"; }>; output: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"reasoning">; content: z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>>; rawContent: z.ZodOptional>; type: z.ZodLiteral<"reasoning_text">; text: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"compaction">; encrypted_content: z.ZodString; id: z.ZodOptional; created_by: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"unknown">; }, z.core.$strip>], "type">>; responseId: z.ZodOptional; requestId: z.ZodOptional; providerData: z.ZodOptional>; }, z.core.$strip>>; generatedItems: z.ZodArray; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodOptional>; role: z.ZodLiteral<"assistant">; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; content: z.ZodArray>; type: z.ZodLiteral<"output_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"refusal">; refusal: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"audio">; audio: z.ZodUnion<[z.ZodString, z.ZodObject<{ id: z.ZodString; }, z.core.$strip>]>; format: z.ZodOptional>; transcript: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodString; }, z.core.$strip>], "type">>; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_search_call_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_call">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; arguments: z.ZodUnknown; status: z.ZodOptional; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_search_output_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_output">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; status: z.ZodOptional; tools: z.ZodArray>; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_call_item">; rawItem: z.ZodUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; action: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>; actions: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call">; callId: z.ZodString; status: z.ZodOptional>; action: z.ZodObject<{ commands: z.ZodArray; timeoutMs: z.ZodOptional; maxOutputLength: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; }>; operation: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"create_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"update_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"delete_file">; path: z.ZodString; }, z.core.$strip>], "type">; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call">; callId: z.ZodString; name: z.ZodString; namespace: z.ZodOptional; status: z.ZodOptional>; arguments: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"hosted_tool_call">; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; }, z.core.$strip>], "type">, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"hosted_tool_call">; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; }, z.core.$strip>]>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_call_output_item">; rawItem: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call_result">; name: z.ZodString; namespace: z.ZodOptional; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; output: z.ZodUnion>; type: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodOptional, Uint8Array>]>; mediaType: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ fileId: z.ZodString; }, z.core.$strip>]>]>>; detail: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"file">; file: z.ZodUnion, Uint8Array>]>; mediaType: z.ZodString; filename: z.ZodString; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>]>; }, z.core.$strip>], "type">, z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_image">; image: z.ZodOptional]>>; detail: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_file">; file: z.ZodOptional]>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>]>>; filename: z.ZodOptional; }, z.core.$strip>], "type">>]>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call_result">; callId: z.ZodString; output: z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"computer_screenshot">; data: z.ZodString; }, z.core.$strip>; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call_output">; callId: z.ZodString; maxOutputLength: z.ZodOptional; output: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"exit">; exitCode: z.ZodNullable; }, z.core.$strip>], "type">; }, z.core.$loose>>; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call_output">; callId: z.ZodString; status: z.ZodEnum<{ completed: "completed"; failed: "failed"; }>; output: z.ZodOptional; }, z.core.$strip>]>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; output: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"reasoning_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"reasoning">; content: z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>>; rawContent: z.ZodOptional>; type: z.ZodLiteral<"reasoning_text">; text: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"handoff_call_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call">; callId: z.ZodString; name: z.ZodString; namespace: z.ZodOptional; status: z.ZodOptional>; arguments: z.ZodString; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"handoff_output_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call_result">; name: z.ZodString; namespace: z.ZodOptional; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; output: z.ZodUnion>; type: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodOptional, Uint8Array>]>; mediaType: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ fileId: z.ZodString; }, z.core.$strip>]>]>>; detail: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"file">; file: z.ZodUnion, Uint8Array>]>; mediaType: z.ZodString; filename: z.ZodString; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>]>; }, z.core.$strip>], "type">, z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_image">; image: z.ZodOptional]>>; detail: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_file">; file: z.ZodOptional]>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>]>>; filename: z.ZodOptional; }, z.core.$strip>], "type">>]>; }, z.core.$strip>; sourceAgent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; targetAgent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_approval_item">; rawItem: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call">; callId: z.ZodString; name: z.ZodString; namespace: z.ZodOptional; status: z.ZodOptional>; arguments: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"hosted_tool_call">; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; action: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>; actions: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>>; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call">; callId: z.ZodString; status: z.ZodOptional>; action: z.ZodObject<{ commands: z.ZodArray; timeoutMs: z.ZodOptional; maxOutputLength: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; }>; operation: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"create_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"update_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"delete_file">; path: z.ZodString; }, z.core.$strip>], "type">; }, z.core.$strip>]>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; toolName: z.ZodOptional; }, z.core.$strip>], "type">>; pendingAgentToolRuns: z.ZodDefault>>; lastProcessedResponse: z.ZodOptional; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodOptional>; role: z.ZodLiteral<"assistant">; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; content: z.ZodArray>; type: z.ZodLiteral<"output_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"refusal">; refusal: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"audio">; audio: z.ZodUnion<[z.ZodString, z.ZodObject<{ id: z.ZodString; }, z.core.$strip>]>; format: z.ZodOptional>; transcript: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodString; }, z.core.$strip>], "type">>; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_search_call_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_call">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; arguments: z.ZodUnknown; status: z.ZodOptional; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_search_output_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"tool_search_output">; call_id: z.ZodOptional>; callId: z.ZodOptional>; execution: z.ZodOptional>; status: z.ZodOptional; tools: z.ZodArray>; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_call_item">; rawItem: z.ZodUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; action: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>; actions: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call">; callId: z.ZodString; status: z.ZodOptional>; action: z.ZodObject<{ commands: z.ZodArray; timeoutMs: z.ZodOptional; maxOutputLength: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; }>; operation: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"create_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"update_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"delete_file">; path: z.ZodString; }, z.core.$strip>], "type">; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call">; callId: z.ZodString; name: z.ZodString; namespace: z.ZodOptional; status: z.ZodOptional>; arguments: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"hosted_tool_call">; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; }, z.core.$strip>], "type">, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"hosted_tool_call">; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; }, z.core.$strip>]>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_call_output_item">; rawItem: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call_result">; name: z.ZodString; namespace: z.ZodOptional; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; output: z.ZodUnion>; type: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodOptional, Uint8Array>]>; mediaType: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ fileId: z.ZodString; }, z.core.$strip>]>]>>; detail: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"file">; file: z.ZodUnion, Uint8Array>]>; mediaType: z.ZodString; filename: z.ZodString; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>]>; }, z.core.$strip>], "type">, z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_image">; image: z.ZodOptional]>>; detail: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_file">; file: z.ZodOptional]>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>]>>; filename: z.ZodOptional; }, z.core.$strip>], "type">>]>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call_result">; callId: z.ZodString; output: z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"computer_screenshot">; data: z.ZodString; }, z.core.$strip>; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call_output">; callId: z.ZodString; maxOutputLength: z.ZodOptional; output: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"exit">; exitCode: z.ZodNullable; }, z.core.$strip>], "type">; }, z.core.$loose>>; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call_output">; callId: z.ZodString; status: z.ZodEnum<{ completed: "completed"; failed: "failed"; }>; output: z.ZodOptional; }, z.core.$strip>]>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; output: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"reasoning_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"reasoning">; content: z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>>; rawContent: z.ZodOptional>; type: z.ZodLiteral<"reasoning_text">; text: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"handoff_call_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call">; callId: z.ZodString; name: z.ZodString; namespace: z.ZodOptional; status: z.ZodOptional>; arguments: z.ZodString; }, z.core.$strip>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"handoff_output_item">; rawItem: z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call_result">; name: z.ZodString; namespace: z.ZodOptional; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; output: z.ZodUnion>; type: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"image">; image: z.ZodOptional, Uint8Array>]>; mediaType: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>, z.ZodObject<{ fileId: z.ZodString; }, z.core.$strip>]>]>>; detail: z.ZodOptional>>; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"file">; file: z.ZodUnion, Uint8Array>]>; mediaType: z.ZodString; filename: z.ZodString; }, z.core.$strip>, z.ZodObject<{ url: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; filename: z.ZodOptional; }, z.core.$strip>]>; }, z.core.$strip>], "type">, z.ZodArray>; type: z.ZodLiteral<"input_text">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_image">; image: z.ZodOptional]>>; detail: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; type: z.ZodLiteral<"input_file">; file: z.ZodOptional]>, z.ZodObject<{ url: z.ZodString; }, z.core.$strip>]>>; filename: z.ZodOptional; }, z.core.$strip>], "type">>]>; }, z.core.$strip>; sourceAgent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; targetAgent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_approval_item">; rawItem: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"function_call">; callId: z.ZodString; name: z.ZodString; namespace: z.ZodOptional; status: z.ZodOptional>; arguments: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"hosted_tool_call">; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"computer_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; incomplete: "incomplete"; }>; action: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>; actions: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodEnum<{ left: "left"; right: "right"; wheel: "wheel"; back: "back"; forward: "forward"; }>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"wait">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"drag">; path: z.ZodArray>; }, z.core.$strip>], "type">>>; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"shell_call">; callId: z.ZodString; status: z.ZodOptional>; action: z.ZodObject<{ commands: z.ZodArray; timeoutMs: z.ZodOptional; maxOutputLength: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>]>, z.ZodObject<{ providerData: z.ZodOptional>; id: z.ZodOptional; type: z.ZodLiteral<"apply_patch_call">; callId: z.ZodString; status: z.ZodEnum<{ in_progress: "in_progress"; completed: "completed"; }>; operation: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"create_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"update_file">; path: z.ZodString; diff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"delete_file">; path: z.ZodString; }, z.core.$strip>], "type">; }, z.core.$strip>]>; agent: z.ZodObject<{ name: z.ZodString; }, z.core.$strip>; toolName: z.ZodOptional; }, z.core.$strip>], "type">>; toolsUsed: z.ZodArray; handoffs: z.ZodArray>; functions: z.ZodArray>; computerActions: z.ZodArray>; shellActions: z.ZodOptional>>; applyPatchActions: z.ZodOptional>>; mcpApprovalRequests: z.ZodOptional; name: z.ZodString; arguments: z.ZodOptional; status: z.ZodOptional; output: z.ZodOptional; providerData: z.ZodOptional>>; }, z.core.$strip>; }, z.core.$strip>; mcpTool: z.ZodObject<{ type: z.ZodLiteral<"hosted_tool">; name: z.ZodLiteral<"hosted_mcp">; providerData: z.ZodRecord; }, z.core.$strip>; }, z.core.$strip>>>; }, z.core.$strip>>; currentTurnPersistedItemCount: z.ZodOptional; conversationId: z.ZodOptional; previousResponseId: z.ZodOptional; reasoningItemIdPolicy: z.ZodOptional>; trace: z.ZodNullable; id: z.ZodString; workflow_name: z.ZodString; group_id: z.ZodNullable; metadata: z.ZodRecord; tracing_api_key: z.ZodNullable>; }, z.core.$strip>>; }, z.core.$strip>; export type FinalOutputSource = 'error_handler' | 'turn_resolution'; type ToolSearchRuntimeToolEntry = { order: number; tools: Tool[]; }; type ToolSearchRuntimeToolState = { anonymousEntries: ToolSearchRuntimeToolEntry[]; keyedEntries: Map>; nextOrder: number; }; /** * Serializable snapshot of an agent's run, including context, usage and trace. * While this class has publicly writable properties (prefixed with `_`), they are not meant to be * used directly. To read these properties, use the `RunResult` instead. * * Manipulation of the state directly can lead to unexpected behavior and should be avoided. * Instead, use the `approve` and `reject` methods to interact with the state. */ export declare class RunState> { #private; /** * Current turn number in the conversation. */ _currentTurn: number; /** * Whether the current turn has already been counted (useful when resuming mid-turn). */ _currentTurnInProgress: boolean; /** * The agent currently handling the conversation. */ _currentAgent: TAgent; /** * Original user input prior to any processing. */ _originalInput: string | AgentInputItem[]; /** * Responses from the model so far. */ _modelResponses: ModelResponse[]; /** * Conversation identifier when the server manages conversation history. */ _conversationId: string | undefined; /** * Latest response identifier returned by the server for server-managed conversations. */ _previousResponseId: string | undefined; /** * Runtime options that control how run items are converted into model turn input. * This value is serialized so resumed runs keep the same turn-input behavior. */ _reasoningItemIdPolicy: ReasoningItemIdPolicy | undefined; /** * Effective model settings used for the most recent model call. */ _lastModelSettings: ModelSettings | undefined; /** * Active tracing span for the current agent if tracing is enabled. */ _currentAgentSpan: Span | undefined; /** * Run context tracking approvals, usage, and other metadata. */ _context: RunContext; /** * Runtime-only metadata for the current nested agent-tool invocation. */ _agentToolInvocation: AgentToolInvocation | undefined; /** * The usage aggregated for this run. This includes per-request breakdowns when available. */ get usage(): Usage; /** * Tracks what tools each agent has used. */ _toolUseTracker: AgentToolUseTracker; /** * Serialized pending nested agent runs keyed by tool name and call id. */ _pendingAgentToolRuns: Map; /** * Items generated by the agent during the run. */ _generatedItems: RunItem[]; /** * Number of `_generatedItems` already flushed to session storage for the current turn. * * Persisting the entire turn on every save would duplicate responses and tool outputs. * Instead, `saveToSession` appends only the delta since the previous write. This counter * tracks how many generated run items from *this turn* were already written so the next * save can slice off only the new entries. When a turn is interrupted (e.g., awaiting tool * approval) and later resumed, we rewind the counter before continuing so the pending tool * output still gets stored. */ _currentTurnPersistedItemCount: number; /** * Maximum allowed turns before forcing termination. */ _maxTurns: number; /** * Whether the run has an active agent step in progress. */ _noActiveAgentRun: boolean; /** * Last model response for the previous turn. */ _lastTurnResponse: ModelResponse | undefined; /** * Results from input guardrails applied to the run. */ _inputGuardrailResults: InputGuardrailResult[]; /** * Results from output guardrails applied to the run. */ _outputGuardrailResults: OutputGuardrailResult[]; /** * Results from tool input guardrails applied during tool execution. */ _toolInputGuardrailResults: ToolInputGuardrailResult[]; /** * Results from tool output guardrails applied during tool execution. */ _toolOutputGuardrailResults: ToolOutputGuardrailResult[]; /** * Next step computed for the agent to take. */ _currentStep: NextStep | undefined; /** * Indicates how the final output was produced for the current run. * This value is not serialized. */ _finalOutputSource: FinalOutputSource | undefined; /** * Parsed model response after applying guardrails and tools. */ _lastProcessedResponse: ProcessedResponse | undefined; /** * Trace associated with this run if tracing is enabled. */ _trace: Trace | null; /** * Runtime-only tool_search-loaded tools, scoped by agent name and preserved across turns for * the lifetime of this in-memory run. */ _toolSearchRuntimeToolsByAgentName: Map>; constructor(context: RunContext, originalInput: string | AgentInputItem[], startingAgent: TAgent, maxTurns: number); /** * Updates server-managed conversation identifiers as a single operation. */ setConversationContext(conversationId?: string, previousResponseId?: string): void; /** * Updates runtime options for converting run items into turn input. */ setReasoningItemIdPolicy(policy?: ReasoningItemIdPolicy): void; /** * Updates the agent span associated with the current run. */ setCurrentAgentSpan(span?: Span): void; private getOrCreateToolSearchRuntimeToolState; recordToolSearchRuntimeTools(agent: Agent, toolSearchOutput: protocol.ToolSearchOutputItem, tools: Tool[]): void; getToolSearchRuntimeTools(agent: Agent): Tool[]; /** * Switches the active agent handling the run. */ setCurrentAgent(agent: TAgent): void; /** * Returns the agent currently handling the run. */ get currentAgent(): TAgent; /** * Resets the counter that tracks how many items were persisted for the current turn. */ resetTurnPersistence(): void; /** * Rewinds the persisted item counter when pending approvals require re-writing outputs. */ rewindTurnPersistence(count: number): void; /** * The history of the agent run. This includes the input items and the new items generated during the run. * * This can be used as inputs for the next agent run. */ get history(): AgentInputItem[]; /** * Returns all interruptions if the current step is an interruption otherwise returns an empty array. */ getInterruptions(): RunToolApprovalItem[]; private getPendingAgentToolRunKey; getPendingAgentToolRun(toolName: string, callId: string): string | undefined; hasPendingAgentToolRun(toolName: string, callId: string): boolean; setPendingAgentToolRun(toolName: string, callId: string, serializedState: string): void; clearPendingAgentToolRun(toolName: string, callId: string): void; /** * Approves a tool call requested by the agent through an interruption and approval item request. * * To approve the request use this method and then run the agent again with the same state object * to continue the execution. * * By default it will only approve the current tool call. To allow the tool to be used multiple * times throughout the run, set the `alwaysApprove` option to `true`. * * @param approvalItem - The tool call approval item to approve. * @param options - Options for the approval. * @param options.alwaysApprove - Approve this tool for all future calls in this run. */ approve(approvalItem: RunToolApprovalItem, options?: { alwaysApprove?: boolean; }): void; /** * Rejects a tool call requested by the agent through an interruption and approval item request. * * To reject the request use this method and then run the agent again with the same state object * to continue the execution. * * By default it will only reject the current tool call. To reject the tool for all future * calls throughout the run, set the `alwaysReject` option to `true`. * * When `message` is provided, it is used as the rejection text sent to the model. * Otherwise, `toolErrorFormatter` (if configured) or the SDK default is used. * * @param approvalItem - The tool call approval item to reject. * @param options - Options for the rejection. * @param options.alwaysReject - Reject this tool for all future calls in this run. * @param options.message - The rejection text sent to the model. * If not provided, `toolErrorFormatter` (if configured) or the SDK default is used. */ reject(approvalItem: RunToolApprovalItem, options?: { alwaysReject?: boolean; message?: string; }): void; /** * Serializes the run state to a JSON object. * * This method is used to serialize the run state to a JSON object that can be used to * resume the run later. * * @returns The serialized run state. */ /** * Serializes the run state. By default, tracing API keys are omitted to prevent * accidental persistence of secrets. Pass `includeTracingApiKey: true` only when you * intentionally need to migrate a run along with its tracing credentials (e.g., to * rehydrate in a separate process that lacks the original environment variables). */ toJSON(options?: { includeTracingApiKey?: boolean; }): z.infer; /** * Serializes the run state to a string. * * This method is used to serialize the run state to a string that can be used to * resume the run later. * * @returns The serialized run state. */ toString(options?: { includeTracingApiKey?: boolean; }): string; /** * Deserializes a run state from a string. * * This method is used to deserialize a run state from a string that was serialized using the * `toString` method. */ static fromString>(initialAgent: TAgent, str: string): Promise>; static fromStringWithContext>(initialAgent: TAgent, str: string, context: RunContext, options?: { contextStrategy?: ContextOverrideStrategy; }): Promise>; } export {};