# generated by datamodel-codegen: # filename: codex_app_server_protocol.v2.schemas.json from __future__ import annotations from pydantic import BaseModel, ConfigDict, Field, RootModel from typing import Annotated, Any, Literal from enum import Enum class CodexAppServerProtocolV2(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class AbsolutePathBuf(RootModel[str]): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ str, Field( description="A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute." ), ] class ApiKeyAccount(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["apiKey"], Field(title="ApiKeyAccountType")] class AccountLoginCompletedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) error: str | None = None login_id: Annotated[str | None, Field(alias="loginId")] = None success: bool class TextAgentMessageContent(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[Literal["Text"], Field(title="TextAgentMessageContentType")] class AgentMessageContent(RootModel[TextAgentMessageContent]): model_config = ConfigDict( populate_by_name=True, ) root: TextAgentMessageContent class AgentMessageDeltaNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str item_id: Annotated[str, Field(alias="itemId")] thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class CompletedAgentStatus(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) completed: str | None = None class ErroredAgentStatus(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) errored: str class AgentStatus( RootModel[ Literal["pending_init"] | Literal["running"] | CompletedAgentStatus | ErroredAgentStatus | Literal["shutdown"] | Literal["not_found"] ] ): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ Literal["pending_init"] | Literal["running"] | CompletedAgentStatus | ErroredAgentStatus | Literal["shutdown"] | Literal["not_found"], Field(description="Agent lifecycle status, derived from emitted events."), ] class AnalyticsConfig(BaseModel): model_config = ConfigDict( extra="allow", populate_by_name=True, ) enabled: bool | None = None class AppBranding(BaseModel): model_config = ConfigDict( populate_by_name=True, ) category: str | None = None developer: str | None = None is_discoverable_app: Annotated[bool, Field(alias="isDiscoverableApp")] privacy_policy: Annotated[str | None, Field(alias="privacyPolicy")] = None terms_of_service: Annotated[str | None, Field(alias="termsOfService")] = None website: str | None = None class AppReview(BaseModel): model_config = ConfigDict( populate_by_name=True, ) status: str class AppScreenshot(BaseModel): model_config = ConfigDict( populate_by_name=True, ) file_id: Annotated[str | None, Field(alias="fileId")] = None url: str | None = None user_prompt: Annotated[str, Field(alias="userPrompt")] class AppSummary(BaseModel): model_config = ConfigDict( populate_by_name=True, ) description: str | None = None id: str install_url: Annotated[str | None, Field(alias="installUrl")] = None name: str class AppToolApproval(Enum): auto = "auto" prompt = "prompt" approve = "approve" class AppToolConfig(BaseModel): model_config = ConfigDict( populate_by_name=True, ) approval_mode: AppToolApproval | None = None enabled: bool | None = None class AppToolsConfig(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class AppsDefaultConfig(BaseModel): model_config = ConfigDict( populate_by_name=True, ) destructive_enabled: bool | None = True enabled: bool | None = True open_world_enabled: bool | None = True class AppsListParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cursor: Annotated[ str | None, Field(description="Opaque pagination cursor returned by a previous call."), ] = None force_refetch: Annotated[ bool | None, Field( alias="forceRefetch", description="When true, bypass app caches and fetch the latest data from sources.", ), ] = None limit: Annotated[ int | None, Field( description="Optional page size; defaults to a reasonable server-side value.", ge=0, ), ] = None thread_id: Annotated[ str | None, Field( alias="threadId", description="Optional thread id used to evaluate app feature gating from that thread's config.", ), ] = None class AskForApprovalValue(Enum): untrusted = "untrusted" on_failure = "on-failure" on_request = "on-request" never = "never" class Reject(BaseModel): model_config = ConfigDict( populate_by_name=True, ) mcp_elicitations: bool request_permissions: bool | None = False rules: bool sandbox_approval: bool skill_approval: bool | None = False class RejectAskForApproval(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) reject: Reject class AskForApproval(RootModel[AskForApprovalValue | RejectAskForApproval]): model_config = ConfigDict( populate_by_name=True, ) root: AskForApprovalValue | RejectAskForApproval class AuthMode(Enum): apikey = "apikey" chatgpt = "chatgpt" chatgpt_auth_tokens = "chatgptAuthTokens" class ByteRange(BaseModel): model_config = ConfigDict( populate_by_name=True, ) end: Annotated[int, Field(ge=0)] start: Annotated[int, Field(ge=0)] class CallToolResult(BaseModel): model_config = ConfigDict( populate_by_name=True, ) field_meta: Annotated[Any | None, Field(alias="_meta")] = None content: list is_error: Annotated[bool | None, Field(alias="isError")] = None structured_content: Annotated[Any | None, Field(alias="structuredContent")] = None class CancelLoginAccountParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) login_id: Annotated[str, Field(alias="loginId")] class CancelLoginAccountStatus(Enum): canceled = "canceled" not_found = "notFound" class ClientInfo(BaseModel): model_config = ConfigDict( populate_by_name=True, ) name: str title: str | None = None version: str class CodexErrorInfoValue(Enum): context_window_exceeded = "contextWindowExceeded" usage_limit_exceeded = "usageLimitExceeded" server_overloaded = "serverOverloaded" internal_server_error = "internalServerError" unauthorized = "unauthorized" bad_request = "badRequest" thread_rollback_failed = "threadRollbackFailed" sandbox_error = "sandboxError" other = "other" class HttpConnectionFailed(BaseModel): model_config = ConfigDict( populate_by_name=True, ) http_status_code: Annotated[int | None, Field(alias="httpStatusCode", ge=0)] = None class HttpConnectionFailedCodexErrorInfo(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) http_connection_failed: Annotated[ HttpConnectionFailed, Field(alias="httpConnectionFailed") ] class ResponseStreamConnectionFailed(BaseModel): model_config = ConfigDict( populate_by_name=True, ) http_status_code: Annotated[int | None, Field(alias="httpStatusCode", ge=0)] = None class ResponseStreamConnectionFailedCodexErrorInfo(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) response_stream_connection_failed: Annotated[ ResponseStreamConnectionFailed, Field(alias="responseStreamConnectionFailed") ] class ResponseStreamDisconnected(BaseModel): model_config = ConfigDict( populate_by_name=True, ) http_status_code: Annotated[int | None, Field(alias="httpStatusCode", ge=0)] = None class ResponseStreamDisconnectedCodexErrorInfo(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) response_stream_disconnected: Annotated[ ResponseStreamDisconnected, Field(alias="responseStreamDisconnected") ] class ResponseTooManyFailedAttempts(BaseModel): model_config = ConfigDict( populate_by_name=True, ) http_status_code: Annotated[int | None, Field(alias="httpStatusCode", ge=0)] = None class ResponseTooManyFailedAttemptsCodexErrorInfo(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) response_too_many_failed_attempts: Annotated[ ResponseTooManyFailedAttempts, Field(alias="responseTooManyFailedAttempts") ] class CodexErrorInfo( RootModel[ CodexErrorInfoValue | HttpConnectionFailedCodexErrorInfo | ResponseStreamConnectionFailedCodexErrorInfo | ResponseStreamDisconnectedCodexErrorInfo | ResponseTooManyFailedAttemptsCodexErrorInfo ] ): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ CodexErrorInfoValue | HttpConnectionFailedCodexErrorInfo | ResponseStreamConnectionFailedCodexErrorInfo | ResponseStreamDisconnectedCodexErrorInfo | ResponseTooManyFailedAttemptsCodexErrorInfo, Field( description="This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant." ), ] class CollabAgentStatus(Enum): pending_init = "pendingInit" running = "running" completed = "completed" errored = "errored" shutdown = "shutdown" not_found = "notFound" class CollabAgentTool(Enum): spawn_agent = "spawnAgent" send_input = "sendInput" resume_agent = "resumeAgent" wait = "wait" close_agent = "closeAgent" class CollabAgentToolCallStatus(Enum): in_progress = "inProgress" completed = "completed" failed = "failed" class ReadCommandAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) command: str name: str path: str type: Annotated[Literal["read"], Field(title="ReadCommandActionType")] class ListFilesCommandAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) command: str path: str | None = None type: Annotated[Literal["listFiles"], Field(title="ListFilesCommandActionType")] class SearchCommandAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) command: str path: str | None = None query: str | None = None type: Annotated[Literal["search"], Field(title="SearchCommandActionType")] class UnknownCommandAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) command: str type: Annotated[Literal["unknown"], Field(title="UnknownCommandActionType")] class CommandAction( RootModel[ ReadCommandAction | ListFilesCommandAction | SearchCommandAction | UnknownCommandAction ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( ReadCommandAction | ListFilesCommandAction | SearchCommandAction | UnknownCommandAction ) class CommandExecOutputStream(Enum): stdout = "stdout" stderr = "stderr" class CommandExecResizeResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class CommandExecResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) exit_code: Annotated[int, Field(alias="exitCode", description="Process exit code.")] stderr: Annotated[ str, Field( description="Buffered stderr capture.\n\nEmpty when stderr was streamed via `command/exec/outputDelta`." ), ] stdout: Annotated[ str, Field( description="Buffered stdout capture.\n\nEmpty when stdout was streamed via `command/exec/outputDelta`." ), ] class CommandExecTerminalSize(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cols: Annotated[int, Field(description="Terminal width in character cells.", ge=0)] rows: Annotated[int, Field(description="Terminal height in character cells.", ge=0)] class CommandExecTerminateParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) process_id: Annotated[ str, Field( alias="processId", description="Client-supplied, connection-scoped `processId` from the original `command/exec` request.", ), ] class CommandExecTerminateResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class CommandExecWriteParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) close_stdin: Annotated[ bool | None, Field( alias="closeStdin", description="Close stdin after writing `deltaBase64`, if present.", ), ] = None delta_base64: Annotated[ str | None, Field( alias="deltaBase64", description="Optional base64-encoded stdin bytes to write.", ), ] = None process_id: Annotated[ str, Field( alias="processId", description="Client-supplied, connection-scoped `processId` from the original `command/exec` request.", ), ] class CommandExecWriteResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class CommandExecutionOutputDeltaNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str item_id: Annotated[str, Field(alias="itemId")] thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class CommandExecutionStatus(Enum): in_progress = "inProgress" completed = "completed" failed = "failed" declined = "declined" class MdmConfigLayerSource(BaseModel): model_config = ConfigDict( populate_by_name=True, ) domain: str key: str type: Annotated[Literal["mdm"], Field(title="MdmConfigLayerSourceType")] class SystemConfigLayerSource(BaseModel): model_config = ConfigDict( populate_by_name=True, ) file: Annotated[ AbsolutePathBuf, Field( description="This is the path to the system config.toml file, though it is not guaranteed to exist." ), ] type: Annotated[Literal["system"], Field(title="SystemConfigLayerSourceType")] class UserConfigLayerSource(BaseModel): model_config = ConfigDict( populate_by_name=True, ) file: Annotated[ AbsolutePathBuf, Field( description="This is the path to the user's config.toml file, though it is not guaranteed to exist." ), ] type: Annotated[Literal["user"], Field(title="UserConfigLayerSourceType")] class ProjectConfigLayerSource(BaseModel): model_config = ConfigDict( populate_by_name=True, ) dot_codex_folder: Annotated[AbsolutePathBuf, Field(alias="dotCodexFolder")] type: Annotated[Literal["project"], Field(title="ProjectConfigLayerSourceType")] class SessionFlagsConfigLayerSource(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["sessionFlags"], Field(title="SessionFlagsConfigLayerSourceType") ] class LegacyManagedConfigTomlFromFileConfigLayerSource(BaseModel): model_config = ConfigDict( populate_by_name=True, ) file: AbsolutePathBuf type: Annotated[ Literal["legacyManagedConfigTomlFromFile"], Field(title="LegacyManagedConfigTomlFromFileConfigLayerSourceType"), ] class LegacyManagedConfigTomlFromMdmConfigLayerSource(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["legacyManagedConfigTomlFromMdm"], Field(title="LegacyManagedConfigTomlFromMdmConfigLayerSourceType"), ] class ConfigLayerSource( RootModel[ MdmConfigLayerSource | SystemConfigLayerSource | UserConfigLayerSource | ProjectConfigLayerSource | SessionFlagsConfigLayerSource | LegacyManagedConfigTomlFromFileConfigLayerSource | LegacyManagedConfigTomlFromMdmConfigLayerSource ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( MdmConfigLayerSource | SystemConfigLayerSource | UserConfigLayerSource | ProjectConfigLayerSource | SessionFlagsConfigLayerSource | LegacyManagedConfigTomlFromFileConfigLayerSource | LegacyManagedConfigTomlFromMdmConfigLayerSource ) class ConfigReadParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cwd: Annotated[ str | None, Field( description="Optional working directory to resolve project config layers. If specified, return the effective config as seen from that directory (i.e., including any project layers between `cwd` and the project/repo root)." ), ] = None include_layers: Annotated[bool | None, Field(alias="includeLayers")] = False class InputTextContentItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[Literal["input_text"], Field(title="InputTextContentItemType")] class InputImageContentItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) image_url: str type: Annotated[Literal["input_image"], Field(title="InputImageContentItemType")] class OutputTextContentItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[Literal["output_text"], Field(title="OutputTextContentItemType")] class ContentItem( RootModel[InputTextContentItem | InputImageContentItem | OutputTextContentItem] ): model_config = ConfigDict( populate_by_name=True, ) root: InputTextContentItem | InputImageContentItem | OutputTextContentItem class ContextCompactedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class CreditsSnapshot(BaseModel): model_config = ConfigDict( populate_by_name=True, ) balance: str | None = None has_credits: Annotated[bool, Field(alias="hasCredits")] unlimited: bool class CustomPrompt(BaseModel): model_config = ConfigDict( populate_by_name=True, ) argument_hint: str | None = None content: str description: str | None = None name: str path: str class DeprecationNoticeNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) details: Annotated[ str | None, Field( description="Optional extra guidance, such as migration steps or rationale." ), ] = None summary: Annotated[str, Field(description="Concise summary of what is deprecated.")] class Duration(BaseModel): model_config = ConfigDict( populate_by_name=True, ) nanos: Annotated[int, Field(ge=0)] secs: Annotated[int, Field(ge=0)] class InputTextDynamicToolCallOutputContentItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[ Literal["inputText"], Field(title="InputTextDynamicToolCallOutputContentItemType"), ] class InputImageDynamicToolCallOutputContentItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) image_url: Annotated[str, Field(alias="imageUrl")] type: Annotated[ Literal["inputImage"], Field(title="InputImageDynamicToolCallOutputContentItemType"), ] class DynamicToolCallOutputContentItem( RootModel[ InputTextDynamicToolCallOutputContentItem | InputImageDynamicToolCallOutputContentItem ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( InputTextDynamicToolCallOutputContentItem | InputImageDynamicToolCallOutputContentItem ) class DynamicToolCallStatus(Enum): in_progress = "inProgress" completed = "completed" failed = "failed" class DynamicToolSpec(BaseModel): model_config = ConfigDict( populate_by_name=True, ) description: str input_schema: Annotated[Any, Field(alias="inputSchema")] name: str class FormElicitationRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) field_meta: Annotated[Any | None, Field(alias="_meta")] = None message: str mode: Annotated[Literal["form"], Field(title="FormElicitationRequestMode")] requested_schema: Any class UrlElicitationRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) field_meta: Annotated[Any | None, Field(alias="_meta")] = None elicitation_id: str message: str mode: Annotated[Literal["url"], Field(title="UrlElicitationRequestMode")] url: str class ElicitationRequest(RootModel[FormElicitationRequest | UrlElicitationRequest]): model_config = ConfigDict( populate_by_name=True, ) root: FormElicitationRequest | UrlElicitationRequest class ErrorEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) codex_error_info: CodexErrorInfo | None = None message: str type: Annotated[Literal["error"], Field(title="ErrorEventMsgType")] class WarningEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str type: Annotated[Literal["warning"], Field(title="WarningEventMsgType")] class RealtimeConversationStartedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) session_id: str | None = None type: Annotated[ Literal["realtime_conversation_started"], Field(title="RealtimeConversationStartedEventMsgType"), ] class RealtimeConversationClosedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) reason: str | None = None type: Annotated[ Literal["realtime_conversation_closed"], Field(title="RealtimeConversationClosedEventMsgType"), ] class ContextCompactedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["context_compacted"], Field(title="ContextCompactedEventMsgType") ] class ThreadRolledBackEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) num_turns: Annotated[ int, Field(description="Number of user turns that were removed from context.", ge=0), ] type: Annotated[ Literal["thread_rolled_back"], Field(title="ThreadRolledBackEventMsgType") ] class TaskCompleteEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) last_agent_message: str | None = None turn_id: str type: Annotated[Literal["task_complete"], Field(title="TaskCompleteEventMsgType")] class AgentMessageDeltaEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str type: Annotated[ Literal["agent_message_delta"], Field(title="AgentMessageDeltaEventMsgType") ] class AgentReasoningEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[ Literal["agent_reasoning"], Field(title="AgentReasoningEventMsgType") ] class AgentReasoningDeltaEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str type: Annotated[ Literal["agent_reasoning_delta"], Field(title="AgentReasoningDeltaEventMsgType") ] class AgentReasoningRawContentEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[ Literal["agent_reasoning_raw_content"], Field(title="AgentReasoningRawContentEventMsgType"), ] class AgentReasoningRawContentDeltaEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str type: Annotated[ Literal["agent_reasoning_raw_content_delta"], Field(title="AgentReasoningRawContentDeltaEventMsgType"), ] class AgentReasoningSectionBreakEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item_id: str | None = "" summary_index: int | None = 0 type: Annotated[ Literal["agent_reasoning_section_break"], Field(title="AgentReasoningSectionBreakEventMsgType"), ] class WebSearchBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: str type: Annotated[ Literal["web_search_begin"], Field(title="WebSearchBeginEventMsgType") ] class ImageGenerationBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: str type: Annotated[ Literal["image_generation_begin"], Field(title="ImageGenerationBeginEventMsgType"), ] class ImageGenerationEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: str result: str revised_prompt: str | None = None saved_path: str | None = None status: str type: Annotated[ Literal["image_generation_end"], Field(title="ImageGenerationEndEventMsgType") ] class TerminalInteractionEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field( description="Identifier for the ExecCommandBegin that produced this chunk." ), ] process_id: Annotated[ str, Field(description="Process id associated with the running command.") ] stdin: Annotated[str, Field(description="Stdin sent to the running session.")] type: Annotated[ Literal["terminal_interaction"], Field(title="TerminalInteractionEventMsgType") ] class ViewImageToolCallEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field(description="Identifier for the originating tool call.") ] path: Annotated[ str, Field(description="Local filesystem path provided to the tool.") ] type: Annotated[ Literal["view_image_tool_call"], Field(title="ViewImageToolCallEventMsgType") ] class DynamicToolCallRequestEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) arguments: Any call_id: Annotated[str, Field(alias="callId")] tool: str turn_id: Annotated[str, Field(alias="turnId")] type: Annotated[ Literal["dynamic_tool_call_request"], Field(title="DynamicToolCallRequestEventMsgType"), ] class DynamicToolCallResponseEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) arguments: Annotated[Any, Field(description="Dynamic tool call arguments.")] call_id: Annotated[ str, Field(description="Identifier for the corresponding DynamicToolCallRequest."), ] content_items: Annotated[ list[DynamicToolCallOutputContentItem], Field(description="Dynamic tool response content items."), ] duration: Annotated[ Duration, Field(description="The duration of the dynamic tool call.") ] error: Annotated[ str | None, Field( description="Optional error text when the tool call failed before producing a response." ), ] = None success: Annotated[bool, Field(description="Whether the tool call succeeded.")] tool: Annotated[str, Field(description="Dynamic tool name.")] turn_id: Annotated[ str, Field(description="Turn ID that this dynamic tool call belongs to.") ] type: Annotated[ Literal["dynamic_tool_call_response"], Field(title="DynamicToolCallResponseEventMsgType"), ] class DeprecationNoticeEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) details: Annotated[ str | None, Field( description="Optional extra guidance, such as migration steps or rationale." ), ] = None summary: Annotated[str, Field(description="Concise summary of what is deprecated.")] type: Annotated[ Literal["deprecation_notice"], Field(title="DeprecationNoticeEventMsgType") ] class BackgroundEventEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str type: Annotated[ Literal["background_event"], Field(title="BackgroundEventEventMsgType") ] class UndoStartedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str | None = None type: Annotated[Literal["undo_started"], Field(title="UndoStartedEventMsgType")] class UndoCompletedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str | None = None success: bool type: Annotated[Literal["undo_completed"], Field(title="UndoCompletedEventMsgType")] class StreamErrorEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) additional_details: Annotated[ str | None, Field( description="Optional details about the underlying stream failure (often the same human-readable message that is surfaced as the terminal error if retries are exhausted)." ), ] = None codex_error_info: CodexErrorInfo | None = None message: str type: Annotated[Literal["stream_error"], Field(title="StreamErrorEventMsgType")] class TurnDiffEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["turn_diff"], Field(title="TurnDiffEventMsgType")] unified_diff: str class ListCustomPromptsResponseEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) custom_prompts: list[CustomPrompt] type: Annotated[ Literal["list_custom_prompts_response"], Field(title="ListCustomPromptsResponseEventMsgType"), ] class RemoteSkillDownloadedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str name: str path: str type: Annotated[ Literal["remote_skill_downloaded"], Field(title="RemoteSkillDownloadedEventMsgType"), ] class SkillsUpdateAvailableEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["skills_update_available"], Field(title="SkillsUpdateAvailableEventMsgType"), ] class ShutdownCompleteEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["shutdown_complete"], Field(title="ShutdownCompleteEventMsgType") ] class AgentMessageContentDeltaEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str item_id: str thread_id: str turn_id: str type: Annotated[ Literal["agent_message_content_delta"], Field(title="AgentMessageContentDeltaEventMsgType"), ] class PlanDeltaEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str item_id: str thread_id: str turn_id: str type: Annotated[Literal["plan_delta"], Field(title="PlanDeltaEventMsgType")] class ReasoningContentDeltaEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str item_id: str summary_index: int | None = 0 thread_id: str turn_id: str type: Annotated[ Literal["reasoning_content_delta"], Field(title="ReasoningContentDeltaEventMsgType"), ] class ReasoningRawContentDeltaEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content_index: int | None = 0 delta: str item_id: str thread_id: str turn_id: str type: Annotated[ Literal["reasoning_raw_content_delta"], Field(title="ReasoningRawContentDeltaEventMsgType"), ] class ExecApprovalRequestSkillMetadata(BaseModel): model_config = ConfigDict( populate_by_name=True, ) path_to_skills_md: str class ExecCommandSource(Enum): agent = "agent" user_shell = "user_shell" unified_exec_startup = "unified_exec_startup" unified_exec_interaction = "unified_exec_interaction" class ExecCommandStatus(Enum): completed = "completed" failed = "failed" declined = "declined" class ExecOutputStream(Enum): stdout = "stdout" stderr = "stderr" class ExperimentalFeatureListParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cursor: Annotated[ str | None, Field(description="Opaque pagination cursor returned by a previous call."), ] = None limit: Annotated[ int | None, Field( description="Optional page size; defaults to a reasonable server-side value.", ge=0, ), ] = None class ExperimentalFeatureStage(Enum): beta = "beta" under_development = "underDevelopment" stable = "stable" deprecated = "deprecated" removed = "removed" class ExternalAgentConfigDetectParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cwds: Annotated[ list[str] | None, Field( description="Zero or more working directories to include for repo-scoped detection." ), ] = None include_home: Annotated[ bool | None, Field( alias="includeHome", description="If true, include detection under the user's home (~/.claude, ~/.codex, etc.).", ), ] = None class ExternalAgentConfigImportResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class ExternalAgentConfigMigrationItemType(Enum): agents_md = "AGENTS_MD" config = "CONFIG" skills = "SKILLS" mcp_server_config = "MCP_SERVER_CONFIG" class FeedbackUploadParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) classification: str extra_log_files: Annotated[list[str] | None, Field(alias="extraLogFiles")] = None include_logs: Annotated[bool, Field(alias="includeLogs")] reason: str | None = None thread_id: Annotated[str | None, Field(alias="threadId")] = None class FeedbackUploadResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] class AddFileChange(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content: str type: Annotated[Literal["add"], Field(title="AddFileChangeType")] class DeleteFileChange(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content: str type: Annotated[Literal["delete"], Field(title="DeleteFileChangeType")] class UpdateFileChange(BaseModel): model_config = ConfigDict( populate_by_name=True, ) move_path: str | None = None type: Annotated[Literal["update"], Field(title="UpdateFileChangeType")] unified_diff: str class FileChange(RootModel[AddFileChange | DeleteFileChange | UpdateFileChange]): model_config = ConfigDict( populate_by_name=True, ) root: AddFileChange | DeleteFileChange | UpdateFileChange class FileChangeOutputDeltaNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str item_id: Annotated[str, Field(alias="itemId")] thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class FileSystemPermissions(BaseModel): model_config = ConfigDict( populate_by_name=True, ) read: list[AbsolutePathBuf] | None = None write: list[AbsolutePathBuf] | None = None class ForcedLoginMethod(Enum): chatgpt = "chatgpt" api = "api" class InputTextFunctionCallOutputContentItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[ Literal["input_text"], Field(title="InputTextFunctionCallOutputContentItemType") ] class FuzzyFileSearchParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cancellation_token: Annotated[str | None, Field(alias="cancellationToken")] = None query: str roots: list[str] class Indice(RootModel[int]): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[int, Field(ge=0)] class FuzzyFileSearchResult(BaseModel): model_config = ConfigDict( populate_by_name=True, ) file_name: str indices: list[Indice] | None = None path: str root: str score: Annotated[int, Field(ge=0)] class FuzzyFileSearchSessionCompletedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) session_id: Annotated[str, Field(alias="sessionId")] class FuzzyFileSearchSessionUpdatedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) files: list[FuzzyFileSearchResult] query: str session_id: Annotated[str, Field(alias="sessionId")] class GetAccountParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) refresh_token: Annotated[ bool | None, Field( alias="refreshToken", description="When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.", ), ] = False class GhostCommit(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str parent: str | None = None preexisting_untracked_dirs: list[str] preexisting_untracked_files: list[str] class GitInfo(BaseModel): model_config = ConfigDict( populate_by_name=True, ) branch: str | None = None origin_url: Annotated[str | None, Field(alias="originUrl")] = None sha: str | None = None class HazelnutScope(Enum): example = "example" workspace_shared = "workspace-shared" all_shared = "all-shared" personal = "personal" class HistoryEntry(BaseModel): model_config = ConfigDict( populate_by_name=True, ) conversation_id: str text: str ts: Annotated[int, Field(ge=0)] class HookEventName(Enum): session_start = "sessionStart" stop = "stop" class HookExecutionMode(Enum): sync = "sync" async_ = "async" class HookHandlerType(Enum): command = "command" prompt = "prompt" agent = "agent" class HookOutputEntryKind(Enum): warning = "warning" stop = "stop" feedback = "feedback" context = "context" error = "error" class HookRunStatus(Enum): running = "running" completed = "completed" failed = "failed" blocked = "blocked" stopped = "stopped" class HookScope(Enum): thread = "thread" turn = "turn" class ImageDetail(Enum): auto = "auto" low = "low" high = "high" original = "original" class InitializeCapabilities(BaseModel): model_config = ConfigDict( populate_by_name=True, ) experimental_api: Annotated[ bool | None, Field( alias="experimentalApi", description="Opt into receiving experimental API methods and fields.", ), ] = False opt_out_notification_methods: Annotated[ list[str] | None, Field( alias="optOutNotificationMethods", description="Exact notification method names that should be suppressed for this connection (for example `thread/started`).", ), ] = None class InitializeParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) capabilities: InitializeCapabilities | None = None client_info: Annotated[ClientInfo, Field(alias="clientInfo")] class InputModality(Enum): text = "text" image = "image" class ListMcpServerStatusParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cursor: Annotated[ str | None, Field(description="Opaque pagination cursor returned by a previous call."), ] = None limit: Annotated[ int | None, Field( description="Optional page size; defaults to a server-defined value.", ge=0 ), ] = None class ExecLocalShellAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) command: list[str] env: dict[str, Any] | None = None timeout_ms: Annotated[int | None, Field(ge=0)] = None type: Annotated[Literal["exec"], Field(title="ExecLocalShellActionType")] user: str | None = None working_directory: str | None = None class LocalShellAction(RootModel[ExecLocalShellAction]): model_config = ConfigDict( populate_by_name=True, ) root: ExecLocalShellAction class LocalShellStatus(Enum): completed = "completed" in_progress = "in_progress" incomplete = "incomplete" class ApiKeyLoginAccountParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) api_key: Annotated[str, Field(alias="apiKey")] type: Annotated[Literal["apiKey"], Field(title="ApiKeyv2::LoginAccountParamsType")] class ChatgptLoginAccountParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["chatgpt"], Field(title="Chatgptv2::LoginAccountParamsType") ] class ChatgptAuthTokensLoginAccountParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) access_token: Annotated[ str, Field( alias="accessToken", description="Access token (JWT) supplied by the client. This token is used for backend API requests and email extraction.", ), ] chatgpt_account_id: Annotated[ str, Field( alias="chatgptAccountId", description="Workspace/account identifier supplied by the client.", ), ] chatgpt_plan_type: Annotated[ str | None, Field( alias="chatgptPlanType", description="Optional plan type supplied by the client.\n\nWhen `null`, Codex attempts to derive the plan type from access-token claims. If unavailable, the plan defaults to `unknown`.", ), ] = None type: Annotated[ Literal["chatgptAuthTokens"], Field(title="ChatgptAuthTokensv2::LoginAccountParamsType"), ] class LoginAccountParams( RootModel[ ApiKeyLoginAccountParams | ChatgptLoginAccountParams | ChatgptAuthTokensLoginAccountParams ] ): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ ApiKeyLoginAccountParams | ChatgptLoginAccountParams | ChatgptAuthTokensLoginAccountParams, Field(title="LoginAccountParams"), ] class ApiKeyLoginAccountResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["apiKey"], Field(title="ApiKeyv2::LoginAccountResponseType") ] class ChatgptLoginAccountResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) auth_url: Annotated[ str, Field( alias="authUrl", description="URL the client should open in a browser to initiate the OAuth flow.", ), ] login_id: Annotated[str, Field(alias="loginId")] type: Annotated[ Literal["chatgpt"], Field(title="Chatgptv2::LoginAccountResponseType") ] class ChatgptAuthTokensLoginAccountResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["chatgptAuthTokens"], Field(title="ChatgptAuthTokensv2::LoginAccountResponseType"), ] class LoginAccountResponse( RootModel[ ApiKeyLoginAccountResponse | ChatgptLoginAccountResponse | ChatgptAuthTokensLoginAccountResponse ] ): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ ApiKeyLoginAccountResponse | ChatgptLoginAccountResponse | ChatgptAuthTokensLoginAccountResponse, Field(title="LoginAccountResponse"), ] class LogoutAccountResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class MacOsAutomationPermissionValue(Enum): none = "none" all = "all" class BundleIdsMacOsAutomationPermission(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) bundle_ids: list[str] class MacOsAutomationPermission( RootModel[MacOsAutomationPermissionValue | BundleIdsMacOsAutomationPermission] ): model_config = ConfigDict( populate_by_name=True, ) root: MacOsAutomationPermissionValue | BundleIdsMacOsAutomationPermission class MacOsContactsPermission(Enum): none = "none" read_only = "read_only" read_write = "read_write" class MacOsPreferencesPermission(Enum): none = "none" read_only = "read_only" read_write = "read_write" class MacOsSeatbeltProfileExtensions(BaseModel): model_config = ConfigDict( populate_by_name=True, ) macos_accessibility: bool | None = False macos_automation: Annotated[MacOsAutomationPermission | None, Field()] = "none" macos_calendar: bool | None = False macos_contacts: MacOsContactsPermission | None = "none" macos_launch_services: bool | None = False macos_preferences: MacOsPreferencesPermission | None = "read_only" macos_reminders: bool | None = False class McpAuthStatus(Enum): unsupported = "unsupported" not_logged_in = "notLoggedIn" bearer_token = "bearerToken" o_auth = "oAuth" class McpInvocation(BaseModel): model_config = ConfigDict( populate_by_name=True, ) arguments: Annotated[ Any | None, Field(description="Arguments to the tool call.") ] = None server: Annotated[ str, Field(description="Name of the MCP server as defined in the config.") ] tool: Annotated[ str, Field(description="Name of the tool as given by the MCP server.") ] class McpServerOauthLoginCompletedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) error: str | None = None name: str success: bool class McpServerOauthLoginParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) name: str scopes: list[str] | None = None timeout_secs: Annotated[int | None, Field(alias="timeoutSecs")] = None class McpServerOauthLoginResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) authorization_url: Annotated[str, Field(alias="authorizationUrl")] class McpServerRefreshResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class McpStartupFailure(BaseModel): model_config = ConfigDict( populate_by_name=True, ) error: str server: str class StartingMcpStartupStatus(BaseModel): model_config = ConfigDict( populate_by_name=True, ) state: Annotated[Literal["starting"], Field(title="StartingMcpStartupStatusState")] class ReadyMcpStartupStatus(BaseModel): model_config = ConfigDict( populate_by_name=True, ) state: Annotated[Literal["ready"], Field(title="ReadyMcpStartupStatusState")] class FailedMcpStartupStatus(BaseModel): model_config = ConfigDict( populate_by_name=True, ) error: str state: Annotated[Literal["failed"], Field(title="FailedMcpStartupStatusState")] class CancelledMcpStartupStatus(BaseModel): model_config = ConfigDict( populate_by_name=True, ) state: Annotated[ Literal["cancelled"], Field(title="CancelledMcpStartupStatusState") ] class McpStartupStatus( RootModel[ StartingMcpStartupStatus | ReadyMcpStartupStatus | FailedMcpStartupStatus | CancelledMcpStartupStatus ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( StartingMcpStartupStatus | ReadyMcpStartupStatus | FailedMcpStartupStatus | CancelledMcpStartupStatus ) class McpToolCallError(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str class McpToolCallProgressNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item_id: Annotated[str, Field(alias="itemId")] message: str thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class McpToolCallResult(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content: list structured_content: Annotated[Any | None, Field(alias="structuredContent")] = None class McpToolCallStatus(Enum): in_progress = "inProgress" completed = "completed" failed = "failed" class MergeStrategy(Enum): replace = "replace" upsert = "upsert" class MessagePhase(Enum): commentary = "commentary" final_answer = "final_answer" class ModeKind(Enum): plan = "plan" default = "default" class ModelAvailabilityNux(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str class ModelListParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cursor: Annotated[ str | None, Field(description="Opaque pagination cursor returned by a previous call."), ] = None include_hidden: Annotated[ bool | None, Field( alias="includeHidden", description="When true, include models that are hidden from the default picker list.", ), ] = None limit: Annotated[ int | None, Field( description="Optional page size; defaults to a reasonable server-side value.", ge=0, ), ] = None class ModelRerouteReason(RootModel[Literal["highRiskCyberActivity"]]): model_config = ConfigDict( populate_by_name=True, ) root: Literal["highRiskCyberActivity"] class ModelReroutedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) from_model: Annotated[str, Field(alias="fromModel")] reason: ModelRerouteReason thread_id: Annotated[str, Field(alias="threadId")] to_model: Annotated[str, Field(alias="toModel")] turn_id: Annotated[str, Field(alias="turnId")] class ModelUpgradeInfo(BaseModel): model_config = ConfigDict( populate_by_name=True, ) migration_markdown: Annotated[str | None, Field(alias="migrationMarkdown")] = None model: str model_link: Annotated[str | None, Field(alias="modelLink")] = None upgrade_copy: Annotated[str | None, Field(alias="upgradeCopy")] = None class NetworkAccess(Enum): restricted = "restricted" enabled = "enabled" class NetworkApprovalProtocol(Enum): http = "http" https = "https" socks5_tcp = "socks5Tcp" socks5_udp = "socks5Udp" class NetworkPermissions(BaseModel): model_config = ConfigDict( populate_by_name=True, ) enabled: bool | None = None class NetworkPolicyRuleAction(Enum): allow = "allow" deny = "deny" class NetworkRequirements(BaseModel): model_config = ConfigDict( populate_by_name=True, ) allow_local_binding: Annotated[bool | None, Field(alias="allowLocalBinding")] = None allow_unix_sockets: Annotated[list[str] | None, Field(alias="allowUnixSockets")] = ( None ) allow_upstream_proxy: Annotated[bool | None, Field(alias="allowUpstreamProxy")] = ( None ) allowed_domains: Annotated[list[str] | None, Field(alias="allowedDomains")] = None dangerously_allow_all_unix_sockets: Annotated[ bool | None, Field(alias="dangerouslyAllowAllUnixSockets") ] = None dangerously_allow_non_loopback_proxy: Annotated[ bool | None, Field(alias="dangerouslyAllowNonLoopbackProxy") ] = None denied_domains: Annotated[list[str] | None, Field(alias="deniedDomains")] = None enabled: bool | None = None http_port: Annotated[int | None, Field(alias="httpPort", ge=0)] = None socks_port: Annotated[int | None, Field(alias="socksPort", ge=0)] = None class ReadParsedCommand(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cmd: str name: str path: Annotated[ str, Field( description="(Best effort) Path to the file being read by the command. When possible, this is an absolute path, though when relative, it should be resolved against the `cwd`` that will be used to run the command to derive the absolute path." ), ] type: Annotated[Literal["read"], Field(title="ReadParsedCommandType")] class ListFilesParsedCommand(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cmd: str path: str | None = None type: Annotated[Literal["list_files"], Field(title="ListFilesParsedCommandType")] class SearchParsedCommand(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cmd: str path: str | None = None query: str | None = None type: Annotated[Literal["search"], Field(title="SearchParsedCommandType")] class UnknownParsedCommand(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cmd: str type: Annotated[Literal["unknown"], Field(title="UnknownParsedCommandType")] class ParsedCommand( RootModel[ ReadParsedCommand | ListFilesParsedCommand | SearchParsedCommand | UnknownParsedCommand ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( ReadParsedCommand | ListFilesParsedCommand | SearchParsedCommand | UnknownParsedCommand ) class PatchApplyStatus(Enum): in_progress = "inProgress" completed = "completed" failed = "failed" declined = "declined" class AddPatchChangeKind(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["add"], Field(title="AddPatchChangeKindType")] class DeletePatchChangeKind(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["delete"], Field(title="DeletePatchChangeKindType")] class UpdatePatchChangeKind(BaseModel): model_config = ConfigDict( populate_by_name=True, ) move_path: str | None = None type: Annotated[Literal["update"], Field(title="UpdatePatchChangeKindType")] class PatchChangeKind( RootModel[AddPatchChangeKind | DeletePatchChangeKind | UpdatePatchChangeKind] ): model_config = ConfigDict( populate_by_name=True, ) root: AddPatchChangeKind | DeletePatchChangeKind | UpdatePatchChangeKind class PermissionProfile(BaseModel): model_config = ConfigDict( populate_by_name=True, ) file_system: FileSystemPermissions | None = None macos: MacOsSeatbeltProfileExtensions | None = None network: NetworkPermissions | None = None class Personality(Enum): none = "none" friendly = "friendly" pragmatic = "pragmatic" class PlanDeltaNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str item_id: Annotated[str, Field(alias="itemId")] thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class PlanType(Enum): free = "free" go = "go" plus = "plus" pro = "pro" team = "team" business = "business" enterprise = "enterprise" edu = "edu" unknown = "unknown" class PluginAuthPolicy(Enum): on_install = "ON_INSTALL" on_use = "ON_USE" class PluginInstallParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) marketplace_path: Annotated[AbsolutePathBuf, Field(alias="marketplacePath")] plugin_name: Annotated[str, Field(alias="pluginName")] class PluginInstallPolicy(Enum): not_available = "NOT_AVAILABLE" available = "AVAILABLE" installed_by_default = "INSTALLED_BY_DEFAULT" class PluginInstallResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) apps_needing_auth: Annotated[list[AppSummary], Field(alias="appsNeedingAuth")] auth_policy: Annotated[PluginAuthPolicy, Field(alias="authPolicy")] class PluginInterface(BaseModel): model_config = ConfigDict( populate_by_name=True, ) brand_color: Annotated[str | None, Field(alias="brandColor")] = None capabilities: list[str] category: str | None = None composer_icon: Annotated[AbsolutePathBuf | None, Field(alias="composerIcon")] = None default_prompt: Annotated[str | None, Field(alias="defaultPrompt")] = None developer_name: Annotated[str | None, Field(alias="developerName")] = None display_name: Annotated[str | None, Field(alias="displayName")] = None logo: AbsolutePathBuf | None = None long_description: Annotated[str | None, Field(alias="longDescription")] = None privacy_policy_url: Annotated[str | None, Field(alias="privacyPolicyUrl")] = None screenshots: list[AbsolutePathBuf] short_description: Annotated[str | None, Field(alias="shortDescription")] = None terms_of_service_url: Annotated[str | None, Field(alias="termsOfServiceUrl")] = None website_url: Annotated[str | None, Field(alias="websiteUrl")] = None class PluginListParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cwds: Annotated[ list[AbsolutePathBuf] | None, Field( description="Optional working directories used to discover repo marketplaces. When omitted, only home-scoped marketplaces and the official curated marketplace are considered." ), ] = None force_remote_sync: Annotated[ bool | None, Field( alias="forceRemoteSync", description="When true, reconcile the official curated marketplace against the remote plugin state before listing marketplaces.", ), ] = None class LocalPluginSource(BaseModel): model_config = ConfigDict( populate_by_name=True, ) path: AbsolutePathBuf type: Annotated[Literal["local"], Field(title="LocalPluginSourceType")] class PluginSource(RootModel[LocalPluginSource]): model_config = ConfigDict( populate_by_name=True, ) root: LocalPluginSource class PluginSummary(BaseModel): model_config = ConfigDict( populate_by_name=True, ) auth_policy: Annotated[PluginAuthPolicy, Field(alias="authPolicy")] enabled: bool id: str install_policy: Annotated[PluginInstallPolicy, Field(alias="installPolicy")] installed: bool interface: PluginInterface | None = None name: str source: PluginSource class PluginUninstallParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) plugin_id: Annotated[str, Field(alias="pluginId")] class PluginUninstallResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class ProductSurface(Enum): chatgpt = "chatgpt" codex = "codex" api = "api" atlas = "atlas" class RateLimitWindow(BaseModel): model_config = ConfigDict( populate_by_name=True, ) resets_at: Annotated[int | None, Field(alias="resetsAt")] = None used_percent: Annotated[int, Field(alias="usedPercent")] window_duration_mins: Annotated[int | None, Field(alias="windowDurationMins")] = ( None ) class RestrictedReadOnlyAccess(BaseModel): model_config = ConfigDict( populate_by_name=True, ) include_platform_defaults: Annotated[ bool | None, Field(alias="includePlatformDefaults") ] = True readable_roots: Annotated[ list[AbsolutePathBuf] | None, Field(alias="readableRoots") ] = [] type: Annotated[Literal["restricted"], Field(title="RestrictedReadOnlyAccessType")] class FullAccessReadOnlyAccess(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["fullAccess"], Field(title="FullAccessReadOnlyAccessType")] class ReadOnlyAccess(RootModel[RestrictedReadOnlyAccess | FullAccessReadOnlyAccess]): model_config = ConfigDict( populate_by_name=True, ) root: RestrictedReadOnlyAccess | FullAccessReadOnlyAccess class RealtimeAudioFrame(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: str num_channels: Annotated[int, Field(ge=0)] sample_rate: Annotated[int, Field(ge=0)] samples_per_channel: Annotated[int | None, Field(ge=0)] = None class SessionUpdated(BaseModel): model_config = ConfigDict( populate_by_name=True, ) instructions: str | None = None session_id: str class SessionUpdatedRealtimeEvent(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) session_updated: Annotated[SessionUpdated, Field(alias="SessionUpdated")] class AudioOutRealtimeEvent(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) audio_out: Annotated[RealtimeAudioFrame, Field(alias="AudioOut")] class ConversationItemAddedRealtimeEvent(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) conversation_item_added: Annotated[Any, Field(alias="ConversationItemAdded")] class ConversationItemDone(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item_id: str class ConversationItemDoneRealtimeEvent(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) conversation_item_done: Annotated[ ConversationItemDone, Field(alias="ConversationItemDone") ] class ErrorRealtimeEvent(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) error: Annotated[str, Field(alias="Error")] class RealtimeTranscriptDelta(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str class RealtimeTranscriptEntry(BaseModel): model_config = ConfigDict( populate_by_name=True, ) role: str text: str class ReasoningEffort(Enum): none = "none" minimal = "minimal" low = "low" medium = "medium" high = "high" xhigh = "xhigh" class ReasoningEffortOption(BaseModel): model_config = ConfigDict( populate_by_name=True, ) description: str reasoning_effort: Annotated[ReasoningEffort, Field(alias="reasoningEffort")] class ReasoningTextReasoningItemContent(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[ Literal["reasoning_text"], Field(title="ReasoningTextReasoningItemContentType") ] class TextReasoningItemContent(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[Literal["text"], Field(title="TextReasoningItemContentType")] class ReasoningItemContent( RootModel[ReasoningTextReasoningItemContent | TextReasoningItemContent] ): model_config = ConfigDict( populate_by_name=True, ) root: ReasoningTextReasoningItemContent | TextReasoningItemContent class SummaryTextReasoningItemReasoningSummary(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str type: Annotated[ Literal["summary_text"], Field(title="SummaryTextReasoningItemReasoningSummaryType"), ] class ReasoningItemReasoningSummary( RootModel[SummaryTextReasoningItemReasoningSummary] ): model_config = ConfigDict( populate_by_name=True, ) root: SummaryTextReasoningItemReasoningSummary class ReasoningSummaryValue(Enum): auto = "auto" concise = "concise" detailed = "detailed" class ReasoningSummary(RootModel[ReasoningSummaryValue | Literal["none"]]): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ ReasoningSummaryValue | Literal["none"], Field( description="A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries" ), ] class ReasoningSummaryPartAddedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item_id: Annotated[str, Field(alias="itemId")] summary_index: Annotated[int, Field(alias="summaryIndex")] thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class ReasoningSummaryTextDeltaNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delta: str item_id: Annotated[str, Field(alias="itemId")] summary_index: Annotated[int, Field(alias="summaryIndex")] thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class ReasoningTextDeltaNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content_index: Annotated[int, Field(alias="contentIndex")] delta: str item_id: Annotated[str, Field(alias="itemId")] thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class RemoteSkillSummary(BaseModel): model_config = ConfigDict( populate_by_name=True, ) description: str id: str name: str class RequestId(RootModel[str | int]): model_config = ConfigDict( populate_by_name=True, ) root: str | int class RequestUserInputQuestionOption(BaseModel): model_config = ConfigDict( populate_by_name=True, ) description: str label: str class ResidencyRequirement(RootModel[Literal["us"]]): model_config = ConfigDict( populate_by_name=True, ) root: Literal["us"] class Resource(BaseModel): model_config = ConfigDict( populate_by_name=True, ) field_meta: Annotated[Any | None, Field(alias="_meta")] = None annotations: Any | None = None description: str | None = None icons: list | None = None mime_type: Annotated[str | None, Field(alias="mimeType")] = None name: str size: int | None = None title: str | None = None uri: str class ResourceTemplate(BaseModel): model_config = ConfigDict( populate_by_name=True, ) annotations: Any | None = None description: str | None = None mime_type: Annotated[str | None, Field(alias="mimeType")] = None name: str title: str | None = None uri_template: Annotated[str, Field(alias="uriTemplate")] class MessageResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content: list[ContentItem] end_turn: bool | None = None id: str | None = None phase: MessagePhase | None = None role: str type: Annotated[Literal["message"], Field(title="MessageResponseItemType")] class ReasoningResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content: list[ReasoningItemContent] | None = None encrypted_content: str | None = None id: str summary: list[ReasoningItemReasoningSummary] type: Annotated[Literal["reasoning"], Field(title="ReasoningResponseItemType")] class LocalShellCallResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) action: LocalShellAction call_id: Annotated[ str | None, Field(description="Set when using the Responses API.") ] = None id: Annotated[ str | None, Field( description="Legacy id field retained for compatibility with older payloads." ), ] = None status: LocalShellStatus type: Annotated[ Literal["local_shell_call"], Field(title="LocalShellCallResponseItemType") ] class FunctionCallResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) arguments: str call_id: str id: str | None = None name: str namespace: str | None = None type: Annotated[ Literal["function_call"], Field(title="FunctionCallResponseItemType") ] class ToolSearchCallResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) arguments: Any call_id: str | None = None execution: str id: str | None = None status: str | None = None type: Annotated[ Literal["tool_search_call"], Field(title="ToolSearchCallResponseItemType") ] class CustomToolCallResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: str id: str | None = None input: str name: str status: str | None = None type: Annotated[ Literal["custom_tool_call"], Field(title="CustomToolCallResponseItemType") ] class ToolSearchOutputResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: str | None = None execution: str status: str tools: list type: Annotated[ Literal["tool_search_output"], Field(title="ToolSearchOutputResponseItemType") ] class ImageGenerationCallResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str result: str revised_prompt: str | None = None status: str type: Annotated[ Literal["image_generation_call"], Field(title="ImageGenerationCallResponseItemType"), ] class GhostSnapshotResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) ghost_commit: GhostCommit type: Annotated[ Literal["ghost_snapshot"], Field(title="GhostSnapshotResponseItemType") ] class CompactionResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) encrypted_content: str type: Annotated[Literal["compaction"], Field(title="CompactionResponseItemType")] class OtherResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["other"], Field(title="OtherResponseItemType")] class SearchResponsesApiWebSearchAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) queries: list[str] | None = None query: str | None = None type: Annotated[ Literal["search"], Field(title="SearchResponsesApiWebSearchActionType") ] class OpenPageResponsesApiWebSearchAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["open_page"], Field(title="OpenPageResponsesApiWebSearchActionType") ] url: str | None = None class FindInPageResponsesApiWebSearchAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) pattern: str | None = None type: Annotated[ Literal["find_in_page"], Field(title="FindInPageResponsesApiWebSearchActionType"), ] url: str | None = None class OtherResponsesApiWebSearchAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["other"], Field(title="OtherResponsesApiWebSearchActionType") ] class ResponsesApiWebSearchAction( RootModel[ SearchResponsesApiWebSearchAction | OpenPageResponsesApiWebSearchAction | FindInPageResponsesApiWebSearchAction | OtherResponsesApiWebSearchAction ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( SearchResponsesApiWebSearchAction | OpenPageResponsesApiWebSearchAction | FindInPageResponsesApiWebSearchAction | OtherResponsesApiWebSearchAction ) class OkResultOfCallToolResultOrString(BaseModel): model_config = ConfigDict( populate_by_name=True, ) ok: Annotated[CallToolResult, Field(alias="Ok")] class ErrResultOfCallToolResultOrString(BaseModel): model_config = ConfigDict( populate_by_name=True, ) err: Annotated[str, Field(alias="Err")] class ResultOfCallToolResultOrString( RootModel[OkResultOfCallToolResultOrString | ErrResultOfCallToolResultOrString] ): model_config = ConfigDict( populate_by_name=True, ) root: OkResultOfCallToolResultOrString | ErrResultOfCallToolResultOrString class ApprovedExecpolicyAmendment(BaseModel): model_config = ConfigDict( populate_by_name=True, ) proposed_execpolicy_amendment: list[str] class ApprovedExecpolicyAmendmentReviewDecision(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) approved_execpolicy_amendment: ApprovedExecpolicyAmendment class ReviewDelivery(Enum): inline = "inline" detached = "detached" class ReviewLineRange(BaseModel): model_config = ConfigDict( populate_by_name=True, ) end: Annotated[int, Field(ge=0)] start: Annotated[int, Field(ge=0)] class UncommittedChangesReviewTarget(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["uncommittedChanges"], Field(title="UncommittedChangesReviewTargetType") ] class BaseBranchReviewTarget(BaseModel): model_config = ConfigDict( populate_by_name=True, ) branch: str type: Annotated[Literal["baseBranch"], Field(title="BaseBranchReviewTargetType")] class CommitReviewTarget(BaseModel): model_config = ConfigDict( populate_by_name=True, ) sha: str title: Annotated[ str | None, Field( description="Optional human-readable label (e.g., commit subject) for UIs." ), ] = None type: Annotated[Literal["commit"], Field(title="CommitReviewTargetType")] class CustomReviewTarget(BaseModel): model_config = ConfigDict( populate_by_name=True, ) instructions: str type: Annotated[Literal["custom"], Field(title="CustomReviewTargetType")] class ReviewTarget( RootModel[ UncommittedChangesReviewTarget | BaseBranchReviewTarget | CommitReviewTarget | CustomReviewTarget ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( UncommittedChangesReviewTarget | BaseBranchReviewTarget | CommitReviewTarget | CustomReviewTarget ) class SandboxMode(Enum): read_only = "read-only" workspace_write = "workspace-write" danger_full_access = "danger-full-access" class DangerFullAccessSandboxPolicy(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[ Literal["dangerFullAccess"], Field(title="DangerFullAccessSandboxPolicyType") ] class ReadOnlySandboxPolicy(BaseModel): model_config = ConfigDict( populate_by_name=True, ) access: Annotated[ReadOnlyAccess | None, Field()] = {"type": "fullAccess"} network_access: Annotated[bool | None, Field(alias="networkAccess")] = False type: Annotated[Literal["readOnly"], Field(title="ReadOnlySandboxPolicyType")] class ExternalSandboxSandboxPolicy(BaseModel): model_config = ConfigDict( populate_by_name=True, ) network_access: Annotated[NetworkAccess | None, Field(alias="networkAccess")] = ( "restricted" ) type: Annotated[ Literal["externalSandbox"], Field(title="ExternalSandboxSandboxPolicyType") ] class WorkspaceWriteSandboxPolicy(BaseModel): model_config = ConfigDict( populate_by_name=True, ) exclude_slash_tmp: Annotated[bool | None, Field(alias="excludeSlashTmp")] = False exclude_tmpdir_env_var: Annotated[ bool | None, Field(alias="excludeTmpdirEnvVar") ] = False network_access: Annotated[bool | None, Field(alias="networkAccess")] = False read_only_access: Annotated[ ReadOnlyAccess | None, Field(alias="readOnlyAccess") ] = {"type": "fullAccess"} type: Annotated[ Literal["workspaceWrite"], Field(title="WorkspaceWriteSandboxPolicyType") ] writable_roots: Annotated[ list[AbsolutePathBuf] | None, Field(alias="writableRoots") ] = [] class SandboxPolicy( RootModel[ DangerFullAccessSandboxPolicy | ReadOnlySandboxPolicy | ExternalSandboxSandboxPolicy | WorkspaceWriteSandboxPolicy ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( DangerFullAccessSandboxPolicy | ReadOnlySandboxPolicy | ExternalSandboxSandboxPolicy | WorkspaceWriteSandboxPolicy ) class SandboxWorkspaceWrite(BaseModel): model_config = ConfigDict( populate_by_name=True, ) exclude_slash_tmp: bool | None = False exclude_tmpdir_env_var: bool | None = False network_access: bool | None = False writable_roots: list[str] | None = [] class ItemAgentMessageDeltaServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/agentMessage/delta"], Field(title="Item/agentMessage/deltaNotificationMethod"), ] params: AgentMessageDeltaNotification class ItemPlanDeltaServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/plan/delta"], Field(title="Item/plan/deltaNotificationMethod") ] params: PlanDeltaNotification class ItemCommandExecutionOutputDeltaServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/commandExecution/outputDelta"], Field(title="Item/commandExecution/outputDeltaNotificationMethod"), ] params: CommandExecutionOutputDeltaNotification class ItemFileChangeOutputDeltaServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/fileChange/outputDelta"], Field(title="Item/fileChange/outputDeltaNotificationMethod"), ] params: FileChangeOutputDeltaNotification class ItemMcpToolCallProgressServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/mcpToolCall/progress"], Field(title="Item/mcpToolCall/progressNotificationMethod"), ] params: McpToolCallProgressNotification class McpServerOauthLoginCompletedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["mcpServer/oauthLogin/completed"], Field(title="McpServer/oauthLogin/completedNotificationMethod"), ] params: McpServerOauthLoginCompletedNotification class ItemReasoningSummaryTextDeltaServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/reasoning/summaryTextDelta"], Field(title="Item/reasoning/summaryTextDeltaNotificationMethod"), ] params: ReasoningSummaryTextDeltaNotification class ItemReasoningSummaryPartAddedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/reasoning/summaryPartAdded"], Field(title="Item/reasoning/summaryPartAddedNotificationMethod"), ] params: ReasoningSummaryPartAddedNotification class ItemReasoningTextDeltaServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/reasoning/textDelta"], Field(title="Item/reasoning/textDeltaNotificationMethod"), ] params: ReasoningTextDeltaNotification class ThreadCompactedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/compacted"], Field(title="Thread/compactedNotificationMethod") ] params: ContextCompactedNotification class ModelReroutedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["model/rerouted"], Field(title="Model/reroutedNotificationMethod") ] params: ModelReroutedNotification class DeprecationNoticeServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["deprecationNotice"], Field(title="DeprecationNoticeNotificationMethod") ] params: DeprecationNoticeNotification class FuzzyFileSearchSessionUpdatedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["fuzzyFileSearch/sessionUpdated"], Field(title="FuzzyFileSearch/sessionUpdatedNotificationMethod"), ] params: FuzzyFileSearchSessionUpdatedNotification class FuzzyFileSearchSessionCompletedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["fuzzyFileSearch/sessionCompleted"], Field(title="FuzzyFileSearch/sessionCompletedNotificationMethod"), ] params: FuzzyFileSearchSessionCompletedNotification class AccountLoginCompletedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["account/login/completed"], Field(title="Account/login/completedNotificationMethod"), ] params: AccountLoginCompletedNotification class ServerRequestResolvedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) request_id: Annotated[RequestId, Field(alias="requestId")] thread_id: Annotated[str, Field(alias="threadId")] class ServiceTier(Enum): fast = "fast" flex = "flex" class SessionNetworkProxyRuntime(BaseModel): model_config = ConfigDict( populate_by_name=True, ) http_addr: str socks_addr: str class SessionSourceValue(Enum): cli = "cli" vscode = "vscode" exec = "exec" app_server = "appServer" unknown = "unknown" class Settings(BaseModel): model_config = ConfigDict( populate_by_name=True, ) developer_instructions: str | None = None model: str reasoning_effort: ReasoningEffort | None = None class SkillErrorInfo(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str path: str class SkillInterface(BaseModel): model_config = ConfigDict( populate_by_name=True, ) brand_color: Annotated[str | None, Field(alias="brandColor")] = None default_prompt: Annotated[str | None, Field(alias="defaultPrompt")] = None display_name: Annotated[str | None, Field(alias="displayName")] = None icon_large: Annotated[str | None, Field(alias="iconLarge")] = None icon_small: Annotated[str | None, Field(alias="iconSmall")] = None short_description: Annotated[str | None, Field(alias="shortDescription")] = None class SkillScope(Enum): user = "user" repo = "repo" system = "system" admin = "admin" class SkillToolDependency(BaseModel): model_config = ConfigDict( populate_by_name=True, ) command: str | None = None description: str | None = None transport: str | None = None type: str url: str | None = None value: str class SkillsChangedNotification(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class SkillsConfigWriteParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) enabled: bool path: str class SkillsConfigWriteResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) effective_enabled: Annotated[bool, Field(alias="effectiveEnabled")] class SkillsListExtraRootsForCwd(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cwd: str extra_user_roots: Annotated[list[str], Field(alias="extraUserRoots")] class SkillsListParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cwds: Annotated[ list[str] | None, Field( description="When empty, defaults to the current session working directory." ), ] = None force_reload: Annotated[ bool | None, Field( alias="forceReload", description="When true, bypass the skills cache and re-scan skills from disk.", ), ] = None per_cwd_extra_user_roots: Annotated[ list[SkillsListExtraRootsForCwd] | None, Field( alias="perCwdExtraUserRoots", description="Optional per-cwd extra roots to scan as user-scoped skills.", ), ] = None class SkillsRemoteReadParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) enabled: bool | None = False hazelnut_scope: Annotated[HazelnutScope | None, Field(alias="hazelnutScope")] = ( "example" ) product_surface: Annotated[ProductSurface | None, Field(alias="productSurface")] = ( "codex" ) class SkillsRemoteReadResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: list[RemoteSkillSummary] class SkillsRemoteWriteParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) hazelnut_id: Annotated[str, Field(alias="hazelnutId")] class SkillsRemoteWriteResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str path: str class StepStatus(Enum): pending = "pending" in_progress = "in_progress" completed = "completed" class SubAgentSourceValue(Enum): review = "review" compact = "compact" memory_consolidation = "memory_consolidation" class OtherSubAgentSource(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) other: str class TerminalInteractionNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item_id: Annotated[str, Field(alias="itemId")] process_id: Annotated[str, Field(alias="processId")] stdin: str thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class TextElement(BaseModel): model_config = ConfigDict( populate_by_name=True, ) byte_range: Annotated[ ByteRange, Field( alias="byteRange", description="Byte range in the parent `text` buffer that this element occupies.", ), ] placeholder: Annotated[ str | None, Field( description="Optional human-readable placeholder for the element, displayed in the UI." ), ] = None class TextPosition(BaseModel): model_config = ConfigDict( populate_by_name=True, ) column: Annotated[ int, Field(description="1-based column number (in Unicode scalar values).", ge=0), ] line: Annotated[int, Field(description="1-based line number.", ge=0)] class TextRange(BaseModel): model_config = ConfigDict( populate_by_name=True, ) end: TextPosition start: TextPosition class ThreadActiveFlag(Enum): waiting_on_approval = "waitingOnApproval" waiting_on_user_input = "waitingOnUserInput" class ThreadArchiveParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] class ThreadArchiveResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class ThreadArchivedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] class ThreadClosedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] class ThreadCompactStartParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] class ThreadCompactStartResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class ThreadForkParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) approval_policy: Annotated[AskForApproval | None, Field(alias="approvalPolicy")] = ( None ) base_instructions: Annotated[str | None, Field(alias="baseInstructions")] = None config: dict[str, Any] | None = None cwd: str | None = None developer_instructions: Annotated[ str | None, Field(alias="developerInstructions") ] = None ephemeral: bool | None = None model: Annotated[ str | None, Field(description="Configuration overrides for the forked thread, if any."), ] = None model_provider: Annotated[str | None, Field(alias="modelProvider")] = None sandbox: SandboxMode | None = None service_tier: Annotated[ServiceTier | None, Field(alias="serviceTier")] = None thread_id: Annotated[str, Field(alias="threadId")] class ThreadId(RootModel[str]): model_config = ConfigDict( populate_by_name=True, ) root: str class AgentMessageThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str phase: MessagePhase | None = None text: str type: Annotated[Literal["agentMessage"], Field(title="AgentMessageThreadItemType")] class PlanThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str text: str type: Annotated[Literal["plan"], Field(title="PlanThreadItemType")] class ReasoningThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content: list[str] | None = [] id: str summary: list[str] | None = [] type: Annotated[Literal["reasoning"], Field(title="ReasoningThreadItemType")] class CommandExecutionThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) aggregated_output: Annotated[ str | None, Field( alias="aggregatedOutput", description="The command's output, aggregated from stdout and stderr.", ), ] = None command: Annotated[str, Field(description="The command to be executed.")] command_actions: Annotated[ list[CommandAction], Field( alias="commandActions", description="A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", ), ] cwd: Annotated[str, Field(description="The command's working directory.")] duration_ms: Annotated[ int | None, Field( alias="durationMs", description="The duration of the command execution in milliseconds.", ), ] = None exit_code: Annotated[ int | None, Field(alias="exitCode", description="The command's exit code.") ] = None id: str process_id: Annotated[ str | None, Field( alias="processId", description="Identifier for the underlying PTY process (when available).", ), ] = None status: CommandExecutionStatus type: Annotated[ Literal["commandExecution"], Field(title="CommandExecutionThreadItemType") ] class McpToolCallThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) arguments: Any duration_ms: Annotated[ int | None, Field( alias="durationMs", description="The duration of the MCP tool call in milliseconds.", ), ] = None error: McpToolCallError | None = None id: str result: McpToolCallResult | None = None server: str status: McpToolCallStatus tool: str type: Annotated[Literal["mcpToolCall"], Field(title="McpToolCallThreadItemType")] class DynamicToolCallThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) arguments: Any content_items: Annotated[ list[DynamicToolCallOutputContentItem] | None, Field(alias="contentItems") ] = None duration_ms: Annotated[ int | None, Field( alias="durationMs", description="The duration of the dynamic tool call in milliseconds.", ), ] = None id: str status: DynamicToolCallStatus success: bool | None = None tool: str type: Annotated[ Literal["dynamicToolCall"], Field(title="DynamicToolCallThreadItemType") ] class ImageViewThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str path: str type: Annotated[Literal["imageView"], Field(title="ImageViewThreadItemType")] class ImageGenerationThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str result: str revised_prompt: Annotated[str | None, Field(alias="revisedPrompt")] = None status: str type: Annotated[ Literal["imageGeneration"], Field(title="ImageGenerationThreadItemType") ] class EnteredReviewModeThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str review: str type: Annotated[ Literal["enteredReviewMode"], Field(title="EnteredReviewModeThreadItemType") ] class ExitedReviewModeThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str review: str type: Annotated[ Literal["exitedReviewMode"], Field(title="ExitedReviewModeThreadItemType") ] class ContextCompactionThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str type: Annotated[ Literal["contextCompaction"], Field(title="ContextCompactionThreadItemType") ] class ThreadLoadedListParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cursor: Annotated[ str | None, Field(description="Opaque pagination cursor returned by a previous call."), ] = None limit: Annotated[ int | None, Field(description="Optional page size; defaults to no limit.", ge=0) ] = None class ThreadLoadedListResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: Annotated[ list[str], Field(description="Thread ids for sessions currently loaded in memory."), ] next_cursor: Annotated[ str | None, Field( alias="nextCursor", description="Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.", ), ] = None class ThreadMetadataGitInfoUpdateParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) branch: Annotated[ str | None, Field( description="Omit to leave the stored branch unchanged, set to `null` to clear it, or provide a non-empty string to replace it." ), ] = None origin_url: Annotated[ str | None, Field( alias="originUrl", description="Omit to leave the stored origin URL unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", ), ] = None sha: Annotated[ str | None, Field( description="Omit to leave the stored commit unchanged, set to `null` to clear it, or provide a non-empty string to replace it." ), ] = None class ThreadMetadataUpdateParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) git_info: Annotated[ ThreadMetadataGitInfoUpdateParams | None, Field( alias="gitInfo", description="Patch the stored Git metadata for this thread. Omit a field to leave it unchanged, set it to `null` to clear it, or provide a string to replace the stored value.", ), ] = None thread_id: Annotated[str, Field(alias="threadId")] class ThreadNameUpdatedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] thread_name: Annotated[str | None, Field(alias="threadName")] = None class ThreadReadParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) include_turns: Annotated[ bool | None, Field( alias="includeTurns", description="When true, include turns and their items from rollout history.", ), ] = False thread_id: Annotated[str, Field(alias="threadId")] class ThreadRealtimeAudioChunk(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: str num_channels: Annotated[int, Field(alias="numChannels", ge=0)] sample_rate: Annotated[int, Field(alias="sampleRate", ge=0)] samples_per_channel: Annotated[ int | None, Field(alias="samplesPerChannel", ge=0) ] = None class ThreadRealtimeClosedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) reason: str | None = None thread_id: Annotated[str, Field(alias="threadId")] class ThreadRealtimeErrorNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str thread_id: Annotated[str, Field(alias="threadId")] class ThreadRealtimeItemAddedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item: Any thread_id: Annotated[str, Field(alias="threadId")] class ThreadRealtimeOutputAudioDeltaNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) audio: ThreadRealtimeAudioChunk thread_id: Annotated[str, Field(alias="threadId")] class ThreadRealtimeStartedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) session_id: Annotated[str | None, Field(alias="sessionId")] = None thread_id: Annotated[str, Field(alias="threadId")] class ThreadResumeParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) approval_policy: Annotated[AskForApproval | None, Field(alias="approvalPolicy")] = ( None ) base_instructions: Annotated[str | None, Field(alias="baseInstructions")] = None config: dict[str, Any] | None = None cwd: str | None = None developer_instructions: Annotated[ str | None, Field(alias="developerInstructions") ] = None model: Annotated[ str | None, Field(description="Configuration overrides for the resumed thread, if any."), ] = None model_provider: Annotated[str | None, Field(alias="modelProvider")] = None personality: Personality | None = None sandbox: SandboxMode | None = None service_tier: Annotated[ServiceTier | None, Field(alias="serviceTier")] = None thread_id: Annotated[str, Field(alias="threadId")] class ThreadRollbackParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) num_turns: Annotated[ int, Field( alias="numTurns", description="The number of turns to drop from the end of the thread. Must be >= 1.\n\nThis only modifies the thread's history and does not revert local file changes that have been made by the agent. Clients are responsible for reverting these changes.", ge=0, ), ] thread_id: Annotated[str, Field(alias="threadId")] class ThreadSetNameParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) name: str thread_id: Annotated[str, Field(alias="threadId")] class ThreadSetNameResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class ThreadSortKey(Enum): created_at = "created_at" updated_at = "updated_at" class ThreadSourceKind(Enum): cli = "cli" vscode = "vscode" exec = "exec" app_server = "appServer" sub_agent = "subAgent" sub_agent_review = "subAgentReview" sub_agent_compact = "subAgentCompact" sub_agent_thread_spawn = "subAgentThreadSpawn" sub_agent_other = "subAgentOther" unknown = "unknown" class ThreadStartParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) approval_policy: Annotated[AskForApproval | None, Field(alias="approvalPolicy")] = ( None ) base_instructions: Annotated[str | None, Field(alias="baseInstructions")] = None config: dict[str, Any] | None = None cwd: str | None = None developer_instructions: Annotated[ str | None, Field(alias="developerInstructions") ] = None ephemeral: bool | None = None model: str | None = None model_provider: Annotated[str | None, Field(alias="modelProvider")] = None personality: Personality | None = None sandbox: SandboxMode | None = None service_name: Annotated[str | None, Field(alias="serviceName")] = None service_tier: Annotated[ServiceTier | None, Field(alias="serviceTier")] = None class NotLoadedThreadStatus(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["notLoaded"], Field(title="NotLoadedThreadStatusType")] class IdleThreadStatus(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["idle"], Field(title="IdleThreadStatusType")] class SystemErrorThreadStatus(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["systemError"], Field(title="SystemErrorThreadStatusType")] class ActiveThreadStatus(BaseModel): model_config = ConfigDict( populate_by_name=True, ) active_flags: Annotated[list[ThreadActiveFlag], Field(alias="activeFlags")] type: Annotated[Literal["active"], Field(title="ActiveThreadStatusType")] class ThreadStatus( RootModel[ NotLoadedThreadStatus | IdleThreadStatus | SystemErrorThreadStatus | ActiveThreadStatus ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( NotLoadedThreadStatus | IdleThreadStatus | SystemErrorThreadStatus | ActiveThreadStatus ) class ThreadStatusChangedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) status: ThreadStatus thread_id: Annotated[str, Field(alias="threadId")] class ThreadUnarchiveParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] class ThreadUnarchivedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] class ThreadUnsubscribeParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] class ThreadUnsubscribeStatus(Enum): not_loaded = "notLoaded" not_subscribed = "notSubscribed" unsubscribed = "unsubscribed" class TokenUsage(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cached_input_tokens: int input_tokens: int output_tokens: int reasoning_output_tokens: int total_tokens: int class TokenUsageBreakdown(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cached_input_tokens: Annotated[int, Field(alias="cachedInputTokens")] input_tokens: Annotated[int, Field(alias="inputTokens")] output_tokens: Annotated[int, Field(alias="outputTokens")] reasoning_output_tokens: Annotated[int, Field(alias="reasoningOutputTokens")] total_tokens: Annotated[int, Field(alias="totalTokens")] class TokenUsageInfo(BaseModel): model_config = ConfigDict( populate_by_name=True, ) last_token_usage: TokenUsage model_context_window: int | None = None total_token_usage: TokenUsage class Tool(BaseModel): model_config = ConfigDict( populate_by_name=True, ) field_meta: Annotated[Any | None, Field(alias="_meta")] = None annotations: Any | None = None description: str | None = None icons: list | None = None input_schema: Annotated[Any, Field(alias="inputSchema")] name: str output_schema: Annotated[Any | None, Field(alias="outputSchema")] = None title: str | None = None class TurnAbortReason(Enum): interrupted = "interrupted" replaced = "replaced" review_ended = "review_ended" class TurnDiffUpdatedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) diff: str thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class TurnError(BaseModel): model_config = ConfigDict( populate_by_name=True, ) additional_details: Annotated[str | None, Field(alias="additionalDetails")] = None codex_error_info: Annotated[ CodexErrorInfo | None, Field(alias="codexErrorInfo") ] = None message: str class TurnInterruptParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class TurnInterruptResponse(BaseModel): pass model_config = ConfigDict( populate_by_name=True, ) class AgentMessageTurnItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content: list[AgentMessageContent] id: str phase: Annotated[ MessagePhase | None, Field( description="Optional phase metadata carried through from `ResponseItem::Message`.\n\nThis is currently used by TUI rendering to distinguish mid-turn commentary from a final answer and avoid status-indicator jitter." ), ] = None type: Annotated[Literal["AgentMessage"], Field(title="AgentMessageTurnItemType")] class PlanTurnItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str text: str type: Annotated[Literal["Plan"], Field(title="PlanTurnItemType")] class ReasoningTurnItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str raw_content: list[str] | None = [] summary_text: list[str] type: Annotated[Literal["Reasoning"], Field(title="ReasoningTurnItemType")] class WebSearchTurnItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) action: ResponsesApiWebSearchAction id: str query: str type: Annotated[Literal["WebSearch"], Field(title="WebSearchTurnItemType")] class ImageGenerationTurnItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str result: str revised_prompt: str | None = None saved_path: str | None = None status: str type: Annotated[ Literal["ImageGeneration"], Field(title="ImageGenerationTurnItemType") ] class ContextCompactionTurnItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: str type: Annotated[ Literal["ContextCompaction"], Field(title="ContextCompactionTurnItemType") ] class TurnPlanStepStatus(Enum): pending = "pending" in_progress = "inProgress" completed = "completed" class TurnStatus(Enum): completed = "completed" interrupted = "interrupted" failed = "failed" in_progress = "inProgress" class TurnSteerResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) turn_id: Annotated[str, Field(alias="turnId")] class TextUserInput(BaseModel): model_config = ConfigDict( populate_by_name=True, ) text: str text_elements: Annotated[ list[TextElement] | None, Field( description="UI-defined spans within `text` used to render or persist special elements." ), ] = [] type: Annotated[Literal["text"], Field(title="TextUserInputType")] class ImageUserInput(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["image"], Field(title="ImageUserInputType")] url: str class LocalImageUserInput(BaseModel): model_config = ConfigDict( populate_by_name=True, ) path: str type: Annotated[Literal["localImage"], Field(title="LocalImageUserInputType")] class SkillUserInput(BaseModel): model_config = ConfigDict( populate_by_name=True, ) name: str path: str type: Annotated[Literal["skill"], Field(title="SkillUserInputType")] class MentionUserInput(BaseModel): model_config = ConfigDict( populate_by_name=True, ) name: str path: str type: Annotated[Literal["mention"], Field(title="MentionUserInputType")] class UserInput( RootModel[ TextUserInput | ImageUserInput | LocalImageUserInput | SkillUserInput | MentionUserInput ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( TextUserInput | ImageUserInput | LocalImageUserInput | SkillUserInput | MentionUserInput ) class Verbosity(Enum): low = "low" medium = "medium" high = "high" class SearchWebSearchAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) queries: list[str] | None = None query: str | None = None type: Annotated[Literal["search"], Field(title="SearchWebSearchActionType")] class OpenPageWebSearchAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["openPage"], Field(title="OpenPageWebSearchActionType")] url: str | None = None class FindInPageWebSearchAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) pattern: str | None = None type: Annotated[Literal["findInPage"], Field(title="FindInPageWebSearchActionType")] url: str | None = None class OtherWebSearchAction(BaseModel): model_config = ConfigDict( populate_by_name=True, ) type: Annotated[Literal["other"], Field(title="OtherWebSearchActionType")] class WebSearchAction( RootModel[ SearchWebSearchAction | OpenPageWebSearchAction | FindInPageWebSearchAction | OtherWebSearchAction ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( SearchWebSearchAction | OpenPageWebSearchAction | FindInPageWebSearchAction | OtherWebSearchAction ) class WebSearchContextSize(Enum): low = "low" medium = "medium" high = "high" class WebSearchLocation(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) city: str | None = None country: str | None = None region: str | None = None timezone: str | None = None class WebSearchMode(Enum): disabled = "disabled" cached = "cached" live = "live" class WebSearchToolConfig(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) allowed_domains: list[str] | None = None context_size: WebSearchContextSize | None = None location: WebSearchLocation | None = None class WindowsSandboxSetupMode(Enum): elevated = "elevated" unelevated = "unelevated" class WindowsSandboxSetupStartParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cwd: AbsolutePathBuf | None = None mode: WindowsSandboxSetupMode class WindowsSandboxSetupStartResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) started: bool class WindowsWorldWritableWarningNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) extra_count: Annotated[int, Field(alias="extraCount", ge=0)] failed_scan: Annotated[bool, Field(alias="failedScan")] sample_paths: Annotated[list[str], Field(alias="samplePaths")] class WriteStatus(Enum): ok = "ok" ok_overridden = "okOverridden" class ChatgptAccount(BaseModel): model_config = ConfigDict( populate_by_name=True, ) email: str plan_type: Annotated[PlanType, Field(alias="planType")] type: Annotated[Literal["chatgpt"], Field(title="ChatgptAccountType")] class Account(RootModel[ApiKeyAccount | ChatgptAccount]): model_config = ConfigDict( populate_by_name=True, ) root: ApiKeyAccount | ChatgptAccount class AccountUpdatedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) auth_mode: Annotated[AuthMode | None, Field(alias="authMode")] = None plan_type: Annotated[PlanType | None, Field(alias="planType")] = None class AppConfig(BaseModel): model_config = ConfigDict( populate_by_name=True, ) default_tools_approval_mode: AppToolApproval | None = None default_tools_enabled: bool | None = None destructive_enabled: bool | None = None enabled: bool | None = True open_world_enabled: bool | None = None tools: AppToolsConfig | None = None class AppMetadata(BaseModel): model_config = ConfigDict( populate_by_name=True, ) categories: list[str] | None = None developer: str | None = None first_party_requires_install: Annotated[ bool | None, Field(alias="firstPartyRequiresInstall") ] = None first_party_type: Annotated[str | None, Field(alias="firstPartyType")] = None review: AppReview | None = None screenshots: list[AppScreenshot] | None = None seo_description: Annotated[str | None, Field(alias="seoDescription")] = None show_in_composer_when_unlinked: Annotated[ bool | None, Field(alias="showInComposerWhenUnlinked") ] = None sub_categories: Annotated[list[str] | None, Field(alias="subCategories")] = None version: str | None = None version_id: Annotated[str | None, Field(alias="versionId")] = None version_notes: Annotated[str | None, Field(alias="versionNotes")] = None class AppsConfig(BaseModel): model_config = ConfigDict( populate_by_name=True, ) field_default: Annotated[AppsDefaultConfig | None, Field(alias="_default")] = None class CancelLoginAccountResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) status: CancelLoginAccountStatus class InitializeRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["initialize"], Field(title="InitializeRequestMethod")] params: InitializeParams class ThreadStartRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["thread/start"], Field(title="Thread/startRequestMethod")] params: ThreadStartParams class ThreadResumeRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["thread/resume"], Field(title="Thread/resumeRequestMethod") ] params: ThreadResumeParams class ThreadForkRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["thread/fork"], Field(title="Thread/forkRequestMethod")] params: ThreadForkParams class ThreadArchiveRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["thread/archive"], Field(title="Thread/archiveRequestMethod") ] params: ThreadArchiveParams class ThreadUnsubscribeRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["thread/unsubscribe"], Field(title="Thread/unsubscribeRequestMethod") ] params: ThreadUnsubscribeParams class ThreadNameSetRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["thread/name/set"], Field(title="Thread/name/setRequestMethod") ] params: ThreadSetNameParams class ThreadMetadataUpdateRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["thread/metadata/update"], Field(title="Thread/metadata/updateRequestMethod"), ] params: ThreadMetadataUpdateParams class ThreadUnarchiveRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["thread/unarchive"], Field(title="Thread/unarchiveRequestMethod") ] params: ThreadUnarchiveParams class ThreadCompactStartRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["thread/compact/start"], Field(title="Thread/compact/startRequestMethod"), ] params: ThreadCompactStartParams class ThreadRollbackRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["thread/rollback"], Field(title="Thread/rollbackRequestMethod") ] params: ThreadRollbackParams class ThreadLoadedListRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["thread/loaded/list"], Field(title="Thread/loaded/listRequestMethod") ] params: ThreadLoadedListParams class ThreadReadRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["thread/read"], Field(title="Thread/readRequestMethod")] params: ThreadReadParams class SkillsListRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["skills/list"], Field(title="Skills/listRequestMethod")] params: SkillsListParams class PluginListRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["plugin/list"], Field(title="Plugin/listRequestMethod")] params: PluginListParams class SkillsRemoteListRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["skills/remote/list"], Field(title="Skills/remote/listRequestMethod") ] params: SkillsRemoteReadParams class SkillsRemoteExportRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["skills/remote/export"], Field(title="Skills/remote/exportRequestMethod"), ] params: SkillsRemoteWriteParams class AppListRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["app/list"], Field(title="App/listRequestMethod")] params: AppsListParams class SkillsConfigWriteRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["skills/config/write"], Field(title="Skills/config/writeRequestMethod") ] params: SkillsConfigWriteParams class PluginInstallRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["plugin/install"], Field(title="Plugin/installRequestMethod") ] params: PluginInstallParams class PluginUninstallRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["plugin/uninstall"], Field(title="Plugin/uninstallRequestMethod") ] params: PluginUninstallParams class TurnInterruptRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["turn/interrupt"], Field(title="Turn/interruptRequestMethod") ] params: TurnInterruptParams class ModelListRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["model/list"], Field(title="Model/listRequestMethod")] params: ModelListParams class ExperimentalFeatureListRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["experimentalFeature/list"], Field(title="ExperimentalFeature/listRequestMethod"), ] params: ExperimentalFeatureListParams class McpServerOauthLoginRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["mcpServer/oauth/login"], Field(title="McpServer/oauth/loginRequestMethod"), ] params: McpServerOauthLoginParams class ConfigMcpServerReloadRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["config/mcpServer/reload"], Field(title="Config/mcpServer/reloadRequestMethod"), ] params: None = None class McpServerStatusListRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["mcpServerStatus/list"], Field(title="McpServerStatus/listRequestMethod"), ] params: ListMcpServerStatusParams class WindowsSandboxSetupStartRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["windowsSandbox/setupStart"], Field(title="WindowsSandbox/setupStartRequestMethod"), ] params: WindowsSandboxSetupStartParams class AccountLoginStartRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["account/login/start"], Field(title="Account/login/startRequestMethod") ] params: LoginAccountParams class AccountLoginCancelRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["account/login/cancel"], Field(title="Account/login/cancelRequestMethod"), ] params: CancelLoginAccountParams class AccountLogoutRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["account/logout"], Field(title="Account/logoutRequestMethod") ] params: None = None class AccountRateLimitsReadRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["account/rateLimits/read"], Field(title="Account/rateLimits/readRequestMethod"), ] params: None = None class FeedbackUploadRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["feedback/upload"], Field(title="Feedback/uploadRequestMethod") ] params: FeedbackUploadParams class CommandExecWriteRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["command/exec/write"], Field(title="Command/exec/writeRequestMethod") ] params: CommandExecWriteParams class CommandExecTerminateRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["command/exec/terminate"], Field(title="Command/exec/terminateRequestMethod"), ] params: CommandExecTerminateParams class ConfigReadRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["config/read"], Field(title="Config/readRequestMethod")] params: ConfigReadParams class ExternalAgentConfigDetectRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["externalAgentConfig/detect"], Field(title="ExternalAgentConfig/detectRequestMethod"), ] params: ExternalAgentConfigDetectParams class ConfigRequirementsReadRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["configRequirements/read"], Field(title="ConfigRequirements/readRequestMethod"), ] params: None = None class AccountReadRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["account/read"], Field(title="Account/readRequestMethod")] params: GetAccountParams class FuzzyFileSearchRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["fuzzyFileSearch"], Field(title="FuzzyFileSearchRequestMethod") ] params: FuzzyFileSearchParams class CollabAgentRef(BaseModel): model_config = ConfigDict( populate_by_name=True, ) agent_nickname: Annotated[ str | None, Field( description="Optional nickname assigned to an AgentControl-spawned sub-agent." ), ] = None agent_role: Annotated[ str | None, Field( description="Optional role (agent_role) assigned to an AgentControl-spawned sub-agent." ), ] = None thread_id: Annotated[ ThreadId, Field(description="Thread ID of the receiver/new agent.") ] class CollabAgentState(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str | None = None status: CollabAgentStatus class CollabAgentStatusEntry(BaseModel): model_config = ConfigDict( populate_by_name=True, ) agent_nickname: Annotated[ str | None, Field( description="Optional nickname assigned to an AgentControl-spawned sub-agent." ), ] = None agent_role: Annotated[ str | None, Field( description="Optional role (agent_role) assigned to an AgentControl-spawned sub-agent." ), ] = None status: Annotated[AgentStatus, Field(description="Last known status of the agent.")] thread_id: Annotated[ ThreadId, Field(description="Thread ID of the receiver/new agent.") ] class CollaborationMode(BaseModel): model_config = ConfigDict( populate_by_name=True, ) mode: ModeKind settings: Settings class CollaborationModeMask(BaseModel): model_config = ConfigDict( populate_by_name=True, ) mode: ModeKind | None = None model: str | None = None name: str reasoning_effort: ReasoningEffort | None = None class CommandExecOutputDeltaNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cap_reached: Annotated[ bool, Field( alias="capReached", description="`true` on the final streamed chunk for a stream when `outputBytesCap` truncated later output on that stream.", ), ] delta_base64: Annotated[ str, Field(alias="deltaBase64", description="Base64-encoded output bytes.") ] process_id: Annotated[ str, Field( alias="processId", description="Client-supplied, connection-scoped `processId` from the original `command/exec` request.", ), ] stream: Annotated[ CommandExecOutputStream, Field(description="Output stream for this chunk.") ] class CommandExecParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) command: Annotated[ list[str], Field(description="Command argv vector. Empty arrays are rejected.") ] cwd: Annotated[ str | None, Field(description="Optional working directory. Defaults to the server cwd."), ] = None disable_output_cap: Annotated[ bool | None, Field( alias="disableOutputCap", description="Disable stdout/stderr capture truncation for this request.\n\nCannot be combined with `outputBytesCap`.", ), ] = None disable_timeout: Annotated[ bool | None, Field( alias="disableTimeout", description="Disable the timeout entirely for this request.\n\nCannot be combined with `timeoutMs`.", ), ] = None env: Annotated[ dict[str, Any] | None, Field( description="Optional environment overrides merged into the server-computed environment.\n\nMatching names override inherited values. Set a key to `null` to unset an inherited variable." ), ] = None output_bytes_cap: Annotated[ int | None, Field( alias="outputBytesCap", description="Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.", ge=0, ), ] = None process_id: Annotated[ str | None, Field( alias="processId", description="Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.", ), ] = None sandbox_policy: Annotated[ SandboxPolicy | None, Field( alias="sandboxPolicy", description="Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted.", ), ] = None size: Annotated[ CommandExecTerminalSize | None, Field( description="Optional initial PTY size in character cells. Only valid when `tty` is true." ), ] = None stream_stdin: Annotated[ bool | None, Field( alias="streamStdin", description="Allow follow-up `command/exec/write` requests to write stdin bytes.\n\nRequires a client-supplied `processId`.", ), ] = None stream_stdout_stderr: Annotated[ bool | None, Field( alias="streamStdoutStderr", description="Stream stdout/stderr via `command/exec/outputDelta` notifications.\n\nStreamed bytes are not duplicated into the final response and require a client-supplied `processId`.", ), ] = None timeout_ms: Annotated[ int | None, Field( alias="timeoutMs", description="Optional timeout in milliseconds.\n\nWhen omitted, the server default applies. Cannot be combined with `disableTimeout`.", ), ] = None tty: Annotated[ bool | None, Field( description="Enable PTY mode.\n\nThis implies `streamStdin` and `streamStdoutStderr`." ), ] = None class CommandExecResizeParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) process_id: Annotated[ str, Field( alias="processId", description="Client-supplied, connection-scoped `processId` from the original `command/exec` request.", ), ] size: Annotated[ CommandExecTerminalSize, Field(description="New PTY size in character cells.") ] class ConfigEdit(BaseModel): model_config = ConfigDict( populate_by_name=True, ) key_path: Annotated[str, Field(alias="keyPath")] merge_strategy: Annotated[MergeStrategy, Field(alias="mergeStrategy")] value: Any class ConfigLayer(BaseModel): model_config = ConfigDict( populate_by_name=True, ) config: Any disabled_reason: Annotated[str | None, Field(alias="disabledReason")] = None name: ConfigLayerSource version: str class ConfigLayerMetadata(BaseModel): model_config = ConfigDict( populate_by_name=True, ) name: ConfigLayerSource version: str class ConfigRequirements(BaseModel): model_config = ConfigDict( populate_by_name=True, ) allowed_approval_policies: Annotated[ list[AskForApproval] | None, Field(alias="allowedApprovalPolicies") ] = None allowed_sandbox_modes: Annotated[ list[SandboxMode] | None, Field(alias="allowedSandboxModes") ] = None allowed_web_search_modes: Annotated[ list[WebSearchMode] | None, Field(alias="allowedWebSearchModes") ] = None enforce_residency: Annotated[ ResidencyRequirement | None, Field(alias="enforceResidency") ] = None feature_requirements: Annotated[ dict[str, Any] | None, Field(alias="featureRequirements") ] = None class ConfigRequirementsReadResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) requirements: Annotated[ ConfigRequirements | None, Field( description="Null if no requirements are configured (e.g. no requirements.toml/MDM entries)." ), ] = None class ConfigValueWriteParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) expected_version: Annotated[str | None, Field(alias="expectedVersion")] = None file_path: Annotated[ str | None, Field( alias="filePath", description="Path to the config file to write; defaults to the user's `config.toml` when omitted.", ), ] = None key_path: Annotated[str, Field(alias="keyPath")] merge_strategy: Annotated[MergeStrategy, Field(alias="mergeStrategy")] value: Any class ConfigWarningNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) details: Annotated[ str | None, Field(description="Optional extra guidance or error details.") ] = None path: Annotated[ str | None, Field( description="Optional path to the config file that triggered the warning." ), ] = None range: Annotated[ TextRange | None, Field( description="Optional range for the error location inside the config file." ), ] = None summary: Annotated[str, Field(description="Concise summary of the warning.")] class ErrorNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) error: TurnError thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] will_retry: Annotated[bool, Field(alias="willRetry")] class ModelRerouteEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) from_model: str reason: ModelRerouteReason to_model: str type: Annotated[Literal["model_reroute"], Field(title="ModelRerouteEventMsgType")] class TaskStartedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) collaboration_mode_kind: ModeKind | None = "default" model_context_window: int | None = None turn_id: str type: Annotated[Literal["task_started"], Field(title="TaskStartedEventMsgType")] class AgentMessageEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) message: str phase: MessagePhase | None = None type: Annotated[Literal["agent_message"], Field(title="AgentMessageEventMsgType")] class UserMessageEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) images: Annotated[ list[str] | None, Field( description="Image URLs sourced from `UserInput::Image`. These are safe to replay in legacy UI history events and correspond to images sent to the model." ), ] = None local_images: Annotated[ list[str] | None, Field( description="Local file paths sourced from `UserInput::LocalImage`. These are kept so the UI can reattach images when editing history, and should not be sent to the model or treated as API-ready URLs." ), ] = [] message: str text_elements: Annotated[ list[TextElement] | None, Field( description="UI-defined spans within `message` used to render or persist special elements." ), ] = [] type: Annotated[Literal["user_message"], Field(title="UserMessageEventMsgType")] class ThreadNameUpdatedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: ThreadId thread_name: str | None = None type: Annotated[ Literal["thread_name_updated"], Field(title="ThreadNameUpdatedEventMsgType") ] class McpStartupUpdateEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) server: Annotated[str, Field(description="Server name being started.")] status: Annotated[McpStartupStatus, Field(description="Current startup status.")] type: Annotated[ Literal["mcp_startup_update"], Field(title="McpStartupUpdateEventMsgType") ] class McpStartupCompleteEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cancelled: list[str] failed: list[McpStartupFailure] ready: list[str] type: Annotated[ Literal["mcp_startup_complete"], Field(title="McpStartupCompleteEventMsgType") ] class McpToolCallBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field( description="Identifier so this can be paired with the McpToolCallEnd event." ), ] invocation: McpInvocation type: Annotated[ Literal["mcp_tool_call_begin"], Field(title="McpToolCallBeginEventMsgType") ] class McpToolCallEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field( description="Identifier for the corresponding McpToolCallBegin that finished." ), ] duration: Duration invocation: McpInvocation result: Annotated[ ResultOfCallToolResultOrString, Field(description="Result of the tool call. Note this could be an error."), ] type: Annotated[ Literal["mcp_tool_call_end"], Field(title="McpToolCallEndEventMsgType") ] class WebSearchEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) action: ResponsesApiWebSearchAction call_id: str query: str type: Annotated[Literal["web_search_end"], Field(title="WebSearchEndEventMsgType")] class ExecCommandBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field( description="Identifier so this can be paired with the ExecCommandEnd event." ), ] command: Annotated[list[str], Field(description="The command to be executed.")] cwd: Annotated[ str, Field( description="The command's working directory if not the default cwd for the agent." ), ] interaction_input: Annotated[ str | None, Field( description="Raw input sent to a unified exec session (if this is an interaction event)." ), ] = None parsed_cmd: list[ParsedCommand] process_id: Annotated[ str | None, Field( description="Identifier for the underlying PTY process (when available)." ), ] = None source: Annotated[ ExecCommandSource | None, Field( description="Where the command originated. Defaults to Agent for backward compatibility." ), ] = "agent" turn_id: Annotated[str, Field(description="Turn ID that this command belongs to.")] type: Annotated[ Literal["exec_command_begin"], Field(title="ExecCommandBeginEventMsgType") ] class ExecCommandOutputDeltaEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field( description="Identifier for the ExecCommandBegin that produced this chunk." ), ] chunk: Annotated[ str, Field(description="Raw bytes from the stream (may not be valid UTF-8).") ] stream: Annotated[ ExecOutputStream, Field(description="Which stream produced this chunk.") ] type: Annotated[ Literal["exec_command_output_delta"], Field(title="ExecCommandOutputDeltaEventMsgType"), ] class ExecCommandEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) aggregated_output: Annotated[ str | None, Field(description="Captured aggregated output") ] = "" call_id: Annotated[ str, Field(description="Identifier for the ExecCommandBegin that finished.") ] command: Annotated[list[str], Field(description="The command that was executed.")] cwd: Annotated[ str, Field( description="The command's working directory if not the default cwd for the agent." ), ] duration: Annotated[ Duration, Field(description="The duration of the command execution.") ] exit_code: Annotated[int, Field(description="The command's exit code.")] formatted_output: Annotated[ str, Field(description="Formatted output from the command, as seen by the model."), ] interaction_input: Annotated[ str | None, Field( description="Raw input sent to a unified exec session (if this is an interaction event)." ), ] = None parsed_cmd: list[ParsedCommand] process_id: Annotated[ str | None, Field( description="Identifier for the underlying PTY process (when available)." ), ] = None source: Annotated[ ExecCommandSource | None, Field( description="Where the command originated. Defaults to Agent for backward compatibility." ), ] = "agent" status: Annotated[ ExecCommandStatus, Field(description="Completion status for this command execution."), ] stderr: Annotated[str, Field(description="Captured stderr")] stdout: Annotated[str, Field(description="Captured stdout")] turn_id: Annotated[str, Field(description="Turn ID that this command belongs to.")] type: Annotated[ Literal["exec_command_end"], Field(title="ExecCommandEndEventMsgType") ] class RequestPermissionsEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field( description="Responses API call id for the associated tool call, if available." ), ] permissions: PermissionProfile reason: str | None = None turn_id: Annotated[ str | None, Field( description="Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility." ), ] = "" type: Annotated[ Literal["request_permissions"], Field(title="RequestPermissionsEventMsgType") ] class ElicitationRequestEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId request: ElicitationRequest server_name: str turn_id: Annotated[ str | None, Field(description="Turn ID that this elicitation belongs to, when known."), ] = None type: Annotated[ Literal["elicitation_request"], Field(title="ElicitationRequestEventMsgType") ] class ApplyPatchApprovalRequestEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field( description="Responses API call id for the associated patch apply call, if available." ), ] changes: dict[str, FileChange] grant_root: Annotated[ str | None, Field( description="When set, the agent is asking the user to allow writes under this root for the remainder of the session." ), ] = None reason: Annotated[ str | None, Field( description="Optional explanatory reason (e.g. request for extra write access)." ), ] = None turn_id: Annotated[ str | None, Field( description="Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility with older senders." ), ] = "" type: Annotated[ Literal["apply_patch_approval_request"], Field(title="ApplyPatchApprovalRequestEventMsgType"), ] class PatchApplyBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) auto_approved: Annotated[ bool, Field( description="If true, there was no ApplyPatchApprovalRequest for this patch." ), ] call_id: Annotated[ str, Field( description="Identifier so this can be paired with the PatchApplyEnd event." ), ] changes: Annotated[ dict[str, FileChange], Field(description="The changes to be applied.") ] turn_id: Annotated[ str | None, Field( description="Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility." ), ] = "" type: Annotated[ Literal["patch_apply_begin"], Field(title="PatchApplyBeginEventMsgType") ] class PatchApplyEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field(description="Identifier for the PatchApplyBegin that finished.") ] changes: Annotated[ dict[str, FileChange] | None, Field( description="The changes that were applied (mirrors PatchApplyBeginEvent::changes)." ), ] = {} status: Annotated[ PatchApplyStatus, Field(description="Completion status for this patch application."), ] stderr: Annotated[ str, Field(description="Captured stderr (parser errors, IO failures, etc.).") ] stdout: Annotated[ str, Field(description="Captured stdout (summary printed by apply_patch).") ] success: Annotated[ bool, Field(description="Whether the patch was applied successfully.") ] turn_id: Annotated[ str | None, Field( description="Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility." ), ] = "" type: Annotated[ Literal["patch_apply_end"], Field(title="PatchApplyEndEventMsgType") ] class GetHistoryEntryResponseEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) entry: Annotated[ HistoryEntry | None, Field( description="The entry at the requested offset, if available and parseable." ), ] = None log_id: Annotated[int, Field(ge=0)] offset: Annotated[int, Field(ge=0)] type: Annotated[ Literal["get_history_entry_response"], Field(title="GetHistoryEntryResponseEventMsgType"), ] class McpListToolsResponseEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) auth_statuses: Annotated[ dict[str, McpAuthStatus], Field(description="Authentication status for each configured MCP server."), ] resource_templates: Annotated[ dict[str, list[ResourceTemplate]], Field(description="Known resource templates grouped by server name."), ] resources: Annotated[ dict[str, list[Resource]], Field(description="Known resources grouped by server name."), ] tools: Annotated[ dict[str, Tool], Field(description="Fully qualified tool name -> tool definition."), ] type: Annotated[ Literal["mcp_list_tools_response"], Field(title="McpListToolsResponseEventMsgType"), ] class ListRemoteSkillsResponseEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) skills: list[RemoteSkillSummary] type: Annotated[ Literal["list_remote_skills_response"], Field(title="ListRemoteSkillsResponseEventMsgType"), ] class TurnAbortedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) reason: TurnAbortReason turn_id: str | None = None type: Annotated[Literal["turn_aborted"], Field(title="TurnAbortedEventMsgType")] class EnteredReviewModeEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) target: ReviewTarget type: Annotated[ Literal["entered_review_mode"], Field(title="EnteredReviewModeEventMsgType") ] user_facing_hint: str | None = None class CollabAgentSpawnBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[str, Field(description="Identifier for the collab tool call.")] model: str prompt: Annotated[ str, Field( description="Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning." ), ] reasoning_effort: ReasoningEffort sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] type: Annotated[ Literal["collab_agent_spawn_begin"], Field(title="CollabAgentSpawnBeginEventMsgType"), ] class CollabAgentSpawnEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[str, Field(description="Identifier for the collab tool call.")] model: Annotated[str, Field(description="Model requested for the spawned agent.")] new_agent_nickname: Annotated[ str | None, Field(description="Optional nickname assigned to the new agent.") ] = None new_agent_role: Annotated[ str | None, Field(description="Optional role assigned to the new agent.") ] = None new_thread_id: Annotated[ ThreadId | None, Field(description="Thread ID of the newly spawned agent, if it was created."), ] = None prompt: Annotated[ str, Field( description="Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning." ), ] reasoning_effort: Annotated[ ReasoningEffort, Field(description="Reasoning effort requested for the spawned agent."), ] sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] status: Annotated[ AgentStatus, Field( description="Last known status of the new agent reported to the sender agent." ), ] type: Annotated[ Literal["collab_agent_spawn_end"], Field(title="CollabAgentSpawnEndEventMsgType"), ] class CollabAgentInteractionBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[str, Field(description="Identifier for the collab tool call.")] prompt: Annotated[ str, Field( description="Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning." ), ] receiver_thread_id: Annotated[ ThreadId, Field(description="Thread ID of the receiver.") ] sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] type: Annotated[ Literal["collab_agent_interaction_begin"], Field(title="CollabAgentInteractionBeginEventMsgType"), ] class CollabAgentInteractionEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[str, Field(description="Identifier for the collab tool call.")] prompt: Annotated[ str, Field( description="Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning." ), ] receiver_agent_nickname: Annotated[ str | None, Field(description="Optional nickname assigned to the receiver agent."), ] = None receiver_agent_role: Annotated[ str | None, Field(description="Optional role assigned to the receiver agent.") ] = None receiver_thread_id: Annotated[ ThreadId, Field(description="Thread ID of the receiver.") ] sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] status: Annotated[ AgentStatus, Field( description="Last known status of the receiver agent reported to the sender agent." ), ] type: Annotated[ Literal["collab_agent_interaction_end"], Field(title="CollabAgentInteractionEndEventMsgType"), ] class CollabWaitingBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[str, Field(description="ID of the waiting call.")] receiver_agents: Annotated[ list[CollabAgentRef] | None, Field(description="Optional nicknames/roles for receivers."), ] = None receiver_thread_ids: Annotated[ list[ThreadId], Field(description="Thread ID of the receivers.") ] sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] type: Annotated[ Literal["collab_waiting_begin"], Field(title="CollabWaitingBeginEventMsgType") ] class CollabWaitingEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) agent_statuses: Annotated[ list[CollabAgentStatusEntry] | None, Field(description="Optional receiver metadata paired with final statuses."), ] = None call_id: Annotated[str, Field(description="ID of the waiting call.")] sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] statuses: Annotated[ dict[str, AgentStatus], Field( description="Last known status of the receiver agents reported to the sender agent." ), ] type: Annotated[ Literal["collab_waiting_end"], Field(title="CollabWaitingEndEventMsgType") ] class CollabCloseBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[str, Field(description="Identifier for the collab tool call.")] receiver_thread_id: Annotated[ ThreadId, Field(description="Thread ID of the receiver.") ] sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] type: Annotated[ Literal["collab_close_begin"], Field(title="CollabCloseBeginEventMsgType") ] class CollabCloseEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[str, Field(description="Identifier for the collab tool call.")] receiver_agent_nickname: Annotated[ str | None, Field(description="Optional nickname assigned to the receiver agent."), ] = None receiver_agent_role: Annotated[ str | None, Field(description="Optional role assigned to the receiver agent.") ] = None receiver_thread_id: Annotated[ ThreadId, Field(description="Thread ID of the receiver.") ] sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] status: Annotated[ AgentStatus, Field( description="Last known status of the receiver agent reported to the sender agent before the close." ), ] type: Annotated[ Literal["collab_close_end"], Field(title="CollabCloseEndEventMsgType") ] class CollabResumeBeginEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[str, Field(description="Identifier for the collab tool call.")] receiver_agent_nickname: Annotated[ str | None, Field(description="Optional nickname assigned to the receiver agent."), ] = None receiver_agent_role: Annotated[ str | None, Field(description="Optional role assigned to the receiver agent.") ] = None receiver_thread_id: Annotated[ ThreadId, Field(description="Thread ID of the receiver.") ] sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] type: Annotated[ Literal["collab_resume_begin"], Field(title="CollabResumeBeginEventMsgType") ] class CollabResumeEndEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[str, Field(description="Identifier for the collab tool call.")] receiver_agent_nickname: Annotated[ str | None, Field(description="Optional nickname assigned to the receiver agent."), ] = None receiver_agent_role: Annotated[ str | None, Field(description="Optional role assigned to the receiver agent.") ] = None receiver_thread_id: Annotated[ ThreadId, Field(description="Thread ID of the receiver.") ] sender_thread_id: Annotated[ThreadId, Field(description="Thread ID of the sender.")] status: Annotated[ AgentStatus, Field( description="Last known status of the receiver agent reported to the sender agent after resume." ), ] type: Annotated[ Literal["collab_resume_end"], Field(title="CollabResumeEndEventMsgType") ] class ExperimentalFeature(BaseModel): model_config = ConfigDict( populate_by_name=True, ) announcement: Annotated[ str | None, Field( description="Announcement copy shown to users when the feature is introduced. Null when this feature is not in beta." ), ] = None default_enabled: Annotated[ bool, Field( alias="defaultEnabled", description="Whether this feature is enabled by default.", ), ] description: Annotated[ str | None, Field( description="Short summary describing what the feature does. Null when this feature is not in beta." ), ] = None display_name: Annotated[ str | None, Field( alias="displayName", description="User-facing display name shown in the experimental features UI. Null when this feature is not in beta.", ), ] = None enabled: Annotated[ bool, Field( description="Whether this feature is currently enabled in the loaded config." ), ] name: Annotated[ str, Field(description="Stable key used in config.toml and CLI flag toggles.") ] stage: Annotated[ ExperimentalFeatureStage, Field(description="Lifecycle stage of this feature flag."), ] class ExperimentalFeatureListResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: list[ExperimentalFeature] next_cursor: Annotated[ str | None, Field( alias="nextCursor", description="Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", ), ] = None class ExternalAgentConfigMigrationItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cwd: Annotated[ str | None, Field( description="Null or empty means home-scoped migration; non-empty means repo-scoped migration." ), ] = None description: str item_type: Annotated[ExternalAgentConfigMigrationItemType, Field(alias="itemType")] class FileUpdateChange(BaseModel): model_config = ConfigDict( populate_by_name=True, ) diff: str kind: PatchChangeKind path: str class InputImageFunctionCallOutputContentItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) detail: ImageDetail | None = None image_url: str type: Annotated[ Literal["input_image"], Field(title="InputImageFunctionCallOutputContentItemType"), ] class FunctionCallOutputContentItem( RootModel[ InputTextFunctionCallOutputContentItem | InputImageFunctionCallOutputContentItem ] ): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ InputTextFunctionCallOutputContentItem | InputImageFunctionCallOutputContentItem, Field( description="Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs." ), ] class GetAccountResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) account: Account | None = None requires_openai_auth: Annotated[bool, Field(alias="requiresOpenaiAuth")] class HookOutputEntry(BaseModel): model_config = ConfigDict( populate_by_name=True, ) kind: HookOutputEntryKind text: str class HookRunSummary(BaseModel): model_config = ConfigDict( populate_by_name=True, ) completed_at: Annotated[int | None, Field(alias="completedAt")] = None display_order: Annotated[int, Field(alias="displayOrder")] duration_ms: Annotated[int | None, Field(alias="durationMs")] = None entries: list[HookOutputEntry] event_name: Annotated[HookEventName, Field(alias="eventName")] execution_mode: Annotated[HookExecutionMode, Field(alias="executionMode")] handler_type: Annotated[HookHandlerType, Field(alias="handlerType")] id: str scope: HookScope source_path: Annotated[str, Field(alias="sourcePath")] started_at: Annotated[int, Field(alias="startedAt")] status: HookRunStatus status_message: Annotated[str | None, Field(alias="statusMessage")] = None class HookStartedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) run: HookRunSummary thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str | None, Field(alias="turnId")] = None class McpServerStatus(BaseModel): model_config = ConfigDict( populate_by_name=True, ) auth_status: Annotated[McpAuthStatus, Field(alias="authStatus")] name: str resource_templates: Annotated[ list[ResourceTemplate], Field(alias="resourceTemplates") ] resources: list[Resource] tools: dict[str, Tool] class Model(BaseModel): model_config = ConfigDict( populate_by_name=True, ) availability_nux: Annotated[ ModelAvailabilityNux | None, Field(alias="availabilityNux") ] = None default_reasoning_effort: Annotated[ ReasoningEffort, Field(alias="defaultReasoningEffort") ] description: str display_name: Annotated[str, Field(alias="displayName")] hidden: bool id: str input_modalities: Annotated[ list[InputModality] | None, Field(alias="inputModalities") ] = ["text", "image"] is_default: Annotated[bool, Field(alias="isDefault")] model: str supported_reasoning_efforts: Annotated[ list[ReasoningEffortOption], Field(alias="supportedReasoningEfforts") ] supports_personality: Annotated[bool | None, Field(alias="supportsPersonality")] = ( False ) upgrade: str | None = None upgrade_info: Annotated[ModelUpgradeInfo | None, Field(alias="upgradeInfo")] = None class ModelListResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: list[Model] next_cursor: Annotated[ str | None, Field( alias="nextCursor", description="Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", ), ] = None class NetworkApprovalContext(BaseModel): model_config = ConfigDict( populate_by_name=True, ) host: str protocol: NetworkApprovalProtocol class NetworkPolicyAmendment(BaseModel): model_config = ConfigDict( populate_by_name=True, ) action: NetworkPolicyRuleAction host: str class OverriddenMetadata(BaseModel): model_config = ConfigDict( populate_by_name=True, ) effective_value: Annotated[Any, Field(alias="effectiveValue")] message: str overriding_layer: Annotated[ConfigLayerMetadata, Field(alias="overridingLayer")] class PlanItemArg(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) status: StepStatus step: str class PluginMarketplaceEntry(BaseModel): model_config = ConfigDict( populate_by_name=True, ) name: str path: AbsolutePathBuf plugins: list[PluginSummary] class RateLimitSnapshot(BaseModel): model_config = ConfigDict( populate_by_name=True, ) credits: CreditsSnapshot | None = None limit_id: Annotated[str | None, Field(alias="limitId")] = None limit_name: Annotated[str | None, Field(alias="limitName")] = None plan_type: Annotated[PlanType | None, Field(alias="planType")] = None primary: RateLimitWindow | None = None secondary: RateLimitWindow | None = None class InputTranscriptDeltaRealtimeEvent(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) input_transcript_delta: Annotated[ RealtimeTranscriptDelta, Field(alias="InputTranscriptDelta") ] class OutputTranscriptDeltaRealtimeEvent(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) output_transcript_delta: Annotated[ RealtimeTranscriptDelta, Field(alias="OutputTranscriptDelta") ] class RealtimeHandoffRequested(BaseModel): model_config = ConfigDict( populate_by_name=True, ) active_transcript: list[RealtimeTranscriptEntry] handoff_id: str input_transcript: str item_id: str class RequestUserInputQuestion(BaseModel): model_config = ConfigDict( populate_by_name=True, ) header: str id: str is_other: Annotated[bool | None, Field(alias="isOther")] = False is_secret: Annotated[bool | None, Field(alias="isSecret")] = False options: list[RequestUserInputQuestionOption] | None = None question: str class WebSearchCallResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) action: ResponsesApiWebSearchAction | None = None id: str | None = None status: str | None = None type: Annotated[ Literal["web_search_call"], Field(title="WebSearchCallResponseItemType") ] class ReviewCodeLocation(BaseModel): model_config = ConfigDict( populate_by_name=True, ) absolute_file_path: str line_range: ReviewLineRange class NetworkPolicyAmendment1(BaseModel): model_config = ConfigDict( populate_by_name=True, ) network_policy_amendment: NetworkPolicyAmendment class NetworkPolicyAmendmentReviewDecision(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) network_policy_amendment: NetworkPolicyAmendment1 class ReviewDecision( RootModel[ Literal["approved"] | ApprovedExecpolicyAmendmentReviewDecision | Literal["approved_for_session"] | NetworkPolicyAmendmentReviewDecision | Literal["denied"] | Literal["abort"] ] ): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ Literal["approved"] | ApprovedExecpolicyAmendmentReviewDecision | Literal["approved_for_session"] | NetworkPolicyAmendmentReviewDecision | Literal["denied"] | Literal["abort"], Field(description="User's decision in response to an ExecApprovalRequest."), ] class ReviewFinding(BaseModel): model_config = ConfigDict( populate_by_name=True, ) body: str code_location: ReviewCodeLocation confidence_score: float priority: int title: str class ReviewOutputEvent(BaseModel): model_config = ConfigDict( populate_by_name=True, ) findings: list[ReviewFinding] overall_confidence_score: float overall_correctness: str overall_explanation: str class ReviewStartParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) delivery: Annotated[ ReviewDelivery | None, Field( description="Where to run the review: inline (default) on the current thread or detached on a new thread (returned in `reviewThreadId`)." ), ] = None target: ReviewTarget thread_id: Annotated[str, Field(alias="threadId")] class ErrorServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[Literal["error"], Field(title="ErrorNotificationMethod")] params: ErrorNotification class ThreadStatusChangedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/status/changed"], Field(title="Thread/status/changedNotificationMethod"), ] params: ThreadStatusChangedNotification class ThreadArchivedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/archived"], Field(title="Thread/archivedNotificationMethod") ] params: ThreadArchivedNotification class ThreadUnarchivedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/unarchived"], Field(title="Thread/unarchivedNotificationMethod") ] params: ThreadUnarchivedNotification class ThreadClosedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/closed"], Field(title="Thread/closedNotificationMethod") ] params: ThreadClosedNotification class SkillsChangedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["skills/changed"], Field(title="Skills/changedNotificationMethod") ] params: SkillsChangedNotification class ThreadNameUpdatedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/name/updated"], Field(title="Thread/name/updatedNotificationMethod"), ] params: ThreadNameUpdatedNotification class HookStartedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["hook/started"], Field(title="Hook/startedNotificationMethod") ] params: HookStartedNotification class TurnDiffUpdatedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["turn/diff/updated"], Field(title="Turn/diff/updatedNotificationMethod") ] params: TurnDiffUpdatedNotification class CommandExecOutputDeltaServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["command/exec/outputDelta"], Field(title="Command/exec/outputDeltaNotificationMethod"), ] params: CommandExecOutputDeltaNotification class ItemCommandExecutionTerminalInteractionServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/commandExecution/terminalInteraction"], Field(title="Item/commandExecution/terminalInteractionNotificationMethod"), ] params: TerminalInteractionNotification class ServerRequestResolvedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["serverRequest/resolved"], Field(title="ServerRequest/resolvedNotificationMethod"), ] params: ServerRequestResolvedNotification class AccountUpdatedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["account/updated"], Field(title="Account/updatedNotificationMethod") ] params: AccountUpdatedNotification class ConfigWarningServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["configWarning"], Field(title="ConfigWarningNotificationMethod") ] params: ConfigWarningNotification class ThreadRealtimeStartedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/realtime/started"], Field(title="Thread/realtime/startedNotificationMethod"), ] params: ThreadRealtimeStartedNotification class ThreadRealtimeItemAddedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/realtime/itemAdded"], Field(title="Thread/realtime/itemAddedNotificationMethod"), ] params: ThreadRealtimeItemAddedNotification class ThreadRealtimeOutputAudioDeltaServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/realtime/outputAudio/delta"], Field(title="Thread/realtime/outputAudio/deltaNotificationMethod"), ] params: ThreadRealtimeOutputAudioDeltaNotification class ThreadRealtimeErrorServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/realtime/error"], Field(title="Thread/realtime/errorNotificationMethod"), ] params: ThreadRealtimeErrorNotification class ThreadRealtimeClosedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/realtime/closed"], Field(title="Thread/realtime/closedNotificationMethod"), ] params: ThreadRealtimeClosedNotification class WindowsWorldWritableWarningServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["windows/worldWritableWarning"], Field(title="Windows/worldWritableWarningNotificationMethod"), ] params: WindowsWorldWritableWarningNotification class SkillDependencies(BaseModel): model_config = ConfigDict( populate_by_name=True, ) tools: list[SkillToolDependency] class SkillMetadata(BaseModel): model_config = ConfigDict( populate_by_name=True, ) dependencies: SkillDependencies | None = None description: str enabled: bool interface: SkillInterface | None = None name: str path: str scope: SkillScope short_description: Annotated[ str | None, Field( alias="shortDescription", description="Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", ), ] = None class SkillsListEntry(BaseModel): model_config = ConfigDict( populate_by_name=True, ) cwd: str errors: list[SkillErrorInfo] skills: list[SkillMetadata] class SkillsListResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: list[SkillsListEntry] class ThreadSpawn(BaseModel): model_config = ConfigDict( populate_by_name=True, ) agent_nickname: str | None = None agent_role: str | None = None depth: int parent_thread_id: ThreadId class ThreadSpawnSubAgentSource(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) thread_spawn: ThreadSpawn class SubAgentSource( RootModel[SubAgentSourceValue | ThreadSpawnSubAgentSource | OtherSubAgentSource] ): model_config = ConfigDict( populate_by_name=True, ) root: SubAgentSourceValue | ThreadSpawnSubAgentSource | OtherSubAgentSource class UserMessageThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content: list[UserInput] id: str type: Annotated[Literal["userMessage"], Field(title="UserMessageThreadItemType")] class FileChangeThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) changes: list[FileUpdateChange] id: str status: PatchApplyStatus type: Annotated[Literal["fileChange"], Field(title="FileChangeThreadItemType")] class CollabAgentToolCallThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) agents_states: Annotated[ dict[str, CollabAgentState], Field( alias="agentsStates", description="Last known status of the target agents, when available.", ), ] id: Annotated[ str, Field(description="Unique identifier for this collab tool call.") ] model: Annotated[ str | None, Field(description="Model requested for the spawned agent, when applicable."), ] = None prompt: Annotated[ str | None, Field( description="Prompt text sent as part of the collab tool call, when available." ), ] = None reasoning_effort: Annotated[ ReasoningEffort | None, Field( alias="reasoningEffort", description="Reasoning effort requested for the spawned agent, when applicable.", ), ] = None receiver_thread_ids: Annotated[ list[str], Field( alias="receiverThreadIds", description="Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", ), ] sender_thread_id: Annotated[ str, Field( alias="senderThreadId", description="Thread ID of the agent issuing the collab request.", ), ] status: Annotated[ CollabAgentToolCallStatus, Field(description="Current status of the collab tool call."), ] tool: Annotated[ CollabAgentTool, Field(description="Name of the collab tool that was invoked.") ] type: Annotated[ Literal["collabAgentToolCall"], Field(title="CollabAgentToolCallThreadItemType") ] class WebSearchThreadItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) action: WebSearchAction | None = None id: str query: str type: Annotated[Literal["webSearch"], Field(title="WebSearchThreadItemType")] class ThreadItem( RootModel[ UserMessageThreadItem | AgentMessageThreadItem | PlanThreadItem | ReasoningThreadItem | CommandExecutionThreadItem | FileChangeThreadItem | McpToolCallThreadItem | DynamicToolCallThreadItem | CollabAgentToolCallThreadItem | WebSearchThreadItem | ImageViewThreadItem | ImageGenerationThreadItem | EnteredReviewModeThreadItem | ExitedReviewModeThreadItem | ContextCompactionThreadItem ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( UserMessageThreadItem | AgentMessageThreadItem | PlanThreadItem | ReasoningThreadItem | CommandExecutionThreadItem | FileChangeThreadItem | McpToolCallThreadItem | DynamicToolCallThreadItem | CollabAgentToolCallThreadItem | WebSearchThreadItem | ImageViewThreadItem | ImageGenerationThreadItem | EnteredReviewModeThreadItem | ExitedReviewModeThreadItem | ContextCompactionThreadItem ) class ThreadListParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) archived: Annotated[ bool | None, Field( description="Optional archived filter; when set to true, only archived threads are returned. If false or null, only non-archived threads are returned." ), ] = None cursor: Annotated[ str | None, Field(description="Opaque pagination cursor returned by a previous call."), ] = None cwd: Annotated[ str | None, Field( description="Optional cwd filter; when set, only threads whose session cwd exactly matches this path are returned." ), ] = None limit: Annotated[ int | None, Field( description="Optional page size; defaults to a reasonable server-side value.", ge=0, ), ] = None model_providers: Annotated[ list[str] | None, Field( alias="modelProviders", description="Optional provider filter; when set, only sessions recorded under these providers are returned. When present but empty, includes all providers.", ), ] = None search_term: Annotated[ str | None, Field( alias="searchTerm", description="Optional substring filter for the extracted thread title.", ), ] = None sort_key: Annotated[ ThreadSortKey | None, Field( alias="sortKey", description="Optional sort key; defaults to created_at." ), ] = None source_kinds: Annotated[ list[ThreadSourceKind] | None, Field( alias="sourceKinds", description="Optional source filter; when set, only sessions from these source kinds are returned. When omitted or empty, defaults to interactive sources.", ), ] = None class ThreadTokenUsage(BaseModel): model_config = ConfigDict( populate_by_name=True, ) last: TokenUsageBreakdown model_context_window: Annotated[int | None, Field(alias="modelContextWindow")] = ( None ) total: TokenUsageBreakdown class ThreadTokenUsageUpdatedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] token_usage: Annotated[ThreadTokenUsage, Field(alias="tokenUsage")] turn_id: Annotated[str, Field(alias="turnId")] class ThreadUnsubscribeResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) status: ThreadUnsubscribeStatus class ToolsV2(BaseModel): model_config = ConfigDict( populate_by_name=True, ) view_image: bool | None = None web_search: WebSearchToolConfig | None = None class Turn(BaseModel): model_config = ConfigDict( populate_by_name=True, ) error: Annotated[ TurnError | None, Field(description="Only populated when the Turn's status is failed."), ] = None id: str items: Annotated[ list[ThreadItem], Field( description="Only populated on a `thread/resume` or `thread/fork` response. For all other responses and notifications returning a Turn, the items field will be an empty list." ), ] status: TurnStatus class TurnCompletedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] turn: Turn class UserMessageTurnItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) content: list[UserInput] id: str type: Annotated[Literal["UserMessage"], Field(title="UserMessageTurnItemType")] class TurnItem( RootModel[ UserMessageTurnItem | AgentMessageTurnItem | PlanTurnItem | ReasoningTurnItem | WebSearchTurnItem | ImageGenerationTurnItem | ContextCompactionTurnItem ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( UserMessageTurnItem | AgentMessageTurnItem | PlanTurnItem | ReasoningTurnItem | WebSearchTurnItem | ImageGenerationTurnItem | ContextCompactionTurnItem ) class TurnPlanStep(BaseModel): model_config = ConfigDict( populate_by_name=True, ) status: TurnPlanStepStatus step: str class TurnPlanUpdatedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) explanation: str | None = None plan: list[TurnPlanStep] thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class TurnStartParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) approval_policy: Annotated[ AskForApproval | None, Field( alias="approvalPolicy", description="Override the approval policy for this turn and subsequent turns.", ), ] = None cwd: Annotated[ str | None, Field( description="Override the working directory for this turn and subsequent turns." ), ] = None effort: Annotated[ ReasoningEffort | None, Field( description="Override the reasoning effort for this turn and subsequent turns." ), ] = None input: list[UserInput] model: Annotated[ str | None, Field(description="Override the model for this turn and subsequent turns."), ] = None output_schema: Annotated[ Any | None, Field( alias="outputSchema", description="Optional JSON Schema used to constrain the final assistant message for this turn.", ), ] = None personality: Annotated[ Personality | None, Field( description="Override the personality for this turn and subsequent turns." ), ] = None sandbox_policy: Annotated[ SandboxPolicy | None, Field( alias="sandboxPolicy", description="Override the sandbox policy for this turn and subsequent turns.", ), ] = None service_tier: Annotated[ ServiceTier | None, Field( alias="serviceTier", description="Override the service tier for this turn and subsequent turns.", ), ] = None summary: Annotated[ ReasoningSummary | None, Field( description="Override the reasoning summary for this turn and subsequent turns." ), ] = None thread_id: Annotated[str, Field(alias="threadId")] class TurnStartResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) turn: Turn class TurnStartedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread_id: Annotated[str, Field(alias="threadId")] turn: Turn class TurnSteerParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) expected_turn_id: Annotated[ str, Field( alias="expectedTurnId", description="Required active turn id precondition. The request fails when it does not match the currently active turn.", ), ] input: list[UserInput] thread_id: Annotated[str, Field(alias="threadId")] class WindowsSandboxSetupCompletedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) error: str | None = None mode: WindowsSandboxSetupMode success: bool class AccountRateLimitsUpdatedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) rate_limits: Annotated[RateLimitSnapshot, Field(alias="rateLimits")] class AppInfo(BaseModel): model_config = ConfigDict( populate_by_name=True, ) app_metadata: Annotated[AppMetadata | None, Field(alias="appMetadata")] = None branding: AppBranding | None = None description: str | None = None distribution_channel: Annotated[str | None, Field(alias="distributionChannel")] = ( None ) id: str install_url: Annotated[str | None, Field(alias="installUrl")] = None is_accessible: Annotated[bool | None, Field(alias="isAccessible")] = False is_enabled: Annotated[ bool | None, Field( alias="isEnabled", description="Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", ), ] = True labels: dict[str, Any] | None = None logo_url: Annotated[str | None, Field(alias="logoUrl")] = None logo_url_dark: Annotated[str | None, Field(alias="logoUrlDark")] = None name: str plugin_display_names: Annotated[ list[str] | None, Field(alias="pluginDisplayNames") ] = [] class AppListUpdatedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: list[AppInfo] class AppsListResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: list[AppInfo] next_cursor: Annotated[ str | None, Field( alias="nextCursor", description="Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", ), ] = None class ThreadListRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["thread/list"], Field(title="Thread/listRequestMethod")] params: ThreadListParams class TurnStartRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["turn/start"], Field(title="Turn/startRequestMethod")] params: TurnStartParams class TurnSteerRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["turn/steer"], Field(title="Turn/steerRequestMethod")] params: TurnSteerParams class ReviewStartRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["review/start"], Field(title="Review/startRequestMethod")] params: ReviewStartParams class CommandExecRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[Literal["command/exec"], Field(title="Command/execRequestMethod")] params: CommandExecParams class CommandExecResizeRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["command/exec/resize"], Field(title="Command/exec/resizeRequestMethod") ] params: CommandExecResizeParams class ConfigValueWriteRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["config/value/write"], Field(title="Config/value/writeRequestMethod") ] params: ConfigValueWriteParams class ConfigBatchWriteParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) edits: list[ConfigEdit] expected_version: Annotated[str | None, Field(alias="expectedVersion")] = None file_path: Annotated[ str | None, Field( alias="filePath", description="Path to the config file to write; defaults to the user's `config.toml` when omitted.", ), ] = None reload_user_config: Annotated[ bool | None, Field( alias="reloadUserConfig", description="When true, hot-reload the updated user config into all loaded threads after writing.", ), ] = None class ConfigWriteResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) file_path: Annotated[ AbsolutePathBuf, Field( alias="filePath", description="Canonical path to the config file that was written.", ), ] overridden_metadata: Annotated[ OverriddenMetadata | None, Field(alias="overriddenMetadata") ] = None status: WriteStatus version: str class TokenCountEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) info: TokenUsageInfo | None = None rate_limits: RateLimitSnapshot | None = None type: Annotated[Literal["token_count"], Field(title="TokenCountEventMsgType")] class ExecApprovalRequestEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) additional_permissions: Annotated[ PermissionProfile | None, Field( description="Optional additional filesystem permissions requested for this command." ), ] = None approval_id: Annotated[ str | None, Field( description="Identifier for this specific approval callback.\n\nWhen absent, the approval is for the command item itself (`call_id`). This is present for subcommand approvals (via execve intercept)." ), ] = None available_decisions: Annotated[ list[ReviewDecision] | None, Field( description="Ordered list of decisions the client may present for this prompt.\n\nWhen absent, clients should derive the legacy default set from the other fields on this request." ), ] = None call_id: Annotated[ str, Field(description="Identifier for the associated command execution item.") ] command: Annotated[list[str], Field(description="The command to be executed.")] cwd: Annotated[str, Field(description="The command's working directory.")] network_approval_context: Annotated[ NetworkApprovalContext | None, Field( description="Optional network context for a blocked request that can be approved." ), ] = None parsed_cmd: list[ParsedCommand] proposed_execpolicy_amendment: Annotated[ list[str] | None, Field( description="Proposed execpolicy amendment that can be applied to allow future runs." ), ] = None proposed_network_policy_amendments: Annotated[ list[NetworkPolicyAmendment] | None, Field( description="Proposed network policy amendments (for example allow/deny this host in future)." ), ] = None reason: Annotated[ str | None, Field( description="Optional human-readable reason for the approval (e.g. retry without sandbox)." ), ] = None skill_metadata: Annotated[ ExecApprovalRequestSkillMetadata | None, Field( description="Optional skill metadata when the approval was triggered by a skill script." ), ] = None turn_id: Annotated[ str | None, Field( description="Turn ID that this command belongs to. Uses `#[serde(default)]` for backwards compatibility." ), ] = "" type: Annotated[ Literal["exec_approval_request"], Field(title="ExecApprovalRequestEventMsgType") ] class RequestUserInputEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: Annotated[ str, Field( description="Responses API call id for the associated tool call, if available." ), ] questions: list[RequestUserInputQuestion] turn_id: Annotated[ str | None, Field( description="Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility." ), ] = "" type: Annotated[ Literal["request_user_input"], Field(title="RequestUserInputEventMsgType") ] class ListSkillsResponseEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) skills: list[SkillsListEntry] type: Annotated[ Literal["list_skills_response"], Field(title="ListSkillsResponseEventMsgType") ] class PlanUpdateEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) explanation: Annotated[ str | None, Field( description="Arguments for the `update_plan` todo/checklist tool (not plan mode)." ), ] = None plan: list[PlanItemArg] type: Annotated[Literal["plan_update"], Field(title="PlanUpdateEventMsgType")] class ExitedReviewModeEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) review_output: ReviewOutputEvent | None = None type: Annotated[ Literal["exited_review_mode"], Field(title="ExitedReviewModeEventMsgType") ] class ItemStartedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item: TurnItem thread_id: ThreadId turn_id: str type: Annotated[Literal["item_started"], Field(title="ItemStartedEventMsgType")] class ItemCompletedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item: TurnItem thread_id: ThreadId turn_id: str type: Annotated[Literal["item_completed"], Field(title="ItemCompletedEventMsgType")] class HookStartedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) run: HookRunSummary turn_id: str | None = None type: Annotated[Literal["hook_started"], Field(title="HookStartedEventMsgType")] class HookCompletedEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) run: HookRunSummary turn_id: str | None = None type: Annotated[Literal["hook_completed"], Field(title="HookCompletedEventMsgType")] class ExternalAgentConfigDetectResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) items: list[ExternalAgentConfigMigrationItem] class ExternalAgentConfigImportParams(BaseModel): model_config = ConfigDict( populate_by_name=True, ) migration_items: Annotated[ list[ExternalAgentConfigMigrationItem], Field(alias="migrationItems") ] class FunctionCallOutputBody(RootModel[str | list[FunctionCallOutputContentItem]]): model_config = ConfigDict( populate_by_name=True, ) root: str | list[FunctionCallOutputContentItem] class FunctionCallOutputPayload(BaseModel): model_config = ConfigDict( populate_by_name=True, ) body: FunctionCallOutputBody success: bool | None = None class GetAccountRateLimitsResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) rate_limits: Annotated[ RateLimitSnapshot, Field( alias="rateLimits", description="Backward-compatible single-bucket view; mirrors the historical payload.", ), ] rate_limits_by_limit_id: Annotated[ dict[str, Any] | None, Field( alias="rateLimitsByLimitId", description="Multi-bucket view keyed by metered `limit_id` (for example, `codex`).", ), ] = None class HookCompletedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) run: HookRunSummary thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str | None, Field(alias="turnId")] = None class ItemCompletedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item: ThreadItem thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class ItemStartedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item: ThreadItem thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class ListMcpServerStatusResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: list[McpServerStatus] next_cursor: Annotated[ str | None, Field( alias="nextCursor", description="Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", ), ] = None class PluginListResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) marketplaces: list[PluginMarketplaceEntry] remote_sync_error: Annotated[str | None, Field(alias="remoteSyncError")] = None class ProfileV2(BaseModel): model_config = ConfigDict( extra="allow", populate_by_name=True, ) approval_policy: AskForApproval | None = None chatgpt_base_url: str | None = None model: str | None = None model_provider: str | None = None model_reasoning_effort: ReasoningEffort | None = None model_reasoning_summary: ReasoningSummary | None = None model_verbosity: Verbosity | None = None service_tier: ServiceTier | None = None tools: ToolsV2 | None = None web_search: WebSearchMode | None = None class HandoffRequestedRealtimeEvent(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) handoff_requested: Annotated[ RealtimeHandoffRequested, Field(alias="HandoffRequested") ] class RealtimeEvent( RootModel[ SessionUpdatedRealtimeEvent | InputTranscriptDeltaRealtimeEvent | OutputTranscriptDeltaRealtimeEvent | AudioOutRealtimeEvent | ConversationItemAddedRealtimeEvent | ConversationItemDoneRealtimeEvent | HandoffRequestedRealtimeEvent | ErrorRealtimeEvent ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( SessionUpdatedRealtimeEvent | InputTranscriptDeltaRealtimeEvent | OutputTranscriptDeltaRealtimeEvent | AudioOutRealtimeEvent | ConversationItemAddedRealtimeEvent | ConversationItemDoneRealtimeEvent | HandoffRequestedRealtimeEvent | ErrorRealtimeEvent ) class FunctionCallOutputResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: str output: FunctionCallOutputPayload type: Annotated[ Literal["function_call_output"], Field(title="FunctionCallOutputResponseItemType"), ] class CustomToolCallOutputResponseItem(BaseModel): model_config = ConfigDict( populate_by_name=True, ) call_id: str output: FunctionCallOutputPayload type: Annotated[ Literal["custom_tool_call_output"], Field(title="CustomToolCallOutputResponseItemType"), ] class ResponseItem( RootModel[ MessageResponseItem | ReasoningResponseItem | LocalShellCallResponseItem | FunctionCallResponseItem | ToolSearchCallResponseItem | FunctionCallOutputResponseItem | CustomToolCallResponseItem | CustomToolCallOutputResponseItem | ToolSearchOutputResponseItem | WebSearchCallResponseItem | ImageGenerationCallResponseItem | GhostSnapshotResponseItem | CompactionResponseItem | OtherResponseItem ] ): model_config = ConfigDict( populate_by_name=True, ) root: ( MessageResponseItem | ReasoningResponseItem | LocalShellCallResponseItem | FunctionCallResponseItem | ToolSearchCallResponseItem | FunctionCallOutputResponseItem | CustomToolCallResponseItem | CustomToolCallOutputResponseItem | ToolSearchOutputResponseItem | WebSearchCallResponseItem | ImageGenerationCallResponseItem | GhostSnapshotResponseItem | CompactionResponseItem | OtherResponseItem ) class ReviewStartResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) review_thread_id: Annotated[ str, Field( alias="reviewThreadId", description="Identifies the thread where the review runs.\n\nFor inline reviews, this is the original thread id. For detached reviews, this is the id of the new review thread.", ), ] turn: Turn class ThreadTokenUsageUpdatedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/tokenUsage/updated"], Field(title="Thread/tokenUsage/updatedNotificationMethod"), ] params: ThreadTokenUsageUpdatedNotification class TurnStartedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["turn/started"], Field(title="Turn/startedNotificationMethod") ] params: TurnStartedNotification class TurnCompletedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["turn/completed"], Field(title="Turn/completedNotificationMethod") ] params: TurnCompletedNotification class HookCompletedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["hook/completed"], Field(title="Hook/completedNotificationMethod") ] params: HookCompletedNotification class TurnPlanUpdatedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["turn/plan/updated"], Field(title="Turn/plan/updatedNotificationMethod") ] params: TurnPlanUpdatedNotification class ItemStartedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/started"], Field(title="Item/startedNotificationMethod") ] params: ItemStartedNotification class ItemCompletedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["item/completed"], Field(title="Item/completedNotificationMethod") ] params: ItemCompletedNotification class AccountRateLimitsUpdatedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["account/rateLimits/updated"], Field(title="Account/rateLimits/updatedNotificationMethod"), ] params: AccountRateLimitsUpdatedNotification class AppListUpdatedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["app/list/updated"], Field(title="App/list/updatedNotificationMethod") ] params: AppListUpdatedNotification class WindowsSandboxSetupCompletedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["windowsSandbox/setupCompleted"], Field(title="WindowsSandbox/setupCompletedNotificationMethod"), ] params: WindowsSandboxSetupCompletedNotification class SubAgentSessionSource(BaseModel): model_config = ConfigDict( extra="forbid", populate_by_name=True, ) sub_agent: Annotated[SubAgentSource, Field(alias="subAgent")] class SessionSource(RootModel[SessionSourceValue | SubAgentSessionSource]): model_config = ConfigDict( populate_by_name=True, ) root: SessionSourceValue | SubAgentSessionSource class Thread(BaseModel): model_config = ConfigDict( populate_by_name=True, ) agent_nickname: Annotated[ str | None, Field( alias="agentNickname", description="Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", ), ] = None agent_role: Annotated[ str | None, Field( alias="agentRole", description="Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", ), ] = None cli_version: Annotated[ str, Field( alias="cliVersion", description="Version of the CLI that created the thread.", ), ] created_at: Annotated[ int, Field( alias="createdAt", description="Unix timestamp (in seconds) when the thread was created.", ), ] cwd: Annotated[str, Field(description="Working directory captured for the thread.")] ephemeral: Annotated[ bool, Field( description="Whether the thread is ephemeral and should not be materialized on disk." ), ] git_info: Annotated[ GitInfo | None, Field( alias="gitInfo", description="Optional Git metadata captured when the thread was created.", ), ] = None id: str model_provider: Annotated[ str, Field( alias="modelProvider", description="Model provider used for this thread (for example, 'openai').", ), ] name: Annotated[ str | None, Field(description="Optional user-facing thread title.") ] = None path: Annotated[ str | None, Field(description="[UNSTABLE] Path to the thread on disk.") ] = None preview: Annotated[ str, Field( description="Usually the first user message in the thread, if available." ), ] source: Annotated[ SessionSource, Field( description="Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)." ), ] status: Annotated[ ThreadStatus, Field(description="Current runtime status for the thread.") ] turns: Annotated[ list[Turn], Field( description="Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list." ), ] updated_at: Annotated[ int, Field( alias="updatedAt", description="Unix timestamp (in seconds) when the thread was last updated.", ), ] class ThreadForkResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) approval_policy: Annotated[AskForApproval, Field(alias="approvalPolicy")] cwd: str model: str model_provider: Annotated[str, Field(alias="modelProvider")] reasoning_effort: Annotated[ ReasoningEffort | None, Field(alias="reasoningEffort") ] = None sandbox: SandboxPolicy service_tier: Annotated[ServiceTier | None, Field(alias="serviceTier")] = None thread: Thread class ThreadListResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) data: list[Thread] next_cursor: Annotated[ str | None, Field( alias="nextCursor", description="Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.", ), ] = None class ThreadMetadataUpdateResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread: Thread class ThreadReadResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread: Thread class ThreadResumeResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) approval_policy: Annotated[AskForApproval, Field(alias="approvalPolicy")] cwd: str model: str model_provider: Annotated[str, Field(alias="modelProvider")] reasoning_effort: Annotated[ ReasoningEffort | None, Field(alias="reasoningEffort") ] = None sandbox: SandboxPolicy service_tier: Annotated[ServiceTier | None, Field(alias="serviceTier")] = None thread: Thread class ThreadRollbackResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread: Annotated[ Thread, Field( description="The updated thread after applying the rollback, with `turns` populated.\n\nThe ThreadItems stored in each Turn are lossy since we explicitly do not persist all agent interactions, such as command executions. This is the same behavior as `thread/resume`." ), ] class ThreadStartResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) approval_policy: Annotated[AskForApproval, Field(alias="approvalPolicy")] cwd: str model: str model_provider: Annotated[str, Field(alias="modelProvider")] reasoning_effort: Annotated[ ReasoningEffort | None, Field(alias="reasoningEffort") ] = None sandbox: SandboxPolicy service_tier: Annotated[ServiceTier | None, Field(alias="serviceTier")] = None thread: Thread class ThreadStartedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread: Thread class ThreadUnarchiveResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) thread: Thread class ExternalAgentConfigImportRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["externalAgentConfig/import"], Field(title="ExternalAgentConfig/importRequestMethod"), ] params: ExternalAgentConfigImportParams class ConfigBatchWriteRequest(BaseModel): model_config = ConfigDict( populate_by_name=True, ) id: RequestId method: Annotated[ Literal["config/batchWrite"], Field(title="Config/batchWriteRequestMethod") ] params: ConfigBatchWriteParams class ClientRequest( RootModel[ InitializeRequest | ThreadStartRequest | ThreadResumeRequest | ThreadForkRequest | ThreadArchiveRequest | ThreadUnsubscribeRequest | ThreadNameSetRequest | ThreadMetadataUpdateRequest | ThreadUnarchiveRequest | ThreadCompactStartRequest | ThreadRollbackRequest | ThreadListRequest | ThreadLoadedListRequest | ThreadReadRequest | SkillsListRequest | PluginListRequest | SkillsRemoteListRequest | SkillsRemoteExportRequest | AppListRequest | SkillsConfigWriteRequest | PluginInstallRequest | PluginUninstallRequest | TurnStartRequest | TurnSteerRequest | TurnInterruptRequest | ReviewStartRequest | ModelListRequest | ExperimentalFeatureListRequest | McpServerOauthLoginRequest | ConfigMcpServerReloadRequest | McpServerStatusListRequest | WindowsSandboxSetupStartRequest | AccountLoginStartRequest | AccountLoginCancelRequest | AccountLogoutRequest | AccountRateLimitsReadRequest | FeedbackUploadRequest | CommandExecRequest | CommandExecWriteRequest | CommandExecTerminateRequest | CommandExecResizeRequest | ConfigReadRequest | ExternalAgentConfigDetectRequest | ExternalAgentConfigImportRequest | ConfigValueWriteRequest | ConfigBatchWriteRequest | ConfigRequirementsReadRequest | AccountReadRequest | FuzzyFileSearchRequest ] ): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ InitializeRequest | ThreadStartRequest | ThreadResumeRequest | ThreadForkRequest | ThreadArchiveRequest | ThreadUnsubscribeRequest | ThreadNameSetRequest | ThreadMetadataUpdateRequest | ThreadUnarchiveRequest | ThreadCompactStartRequest | ThreadRollbackRequest | ThreadListRequest | ThreadLoadedListRequest | ThreadReadRequest | SkillsListRequest | PluginListRequest | SkillsRemoteListRequest | SkillsRemoteExportRequest | AppListRequest | SkillsConfigWriteRequest | PluginInstallRequest | PluginUninstallRequest | TurnStartRequest | TurnSteerRequest | TurnInterruptRequest | ReviewStartRequest | ModelListRequest | ExperimentalFeatureListRequest | McpServerOauthLoginRequest | ConfigMcpServerReloadRequest | McpServerStatusListRequest | WindowsSandboxSetupStartRequest | AccountLoginStartRequest | AccountLoginCancelRequest | AccountLogoutRequest | AccountRateLimitsReadRequest | FeedbackUploadRequest | CommandExecRequest | CommandExecWriteRequest | CommandExecTerminateRequest | CommandExecResizeRequest | ConfigReadRequest | ExternalAgentConfigDetectRequest | ExternalAgentConfigImportRequest | ConfigValueWriteRequest | ConfigBatchWriteRequest | ConfigRequirementsReadRequest | AccountReadRequest | FuzzyFileSearchRequest, Field( description="Request from the client to the server.", title="ClientRequest" ), ] class Config(BaseModel): model_config = ConfigDict( extra="allow", populate_by_name=True, ) analytics: AnalyticsConfig | None = None approval_policy: AskForApproval | None = None compact_prompt: str | None = None developer_instructions: str | None = None forced_chatgpt_workspace_id: str | None = None forced_login_method: ForcedLoginMethod | None = None instructions: str | None = None model: str | None = None model_auto_compact_token_limit: int | None = None model_context_window: int | None = None model_provider: str | None = None model_reasoning_effort: ReasoningEffort | None = None model_reasoning_summary: ReasoningSummary | None = None model_verbosity: Verbosity | None = None profile: str | None = None profiles: dict[str, ProfileV2] | None = {} review_model: str | None = None sandbox_mode: SandboxMode | None = None sandbox_workspace_write: SandboxWorkspaceWrite | None = None service_tier: ServiceTier | None = None tools: ToolsV2 | None = None web_search: WebSearchMode | None = None class ConfigReadResponse(BaseModel): model_config = ConfigDict( populate_by_name=True, ) config: Config layers: list[ConfigLayer] | None = None origins: dict[str, ConfigLayerMetadata] class RealtimeConversationRealtimeEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) payload: RealtimeEvent type: Annotated[ Literal["realtime_conversation_realtime"], Field(title="RealtimeConversationRealtimeEventMsgType"), ] class RawResponseItemEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item: ResponseItem type: Annotated[ Literal["raw_response_item"], Field(title="RawResponseItemEventMsgType") ] class RawResponseItemCompletedNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) item: ResponseItem thread_id: Annotated[str, Field(alias="threadId")] turn_id: Annotated[str, Field(alias="turnId")] class ThreadStartedServerNotification(BaseModel): model_config = ConfigDict( populate_by_name=True, ) method: Annotated[ Literal["thread/started"], Field(title="Thread/startedNotificationMethod") ] params: ThreadStartedNotification class ServerNotification( RootModel[ ErrorServerNotification | ThreadStartedServerNotification | ThreadStatusChangedServerNotification | ThreadArchivedServerNotification | ThreadUnarchivedServerNotification | ThreadClosedServerNotification | SkillsChangedServerNotification | ThreadNameUpdatedServerNotification | ThreadTokenUsageUpdatedServerNotification | TurnStartedServerNotification | HookStartedServerNotification | TurnCompletedServerNotification | HookCompletedServerNotification | TurnDiffUpdatedServerNotification | TurnPlanUpdatedServerNotification | ItemStartedServerNotification | ItemCompletedServerNotification | ItemAgentMessageDeltaServerNotification | ItemPlanDeltaServerNotification | CommandExecOutputDeltaServerNotification | ItemCommandExecutionOutputDeltaServerNotification | ItemCommandExecutionTerminalInteractionServerNotification | ItemFileChangeOutputDeltaServerNotification | ServerRequestResolvedServerNotification | ItemMcpToolCallProgressServerNotification | McpServerOauthLoginCompletedServerNotification | AccountUpdatedServerNotification | AccountRateLimitsUpdatedServerNotification | AppListUpdatedServerNotification | ItemReasoningSummaryTextDeltaServerNotification | ItemReasoningSummaryPartAddedServerNotification | ItemReasoningTextDeltaServerNotification | ThreadCompactedServerNotification | ModelReroutedServerNotification | DeprecationNoticeServerNotification | ConfigWarningServerNotification | FuzzyFileSearchSessionUpdatedServerNotification | FuzzyFileSearchSessionCompletedServerNotification | ThreadRealtimeStartedServerNotification | ThreadRealtimeItemAddedServerNotification | ThreadRealtimeOutputAudioDeltaServerNotification | ThreadRealtimeErrorServerNotification | ThreadRealtimeClosedServerNotification | WindowsWorldWritableWarningServerNotification | WindowsSandboxSetupCompletedServerNotification | AccountLoginCompletedServerNotification ] ): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ ErrorServerNotification | ThreadStartedServerNotification | ThreadStatusChangedServerNotification | ThreadArchivedServerNotification | ThreadUnarchivedServerNotification | ThreadClosedServerNotification | SkillsChangedServerNotification | ThreadNameUpdatedServerNotification | ThreadTokenUsageUpdatedServerNotification | TurnStartedServerNotification | HookStartedServerNotification | TurnCompletedServerNotification | HookCompletedServerNotification | TurnDiffUpdatedServerNotification | TurnPlanUpdatedServerNotification | ItemStartedServerNotification | ItemCompletedServerNotification | ItemAgentMessageDeltaServerNotification | ItemPlanDeltaServerNotification | CommandExecOutputDeltaServerNotification | ItemCommandExecutionOutputDeltaServerNotification | ItemCommandExecutionTerminalInteractionServerNotification | ItemFileChangeOutputDeltaServerNotification | ServerRequestResolvedServerNotification | ItemMcpToolCallProgressServerNotification | McpServerOauthLoginCompletedServerNotification | AccountUpdatedServerNotification | AccountRateLimitsUpdatedServerNotification | AppListUpdatedServerNotification | ItemReasoningSummaryTextDeltaServerNotification | ItemReasoningSummaryPartAddedServerNotification | ItemReasoningTextDeltaServerNotification | ThreadCompactedServerNotification | ModelReroutedServerNotification | DeprecationNoticeServerNotification | ConfigWarningServerNotification | FuzzyFileSearchSessionUpdatedServerNotification | FuzzyFileSearchSessionCompletedServerNotification | ThreadRealtimeStartedServerNotification | ThreadRealtimeItemAddedServerNotification | ThreadRealtimeOutputAudioDeltaServerNotification | ThreadRealtimeErrorServerNotification | ThreadRealtimeClosedServerNotification | WindowsWorldWritableWarningServerNotification | WindowsSandboxSetupCompletedServerNotification | AccountLoginCompletedServerNotification, Field( description="Notification sent from the server to the client.", title="ServerNotification", ), ] class SessionConfiguredEventMsg(BaseModel): model_config = ConfigDict( populate_by_name=True, ) approval_policy: Annotated[ AskForApproval, Field(description="When to escalate for approval for execution") ] cwd: Annotated[ str, Field( description="Working directory that should be treated as the *root* of the session." ), ] forked_from_id: ThreadId | None = None history_entry_count: Annotated[ int, Field(description="Current number of entries in the history log.", ge=0) ] history_log_id: Annotated[ int, Field( description="Identifier of the history log file (inode on Unix, 0 otherwise).", ge=0, ), ] initial_messages: Annotated[ list[EventMsg] | None, Field( description="Optional initial messages (as events) for resumed sessions. When present, UIs can use these to seed the history." ), ] = None model: Annotated[ str, Field(description="Tell the client what model is being queried.") ] model_provider_id: str network_proxy: Annotated[ SessionNetworkProxyRuntime | None, Field( description="Runtime proxy bind addresses, when the managed proxy was started for this session." ), ] = None reasoning_effort: Annotated[ ReasoningEffort | None, Field( description="The effort the model is putting into reasoning about the user's request." ), ] = None rollout_path: Annotated[ str | None, Field( description="Path in which the rollout is stored. Can be `None` for ephemeral threads" ), ] = None sandbox_policy: Annotated[ SandboxPolicy, Field(description="How to sandbox commands executed in the system"), ] service_tier: ServiceTier | None = None session_id: ThreadId thread_name: Annotated[ str | None, Field(description="Optional user-facing thread name (may be unset)."), ] = None type: Annotated[ Literal["session_configured"], Field(title="SessionConfiguredEventMsgType") ] class EventMsg( RootModel[ ErrorEventMsg | WarningEventMsg | RealtimeConversationStartedEventMsg | RealtimeConversationRealtimeEventMsg | RealtimeConversationClosedEventMsg | ModelRerouteEventMsg | ContextCompactedEventMsg | ThreadRolledBackEventMsg | TaskStartedEventMsg | TaskCompleteEventMsg | TokenCountEventMsg | AgentMessageEventMsg | UserMessageEventMsg | AgentMessageDeltaEventMsg | AgentReasoningEventMsg | AgentReasoningDeltaEventMsg | AgentReasoningRawContentEventMsg | AgentReasoningRawContentDeltaEventMsg | AgentReasoningSectionBreakEventMsg | SessionConfiguredEventMsg | ThreadNameUpdatedEventMsg | McpStartupUpdateEventMsg | McpStartupCompleteEventMsg | McpToolCallBeginEventMsg | McpToolCallEndEventMsg | WebSearchBeginEventMsg | WebSearchEndEventMsg | ImageGenerationBeginEventMsg | ImageGenerationEndEventMsg | ExecCommandBeginEventMsg | ExecCommandOutputDeltaEventMsg | TerminalInteractionEventMsg | ExecCommandEndEventMsg | ViewImageToolCallEventMsg | ExecApprovalRequestEventMsg | RequestPermissionsEventMsg | RequestUserInputEventMsg | DynamicToolCallRequestEventMsg | DynamicToolCallResponseEventMsg | ElicitationRequestEventMsg | ApplyPatchApprovalRequestEventMsg | DeprecationNoticeEventMsg | BackgroundEventEventMsg | UndoStartedEventMsg | UndoCompletedEventMsg | StreamErrorEventMsg | PatchApplyBeginEventMsg | PatchApplyEndEventMsg | TurnDiffEventMsg | GetHistoryEntryResponseEventMsg | McpListToolsResponseEventMsg | ListCustomPromptsResponseEventMsg | ListSkillsResponseEventMsg | ListRemoteSkillsResponseEventMsg | RemoteSkillDownloadedEventMsg | SkillsUpdateAvailableEventMsg | PlanUpdateEventMsg | TurnAbortedEventMsg | ShutdownCompleteEventMsg | EnteredReviewModeEventMsg | ExitedReviewModeEventMsg | RawResponseItemEventMsg | ItemStartedEventMsg | ItemCompletedEventMsg | HookStartedEventMsg | HookCompletedEventMsg | AgentMessageContentDeltaEventMsg | PlanDeltaEventMsg | ReasoningContentDeltaEventMsg | ReasoningRawContentDeltaEventMsg | CollabAgentSpawnBeginEventMsg | CollabAgentSpawnEndEventMsg | CollabAgentInteractionBeginEventMsg | CollabAgentInteractionEndEventMsg | CollabWaitingBeginEventMsg | CollabWaitingEndEventMsg | CollabCloseBeginEventMsg | CollabCloseEndEventMsg | CollabResumeBeginEventMsg | CollabResumeEndEventMsg ] ): model_config = ConfigDict( populate_by_name=True, ) root: Annotated[ ErrorEventMsg | WarningEventMsg | RealtimeConversationStartedEventMsg | RealtimeConversationRealtimeEventMsg | RealtimeConversationClosedEventMsg | ModelRerouteEventMsg | ContextCompactedEventMsg | ThreadRolledBackEventMsg | TaskStartedEventMsg | TaskCompleteEventMsg | TokenCountEventMsg | AgentMessageEventMsg | UserMessageEventMsg | AgentMessageDeltaEventMsg | AgentReasoningEventMsg | AgentReasoningDeltaEventMsg | AgentReasoningRawContentEventMsg | AgentReasoningRawContentDeltaEventMsg | AgentReasoningSectionBreakEventMsg | SessionConfiguredEventMsg | ThreadNameUpdatedEventMsg | McpStartupUpdateEventMsg | McpStartupCompleteEventMsg | McpToolCallBeginEventMsg | McpToolCallEndEventMsg | WebSearchBeginEventMsg | WebSearchEndEventMsg | ImageGenerationBeginEventMsg | ImageGenerationEndEventMsg | ExecCommandBeginEventMsg | ExecCommandOutputDeltaEventMsg | TerminalInteractionEventMsg | ExecCommandEndEventMsg | ViewImageToolCallEventMsg | ExecApprovalRequestEventMsg | RequestPermissionsEventMsg | RequestUserInputEventMsg | DynamicToolCallRequestEventMsg | DynamicToolCallResponseEventMsg | ElicitationRequestEventMsg | ApplyPatchApprovalRequestEventMsg | DeprecationNoticeEventMsg | BackgroundEventEventMsg | UndoStartedEventMsg | UndoCompletedEventMsg | StreamErrorEventMsg | PatchApplyBeginEventMsg | PatchApplyEndEventMsg | TurnDiffEventMsg | GetHistoryEntryResponseEventMsg | McpListToolsResponseEventMsg | ListCustomPromptsResponseEventMsg | ListSkillsResponseEventMsg | ListRemoteSkillsResponseEventMsg | RemoteSkillDownloadedEventMsg | SkillsUpdateAvailableEventMsg | PlanUpdateEventMsg | TurnAbortedEventMsg | ShutdownCompleteEventMsg | EnteredReviewModeEventMsg | ExitedReviewModeEventMsg | RawResponseItemEventMsg | ItemStartedEventMsg | ItemCompletedEventMsg | HookStartedEventMsg | HookCompletedEventMsg | AgentMessageContentDeltaEventMsg | PlanDeltaEventMsg | ReasoningContentDeltaEventMsg | ReasoningRawContentDeltaEventMsg | CollabAgentSpawnBeginEventMsg | CollabAgentSpawnEndEventMsg | CollabAgentInteractionBeginEventMsg | CollabAgentInteractionEndEventMsg | CollabWaitingBeginEventMsg | CollabWaitingEndEventMsg | CollabCloseBeginEventMsg | CollabCloseEndEventMsg | CollabResumeBeginEventMsg | CollabResumeEndEventMsg, Field( description="Response event from the agent NOTE: Make sure none of these values have optional types, as it will mess up the extension code-gen.", title="EventMsg", ), ] SessionConfiguredEventMsg.model_rebuild()