From 7fe3d745ed9b94afc72af9a0fb28e7935dfe5758 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 04:37:24 -0700 Subject: [PATCH 01/18] add TS codegen --- codex-rs/protocol/src/protocol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index 152743b3e13..6867df59484 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -2501,7 +2501,7 @@ pub enum TruncationPolicy { Tokens(usize), } -#[derive(Serialize, Deserialize, Clone, JsonSchema)] +#[derive(Serialize, Deserialize, Clone, JsonSchema, TS)] pub struct RolloutLine { pub timestamp: String, #[serde(flatten)] From 70ed1917e327df3c5d5740fc19f2fd7f7109770c Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 11:45:12 -0700 Subject: [PATCH 02/18] script --- .../bin/codex-write-rollout-line-schema.rs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs new file mode 100644 index 00000000000..c8abd281f6a --- /dev/null +++ b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs @@ -0,0 +1,22 @@ +use std::error::Error; +use std::path::PathBuf; + +use codex_protocol::protocol::RolloutLine; + +fn main() -> Result<(), Box> { + let out_dir = std::env::args_os() + .nth(1) + .map(PathBuf::from) + .unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("schema/rollout_line")); + + std::fs::create_dir_all(&out_dir)?; + + let schema_path = out_dir.join("RolloutLine.schema.json"); + let schema = schemars::schema_for!(RolloutLine); + let schema_json = serde_json::to_vec_pretty(&schema)?; + std::fs::write(&schema_path, schema_json)?; + + println!("wrote {}", schema_path.display()); + + Ok(()) +} From c1ea0fa73986e627ecb9ab787cb15bdd4e93e54c Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 11:45:18 -0700 Subject: [PATCH 03/18] schema --- .../rollout_line/RolloutLine.schema.json | 7066 +++++++++++++++++ 1 file changed, 7066 insertions(+) create mode 100644 codex-rs/protocol/schema/rollout_line/RolloutLine.schema.json diff --git a/codex-rs/protocol/schema/rollout_line/RolloutLine.schema.json b/codex-rs/protocol/schema/rollout_line/RolloutLine.schema.json new file mode 100644 index 00000000000..c18f84550e9 --- /dev/null +++ b/codex-rs/protocol/schema/rollout_line/RolloutLine.schema.json @@ -0,0 +1,7066 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RolloutLine", + "type": "object", + "oneOf": [ + { + "type": "object", + "required": [ + "payload", + "type" + ], + "properties": { + "payload": { + "$ref": "#/definitions/SessionMetaLine" + }, + "type": { + "type": "string", + "enum": [ + "session_meta" + ] + } + } + }, + { + "type": "object", + "required": [ + "payload", + "type" + ], + "properties": { + "payload": { + "$ref": "#/definitions/ResponseItem" + }, + "type": { + "type": "string", + "enum": [ + "response_item" + ] + } + } + }, + { + "type": "object", + "required": [ + "payload", + "type" + ], + "properties": { + "payload": { + "$ref": "#/definitions/CompactedItem" + }, + "type": { + "type": "string", + "enum": [ + "compacted" + ] + } + } + }, + { + "type": "object", + "required": [ + "payload", + "type" + ], + "properties": { + "payload": { + "$ref": "#/definitions/TurnContextItem" + }, + "type": { + "type": "string", + "enum": [ + "turn_context" + ] + } + } + }, + { + "type": "object", + "required": [ + "payload", + "type" + ], + "properties": { + "payload": { + "$ref": "#/definitions/EventMsg" + }, + "type": { + "type": "string", + "enum": [ + "event_msg" + ] + } + } + } + ], + "required": [ + "timestamp" + ], + "properties": { + "timestamp": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "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.", + "type": "string" + }, + "AgentMessageContent": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "Text" + ] + } + } + } + ] + }, + "AgentStatus": { + "description": "Agent lifecycle status, derived from emitted events.", + "oneOf": [ + { + "description": "Agent is waiting for initialization.", + "type": "string", + "enum": [ + "pending_init" + ] + }, + { + "description": "Agent is currently running.", + "type": "string", + "enum": [ + "running" + ] + }, + { + "description": "Agent is done. Contains the final assistant message.", + "type": "object", + "required": [ + "completed" + ], + "properties": { + "completed": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + { + "description": "Agent encountered an error.", + "type": "object", + "required": [ + "errored" + ], + "properties": { + "errored": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "description": "Agent has been shutdown.", + "type": "string", + "enum": [ + "shutdown" + ] + }, + { + "description": "Agent is not found.", + "type": "string", + "enum": [ + "not_found" + ] + } + ] + }, + "AskForApproval": { + "description": "Determines the conditions under which the user is consulted to approve running the command proposed by Codex.", + "oneOf": [ + { + "description": "Under this policy, only \"known safe\" commands—as determined by `is_safe_command()`—that **only read files** are auto‑approved. Everything else will ask the user to approve.", + "type": "string", + "enum": [ + "untrusted" + ] + }, + { + "description": "DEPRECATED: *All* commands are auto‑approved, but they are expected to run inside a sandbox where network access is disabled and writes are confined to a specific set of paths. If the command fails, it will be escalated to the user to approve execution without a sandbox. Prefer `OnRequest` for interactive runs or `Never` for non-interactive runs.", + "type": "string", + "enum": [ + "on-failure" + ] + }, + { + "description": "The model decides when to ask the user for approval.", + "type": "string", + "enum": [ + "on-request" + ] + }, + { + "description": "Fine-grained rejection controls for approval prompts.\n\nWhen a field is `true`, prompts of that category are automatically rejected instead of shown to the user.", + "type": "object", + "required": [ + "reject" + ], + "properties": { + "reject": { + "$ref": "#/definitions/RejectConfig" + } + }, + "additionalProperties": false + }, + { + "description": "Never ask the user to approve commands. Failures are immediately returned to the model, and never escalated to the user for approval.", + "type": "string", + "enum": [ + "never" + ] + } + ] + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "description": "End byte offset (exclusive) within the UTF-8 text buffer.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "description": "Start byte offset (inclusive) within the UTF-8 text buffer.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CallToolResult": { + "description": "The server's response to a tool call.", + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "isError": { + "type": [ + "boolean", + "null" + ] + }, + "structuredContent": true + } + }, + "CodexErrorInfo": { + "description": "Codex errors that we expose to clients.", + "oneOf": [ + { + "type": "string", + "enum": [ + "context_window_exceeded", + "usage_limit_exceeded", + "server_overloaded", + "internal_server_error", + "unauthorized", + "bad_request", + "sandbox_error", + "thread_rollback_failed", + "other" + ] + }, + { + "type": "object", + "required": [ + "http_connection_failed" + ], + "properties": { + "http_connection_failed": { + "type": "object", + "properties": { + "http_status_code": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "response_stream_connection_failed" + ], + "properties": { + "response_stream_connection_failed": { + "type": "object", + "properties": { + "http_status_code": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "The response SSE stream disconnected in the middle of a turnbefore completion.", + "type": "object", + "required": [ + "response_stream_disconnected" + ], + "properties": { + "response_stream_disconnected": { + "type": "object", + "properties": { + "http_status_code": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "response_too_many_failed_attempts" + ], + "properties": { + "response_too_many_failed_attempts": { + "type": "object", + "properties": { + "http_status_code": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false + } + ] + }, + "CollabAgentRef": { + "type": "object", + "required": [ + "thread_id" + ], + "properties": { + "agent_nickname": { + "description": "Optional nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agent_role": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "thread_id": { + "description": "Thread ID of the receiver/new agent.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + } + } + }, + "CollabAgentStatusEntry": { + "type": "object", + "required": [ + "status", + "thread_id" + ], + "properties": { + "agent_nickname": { + "description": "Optional nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agent_role": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "status": { + "description": "Last known status of the agent.", + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ] + }, + "thread_id": { + "description": "Thread ID of the receiver/new agent.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + } + } + }, + "CollaborationMode": { + "description": "Collaboration mode for a Codex session.", + "type": "object", + "required": [ + "mode", + "settings" + ], + "properties": { + "mode": { + "$ref": "#/definitions/ModeKind" + }, + "settings": { + "$ref": "#/definitions/Settings" + } + } + }, + "CompactedItem": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + }, + "replacement_history": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ResponseItem" + } + } + } + }, + "ContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ] + } + } + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ] + } + } + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "output_text" + ] + } + } + } + ] + }, + "CreditsSnapshot": { + "type": "object", + "required": [ + "has_credits", + "unlimited" + ], + "properties": { + "balance": { + "type": [ + "string", + "null" + ] + }, + "has_credits": { + "type": "boolean" + }, + "unlimited": { + "type": "boolean" + } + } + }, + "CustomPrompt": { + "type": "object", + "required": [ + "content", + "name", + "path" + ], + "properties": { + "argument_hint": { + "type": [ + "string", + "null" + ] + }, + "content": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "Duration": { + "type": "object", + "required": [ + "nanos", + "secs" + ], + "properties": { + "nanos": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "secs": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ] + } + } + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ] + } + } + } + ] + }, + "DynamicToolSpec": { + "type": "object", + "required": [ + "description", + "inputSchema", + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "inputSchema": true, + "name": { + "type": "string" + } + } + }, + "ElicitationRequest": { + "oneOf": [ + { + "type": "object", + "required": [ + "message", + "mode", + "requested_schema" + ], + "properties": { + "_meta": true, + "message": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "form" + ] + }, + "requested_schema": true + } + }, + { + "type": "object", + "required": [ + "elicitation_id", + "message", + "mode", + "url" + ], + "properties": { + "_meta": true, + "elicitation_id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "url" + ] + }, + "url": { + "type": "string" + } + } + } + ] + }, + "EventMsg": { + "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.", + "oneOf": [ + { + "description": "Error while executing a submission", + "type": "object", + "required": [ + "message", + "type" + ], + "properties": { + "codex_error_info": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "error" + ] + } + } + }, + { + "description": "Warning issued while processing a submission. Unlike `Error`, this indicates the turn continued but the user should still be notified.", + "type": "object", + "required": [ + "message", + "type" + ], + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "warning" + ] + } + } + }, + { + "description": "Realtime conversation lifecycle start event.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "session_id": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "realtime_conversation_started" + ] + } + } + }, + { + "description": "Realtime conversation streaming payload event.", + "type": "object", + "required": [ + "payload", + "type" + ], + "properties": { + "payload": { + "$ref": "#/definitions/RealtimeEvent" + }, + "type": { + "type": "string", + "enum": [ + "realtime_conversation_realtime" + ] + } + } + }, + { + "description": "Realtime conversation lifecycle close event.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "reason": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "realtime_conversation_closed" + ] + } + } + }, + { + "description": "Model routing changed from the requested model to a different model.", + "type": "object", + "required": [ + "from_model", + "reason", + "to_model", + "type" + ], + "properties": { + "from_model": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/ModelRerouteReason" + }, + "to_model": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "model_reroute" + ] + } + } + }, + { + "description": "Conversation history was compacted (either automatically or manually).", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "context_compacted" + ] + } + } + }, + { + "description": "Conversation history was rolled back by dropping the last N user turns.", + "type": "object", + "required": [ + "num_turns", + "type" + ], + "properties": { + "num_turns": { + "description": "Number of user turns that were removed from context.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "thread_rolled_back" + ] + } + } + }, + { + "description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.", + "type": "object", + "required": [ + "turn_id", + "type" + ], + "properties": { + "collaboration_mode_kind": { + "default": "default", + "allOf": [ + { + "$ref": "#/definitions/ModeKind" + } + ] + }, + "model_context_window": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "turn_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "task_started" + ] + } + } + }, + { + "description": "Agent has completed all actions. v1 wire format uses `task_complete`; accept `turn_complete` for v2 interop.", + "type": "object", + "required": [ + "turn_id", + "type" + ], + "properties": { + "last_agent_message": { + "type": [ + "string", + "null" + ] + }, + "turn_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "task_complete" + ] + } + } + }, + { + "description": "Usage update for the current session, including totals and last turn. Optional means unknown — UIs should not display when `None`.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "info": { + "anyOf": [ + { + "$ref": "#/definitions/TokenUsageInfo" + }, + { + "type": "null" + } + ] + }, + "rate_limits": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitSnapshot" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "token_count" + ] + } + } + }, + { + "description": "Agent text output message", + "type": "object", + "required": [ + "message", + "type" + ], + "properties": { + "message": { + "type": "string" + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "agent_message" + ] + } + } + }, + { + "description": "User/system input message (what was sent to the model)", + "type": "object", + "required": [ + "message", + "type" + ], + "properties": { + "images": { + "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.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "local_images": { + "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.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `message` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "user_message" + ] + } + } + }, + { + "description": "Agent text output delta message", + "type": "object", + "required": [ + "delta", + "type" + ], + "properties": { + "delta": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agent_message_delta" + ] + } + } + }, + { + "description": "Reasoning event from agent.", + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agent_reasoning" + ] + } + } + }, + { + "description": "Agent reasoning delta event from agent.", + "type": "object", + "required": [ + "delta", + "type" + ], + "properties": { + "delta": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agent_reasoning_delta" + ] + } + } + }, + { + "description": "Raw chain-of-thought from agent.", + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agent_reasoning_raw_content" + ] + } + } + }, + { + "description": "Agent reasoning content delta event from agent.", + "type": "object", + "required": [ + "delta", + "type" + ], + "properties": { + "delta": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agent_reasoning_raw_content_delta" + ] + } + } + }, + { + "description": "Signaled when the model begins a new reasoning summary section (e.g., a new titled block).", + "type": "object", + "required": [ + "type" + ], + "properties": { + "item_id": { + "default": "", + "type": "string" + }, + "summary_index": { + "default": 0, + "type": "integer", + "format": "int64" + }, + "type": { + "type": "string", + "enum": [ + "agent_reasoning_section_break" + ] + } + } + }, + { + "description": "Ack the client's configure message.", + "type": "object", + "required": [ + "approval_policy", + "cwd", + "history_entry_count", + "history_log_id", + "model", + "model_provider_id", + "sandbox_policy", + "session_id", + "type" + ], + "properties": { + "approval_policy": { + "description": "When to escalate for approval for execution", + "allOf": [ + { + "$ref": "#/definitions/AskForApproval" + } + ] + }, + "cwd": { + "description": "Working directory that should be treated as the *root* of the session.", + "type": "string" + }, + "forked_from_id": { + "anyOf": [ + { + "$ref": "#/definitions/ThreadId" + }, + { + "type": "null" + } + ] + }, + "history_entry_count": { + "description": "Current number of entries in the history log.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "history_log_id": { + "description": "Identifier of the history log file (inode on Unix, 0 otherwise).", + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "initial_messages": { + "description": "Optional initial messages (as events) for resumed sessions. When present, UIs can use these to seed the history.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/EventMsg" + } + }, + "model": { + "description": "Tell the client what model is being queried.", + "type": "string" + }, + "model_provider_id": { + "type": "string" + }, + "network_proxy": { + "description": "Runtime proxy bind addresses, when the managed proxy was started for this session.", + "anyOf": [ + { + "$ref": "#/definitions/SessionNetworkProxyRuntime" + }, + { + "type": "null" + } + ] + }, + "reasoning_effort": { + "description": "The effort the model is putting into reasoning about the user's request.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "rollout_path": { + "description": "Path in which the rollout is stored. Can be `None` for ephemeral threads", + "type": [ + "string", + "null" + ] + }, + "sandbox_policy": { + "description": "How to sandbox commands executed in the system", + "allOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + } + ] + }, + "service_tier": { + "anyOf": [ + { + "$ref": "#/definitions/ServiceTier" + }, + { + "type": "null" + } + ] + }, + "session_id": { + "$ref": "#/definitions/ThreadId" + }, + "thread_name": { + "description": "Optional user-facing thread name (may be unset).", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "session_configured" + ] + } + } + }, + { + "description": "Updated session metadata (e.g., thread name changes).", + "type": "object", + "required": [ + "thread_id", + "type" + ], + "properties": { + "thread_id": { + "$ref": "#/definitions/ThreadId" + }, + "thread_name": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "thread_name_updated" + ] + } + } + }, + { + "description": "Incremental MCP startup progress updates.", + "type": "object", + "required": [ + "server", + "status", + "type" + ], + "properties": { + "server": { + "description": "Server name being started.", + "type": "string" + }, + "status": { + "description": "Current startup status.", + "allOf": [ + { + "$ref": "#/definitions/McpStartupStatus" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "mcp_startup_update" + ] + } + } + }, + { + "description": "Aggregate MCP startup completion summary.", + "type": "object", + "required": [ + "cancelled", + "failed", + "ready", + "type" + ], + "properties": { + "cancelled": { + "type": "array", + "items": { + "type": "string" + } + }, + "failed": { + "type": "array", + "items": { + "$ref": "#/definitions/McpStartupFailure" + } + }, + "ready": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "mcp_startup_complete" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "invocation", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier so this can be paired with the McpToolCallEnd event.", + "type": "string" + }, + "invocation": { + "$ref": "#/definitions/McpInvocation" + }, + "type": { + "type": "string", + "enum": [ + "mcp_tool_call_begin" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "duration", + "invocation", + "result", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the corresponding McpToolCallBegin that finished.", + "type": "string" + }, + "duration": { + "$ref": "#/definitions/Duration" + }, + "invocation": { + "$ref": "#/definitions/McpInvocation" + }, + "result": { + "description": "Result of the tool call. Note this could be an error.", + "allOf": [ + { + "$ref": "#/definitions/Result_of_CallToolResult_or_String" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "mcp_tool_call_end" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "web_search_begin" + ] + } + } + }, + { + "type": "object", + "required": [ + "action", + "call_id", + "query", + "type" + ], + "properties": { + "action": { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + "call_id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "web_search_end" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "image_generation_begin" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "result", + "status", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "saved_path": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "image_generation_end" + ] + } + } + }, + { + "description": "Notification that the server is about to execute a command.", + "type": "object", + "required": [ + "call_id", + "command", + "cwd", + "parsed_cmd", + "turn_id", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier so this can be paired with the ExecCommandEnd event.", + "type": "string" + }, + "command": { + "description": "The command to be executed.", + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "description": "The command's working directory if not the default cwd for the agent.", + "type": "string" + }, + "interaction_input": { + "description": "Raw input sent to a unified exec session (if this is an interaction event).", + "type": [ + "string", + "null" + ] + }, + "parsed_cmd": { + "type": "array", + "items": { + "$ref": "#/definitions/ParsedCommand" + } + }, + "process_id": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "description": "Where the command originated. Defaults to Agent for backward compatibility.", + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/ExecCommandSource" + } + ] + }, + "turn_id": { + "description": "Turn ID that this command belongs to.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exec_command_begin" + ] + } + } + }, + { + "description": "Incremental chunk of output from a running command.", + "type": "object", + "required": [ + "call_id", + "chunk", + "stream", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the ExecCommandBegin that produced this chunk.", + "type": "string" + }, + "chunk": { + "description": "Raw bytes from the stream (may not be valid UTF-8).", + "type": "string" + }, + "stream": { + "description": "Which stream produced this chunk.", + "allOf": [ + { + "$ref": "#/definitions/ExecOutputStream" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "exec_command_output_delta" + ] + } + } + }, + { + "description": "Terminal interaction for an in-progress command (stdin sent and stdout observed).", + "type": "object", + "required": [ + "call_id", + "process_id", + "stdin", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the ExecCommandBegin that produced this chunk.", + "type": "string" + }, + "process_id": { + "description": "Process id associated with the running command.", + "type": "string" + }, + "stdin": { + "description": "Stdin sent to the running session.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "terminal_interaction" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "command", + "cwd", + "duration", + "exit_code", + "formatted_output", + "parsed_cmd", + "status", + "stderr", + "stdout", + "turn_id", + "type" + ], + "properties": { + "aggregated_output": { + "description": "Captured aggregated output", + "default": "", + "type": "string" + }, + "call_id": { + "description": "Identifier for the ExecCommandBegin that finished.", + "type": "string" + }, + "command": { + "description": "The command that was executed.", + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "description": "The command's working directory if not the default cwd for the agent.", + "type": "string" + }, + "duration": { + "description": "The duration of the command execution.", + "allOf": [ + { + "$ref": "#/definitions/Duration" + } + ] + }, + "exit_code": { + "description": "The command's exit code.", + "type": "integer", + "format": "int32" + }, + "formatted_output": { + "description": "Formatted output from the command, as seen by the model.", + "type": "string" + }, + "interaction_input": { + "description": "Raw input sent to a unified exec session (if this is an interaction event).", + "type": [ + "string", + "null" + ] + }, + "parsed_cmd": { + "type": "array", + "items": { + "$ref": "#/definitions/ParsedCommand" + } + }, + "process_id": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "description": "Where the command originated. Defaults to Agent for backward compatibility.", + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/ExecCommandSource" + } + ] + }, + "status": { + "description": "Completion status for this command execution.", + "allOf": [ + { + "$ref": "#/definitions/ExecCommandStatus" + } + ] + }, + "stderr": { + "description": "Captured stderr", + "type": "string" + }, + "stdout": { + "description": "Captured stdout", + "type": "string" + }, + "turn_id": { + "description": "Turn ID that this command belongs to.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exec_command_end" + ] + } + } + }, + { + "description": "Notification that the agent attached a local image via the view_image tool.", + "type": "object", + "required": [ + "call_id", + "path", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the originating tool call.", + "type": "string" + }, + "path": { + "description": "Local filesystem path provided to the tool.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "view_image_tool_call" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "command", + "cwd", + "parsed_cmd", + "type" + ], + "properties": { + "additional_permissions": { + "description": "Optional additional filesystem permissions requested for this command.", + "anyOf": [ + { + "$ref": "#/definitions/PermissionProfile" + }, + { + "type": "null" + } + ] + }, + "approval_id": { + "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).", + "type": [ + "string", + "null" + ] + }, + "available_decisions": { + "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.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ReviewDecision" + } + }, + "call_id": { + "description": "Identifier for the associated command execution item.", + "type": "string" + }, + "command": { + "description": "The command to be executed.", + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "description": "The command's working directory.", + "type": "string" + }, + "network_approval_context": { + "description": "Optional network context for a blocked request that can be approved.", + "anyOf": [ + { + "$ref": "#/definitions/NetworkApprovalContext" + }, + { + "type": "null" + } + ] + }, + "parsed_cmd": { + "type": "array", + "items": { + "$ref": "#/definitions/ParsedCommand" + } + }, + "proposed_execpolicy_amendment": { + "description": "Proposed execpolicy amendment that can be applied to allow future runs.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "proposed_network_policy_amendments": { + "description": "Proposed network policy amendments (for example allow/deny this host in future).", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + }, + "reason": { + "description": "Optional human-readable reason for the approval (e.g. retry without sandbox).", + "type": [ + "string", + "null" + ] + }, + "skill_metadata": { + "description": "Optional skill metadata when the approval was triggered by a skill script.", + "anyOf": [ + { + "$ref": "#/definitions/ExecApprovalRequestSkillMetadata" + }, + { + "type": "null" + } + ] + }, + "turn_id": { + "description": "Turn ID that this command belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "default": "", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exec_approval_request" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "permissions", + "type" + ], + "properties": { + "call_id": { + "description": "Responses API call id for the associated tool call, if available.", + "type": "string" + }, + "permissions": { + "$ref": "#/definitions/PermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "turn_id": { + "description": "Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "default": "", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "request_permissions" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "questions", + "type" + ], + "properties": { + "call_id": { + "description": "Responses API call id for the associated tool call, if available.", + "type": "string" + }, + "questions": { + "type": "array", + "items": { + "$ref": "#/definitions/RequestUserInputQuestion" + } + }, + "turn_id": { + "description": "Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "default": "", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "request_user_input" + ] + } + } + }, + { + "type": "object", + "required": [ + "arguments", + "callId", + "tool", + "turnId", + "type" + ], + "properties": { + "arguments": true, + "callId": { + "type": "string" + }, + "tool": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamic_tool_call_request" + ] + } + } + }, + { + "type": "object", + "required": [ + "arguments", + "call_id", + "content_items", + "duration", + "success", + "tool", + "turn_id", + "type" + ], + "properties": { + "arguments": { + "description": "Dynamic tool call arguments." + }, + "call_id": { + "description": "Identifier for the corresponding DynamicToolCallRequest.", + "type": "string" + }, + "content_items": { + "description": "Dynamic tool response content items.", + "type": "array", + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "duration": { + "description": "The duration of the dynamic tool call.", + "allOf": [ + { + "$ref": "#/definitions/Duration" + } + ] + }, + "error": { + "description": "Optional error text when the tool call failed before producing a response.", + "type": [ + "string", + "null" + ] + }, + "success": { + "description": "Whether the tool call succeeded.", + "type": "boolean" + }, + "tool": { + "description": "Dynamic tool name.", + "type": "string" + }, + "turn_id": { + "description": "Turn ID that this dynamic tool call belongs to.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamic_tool_call_response" + ] + } + } + }, + { + "type": "object", + "required": [ + "id", + "request", + "server_name", + "type" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "request": { + "$ref": "#/definitions/ElicitationRequest" + }, + "server_name": { + "type": "string" + }, + "turn_id": { + "description": "Turn ID that this elicitation belongs to, when known.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "elicitation_request" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "changes", + "type" + ], + "properties": { + "call_id": { + "description": "Responses API call id for the associated patch apply call, if available.", + "type": "string" + }, + "changes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FileChange" + } + }, + "grant_root": { + "description": "When set, the agent is asking the user to allow writes under this root for the remainder of the session.", + "type": [ + "string", + "null" + ] + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for extra write access).", + "type": [ + "string", + "null" + ] + }, + "turn_id": { + "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility with older senders.", + "default": "", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "apply_patch_approval_request" + ] + } + } + }, + { + "description": "Notification advising the user that something they are using has been deprecated and should be phased out.", + "type": "object", + "required": [ + "summary", + "type" + ], + "properties": { + "details": { + "description": "Optional extra guidance, such as migration steps or rationale.", + "type": [ + "string", + "null" + ] + }, + "summary": { + "description": "Concise summary of what is deprecated.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "deprecation_notice" + ] + } + } + }, + { + "type": "object", + "required": [ + "message", + "type" + ], + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "background_event" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "undo_started" + ] + } + } + }, + { + "type": "object", + "required": [ + "success", + "type" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "success": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "undo_completed" + ] + } + } + }, + { + "description": "Notification that a model stream experienced an error or disconnect and the system is handling it (e.g., retrying with backoff).", + "type": "object", + "required": [ + "message", + "type" + ], + "properties": { + "additional_details": { + "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).", + "default": null, + "type": [ + "string", + "null" + ] + }, + "codex_error_info": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "stream_error" + ] + } + } + }, + { + "description": "Notification that the agent is about to apply a code patch. Mirrors `ExecCommandBegin` so front‑ends can show progress indicators.", + "type": "object", + "required": [ + "auto_approved", + "call_id", + "changes", + "type" + ], + "properties": { + "auto_approved": { + "description": "If true, there was no ApplyPatchApprovalRequest for this patch.", + "type": "boolean" + }, + "call_id": { + "description": "Identifier so this can be paired with the PatchApplyEnd event.", + "type": "string" + }, + "changes": { + "description": "The changes to be applied.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FileChange" + } + }, + "turn_id": { + "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "default": "", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "patch_apply_begin" + ] + } + } + }, + { + "description": "Notification that a patch application has finished.", + "type": "object", + "required": [ + "call_id", + "status", + "stderr", + "stdout", + "success", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the PatchApplyBegin that finished.", + "type": "string" + }, + "changes": { + "description": "The changes that were applied (mirrors PatchApplyBeginEvent::changes).", + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FileChange" + } + }, + "status": { + "description": "Completion status for this patch application.", + "allOf": [ + { + "$ref": "#/definitions/PatchApplyStatus" + } + ] + }, + "stderr": { + "description": "Captured stderr (parser errors, IO failures, etc.).", + "type": "string" + }, + "stdout": { + "description": "Captured stdout (summary printed by apply_patch).", + "type": "string" + }, + "success": { + "description": "Whether the patch was applied successfully.", + "type": "boolean" + }, + "turn_id": { + "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "default": "", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "patch_apply_end" + ] + } + } + }, + { + "type": "object", + "required": [ + "type", + "unified_diff" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "turn_diff" + ] + }, + "unified_diff": { + "type": "string" + } + } + }, + { + "description": "Response to GetHistoryEntryRequest.", + "type": "object", + "required": [ + "log_id", + "offset", + "type" + ], + "properties": { + "entry": { + "description": "The entry at the requested offset, if available and parseable.", + "anyOf": [ + { + "$ref": "#/definitions/HistoryEntry" + }, + { + "type": "null" + } + ] + }, + "log_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "offset": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "get_history_entry_response" + ] + } + } + }, + { + "description": "List of MCP tools available to the agent.", + "type": "object", + "required": [ + "auth_statuses", + "resource_templates", + "resources", + "tools", + "type" + ], + "properties": { + "auth_statuses": { + "description": "Authentication status for each configured MCP server.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/McpAuthStatus" + } + }, + "resource_templates": { + "description": "Known resource templates grouped by server name.", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceTemplate" + } + } + }, + "resources": { + "description": "Known resources grouped by server name.", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/Resource" + } + } + }, + "tools": { + "description": "Fully qualified tool name -> tool definition.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Tool" + } + }, + "type": { + "type": "string", + "enum": [ + "mcp_list_tools_response" + ] + } + } + }, + { + "description": "List of custom prompts available to the agent.", + "type": "object", + "required": [ + "custom_prompts", + "type" + ], + "properties": { + "custom_prompts": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomPrompt" + } + }, + "type": { + "type": "string", + "enum": [ + "list_custom_prompts_response" + ] + } + } + }, + { + "description": "List of skills available to the agent.", + "type": "object", + "required": [ + "skills", + "type" + ], + "properties": { + "skills": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillsListEntry" + } + }, + "type": { + "type": "string", + "enum": [ + "list_skills_response" + ] + } + } + }, + { + "description": "List of remote skills available to the agent.", + "type": "object", + "required": [ + "skills", + "type" + ], + "properties": { + "skills": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSkillSummary" + } + }, + "type": { + "type": "string", + "enum": [ + "list_remote_skills_response" + ] + } + } + }, + { + "description": "Remote skill downloaded to local cache.", + "type": "object", + "required": [ + "id", + "name", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "remote_skill_downloaded" + ] + } + } + }, + { + "description": "Notification that skill data may have been updated and clients may want to reload.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "skills_update_available" + ] + } + } + }, + { + "type": "object", + "required": [ + "plan", + "type" + ], + "properties": { + "explanation": { + "description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).", + "default": null, + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": "array", + "items": { + "$ref": "#/definitions/PlanItemArg" + } + }, + "type": { + "type": "string", + "enum": [ + "plan_update" + ] + } + } + }, + { + "type": "object", + "required": [ + "reason", + "type" + ], + "properties": { + "reason": { + "$ref": "#/definitions/TurnAbortReason" + }, + "turn_id": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "turn_aborted" + ] + } + } + }, + { + "description": "Notification that the agent is shutting down.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shutdown_complete" + ] + } + } + }, + { + "description": "Entered review mode.", + "type": "object", + "required": [ + "target", + "type" + ], + "properties": { + "target": { + "$ref": "#/definitions/ReviewTarget" + }, + "type": { + "type": "string", + "enum": [ + "entered_review_mode" + ] + }, + "user_facing_hint": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "description": "Exited review mode with an optional final result to apply.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "review_output": { + "anyOf": [ + { + "$ref": "#/definitions/ReviewOutputEvent" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "exited_review_mode" + ] + } + } + }, + { + "type": "object", + "required": [ + "item", + "type" + ], + "properties": { + "item": { + "$ref": "#/definitions/ResponseItem" + }, + "type": { + "type": "string", + "enum": [ + "raw_response_item" + ] + } + } + }, + { + "type": "object", + "required": [ + "item", + "thread_id", + "turn_id", + "type" + ], + "properties": { + "item": { + "$ref": "#/definitions/TurnItem" + }, + "thread_id": { + "$ref": "#/definitions/ThreadId" + }, + "turn_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "item_started" + ] + } + } + }, + { + "type": "object", + "required": [ + "item", + "thread_id", + "turn_id", + "type" + ], + "properties": { + "item": { + "$ref": "#/definitions/TurnItem" + }, + "thread_id": { + "$ref": "#/definitions/ThreadId" + }, + "turn_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "item_completed" + ] + } + } + }, + { + "type": "object", + "required": [ + "run", + "type" + ], + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "turn_id": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "hook_started" + ] + } + } + }, + { + "type": "object", + "required": [ + "run", + "type" + ], + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "turn_id": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "hook_completed" + ] + } + } + }, + { + "type": "object", + "required": [ + "delta", + "item_id", + "thread_id", + "turn_id", + "type" + ], + "properties": { + "delta": { + "type": "string" + }, + "item_id": { + "type": "string" + }, + "thread_id": { + "type": "string" + }, + "turn_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agent_message_content_delta" + ] + } + } + }, + { + "type": "object", + "required": [ + "delta", + "item_id", + "thread_id", + "turn_id", + "type" + ], + "properties": { + "delta": { + "type": "string" + }, + "item_id": { + "type": "string" + }, + "thread_id": { + "type": "string" + }, + "turn_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan_delta" + ] + } + } + }, + { + "type": "object", + "required": [ + "delta", + "item_id", + "thread_id", + "turn_id", + "type" + ], + "properties": { + "delta": { + "type": "string" + }, + "item_id": { + "type": "string" + }, + "summary_index": { + "default": 0, + "type": "integer", + "format": "int64" + }, + "thread_id": { + "type": "string" + }, + "turn_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "reasoning_content_delta" + ] + } + } + }, + { + "type": "object", + "required": [ + "delta", + "item_id", + "thread_id", + "turn_id", + "type" + ], + "properties": { + "content_index": { + "default": 0, + "type": "integer", + "format": "int64" + }, + "delta": { + "type": "string" + }, + "item_id": { + "type": "string" + }, + "thread_id": { + "type": "string" + }, + "turn_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "reasoning_raw_content_delta" + ] + } + } + }, + { + "description": "Collab interaction: agent spawn begin.", + "type": "object", + "required": [ + "call_id", + "model", + "prompt", + "reasoning_effort", + "sender_thread_id", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "model": { + "type": "string" + }, + "prompt": { + "description": "Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning.", + "type": "string" + }, + "reasoning_effort": { + "$ref": "#/definitions/ReasoningEffort" + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collab_agent_spawn_begin" + ] + } + } + }, + { + "description": "Collab interaction: agent spawn end.", + "type": "object", + "required": [ + "call_id", + "prompt", + "sender_thread_id", + "status", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "new_agent_nickname": { + "description": "Optional nickname assigned to the new agent.", + "type": [ + "string", + "null" + ] + }, + "new_agent_role": { + "description": "Optional role assigned to the new agent.", + "type": [ + "string", + "null" + ] + }, + "new_thread_id": { + "description": "Thread ID of the newly spawned agent, if it was created.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadId" + }, + { + "type": "null" + } + ] + }, + "prompt": { + "description": "Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning.", + "type": "string" + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "status": { + "description": "Last known status of the new agent reported to the sender agent.", + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collab_agent_spawn_end" + ] + } + } + }, + { + "description": "Collab interaction: agent interaction begin.", + "type": "object", + "required": [ + "call_id", + "prompt", + "receiver_thread_id", + "sender_thread_id", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "prompt": { + "description": "Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning.", + "type": "string" + }, + "receiver_thread_id": { + "description": "Thread ID of the receiver.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collab_agent_interaction_begin" + ] + } + } + }, + { + "description": "Collab interaction: agent interaction end.", + "type": "object", + "required": [ + "call_id", + "prompt", + "receiver_thread_id", + "sender_thread_id", + "status", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "prompt": { + "description": "Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning.", + "type": "string" + }, + "receiver_agent_nickname": { + "description": "Optional nickname assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_agent_role": { + "description": "Optional role assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_thread_id": { + "description": "Thread ID of the receiver.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "status": { + "description": "Last known status of the receiver agent reported to the sender agent.", + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collab_agent_interaction_end" + ] + } + } + }, + { + "description": "Collab interaction: waiting begin.", + "type": "object", + "required": [ + "call_id", + "receiver_thread_ids", + "sender_thread_id", + "type" + ], + "properties": { + "call_id": { + "description": "ID of the waiting call.", + "type": "string" + }, + "receiver_agents": { + "description": "Optional nicknames/roles for receivers.", + "type": "array", + "items": { + "$ref": "#/definitions/CollabAgentRef" + } + }, + "receiver_thread_ids": { + "description": "Thread ID of the receivers.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadId" + } + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collab_waiting_begin" + ] + } + } + }, + { + "description": "Collab interaction: waiting end.", + "type": "object", + "required": [ + "call_id", + "sender_thread_id", + "statuses", + "type" + ], + "properties": { + "agent_statuses": { + "description": "Optional receiver metadata paired with final statuses.", + "type": "array", + "items": { + "$ref": "#/definitions/CollabAgentStatusEntry" + } + }, + "call_id": { + "description": "ID of the waiting call.", + "type": "string" + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "statuses": { + "description": "Last known status of the receiver agents reported to the sender agent.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AgentStatus" + } + }, + "type": { + "type": "string", + "enum": [ + "collab_waiting_end" + ] + } + } + }, + { + "description": "Collab interaction: close begin.", + "type": "object", + "required": [ + "call_id", + "receiver_thread_id", + "sender_thread_id", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "receiver_thread_id": { + "description": "Thread ID of the receiver.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collab_close_begin" + ] + } + } + }, + { + "description": "Collab interaction: close end.", + "type": "object", + "required": [ + "call_id", + "receiver_thread_id", + "sender_thread_id", + "status", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "receiver_agent_nickname": { + "description": "Optional nickname assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_agent_role": { + "description": "Optional role assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_thread_id": { + "description": "Thread ID of the receiver.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "status": { + "description": "Last known status of the receiver agent reported to the sender agent before the close.", + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collab_close_end" + ] + } + } + }, + { + "description": "Collab interaction: resume begin.", + "type": "object", + "required": [ + "call_id", + "receiver_thread_id", + "sender_thread_id", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "receiver_agent_nickname": { + "description": "Optional nickname assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_agent_role": { + "description": "Optional role assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_thread_id": { + "description": "Thread ID of the receiver.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collab_resume_begin" + ] + } + } + }, + { + "description": "Collab interaction: resume end.", + "type": "object", + "required": [ + "call_id", + "receiver_thread_id", + "sender_thread_id", + "status", + "type" + ], + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "receiver_agent_nickname": { + "description": "Optional nickname assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_agent_role": { + "description": "Optional role assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_thread_id": { + "description": "Thread ID of the receiver.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "sender_thread_id": { + "description": "Thread ID of the sender.", + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ] + }, + "status": { + "description": "Last known status of the receiver agent reported to the sender agent after resume.", + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collab_resume_end" + ] + } + } + } + ] + }, + "ExecApprovalRequestSkillMetadata": { + "type": "object", + "required": [ + "path_to_skills_md" + ], + "properties": { + "path_to_skills_md": { + "type": "string" + } + } + }, + "ExecCommandSource": { + "type": "string", + "enum": [ + "agent", + "user_shell", + "unified_exec_startup", + "unified_exec_interaction" + ] + }, + "ExecCommandStatus": { + "type": "string", + "enum": [ + "completed", + "failed", + "declined" + ] + }, + "ExecOutputStream": { + "type": "string", + "enum": [ + "stdout", + "stderr" + ] + }, + "FileChange": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "add" + ] + } + } + }, + { + "type": "object", + "required": [ + "content", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "delete" + ] + } + } + }, + { + "type": "object", + "required": [ + "type", + "unified_diff" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ] + }, + "unified_diff": { + "type": "string" + } + } + } + ] + }, + "FileSystemPermissions": { + "type": "object", + "properties": { + "read": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "write": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "FunctionCallOutputBody": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/FunctionCallOutputContentItem" + } + } + ] + }, + "FunctionCallOutputContentItem": { + "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.", + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ] + } + } + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ] + } + } + } + ] + }, + "FunctionCallOutputPayload": { + "description": "The payload we send back to OpenAI when reporting a tool call result.\n\n`body` serializes directly as the wire value for `function_call_output.output`. `success` remains internal metadata for downstream handling.", + "type": "object", + "required": [ + "body" + ], + "properties": { + "body": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "success": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "GhostCommit": { + "description": "Details of a ghost commit created from a repository state.", + "type": "object", + "required": [ + "id", + "preexisting_untracked_dirs", + "preexisting_untracked_files" + ], + "properties": { + "id": { + "type": "string" + }, + "parent": { + "type": [ + "string", + "null" + ] + }, + "preexisting_untracked_dirs": { + "type": "array", + "items": { + "type": "string" + } + }, + "preexisting_untracked_files": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "description": "Current branch name", + "type": [ + "string", + "null" + ] + }, + "commit_hash": { + "description": "Current commit hash (SHA)", + "type": [ + "string", + "null" + ] + }, + "repository_url": { + "description": "Repository URL (if available from remote)", + "type": [ + "string", + "null" + ] + } + } + }, + "HistoryEntry": { + "type": "object", + "required": [ + "conversation_id", + "text", + "ts" + ], + "properties": { + "conversation_id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "ts": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + } + }, + "HookEventName": { + "type": "string", + "enum": [ + "session_start", + "stop" + ] + }, + "HookExecutionMode": { + "type": "string", + "enum": [ + "sync", + "async" + ] + }, + "HookHandlerType": { + "type": "string", + "enum": [ + "command", + "prompt", + "agent" + ] + }, + "HookOutputEntry": { + "type": "object", + "required": [ + "kind", + "text" + ], + "properties": { + "kind": { + "$ref": "#/definitions/HookOutputEntryKind" + }, + "text": { + "type": "string" + } + } + }, + "HookOutputEntryKind": { + "type": "string", + "enum": [ + "warning", + "stop", + "feedback", + "context", + "error" + ] + }, + "HookRunStatus": { + "type": "string", + "enum": [ + "running", + "completed", + "failed", + "blocked", + "stopped" + ] + }, + "HookRunSummary": { + "type": "object", + "required": [ + "display_order", + "entries", + "event_name", + "execution_mode", + "handler_type", + "id", + "scope", + "source_path", + "started_at", + "status" + ], + "properties": { + "completed_at": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "display_order": { + "type": "integer", + "format": "int64" + }, + "duration_ms": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/HookOutputEntry" + } + }, + "event_name": { + "$ref": "#/definitions/HookEventName" + }, + "execution_mode": { + "$ref": "#/definitions/HookExecutionMode" + }, + "handler_type": { + "$ref": "#/definitions/HookHandlerType" + }, + "id": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/HookScope" + }, + "source_path": { + "type": "string" + }, + "started_at": { + "type": "integer", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/HookRunStatus" + }, + "status_message": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookScope": { + "type": "string", + "enum": [ + "thread", + "turn" + ] + }, + "ImageDetail": { + "type": "string", + "enum": [ + "auto", + "low", + "high", + "original" + ] + }, + "LocalShellAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "timeout_ms": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "exec" + ] + }, + "user": { + "type": [ + "string", + "null" + ] + }, + "working_directory": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "LocalShellStatus": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "incomplete" + ] + }, + "MacOsAutomationPermission": { + "oneOf": [ + { + "type": "string", + "enum": [ + "none", + "all" + ] + }, + { + "type": "object", + "required": [ + "bundle_ids" + ], + "properties": { + "bundle_ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + ] + }, + "MacOsContactsPermission": { + "type": "string", + "enum": [ + "none", + "read_only", + "read_write" + ] + }, + "MacOsPreferencesPermission": { + "type": "string", + "enum": [ + "none", + "read_only", + "read_write" + ] + }, + "MacOsSeatbeltProfileExtensions": { + "type": "object", + "properties": { + "macos_accessibility": { + "default": false, + "type": "boolean" + }, + "macos_automation": { + "default": "none", + "allOf": [ + { + "$ref": "#/definitions/MacOsAutomationPermission" + } + ] + }, + "macos_calendar": { + "default": false, + "type": "boolean" + }, + "macos_contacts": { + "default": "none", + "allOf": [ + { + "$ref": "#/definitions/MacOsContactsPermission" + } + ] + }, + "macos_launch_services": { + "default": false, + "type": "boolean" + }, + "macos_preferences": { + "default": "read_only", + "allOf": [ + { + "$ref": "#/definitions/MacOsPreferencesPermission" + } + ] + }, + "macos_reminders": { + "default": false, + "type": "boolean" + } + } + }, + "McpAuthStatus": { + "type": "string", + "enum": [ + "unsupported", + "not_logged_in", + "bearer_token", + "o_auth" + ] + }, + "McpInvocation": { + "type": "object", + "required": [ + "server", + "tool" + ], + "properties": { + "arguments": { + "description": "Arguments to the tool call." + }, + "server": { + "description": "Name of the MCP server as defined in the config.", + "type": "string" + }, + "tool": { + "description": "Name of the tool as given by the MCP server.", + "type": "string" + } + } + }, + "McpStartupFailure": { + "type": "object", + "required": [ + "error", + "server" + ], + "properties": { + "error": { + "type": "string" + }, + "server": { + "type": "string" + } + } + }, + "McpStartupStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "state" + ], + "properties": { + "state": { + "type": "string", + "enum": [ + "starting" + ] + } + } + }, + { + "type": "object", + "required": [ + "state" + ], + "properties": { + "state": { + "type": "string", + "enum": [ + "ready" + ] + } + } + }, + { + "type": "object", + "required": [ + "error", + "state" + ], + "properties": { + "error": { + "type": "string" + }, + "state": { + "type": "string", + "enum": [ + "failed" + ] + } + } + }, + { + "type": "object", + "required": [ + "state" + ], + "properties": { + "state": { + "type": "string", + "enum": [ + "cancelled" + ] + } + } + } + ] + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "type": "string", + "enum": [ + "plan", + "default" + ] + }, + "ModelRerouteReason": { + "type": "string", + "enum": [ + "high_risk_cyber_activity" + ] + }, + "NetworkAccess": { + "description": "Represents whether outbound network access is available to the agent.", + "type": "string", + "enum": [ + "restricted", + "enabled" + ] + }, + "NetworkApprovalContext": { + "type": "object", + "required": [ + "host", + "protocol" + ], + "properties": { + "host": { + "type": "string" + }, + "protocol": { + "$ref": "#/definitions/NetworkApprovalProtocol" + } + } + }, + "NetworkApprovalProtocol": { + "type": "string", + "enum": [ + "http", + "https", + "socks5_tcp", + "socks5_udp" + ] + }, + "NetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "NetworkPolicyAmendment": { + "type": "object", + "required": [ + "action", + "host" + ], + "properties": { + "action": { + "$ref": "#/definitions/NetworkPolicyRuleAction" + }, + "host": { + "type": "string" + } + } + }, + "NetworkPolicyRuleAction": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + }, + "ParsedCommand": { + "oneOf": [ + { + "type": "object", + "required": [ + "cmd", + "name", + "path", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "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": "string" + }, + "type": { + "type": "string", + "enum": [ + "read" + ] + } + } + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "list_files" + ] + } + } + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ] + } + } + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ] + } + } + } + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "completed", + "failed", + "declined" + ] + }, + "PermissionProfile": { + "type": "object", + "properties": { + "file_system": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "macos": { + "anyOf": [ + { + "$ref": "#/definitions/MacOsSeatbeltProfileExtensions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/NetworkPermissions" + }, + { + "type": "null" + } + ] + } + } + }, + "Personality": { + "type": "string", + "enum": [ + "none", + "friendly", + "pragmatic" + ] + }, + "PlanItemArg": { + "type": "object", + "required": [ + "status", + "step" + ], + "properties": { + "status": { + "$ref": "#/definitions/StepStatus" + }, + "step": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PlanType": { + "type": "string", + "enum": [ + "free", + "go", + "plus", + "pro", + "team", + "business", + "enterprise", + "edu", + "unknown" + ] + }, + "RateLimitSnapshot": { + "type": "object", + "properties": { + "credits": { + "anyOf": [ + { + "$ref": "#/definitions/CreditsSnapshot" + }, + { + "type": "null" + } + ] + }, + "limit_id": { + "type": [ + "string", + "null" + ] + }, + "limit_name": { + "type": [ + "string", + "null" + ] + }, + "plan_type": { + "anyOf": [ + { + "$ref": "#/definitions/PlanType" + }, + { + "type": "null" + } + ] + }, + "primary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + }, + "secondary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + } + } + }, + "RateLimitWindow": { + "type": "object", + "required": [ + "used_percent" + ], + "properties": { + "resets_at": { + "description": "Unix timestamp (seconds since epoch) when the window resets.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "used_percent": { + "description": "Percentage (0-100) of the window that has been consumed.", + "type": "number", + "format": "double" + }, + "window_minutes": { + "description": "Rolling window duration, in minutes.", + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "ReadOnlyAccess": { + "description": "Determines how read-only file access is granted inside a restricted sandbox.", + "oneOf": [ + { + "description": "Restrict reads to an explicit set of roots.\n\nWhen `include_platform_defaults` is `true`, platform defaults required for basic execution are included in addition to `readable_roots`.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "include_platform_defaults": { + "description": "Include built-in platform read roots required for basic process execution.", + "default": true, + "type": "boolean" + }, + "readable_roots": { + "description": "Additional absolute roots that should be readable.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "type": { + "type": "string", + "enum": [ + "restricted" + ] + } + } + }, + { + "description": "Allow unrestricted file reads.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "full-access" + ] + } + } + } + ] + }, + "RealtimeAudioFrame": { + "type": "object", + "required": [ + "data", + "num_channels", + "sample_rate" + ], + "properties": { + "data": { + "type": "string" + }, + "num_channels": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "sample_rate": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "samples_per_channel": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "RealtimeEvent": { + "oneOf": [ + { + "type": "object", + "required": [ + "SessionUpdated" + ], + "properties": { + "SessionUpdated": { + "type": "object", + "required": [ + "session_id" + ], + "properties": { + "instructions": { + "type": [ + "string", + "null" + ] + }, + "session_id": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "InputTranscriptDelta" + ], + "properties": { + "InputTranscriptDelta": { + "$ref": "#/definitions/RealtimeTranscriptDelta" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "OutputTranscriptDelta" + ], + "properties": { + "OutputTranscriptDelta": { + "$ref": "#/definitions/RealtimeTranscriptDelta" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "AudioOut" + ], + "properties": { + "AudioOut": { + "$ref": "#/definitions/RealtimeAudioFrame" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ConversationItemAdded" + ], + "properties": { + "ConversationItemAdded": true + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "ConversationItemDone" + ], + "properties": { + "ConversationItemDone": { + "type": "object", + "required": [ + "item_id" + ], + "properties": { + "item_id": { + "type": "string" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "HandoffRequested" + ], + "properties": { + "HandoffRequested": { + "$ref": "#/definitions/RealtimeHandoffRequested" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "Error" + ], + "properties": { + "Error": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "RealtimeHandoffRequested": { + "type": "object", + "required": [ + "active_transcript", + "handoff_id", + "input_transcript", + "item_id" + ], + "properties": { + "active_transcript": { + "type": "array", + "items": { + "$ref": "#/definitions/RealtimeTranscriptEntry" + } + }, + "handoff_id": { + "type": "string" + }, + "input_transcript": { + "type": "string" + }, + "item_id": { + "type": "string" + } + } + }, + "RealtimeTranscriptDelta": { + "type": "object", + "required": [ + "delta" + ], + "properties": { + "delta": { + "type": "string" + } + } + }, + "RealtimeTranscriptEntry": { + "type": "object", + "required": [ + "role", + "text" + ], + "properties": { + "role": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "ReasoningItemContent": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "reasoning_text" + ] + } + } + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "text" + ] + } + } + } + ] + }, + "ReasoningItemReasoningSummary": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "summary_text" + ] + } + } + } + ] + }, + "ReasoningSummary": { + "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", + "oneOf": [ + { + "type": "string", + "enum": [ + "auto", + "concise", + "detailed" + ] + }, + { + "description": "Option to disable reasoning summaries.", + "type": "string", + "enum": [ + "none" + ] + } + ] + }, + "RejectConfig": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "description": "Reject MCP elicitation prompts.", + "type": "boolean" + }, + "request_permissions": { + "description": "Reject approval prompts related to built-in permission requests.", + "default": false, + "type": "boolean" + }, + "rules": { + "description": "Reject prompts triggered by execpolicy `prompt` rules.", + "type": "boolean" + }, + "sandbox_approval": { + "description": "Reject approval prompts related to sandbox escalation.", + "type": "boolean" + }, + "skill_approval": { + "description": "Reject approval prompts triggered by skill script execution.", + "default": false, + "type": "boolean" + } + } + }, + "RemoteSkillSummary": { + "type": "object", + "required": [ + "description", + "id", + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "RequestId": { + "description": "ID of a request, which can be either a string or an integer.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "RequestUserInputQuestion": { + "type": "object", + "required": [ + "header", + "id", + "question" + ], + "properties": { + "header": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isOther": { + "default": false, + "type": "boolean" + }, + "isSecret": { + "default": false, + "type": "boolean" + }, + "options": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/RequestUserInputQuestionOption" + } + }, + "question": { + "type": "string" + } + } + }, + "RequestUserInputQuestionOption": { + "type": "object", + "required": [ + "description", + "label" + ], + "properties": { + "description": { + "type": "string" + }, + "label": { + "type": "string" + } + } + }, + "Resource": { + "description": "A known resource that the server is capable of reading.", + "type": "object", + "required": [ + "name", + "uri" + ], + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "type": [ + "array", + "null" + ], + "items": true + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "size": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + } + }, + "ResourceTemplate": { + "description": "A template description for resources available on the server.", + "type": "object", + "required": [ + "name", + "uriTemplate" + ], + "properties": { + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uriTemplate": { + "type": "string" + } + } + }, + "ResponseItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "role", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/ContentItem" + } + }, + "end_turn": { + "type": [ + "boolean", + "null" + ] + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "role": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "message" + ] + } + } + }, + { + "type": "object", + "required": [ + "id", + "summary", + "type" + ], + "properties": { + "content": { + "default": null, + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ReasoningItemContent" + } + }, + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "id": { + "writeOnly": true, + "type": "string" + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/definitions/ReasoningItemReasoningSummary" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ] + } + } + }, + { + "type": "object", + "required": [ + "action", + "status", + "type" + ], + "properties": { + "action": { + "$ref": "#/definitions/LocalShellAction" + }, + "call_id": { + "description": "Set when using the Responses API.", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Legacy id field retained for compatibility with older payloads.", + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/LocalShellStatus" + }, + "type": { + "type": "string", + "enum": [ + "local_shell_call" + ] + } + } + }, + { + "type": "object", + "required": [ + "arguments", + "call_id", + "name", + "type" + ], + "properties": { + "arguments": { + "type": "string" + }, + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "function_call" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputPayload" + }, + "type": { + "type": "string", + "enum": [ + "function_call_output" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "input", + "name", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "input": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call" + ] + } + } + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputPayload" + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call_output" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "web_search_call" + ] + } + } + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "image_generation_call" + ] + } + } + }, + { + "type": "object", + "required": [ + "ghost_commit", + "type" + ], + "properties": { + "ghost_commit": { + "$ref": "#/definitions/GhostCommit" + }, + "type": { + "type": "string", + "enum": [ + "ghost_snapshot" + ] + } + } + }, + { + "type": "object", + "required": [ + "encrypted_content", + "type" + ], + "properties": { + "encrypted_content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "compaction" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ] + } + } + } + ] + }, + "ResponsesApiWebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "open_page" + ] + }, + "url": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "find_in_page" + ] + }, + "url": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ] + } + } + } + ] + }, + "Result_of_CallToolResult_or_String": { + "oneOf": [ + { + "type": "object", + "required": [ + "Ok" + ], + "properties": { + "Ok": { + "$ref": "#/definitions/CallToolResult" + } + } + }, + { + "type": "object", + "required": [ + "Err" + ], + "properties": { + "Err": { + "type": "string" + } + } + } + ] + }, + "ReviewCodeLocation": { + "description": "Location of the code related to a review finding.", + "type": "object", + "required": [ + "absolute_file_path", + "line_range" + ], + "properties": { + "absolute_file_path": { + "type": "string" + }, + "line_range": { + "$ref": "#/definitions/ReviewLineRange" + } + } + }, + "ReviewDecision": { + "description": "User's decision in response to an ExecApprovalRequest.", + "oneOf": [ + { + "description": "User has approved this command and the agent should execute it.", + "type": "string", + "enum": [ + "approved" + ] + }, + { + "description": "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", + "type": "object", + "required": [ + "approved_execpolicy_amendment" + ], + "properties": { + "approved_execpolicy_amendment": { + "type": "object", + "required": [ + "proposed_execpolicy_amendment" + ], + "properties": { + "proposed_execpolicy_amendment": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false + }, + { + "description": "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", + "type": "string", + "enum": [ + "approved_for_session" + ] + }, + { + "description": "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + } + } + }, + "additionalProperties": false + }, + { + "description": "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", + "type": "string", + "enum": [ + "denied" + ] + }, + { + "description": "User has denied this command and the agent should not do anything until the user's next command.", + "type": "string", + "enum": [ + "abort" + ] + } + ] + }, + "ReviewFinding": { + "description": "A single review finding describing an observed issue or recommendation.", + "type": "object", + "required": [ + "body", + "code_location", + "confidence_score", + "priority", + "title" + ], + "properties": { + "body": { + "type": "string" + }, + "code_location": { + "$ref": "#/definitions/ReviewCodeLocation" + }, + "confidence_score": { + "type": "number", + "format": "float" + }, + "priority": { + "type": "integer", + "format": "int32" + }, + "title": { + "type": "string" + } + } + }, + "ReviewLineRange": { + "description": "Inclusive line range in a file associated with the finding.", + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ReviewOutputEvent": { + "description": "Structured review result produced by a child review session.", + "type": "object", + "required": [ + "findings", + "overall_confidence_score", + "overall_correctness", + "overall_explanation" + ], + "properties": { + "findings": { + "type": "array", + "items": { + "$ref": "#/definitions/ReviewFinding" + } + }, + "overall_confidence_score": { + "type": "number", + "format": "float" + }, + "overall_correctness": { + "type": "string" + }, + "overall_explanation": { + "type": "string" + } + } + }, + "ReviewTarget": { + "oneOf": [ + { + "description": "Review the working tree: staged, unstaged, and untracked files.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "uncommittedChanges" + ] + } + } + }, + { + "description": "Review changes between the current branch and the given base branch.", + "type": "object", + "required": [ + "branch", + "type" + ], + "properties": { + "branch": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "baseBranch" + ] + } + } + }, + { + "description": "Review the changes introduced by a specific commit.", + "type": "object", + "required": [ + "sha", + "type" + ], + "properties": { + "sha": { + "type": "string" + }, + "title": { + "description": "Optional human-readable label (e.g., commit subject) for UIs.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "commit" + ] + } + } + }, + { + "description": "Arbitrary instructions provided by the user.", + "type": "object", + "required": [ + "instructions", + "type" + ], + "properties": { + "instructions": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "custom" + ] + } + } + } + ] + }, + "SandboxPolicy": { + "description": "Determines execution restrictions for model shell commands.", + "oneOf": [ + { + "description": "No restrictions whatsoever. Use with caution.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "danger-full-access" + ] + } + } + }, + { + "description": "Read-only access configuration.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "access": { + "description": "Read access granted while running under this policy.", + "allOf": [ + { + "$ref": "#/definitions/ReadOnlyAccess" + } + ] + }, + "network_access": { + "description": "When set to `true`, outbound network access is allowed. `false` by default.", + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "read-only" + ] + } + } + }, + { + "description": "Indicates the process is already in an external sandbox. Allows full disk access while honoring the provided network setting.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "network_access": { + "description": "Whether the external sandbox permits outbound network traffic.", + "default": "restricted", + "allOf": [ + { + "$ref": "#/definitions/NetworkAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "external-sandbox" + ] + } + } + }, + { + "description": "Same as `ReadOnly` but additionally grants write access to the current working directory (\"workspace\").", + "type": "object", + "required": [ + "type" + ], + "properties": { + "exclude_slash_tmp": { + "description": "When set to `true`, will NOT include the `/tmp` among the default writable roots on UNIX. Defaults to `false`.", + "default": false, + "type": "boolean" + }, + "exclude_tmpdir_env_var": { + "description": "When set to `true`, will NOT include the per-user `TMPDIR` environment variable among the default writable roots. Defaults to `false`.", + "default": false, + "type": "boolean" + }, + "network_access": { + "description": "When set to `true`, outbound network access is allowed. `false` by default.", + "default": false, + "type": "boolean" + }, + "read_only_access": { + "description": "Read access granted while running under this policy.", + "allOf": [ + { + "$ref": "#/definitions/ReadOnlyAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "workspace-write" + ] + }, + "writable_roots": { + "description": "Additional folders (beyond cwd and possibly TMPDIR) that should be writable from within the sandbox.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + } + ] + }, + "ServiceTier": { + "type": "string", + "enum": [ + "fast", + "flex" + ] + }, + "SessionMetaLine": { + "description": "SessionMeta contains session-level data that doesn't correspond to a specific turn.\n\nNOTE: There used to be an `instructions` field here, which stored user_instructions, but we now save that on TurnContext. base_instructions stores the base instructions for the session, and should be used when there is no config override.", + "type": "object", + "required": [ + "cli_version", + "cwd", + "id", + "originator", + "timestamp" + ], + "properties": { + "agent_nickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agent_role": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "base_instructions": { + "description": "base_instructions for the session. This *should* always be present when creating a new session, but may be missing for older sessions. If not present, fall back to rendering the base_instructions from ModelsManager.", + "anyOf": [ + { + "$ref": "#/definitions/base_instructions" + }, + { + "type": "null" + } + ] + }, + "cli_version": { + "type": "string" + }, + "cwd": { + "type": "string" + }, + "dynamic_tools": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolSpec" + } + }, + "forked_from_id": { + "anyOf": [ + { + "$ref": "#/definitions/ThreadId" + }, + { + "type": "null" + } + ] + }, + "git": { + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "$ref": "#/definitions/ThreadId" + }, + "memory_mode": { + "type": [ + "string", + "null" + ] + }, + "model_provider": { + "type": [ + "string", + "null" + ] + }, + "originator": { + "type": "string" + }, + "source": { + "default": "vscode", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "timestamp": { + "type": "string" + } + } + }, + "SessionNetworkProxyRuntime": { + "type": "object", + "required": [ + "http_addr", + "socks_addr" + ], + "properties": { + "http_addr": { + "type": "string" + }, + "socks_addr": { + "type": "string" + } + } + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "mcp", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "subagent" + ], + "properties": { + "subagent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false + } + ] + }, + "Settings": { + "description": "Settings for a collaboration mode.", + "type": "object", + "required": [ + "model" + ], + "properties": { + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": "string" + }, + "reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + } + } + }, + "SkillDependencies": { + "type": "object", + "required": [ + "tools" + ], + "properties": { + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillToolDependency" + } + } + } + }, + "SkillErrorInfo": { + "type": "object", + "required": [ + "message", + "path" + ], + "properties": { + "message": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "SkillInterface": { + "type": "object", + "properties": { + "brand_color": { + "type": [ + "string", + "null" + ] + }, + "default_prompt": { + "type": [ + "string", + "null" + ] + }, + "display_name": { + "type": [ + "string", + "null" + ] + }, + "icon_large": { + "type": [ + "string", + "null" + ] + }, + "icon_small": { + "type": [ + "string", + "null" + ] + }, + "short_description": { + "type": [ + "string", + "null" + ] + } + } + }, + "SkillMetadata": { + "type": "object", + "required": [ + "description", + "enabled", + "name", + "path", + "scope" + ], + "properties": { + "dependencies": { + "anyOf": [ + { + "$ref": "#/definitions/SkillDependencies" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/SkillInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/SkillScope" + }, + "short_description": { + "description": "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", + "type": [ + "string", + "null" + ] + } + } + }, + "SkillScope": { + "type": "string", + "enum": [ + "user", + "repo", + "system", + "admin" + ] + }, + "SkillToolDependency": { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "command": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "transport": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string" + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "value": { + "type": "string" + } + } + }, + "SkillsListEntry": { + "type": "object", + "required": [ + "cwd", + "errors", + "skills" + ], + "properties": { + "cwd": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillErrorInfo" + } + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillMetadata" + } + } + } + }, + "StepStatus": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed" + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byte_range" + ], + "properties": { + "byte_range": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadId": { + "type": "string" + }, + "TokenUsage": { + "type": "object", + "required": [ + "cached_input_tokens", + "input_tokens", + "output_tokens", + "reasoning_output_tokens", + "total_tokens" + ], + "properties": { + "cached_input_tokens": { + "type": "integer", + "format": "int64" + }, + "input_tokens": { + "type": "integer", + "format": "int64" + }, + "output_tokens": { + "type": "integer", + "format": "int64" + }, + "reasoning_output_tokens": { + "type": "integer", + "format": "int64" + }, + "total_tokens": { + "type": "integer", + "format": "int64" + } + } + }, + "TokenUsageInfo": { + "type": "object", + "required": [ + "last_token_usage", + "total_token_usage" + ], + "properties": { + "last_token_usage": { + "$ref": "#/definitions/TokenUsage" + }, + "model_context_window": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "total_token_usage": { + "$ref": "#/definitions/TokenUsage" + } + } + }, + "Tool": { + "description": "Definition for a tool the client can call.", + "type": "object", + "required": [ + "inputSchema", + "name" + ], + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "type": [ + "array", + "null" + ], + "items": true + }, + "inputSchema": true, + "name": { + "type": "string" + }, + "outputSchema": true, + "title": { + "type": [ + "string", + "null" + ] + } + } + }, + "TruncationPolicy": { + "oneOf": [ + { + "type": "object", + "required": [ + "limit", + "mode" + ], + "properties": { + "limit": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "mode": { + "type": "string", + "enum": [ + "bytes" + ] + } + } + }, + { + "type": "object", + "required": [ + "limit", + "mode" + ], + "properties": { + "limit": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "mode": { + "type": "string", + "enum": [ + "tokens" + ] + } + } + } + ] + }, + "TurnAbortReason": { + "type": "string", + "enum": [ + "interrupted", + "replaced", + "review_ended" + ] + }, + "TurnContextItem": { + "description": "Persist once per real user turn after computing that turn's model-visible context updates, and again after mid-turn compaction when replacement history re-establishes full context, so resume/fork replay can recover the latest durable baseline.", + "type": "object", + "required": [ + "approval_policy", + "cwd", + "model", + "sandbox_policy", + "summary" + ], + "properties": { + "approval_policy": { + "$ref": "#/definitions/AskForApproval" + }, + "collaboration_mode": { + "anyOf": [ + { + "$ref": "#/definitions/CollaborationMode" + }, + { + "type": "null" + } + ] + }, + "current_date": { + "type": [ + "string", + "null" + ] + }, + "cwd": { + "type": "string" + }, + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "final_output_json_schema": true, + "model": { + "type": "string" + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/TurnContextNetworkItem" + }, + { + "type": "null" + } + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "realtime_active": { + "type": [ + "boolean", + "null" + ] + }, + "sandbox_policy": { + "$ref": "#/definitions/SandboxPolicy" + }, + "summary": { + "$ref": "#/definitions/ReasoningSummary" + }, + "timezone": { + "type": [ + "string", + "null" + ] + }, + "trace_id": { + "type": [ + "string", + "null" + ] + }, + "truncation_policy": { + "anyOf": [ + { + "$ref": "#/definitions/TruncationPolicy" + }, + { + "type": "null" + } + ] + }, + "turn_id": { + "type": [ + "string", + "null" + ] + }, + "user_instructions": { + "type": [ + "string", + "null" + ] + } + } + }, + "TurnContextNetworkItem": { + "type": "object", + "required": [ + "allowed_domains", + "denied_domains" + ], + "properties": { + "allowed_domains": { + "type": "array", + "items": { + "type": "string" + } + }, + "denied_domains": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "TurnItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "UserMessage" + ] + } + } + }, + { + "description": "Assistant-authored message payload used in turn-item streams.\n\n`phase` is optional because not all providers/models emit it. Consumers should use it when present, but retain legacy completion semantics when it is `None`.", + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/AgentMessageContent" + } + }, + "id": { + "type": "string" + }, + "phase": { + "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.", + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "AgentMessage" + ] + } + } + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "Plan" + ] + } + } + }, + { + "type": "object", + "required": [ + "id", + "summary_text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "raw_content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "summary_text": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "Reasoning" + ] + } + } + }, + { + "type": "object", + "required": [ + "action", + "id", + "query", + "type" + ], + "properties": { + "action": { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "WebSearch" + ] + } + } + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "saved_path": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "ImageGeneration" + ] + } + } + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "ContextCompaction" + ] + } + } + } + ] + }, + "UserInput": { + "description": "User input", + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` that should be treated as special elements. These are byte ranges into the UTF-8 `text` buffer and are used to render or persist rich input markers (e.g., image placeholders) across history and resume without mutating the literal text.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ] + } + } + }, + { + "description": "Pre‑encoded data: URI image.", + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "image" + ] + } + } + }, + { + "description": "Local image path provided by the user. This will be converted to an `Image` variant (base64 data URL) during request serialization.", + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "local_image" + ] + } + } + }, + { + "description": "Skill selected by the user (name + path to SKILL.md).", + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ] + } + } + }, + { + "description": "Explicit structured mention selected by the user.\n\n`path` identifies the exact mention target, for example `app://` or `plugin://@`.", + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ] + } + } + } + ] + }, + "base_instructions": { + "description": "Base instructions for the model in a thread. Corresponds to the `instructions` field in the ResponsesAPI.", + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string" + } + } + } + } +} \ No newline at end of file From 2d18d1cec8f2ef45da4b709cc4f611415e1e9f26 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 13:02:32 -0700 Subject: [PATCH 04/18] update --- .../rollout-line.schema.json} | 0 .../protocol/generated/rollout-line.schema.ts | 1360 +++++++++++++++++ .../bin/codex-write-rollout-line-schema.rs | 86 +- 3 files changed, 1444 insertions(+), 2 deletions(-) rename codex-rs/protocol/{schema/rollout_line/RolloutLine.schema.json => generated/rollout-line.schema.json} (100%) create mode 100644 codex-rs/protocol/generated/rollout-line.schema.ts diff --git a/codex-rs/protocol/schema/rollout_line/RolloutLine.schema.json b/codex-rs/protocol/generated/rollout-line.schema.json similarity index 100% rename from codex-rs/protocol/schema/rollout_line/RolloutLine.schema.json rename to codex-rs/protocol/generated/rollout-line.schema.json diff --git a/codex-rs/protocol/generated/rollout-line.schema.ts b/codex-rs/protocol/generated/rollout-line.schema.ts new file mode 100644 index 00000000000..f221a0e032c --- /dev/null +++ b/codex-rs/protocol/generated/rollout-line.schema.ts @@ -0,0 +1,1360 @@ +// GENERATED CODE! DO NOT MODIFY BY HAND! + +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * A path that is guaranteed to be absolute and normalized (though it is not + * guaranteed to be canonicalized or exist on the filesystem). + * + * IMPORTANT: 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. + */ +export type AbsolutePathBuf = string; + +export type AgentMessageContent = { "type": "Text", text: string, }; + +export type AgentMessageContentDeltaEvent = { thread_id: string, turn_id: string, item_id: string, delta: string, }; + +export type AgentMessageDeltaEvent = { delta: string, }; + +export type AgentMessageEvent = { message: string, phase: MessagePhase | null, }; + +/** + * Assistant-authored message payload used in turn-item streams. + * + * `phase` is optional because not all providers/models emit it. Consumers + * should use it when present, but retain legacy completion semantics when it + * is `None`. + */ +export type AgentMessageItem = { id: string, content: Array, +/** + * Optional phase metadata carried through from `ResponseItem::Message`. + * + * This is currently used by TUI rendering to distinguish mid-turn + * commentary from a final answer and avoid status-indicator jitter. + */ +phase?: MessagePhase, }; + +export type AgentReasoningDeltaEvent = { delta: string, }; + +export type AgentReasoningEvent = { text: string, }; + +export type AgentReasoningRawContentDeltaEvent = { delta: string, }; + +export type AgentReasoningRawContentEvent = { text: string, }; + +export type AgentReasoningSectionBreakEvent = { item_id: string, summary_index: bigint, }; + +/** + * Agent lifecycle status, derived from emitted events. + */ +export type AgentStatus = "pending_init" | "running" | { "completed": string | null } | { "errored": string } | "shutdown" | "not_found"; + +export type ApplyPatchApprovalRequestEvent = { +/** + * Responses API call id for the associated patch apply call, if available. + */ +call_id: string, +/** + * Turn ID that this patch belongs to. + * Uses `#[serde(default)]` for backwards compatibility with older senders. + */ +turn_id: string, changes: { [key in string]?: FileChange }, +/** + * Optional explanatory reason (e.g. request for extra write access). + */ +reason: string | null, +/** + * When set, the agent is asking the user to allow writes under this root for the remainder of the session. + */ +grant_root: string | null, }; + +/** + * Determines the conditions under which the user is consulted to approve + * running the command proposed by Codex. + */ +export type AskForApproval = "untrusted" | "on-failure" | "on-request" | { "reject": RejectConfig } | "never"; + +export type BackgroundEventEvent = { message: string, }; + +export type ByteRange = { +/** + * Start byte offset (inclusive) within the UTF-8 text buffer. + */ +start: number, +/** + * End byte offset (exclusive) within the UTF-8 text buffer. + */ +end: number, }; + +/** + * The server's response to a tool call. + */ +export type CallToolResult = { content: Array, structuredContent?: JsonValue, isError?: boolean, _meta?: JsonValue, }; + +/** + * Codex errors that we expose to clients. + */ +export type CodexErrorInfo = "context_window_exceeded" | "usage_limit_exceeded" | "server_overloaded" | { "http_connection_failed": { http_status_code: number | null, } } | { "response_stream_connection_failed": { http_status_code: number | null, } } | "internal_server_error" | "unauthorized" | "bad_request" | "sandbox_error" | { "response_stream_disconnected": { http_status_code: number | null, } } | { "response_too_many_failed_attempts": { http_status_code: number | null, } } | "thread_rollback_failed" | "other"; + +export type CollabAgentInteractionBeginEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, +/** + * Prompt sent from the sender to the receiver. Can be empty to prevent CoT + * leaking at the beginning. + */ +prompt: string, }; + +export type CollabAgentInteractionEndEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, +/** + * Optional nickname assigned to the receiver agent. + */ +receiver_agent_nickname?: string | null, +/** + * Optional role assigned to the receiver agent. + */ +receiver_agent_role?: string | null, +/** + * Prompt sent from the sender to the receiver. Can be empty to prevent CoT + * leaking at the beginning. + */ +prompt: string, +/** + * Last known status of the receiver agent reported to the sender agent. + */ +status: AgentStatus, }; + +export type CollabAgentRef = { +/** + * Thread ID of the receiver/new agent. + */ +thread_id: ThreadId, +/** + * Optional nickname assigned to an AgentControl-spawned sub-agent. + */ +agent_nickname?: string | null, +/** + * Optional role (agent_role) assigned to an AgentControl-spawned sub-agent. + */ +agent_role?: string | null, }; + +export type CollabAgentSpawnBeginEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the + * beginning. + */ +prompt: string, model: string, reasoning_effort: ReasoningEffort, }; + +export type CollabAgentSpawnEndEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the newly spawned agent, if it was created. + */ +new_thread_id: ThreadId | null, +/** + * Optional nickname assigned to the new agent. + */ +new_agent_nickname?: string | null, +/** + * Optional role assigned to the new agent. + */ +new_agent_role?: string | null, +/** + * Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the + * beginning. + */ +prompt: string, +/** + * Last known status of the new agent reported to the sender agent. + */ +status: AgentStatus, }; + +export type CollabAgentStatusEntry = { +/** + * Thread ID of the receiver/new agent. + */ +thread_id: ThreadId, +/** + * Optional nickname assigned to an AgentControl-spawned sub-agent. + */ +agent_nickname?: string | null, +/** + * Optional role (agent_role) assigned to an AgentControl-spawned sub-agent. + */ +agent_role?: string | null, +/** + * Last known status of the agent. + */ +status: AgentStatus, }; + +export type CollabCloseBeginEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, }; + +export type CollabCloseEndEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, +/** + * Optional nickname assigned to the receiver agent. + */ +receiver_agent_nickname?: string | null, +/** + * Optional role assigned to the receiver agent. + */ +receiver_agent_role?: string | null, +/** + * Last known status of the receiver agent reported to the sender agent before + * the close. + */ +status: AgentStatus, }; + +export type CollabResumeBeginEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, +/** + * Optional nickname assigned to the receiver agent. + */ +receiver_agent_nickname?: string | null, +/** + * Optional role assigned to the receiver agent. + */ +receiver_agent_role?: string | null, }; + +export type CollabResumeEndEvent = { +/** + * Identifier for the collab tool call. + */ +call_id: string, +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receiver. + */ +receiver_thread_id: ThreadId, +/** + * Optional nickname assigned to the receiver agent. + */ +receiver_agent_nickname?: string | null, +/** + * Optional role assigned to the receiver agent. + */ +receiver_agent_role?: string | null, +/** + * Last known status of the receiver agent reported to the sender agent after + * resume. + */ +status: AgentStatus, }; + +export type CollabWaitingBeginEvent = { +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * Thread ID of the receivers. + */ +receiver_thread_ids: Array, +/** + * Optional nicknames/roles for receivers. + */ +receiver_agents?: Array, +/** + * ID of the waiting call. + */ +call_id: string, }; + +export type CollabWaitingEndEvent = { +/** + * Thread ID of the sender. + */ +sender_thread_id: ThreadId, +/** + * ID of the waiting call. + */ +call_id: string, +/** + * Optional receiver metadata paired with final statuses. + */ +agent_statuses?: Array, +/** + * Last known status of the receiver agents reported to the sender agent. + */ +statuses: { [key in ThreadId]?: AgentStatus }, }; + +/** + * Collaboration mode for a Codex session. + */ +export type CollaborationMode = { mode: ModeKind, settings: Settings, }; + +export type CompactedItem = { message: string, replacement_history?: Array | null, }; + +export type ContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, } | { "type": "output_text", text: string, }; + +export type ContextCompactedEvent = null; + +export type ContextCompactionItem = { id: string, }; + +export type CreditsSnapshot = { has_credits: boolean, unlimited: boolean, balance: string | null, }; + +export type CustomPrompt = { name: string, path: string, content: string, description: string | null, argument_hint: string | null, }; + +export type DeprecationNoticeEvent = { +/** + * Concise summary of what is deprecated. + */ +summary: string, +/** + * Optional extra guidance, such as migration steps or rationale. + */ +details: string | null, }; + +export type DynamicToolCallOutputContentItem = { "type": "inputText", text: string, } | { "type": "inputImage", imageUrl: string, }; + +export type DynamicToolCallRequest = { callId: string, turnId: string, tool: string, arguments: JsonValue, }; + +export type DynamicToolCallResponseEvent = { +/** + * Identifier for the corresponding DynamicToolCallRequest. + */ +call_id: string, +/** + * Turn ID that this dynamic tool call belongs to. + */ +turn_id: string, +/** + * Dynamic tool name. + */ +tool: string, +/** + * Dynamic tool call arguments. + */ +arguments: JsonValue, +/** + * Dynamic tool response content items. + */ +content_items: Array, +/** + * Whether the tool call succeeded. + */ +success: boolean, +/** + * Optional error text when the tool call failed before producing a response. + */ +error: string | null, +/** + * The duration of the dynamic tool call. + */ +duration: string, }; + +export type DynamicToolSpec = { name: string, description: string, inputSchema: JsonValue, }; + +export type ElicitationRequest = { "mode": "form", _meta?: JsonValue, message: string, requested_schema: JsonValue, } | { "mode": "url", _meta?: JsonValue, message: string, url: string, elicitation_id: string, }; + +export type ElicitationRequestEvent = { +/** + * Turn ID that this elicitation belongs to, when known. + */ +turn_id?: string, server_name: string, id: string | number, request: ElicitationRequest, }; + +export type ErrorEvent = { message: string, codex_error_info: CodexErrorInfo | null, }; + +/** + * Response event from the agent + * NOTE: Make sure none of these values have optional types, as it will mess up the extension code-gen. + */ +export type EventMsg = { "type": "error" } & ErrorEvent | { "type": "warning" } & WarningEvent | { "type": "realtime_conversation_started" } & RealtimeConversationStartedEvent | { "type": "realtime_conversation_realtime" } & RealtimeConversationRealtimeEvent | { "type": "realtime_conversation_closed" } & RealtimeConversationClosedEvent | { "type": "model_reroute" } & ModelRerouteEvent | { "type": "context_compacted" } & ContextCompactedEvent | { "type": "thread_rolled_back" } & ThreadRolledBackEvent | { "type": "task_started" } & TurnStartedEvent | { "type": "task_complete" } & TurnCompleteEvent | { "type": "token_count" } & TokenCountEvent | { "type": "agent_message" } & AgentMessageEvent | { "type": "user_message" } & UserMessageEvent | { "type": "agent_message_delta" } & AgentMessageDeltaEvent | { "type": "agent_reasoning" } & AgentReasoningEvent | { "type": "agent_reasoning_delta" } & AgentReasoningDeltaEvent | { "type": "agent_reasoning_raw_content" } & AgentReasoningRawContentEvent | { "type": "agent_reasoning_raw_content_delta" } & AgentReasoningRawContentDeltaEvent | { "type": "agent_reasoning_section_break" } & AgentReasoningSectionBreakEvent | { "type": "session_configured" } & SessionConfiguredEvent | { "type": "thread_name_updated" } & ThreadNameUpdatedEvent | { "type": "mcp_startup_update" } & McpStartupUpdateEvent | { "type": "mcp_startup_complete" } & McpStartupCompleteEvent | { "type": "mcp_tool_call_begin" } & McpToolCallBeginEvent | { "type": "mcp_tool_call_end" } & McpToolCallEndEvent | { "type": "web_search_begin" } & WebSearchBeginEvent | { "type": "web_search_end" } & WebSearchEndEvent | { "type": "image_generation_begin" } & ImageGenerationBeginEvent | { "type": "image_generation_end" } & ImageGenerationEndEvent | { "type": "exec_command_begin" } & ExecCommandBeginEvent | { "type": "exec_command_output_delta" } & ExecCommandOutputDeltaEvent | { "type": "terminal_interaction" } & TerminalInteractionEvent | { "type": "exec_command_end" } & ExecCommandEndEvent | { "type": "view_image_tool_call" } & ViewImageToolCallEvent | { "type": "exec_approval_request" } & ExecApprovalRequestEvent | { "type": "request_permissions" } & RequestPermissionsEvent | { "type": "request_user_input" } & RequestUserInputEvent | { "type": "dynamic_tool_call_request" } & DynamicToolCallRequest | { "type": "dynamic_tool_call_response" } & DynamicToolCallResponseEvent | { "type": "elicitation_request" } & ElicitationRequestEvent | { "type": "apply_patch_approval_request" } & ApplyPatchApprovalRequestEvent | { "type": "deprecation_notice" } & DeprecationNoticeEvent | { "type": "background_event" } & BackgroundEventEvent | { "type": "undo_started" } & UndoStartedEvent | { "type": "undo_completed" } & UndoCompletedEvent | { "type": "stream_error" } & StreamErrorEvent | { "type": "patch_apply_begin" } & PatchApplyBeginEvent | { "type": "patch_apply_end" } & PatchApplyEndEvent | { "type": "turn_diff" } & TurnDiffEvent | { "type": "get_history_entry_response" } & GetHistoryEntryResponseEvent | { "type": "mcp_list_tools_response" } & McpListToolsResponseEvent | { "type": "list_custom_prompts_response" } & ListCustomPromptsResponseEvent | { "type": "list_skills_response" } & ListSkillsResponseEvent | { "type": "list_remote_skills_response" } & ListRemoteSkillsResponseEvent | { "type": "remote_skill_downloaded" } & RemoteSkillDownloadedEvent | { "type": "skills_update_available" } | { "type": "plan_update" } & UpdatePlanArgs | { "type": "turn_aborted" } & TurnAbortedEvent | { "type": "shutdown_complete" } | { "type": "entered_review_mode" } & ReviewRequest | { "type": "exited_review_mode" } & ExitedReviewModeEvent | { "type": "raw_response_item" } & RawResponseItemEvent | { "type": "item_started" } & ItemStartedEvent | { "type": "item_completed" } & ItemCompletedEvent | { "type": "hook_started" } & HookStartedEvent | { "type": "hook_completed" } & HookCompletedEvent | { "type": "agent_message_content_delta" } & AgentMessageContentDeltaEvent | { "type": "plan_delta" } & PlanDeltaEvent | { "type": "reasoning_content_delta" } & ReasoningContentDeltaEvent | { "type": "reasoning_raw_content_delta" } & ReasoningRawContentDeltaEvent | { "type": "collab_agent_spawn_begin" } & CollabAgentSpawnBeginEvent | { "type": "collab_agent_spawn_end" } & CollabAgentSpawnEndEvent | { "type": "collab_agent_interaction_begin" } & CollabAgentInteractionBeginEvent | { "type": "collab_agent_interaction_end" } & CollabAgentInteractionEndEvent | { "type": "collab_waiting_begin" } & CollabWaitingBeginEvent | { "type": "collab_waiting_end" } & CollabWaitingEndEvent | { "type": "collab_close_begin" } & CollabCloseBeginEvent | { "type": "collab_close_end" } & CollabCloseEndEvent | { "type": "collab_resume_begin" } & CollabResumeBeginEvent | { "type": "collab_resume_end" } & CollabResumeEndEvent; + +export type ExecApprovalRequestEvent = { +/** + * Identifier for the associated command execution item. + */ +call_id: string, +/** + * Identifier for this specific approval callback. + * + * When absent, the approval is for the command item itself (`call_id`). + * This is present for subcommand approvals (via execve intercept). + */ +approval_id?: string, +/** + * Turn ID that this command belongs to. + * Uses `#[serde(default)]` for backwards compatibility. + */ +turn_id: string, +/** + * The command to be executed. + */ +command: Array, +/** + * The command's working directory. + */ +cwd: string, +/** + * Optional human-readable reason for the approval (e.g. retry without sandbox). + */ +reason: string | null, +/** + * Optional network context for a blocked request that can be approved. + */ +network_approval_context?: NetworkApprovalContext, +/** + * Proposed execpolicy amendment that can be applied to allow future runs. + */ +proposed_execpolicy_amendment?: ExecPolicyAmendment, +/** + * Proposed network policy amendments (for example allow/deny this host in future). + */ +proposed_network_policy_amendments?: Array, +/** + * Optional additional filesystem permissions requested for this command. + */ +additional_permissions?: PermissionProfile, +/** + * Optional skill metadata when the approval was triggered by a skill script. + */ +skill_metadata?: ExecApprovalRequestSkillMetadata, +/** + * Ordered list of decisions the client may present for this prompt. + * + * When absent, clients should derive the legacy default set from the + * other fields on this request. + */ +available_decisions?: Array, parsed_cmd: Array, }; + +export type ExecApprovalRequestSkillMetadata = { path_to_skills_md: string, }; + +export type ExecCommandBeginEvent = { +/** + * Identifier so this can be paired with the ExecCommandEnd event. + */ +call_id: string, +/** + * Identifier for the underlying PTY process (when available). + */ +process_id?: string, +/** + * Turn ID that this command belongs to. + */ +turn_id: string, +/** + * The command to be executed. + */ +command: Array, +/** + * The command's working directory if not the default cwd for the agent. + */ +cwd: string, parsed_cmd: Array, +/** + * Where the command originated. Defaults to Agent for backward compatibility. + */ +source: ExecCommandSource, +/** + * Raw input sent to a unified exec session (if this is an interaction event). + */ +interaction_input?: string, }; + +export type ExecCommandEndEvent = { +/** + * Identifier for the ExecCommandBegin that finished. + */ +call_id: string, +/** + * Identifier for the underlying PTY process (when available). + */ +process_id?: string, +/** + * Turn ID that this command belongs to. + */ +turn_id: string, +/** + * The command that was executed. + */ +command: Array, +/** + * The command's working directory if not the default cwd for the agent. + */ +cwd: string, parsed_cmd: Array, +/** + * Where the command originated. Defaults to Agent for backward compatibility. + */ +source: ExecCommandSource, +/** + * Raw input sent to a unified exec session (if this is an interaction event). + */ +interaction_input?: string, +/** + * Captured stdout + */ +stdout: string, +/** + * Captured stderr + */ +stderr: string, +/** + * Captured aggregated output + */ +aggregated_output: string, +/** + * The command's exit code. + */ +exit_code: number, +/** + * The duration of the command execution. + */ +duration: string, +/** + * Formatted output from the command, as seen by the model. + */ +formatted_output: string, +/** + * Completion status for this command execution. + */ +status: ExecCommandStatus, }; + +export type ExecCommandOutputDeltaEvent = { +/** + * Identifier for the ExecCommandBegin that produced this chunk. + */ +call_id: string, +/** + * Which stream produced this chunk. + */ +stream: ExecOutputStream, +/** + * Raw bytes from the stream (may not be valid UTF-8). + */ +chunk: string, }; + +export type ExecCommandSource = "agent" | "user_shell" | "unified_exec_startup" | "unified_exec_interaction"; + +export type ExecCommandStatus = "completed" | "failed" | "declined"; + +export type ExecOutputStream = "stdout" | "stderr"; + +/** + * Proposed execpolicy change to allow commands starting with this prefix. + * + * The `command` tokens form the prefix that would be added as an execpolicy + * `prefix_rule(..., decision="allow")`, letting the agent bypass approval for + * commands that start with this token sequence. + */ +export type ExecPolicyAmendment = Array; + +export type ExitedReviewModeEvent = { review_output: ReviewOutputEvent | null, }; + +export type FileChange = { "type": "add", content: string, } | { "type": "delete", content: string, } | { "type": "update", unified_diff: string, move_path: string | null, }; + +export type FileSystemPermissions = { read: Array | null, write: Array | null, }; + +export type FunctionCallOutputBody = string | Array; + +/** + * 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. + */ +export type FunctionCallOutputContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, detail?: ImageDetail, }; + +/** + * The payload we send back to OpenAI when reporting a tool call result. + * + * `body` serializes directly as the wire value for `function_call_output.output`. + * `success` remains internal metadata for downstream handling. + */ +export type FunctionCallOutputPayload = { body: FunctionCallOutputBody, success: boolean | null, }; + +export type GetHistoryEntryResponseEvent = { offset: number, log_id: bigint, +/** + * The entry at the requested offset, if available and parseable. + */ +entry: HistoryEntry | null, }; + +/** + * Details of a ghost commit created from a repository state. + */ +export type GhostCommit = { id: string, parent: string | null, preexisting_untracked_files: Array, preexisting_untracked_dirs: Array, }; + +export type GitInfo = { +/** + * Current commit hash (SHA) + */ +commit_hash: string | null, +/** + * Current branch name + */ +branch: string | null, +/** + * Repository URL (if available from remote) + */ +repository_url: string | null, }; + +export type HistoryEntry = { conversation_id: string, ts: bigint, text: string, }; + +export type HookCompletedEvent = { turn_id: string | null, run: HookRunSummary, }; + +export type HookEventName = "session_start" | "stop"; + +export type HookExecutionMode = "sync" | "async"; + +export type HookHandlerType = "command" | "prompt" | "agent"; + +export type HookOutputEntry = { kind: HookOutputEntryKind, text: string, }; + +export type HookOutputEntryKind = "warning" | "stop" | "feedback" | "context" | "error"; + +export type HookRunStatus = "running" | "completed" | "failed" | "blocked" | "stopped"; + +export type HookRunSummary = { id: string, event_name: HookEventName, handler_type: HookHandlerType, execution_mode: HookExecutionMode, scope: HookScope, source_path: string, display_order: bigint, status: HookRunStatus, status_message: string | null, started_at: number, completed_at: number | null, duration_ms: number | null, entries: Array, }; + +export type HookScope = "thread" | "turn"; + +export type HookStartedEvent = { turn_id: string | null, run: HookRunSummary, }; + +export type ImageDetail = "auto" | "low" | "high" | "original"; + +export type ImageGenerationBeginEvent = { call_id: string, }; + +export type ImageGenerationEndEvent = { call_id: string, status: string, revised_prompt?: string, result: string, saved_path?: string, }; + +export type ImageGenerationItem = { id: string, status: string, revised_prompt?: string, result: string, saved_path?: string, }; + +export type ItemCompletedEvent = { thread_id: ThreadId, turn_id: string, item: TurnItem, }; + +export type ItemStartedEvent = { thread_id: ThreadId, turn_id: string, item: TurnItem, }; + +/** + * Response payload for `Op::ListCustomPrompts`. + */ +export type ListCustomPromptsResponseEvent = { custom_prompts: Array, }; + +/** + * Response payload for `Op::ListRemoteSkills`. + */ +export type ListRemoteSkillsResponseEvent = { skills: Array, }; + +/** + * Response payload for `Op::ListSkills`. + */ +export type ListSkillsResponseEvent = { skills: Array, }; + +export type LocalShellAction = { "type": "exec" } & LocalShellExecAction; + +export type LocalShellExecAction = { command: Array, timeout_ms: bigint | null, working_directory: string | null, env: { [key in string]?: string } | null, user: string | null, }; + +export type LocalShellStatus = "completed" | "in_progress" | "incomplete"; + +export type MacOsAutomationPermission = "none" | "all" | { "bundle_ids": Array }; + +export type MacOsContactsPermission = "none" | "read_only" | "read_write"; + +export type MacOsPreferencesPermission = "none" | "read_only" | "read_write"; + +export type MacOsSeatbeltProfileExtensions = { macos_preferences: MacOsPreferencesPermission, macos_automation: MacOsAutomationPermission, macos_launch_services: boolean, macos_accessibility: boolean, macos_calendar: boolean, macos_reminders: boolean, macos_contacts: MacOsContactsPermission, }; + +export type McpAuthStatus = "unsupported" | "not_logged_in" | "bearer_token" | "o_auth"; + +export type McpInvocation = { +/** + * Name of the MCP server as defined in the config. + */ +server: string, +/** + * Name of the tool as given by the MCP server. + */ +tool: string, +/** + * Arguments to the tool call. + */ +arguments: JsonValue | null, }; + +export type McpListToolsResponseEvent = { +/** + * Fully qualified tool name -> tool definition. + */ +tools: { [key in string]?: Tool }, +/** + * Known resources grouped by server name. + */ +resources: { [key in string]?: Array }, +/** + * Known resource templates grouped by server name. + */ +resource_templates: { [key in string]?: Array }, +/** + * Authentication status for each configured MCP server. + */ +auth_statuses: { [key in string]?: McpAuthStatus }, }; + +export type McpStartupCompleteEvent = { ready: Array, failed: Array, cancelled: Array, }; + +export type McpStartupFailure = { server: string, error: string, }; + +export type McpStartupStatus = { "state": "starting" } | { "state": "ready" } | { "state": "failed", error: string, } | { "state": "cancelled" }; + +export type McpStartupUpdateEvent = { +/** + * Server name being started. + */ +server: string, +/** + * Current startup status. + */ +status: McpStartupStatus, }; + +export type McpToolCallBeginEvent = { +/** + * Identifier so this can be paired with the McpToolCallEnd event. + */ +call_id: string, invocation: McpInvocation, }; + +export type McpToolCallEndEvent = { +/** + * Identifier for the corresponding McpToolCallBegin that finished. + */ +call_id: string, invocation: McpInvocation, duration: string, +/** + * Result of the tool call. Note this could be an error. + */ +result: { Ok : CallToolResult } | { Err : string }, }; + +/** + * Classifies an assistant message as interim commentary or final answer text. + * + * Providers do not emit this consistently, so callers must treat `None` as + * "phase unknown" and keep compatibility behavior for legacy models. + */ +export type MessagePhase = "commentary" | "final_answer"; + +/** + * Initial collaboration mode to use when the TUI starts. + */ +export type ModeKind = "plan" | "default"; + +export type ModelRerouteEvent = { from_model: string, to_model: string, reason: ModelRerouteReason, }; + +export type ModelRerouteReason = "high_risk_cyber_activity"; + +/** + * Represents whether outbound network access is available to the agent. + */ +export type NetworkAccess = "restricted" | "enabled"; + +export type NetworkApprovalContext = { host: string, protocol: NetworkApprovalProtocol, }; + +export type NetworkApprovalProtocol = "http" | "https" | "socks5_tcp" | "socks5_udp"; + +export type NetworkPermissions = { enabled: boolean | null, }; + +export type NetworkPolicyAmendment = { host: string, action: NetworkPolicyRuleAction, }; + +export type NetworkPolicyRuleAction = "allow" | "deny"; + +export type ParsedCommand = { "type": "read", cmd: string, name: string, +/** + * (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. + */ +path: string, } | { "type": "list_files", cmd: string, path: string | null, } | { "type": "search", cmd: string, query: string | null, path: string | null, } | { "type": "unknown", cmd: string, }; + +export type PatchApplyBeginEvent = { +/** + * Identifier so this can be paired with the PatchApplyEnd event. + */ +call_id: string, +/** + * Turn ID that this patch belongs to. + * Uses `#[serde(default)]` for backwards compatibility. + */ +turn_id: string, +/** + * If true, there was no ApplyPatchApprovalRequest for this patch. + */ +auto_approved: boolean, +/** + * The changes to be applied. + */ +changes: { [key in string]?: FileChange }, }; + +export type PatchApplyEndEvent = { +/** + * Identifier for the PatchApplyBegin that finished. + */ +call_id: string, +/** + * Turn ID that this patch belongs to. + * Uses `#[serde(default)]` for backwards compatibility. + */ +turn_id: string, +/** + * Captured stdout (summary printed by apply_patch). + */ +stdout: string, +/** + * Captured stderr (parser errors, IO failures, etc.). + */ +stderr: string, +/** + * Whether the patch was applied successfully. + */ +success: boolean, +/** + * The changes that were applied (mirrors PatchApplyBeginEvent::changes). + */ +changes: { [key in string]?: FileChange }, +/** + * Completion status for this patch application. + */ +status: PatchApplyStatus, }; + +export type PatchApplyStatus = "completed" | "failed" | "declined"; + +export type PermissionProfile = { network: NetworkPermissions | null, file_system: FileSystemPermissions | null, macos: MacOsSeatbeltProfileExtensions | null, }; + +export type Personality = "none" | "friendly" | "pragmatic"; + +export type PlanDeltaEvent = { thread_id: string, turn_id: string, item_id: string, delta: string, }; + +export type PlanItem = { id: string, text: string, }; + +export type PlanItemArg = { step: string, status: StepStatus, }; + +export type PlanType = "free" | "go" | "plus" | "pro" | "team" | "business" | "enterprise" | "edu" | "unknown"; + +export type RateLimitSnapshot = { limit_id: string | null, limit_name: string | null, primary: RateLimitWindow | null, secondary: RateLimitWindow | null, credits: CreditsSnapshot | null, plan_type: PlanType | null, }; + +export type RateLimitWindow = { +/** + * Percentage (0-100) of the window that has been consumed. + */ +used_percent: number, +/** + * Rolling window duration, in minutes. + */ +window_minutes: number | null, +/** + * Unix timestamp (seconds since epoch) when the window resets. + */ +resets_at: number | null, }; + +export type RawResponseItemEvent = { item: ResponseItem, }; + +/** + * Determines how read-only file access is granted inside a restricted + * sandbox. + */ +export type ReadOnlyAccess = { "type": "restricted", +/** + * Include built-in platform read roots required for basic process + * execution. + */ +include_platform_defaults: boolean, +/** + * Additional absolute roots that should be readable. + */ +readable_roots?: Array, } | { "type": "full-access" }; + +export type RealtimeAudioFrame = { data: string, sample_rate: number, num_channels: number, samples_per_channel: number | null, }; + +export type RealtimeConversationClosedEvent = { reason: string | null, }; + +export type RealtimeConversationRealtimeEvent = { payload: RealtimeEvent, }; + +export type RealtimeConversationStartedEvent = { session_id: string | null, }; + +export type RealtimeEvent = { "SessionUpdated": { session_id: string, instructions: string | null, } } | { "InputTranscriptDelta": RealtimeTranscriptDelta } | { "OutputTranscriptDelta": RealtimeTranscriptDelta } | { "AudioOut": RealtimeAudioFrame } | { "ConversationItemAdded": JsonValue } | { "ConversationItemDone": { item_id: string, } } | { "HandoffRequested": RealtimeHandoffRequested } | { "Error": string }; + +export type RealtimeHandoffRequested = { handoff_id: string, item_id: string, input_transcript: string, active_transcript: Array, }; + +export type RealtimeTranscriptDelta = { delta: string, }; + +export type RealtimeTranscriptEntry = { role: string, text: string, }; + +export type ReasoningContentDeltaEvent = { thread_id: string, turn_id: string, item_id: string, delta: string, summary_index: bigint, }; + +/** + * See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning + */ +export type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh"; + +export type ReasoningItem = { id: string, summary_text: Array, raw_content: Array, }; + +export type ReasoningItemContent = { "type": "reasoning_text", text: string, } | { "type": "text", text: string, }; + +export type ReasoningItemReasoningSummary = { "type": "summary_text", text: string, }; + +export type ReasoningRawContentDeltaEvent = { thread_id: string, turn_id: string, item_id: string, delta: string, content_index: bigint, }; + +/** + * 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 + */ +export type ReasoningSummary = "auto" | "concise" | "detailed" | "none"; + +export type RejectConfig = { +/** + * Reject approval prompts related to sandbox escalation. + */ +sandbox_approval: boolean, +/** + * Reject prompts triggered by execpolicy `prompt` rules. + */ +rules: boolean, +/** + * Reject approval prompts triggered by skill script execution. + */ +skill_approval: boolean, +/** + * Reject approval prompts related to built-in permission requests. + */ +request_permissions: boolean, +/** + * Reject MCP elicitation prompts. + */ +mcp_elicitations: boolean, }; + +/** + * Response payload for `Op::DownloadRemoteSkill`. + */ +export type RemoteSkillDownloadedEvent = { id: string, name: string, path: string, }; + +export type RemoteSkillSummary = { id: string, name: string, description: string, }; + +export type RequestPermissionsEvent = { +/** + * Responses API call id for the associated tool call, if available. + */ +call_id: string, +/** + * Turn ID that this request belongs to. + * Uses `#[serde(default)]` for backwards compatibility. + */ +turn_id: string, reason: string | null, permissions: PermissionProfile, }; + +export type RequestUserInputEvent = { +/** + * Responses API call id for the associated tool call, if available. + */ +call_id: string, +/** + * Turn ID that this request belongs to. + * Uses `#[serde(default)]` for backwards compatibility. + */ +turn_id: string, questions: Array, }; + +export type RequestUserInputQuestion = { id: string, header: string, question: string, isOther: boolean, isSecret: boolean, options: Array | null, }; + +export type RequestUserInputQuestionOption = { label: string, description: string, }; + +/** + * A known resource that the server is capable of reading. + */ +export type Resource = { annotations?: JsonValue, description?: string, mimeType?: string, name: string, size?: number, title?: string, uri: string, icons?: Array, _meta?: JsonValue, }; + +/** + * A template description for resources available on the server. + */ +export type ResourceTemplate = { annotations?: JsonValue, uriTemplate: string, name: string, title?: string, description?: string, mimeType?: string, }; + +export type ResponseItem = { "type": "message", role: string, content: Array, end_turn?: boolean, phase?: MessagePhase, } | { "type": "reasoning", summary: Array, content?: Array, encrypted_content: string | null, } | { "type": "local_shell_call", +/** + * Set when using the Responses API. + */ +call_id: string | null, status: LocalShellStatus, action: LocalShellAction, } | { "type": "function_call", name: string, arguments: string, call_id: string, } | { "type": "function_call_output", call_id: string, output: FunctionCallOutputPayload, } | { "type": "custom_tool_call", status?: string, call_id: string, name: string, input: string, } | { "type": "custom_tool_call_output", call_id: string, output: FunctionCallOutputPayload, } | { "type": "web_search_call", status?: string, action?: WebSearchAction, } | { "type": "image_generation_call", id: string, status: string, revised_prompt?: string, result: string, } | { "type": "ghost_snapshot", ghost_commit: GhostCommit, } | { "type": "compaction", encrypted_content: string, } | { "type": "other" }; + +/** + * Location of the code related to a review finding. + */ +export type ReviewCodeLocation = { absolute_file_path: string, line_range: ReviewLineRange, }; + +/** + * User's decision in response to an ExecApprovalRequest. + */ +export type ReviewDecision = "approved" | { "approved_execpolicy_amendment": { proposed_execpolicy_amendment: ExecPolicyAmendment, } } | "approved_for_session" | { "network_policy_amendment": { network_policy_amendment: NetworkPolicyAmendment, } } | "denied" | "abort"; + +/** + * A single review finding describing an observed issue or recommendation. + */ +export type ReviewFinding = { title: string, body: string, confidence_score: number, priority: number, code_location: ReviewCodeLocation, }; + +/** + * Inclusive line range in a file associated with the finding. + */ +export type ReviewLineRange = { start: number, end: number, }; + +/** + * Structured review result produced by a child review session. + */ +export type ReviewOutputEvent = { findings: Array, overall_correctness: string, overall_explanation: string, overall_confidence_score: number, }; + +/** + * Review request sent to the review session. + */ +export type ReviewRequest = { target: ReviewTarget, user_facing_hint?: string, }; + +export type ReviewTarget = { "type": "uncommittedChanges" } | { "type": "baseBranch", branch: string, } | { "type": "commit", sha: string, +/** + * Optional human-readable label (e.g., commit subject) for UIs. + */ +title: string | null, } | { "type": "custom", instructions: string, }; + +export type RolloutLine = { timestamp: string, } & ({ "type": "session_meta", "payload": SessionMetaLine } | { "type": "response_item", "payload": ResponseItem } | { "type": "compacted", "payload": CompactedItem } | { "type": "turn_context", "payload": TurnContextItem } | { "type": "event_msg", "payload": EventMsg }); + +/** + * Determines execution restrictions for model shell commands. + */ +export type SandboxPolicy = { "type": "danger-full-access" } | { "type": "read-only", +/** + * Read access granted while running under this policy. + */ +access?: ReadOnlyAccess, +/** + * When set to `true`, outbound network access is allowed. `false` by + * default. + */ +network_access?: boolean, } | { "type": "external-sandbox", +/** + * Whether the external sandbox permits outbound network traffic. + */ +network_access: NetworkAccess, } | { "type": "workspace-write", +/** + * Additional folders (beyond cwd and possibly TMPDIR) that should be + * writable from within the sandbox. + */ +writable_roots?: Array, +/** + * Read access granted while running under this policy. + */ +read_only_access?: ReadOnlyAccess, +/** + * When set to `true`, outbound network access is allowed. `false` by + * default. + */ +network_access: boolean, +/** + * When set to `true`, will NOT include the per-user `TMPDIR` + * environment variable among the default writable roots. Defaults to + * `false`. + */ +exclude_tmpdir_env_var: boolean, +/** + * When set to `true`, will NOT include the `/tmp` among the default + * writable roots on UNIX. Defaults to `false`. + */ +exclude_slash_tmp: boolean, }; + +export type ServiceTier = "fast" | "flex"; + +export type SessionConfiguredEvent = { session_id: ThreadId, forked_from_id: ThreadId | null, +/** + * Optional user-facing thread name (may be unset). + */ +thread_name?: string, +/** + * Tell the client what model is being queried. + */ +model: string, model_provider_id: string, service_tier: ServiceTier | null, +/** + * When to escalate for approval for execution + */ +approval_policy: AskForApproval, +/** + * How to sandbox commands executed in the system + */ +sandbox_policy: SandboxPolicy, +/** + * Working directory that should be treated as the *root* of the + * session. + */ +cwd: string, +/** + * The effort the model is putting into reasoning about the user's request. + */ +reasoning_effort: ReasoningEffort | null, +/** + * Identifier of the history log file (inode on Unix, 0 otherwise). + */ +history_log_id: bigint, +/** + * Current number of entries in the history log. + */ +history_entry_count: number, +/** + * Optional initial messages (as events) for resumed sessions. + * When present, UIs can use these to seed the history. + */ +initial_messages: Array | null, +/** + * Runtime proxy bind addresses, when the managed proxy was started for this session. + */ +network_proxy?: SessionNetworkProxyRuntime, +/** + * Path in which the rollout is stored. Can be `None` for ephemeral threads + */ +rollout_path: string | null, }; + +export type SessionMetaLine = { git: GitInfo | null, id: ThreadId, forked_from_id: ThreadId | null, timestamp: string, cwd: string, originator: string, cli_version: string, source: SessionSource, +/** + * Optional random unique nickname assigned to an AgentControl-spawned sub-agent. + */ +agent_nickname: string | null, +/** + * Optional role (agent_role) assigned to an AgentControl-spawned sub-agent. + */ +agent_role?: string | null, model_provider: string | null, +/** + * base_instructions for the session. This *should* always be present when creating a new session, + * but may be missing for older sessions. If not present, fall back to rendering the base_instructions + * from ModelsManager. + */ +base_instructions: base_instructions | null, dynamic_tools: Array | null, memory_mode: string | null, }; + +export type SessionNetworkProxyRuntime = { http_addr: string, socks_addr: string, }; + +export type SessionSource = "cli" | "vscode" | "exec" | "mcp" | { "subagent": SubAgentSource } | "unknown"; + +/** + * Settings for a collaboration mode. + */ +export type Settings = { model: string, reasoning_effort: ReasoningEffort | null, developer_instructions: string | null, }; + +export type SkillDependencies = { tools: Array, }; + +export type SkillErrorInfo = { path: string, message: string, }; + +export type SkillInterface = { display_name?: string, short_description?: string, icon_small?: string, icon_large?: string, brand_color?: string, default_prompt?: string, }; + +export type SkillMetadata = { name: string, description: string, +/** + * Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description. + */ +short_description?: string, interface?: SkillInterface, dependencies?: SkillDependencies, path: string, scope: SkillScope, enabled: boolean, }; + +export type SkillScope = "user" | "repo" | "system" | "admin"; + +export type SkillToolDependency = { type: string, value: string, description?: string, transport?: string, command?: string, url?: string, }; + +export type SkillsListEntry = { cwd: string, skills: Array, errors: Array, }; + +export type StepStatus = "pending" | "in_progress" | "completed"; + +export type StreamErrorEvent = { message: string, codex_error_info: CodexErrorInfo | null, +/** + * Optional details about the underlying stream failure (often the same + * human-readable message that is surfaced as the terminal error if retries + * are exhausted). + */ +additional_details: string | null, }; + +export type SubAgentSource = "review" | "compact" | { "thread_spawn": { parent_thread_id: ThreadId, depth: number, agent_nickname: string | null, agent_role: string | null, } } | "memory_consolidation" | { "other": string }; + +export type TerminalInteractionEvent = { +/** + * Identifier for the ExecCommandBegin that produced this chunk. + */ +call_id: string, +/** + * Process id associated with the running command. + */ +process_id: string, +/** + * Stdin sent to the running session. + */ +stdin: string, }; + +export type TextElement = { +/** + * Byte range in the parent `text` buffer that this element occupies. + */ +byte_range: ByteRange, +/** + * Optional human-readable placeholder for the element, displayed in the UI. + */ +placeholder: string | null, }; + +export type ThreadId = string; + +export type ThreadNameUpdatedEvent = { thread_id: ThreadId, thread_name?: string, }; + +export type ThreadRolledBackEvent = { +/** + * Number of user turns that were removed from context. + */ +num_turns: number, }; + +export type TokenCountEvent = { info: TokenUsageInfo | null, rate_limits: RateLimitSnapshot | null, }; + +export type TokenUsage = { input_tokens: number, cached_input_tokens: number, output_tokens: number, reasoning_output_tokens: number, total_tokens: number, }; + +export type TokenUsageInfo = { total_token_usage: TokenUsage, last_token_usage: TokenUsage, model_context_window: number | null, }; + +/** + * Definition for a tool the client can call. + */ +export type Tool = { name: string, title?: string, description?: string, inputSchema: JsonValue, outputSchema?: JsonValue, annotations?: JsonValue, icons?: Array, _meta?: JsonValue, }; + +export type TruncationPolicy = { "mode": "bytes", "limit": number } | { "mode": "tokens", "limit": number }; + +export type TurnAbortReason = "interrupted" | "replaced" | "review_ended"; + +export type TurnAbortedEvent = { turn_id: string | null, reason: TurnAbortReason, }; + +export type TurnCompleteEvent = { turn_id: string, last_agent_message: string | null, }; + +/** + * Persist once per real user turn after computing that turn's model-visible + * context updates, and again after mid-turn compaction when replacement + * history re-establishes full context, so resume/fork replay can recover the + * latest durable baseline. + */ +export type TurnContextItem = { turn_id?: string | null, trace_id?: string | null, cwd: string, current_date?: string | null, timezone?: string | null, approval_policy: AskForApproval, sandbox_policy: SandboxPolicy, network: TurnContextNetworkItem | null, model: string, personality: Personality | null, collaboration_mode?: CollaborationMode | null, realtime_active?: boolean | null, effort: ReasoningEffort | null, summary: ReasoningSummary, user_instructions: string | null, developer_instructions: string | null, final_output_json_schema: JsonValue | null, truncation_policy: TruncationPolicy | null, }; + +export type TurnContextNetworkItem = { allowed_domains: Array, denied_domains: Array, }; + +export type TurnDiffEvent = { unified_diff: string, }; + +export type TurnItem = { "type": "UserMessage" } & UserMessageItem | { "type": "AgentMessage" } & AgentMessageItem | { "type": "Plan" } & PlanItem | { "type": "Reasoning" } & ReasoningItem | { "type": "WebSearch" } & WebSearchItem | { "type": "ImageGeneration" } & ImageGenerationItem | { "type": "ContextCompaction" } & ContextCompactionItem; + +export type TurnStartedEvent = { turn_id: string, model_context_window: bigint | null, collaboration_mode_kind: ModeKind, }; + +export type UndoCompletedEvent = { success: boolean, message: string | null, }; + +export type UndoStartedEvent = { message: string | null, }; + +export type UpdatePlanArgs = { +/** + * Arguments for the `update_plan` todo/checklist tool (not plan mode). + */ +explanation: string | null, plan: Array, }; + +/** + * User input + */ +export type UserInput = { "type": "text", text: string, +/** + * UI-defined spans within `text` that should be treated as special elements. + * These are byte ranges into the UTF-8 `text` buffer and are used to render + * or persist rich input markers (e.g., image placeholders) across history + * and resume without mutating the literal text. + */ +text_elements: Array, } | { "type": "image", image_url: string, } | { "type": "local_image", path: string, } | { "type": "skill", name: string, path: string, } | { "type": "mention", name: string, path: string, }; + +export type UserMessageEvent = { message: string, +/** + * Image URLs sourced from `UserInput::Image`. These are safe + * to replay in legacy UI history events and correspond to images sent to + * the model. + */ +images: Array | null, +/** + * 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. + */ +local_images: Array, +/** + * UI-defined spans within `message` used to render or persist special elements. + */ +text_elements: Array, }; + +export type UserMessageItem = { id: string, content: Array, }; + +export type ViewImageToolCallEvent = { +/** + * Identifier for the originating tool call. + */ +call_id: string, +/** + * Local filesystem path provided to the tool. + */ +path: string, }; + +export type WarningEvent = { message: string, }; + +export type WebSearchAction = { "type": "search", query?: string, queries?: Array, } | { "type": "open_page", url?: string, } | { "type": "find_in_page", url?: string, pattern?: string, } | { "type": "other" }; + +export type WebSearchBeginEvent = { call_id: string, }; + +export type WebSearchEndEvent = { call_id: string, query: string, action: WebSearchAction, }; + +export type WebSearchItem = { id: string, query: string, action: WebSearchAction, }; + +/** + * Base instructions for the model in a thread. Corresponds to the `instructions` field in the ResponsesAPI. + */ +export type base_instructions = { text: string, }; + +export type JsonValue = number | string | boolean | Array | { [key in string]?: JsonValue } | null; diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs index c8abd281f6a..b796167c252 100644 --- a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs +++ b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs @@ -1,22 +1,104 @@ +use std::any::TypeId; +use std::collections::BTreeMap; +use std::collections::HashSet; use std::error::Error; +use std::path::Path; use std::path::PathBuf; use codex_protocol::protocol::RolloutLine; +use ts_rs::TS; +use ts_rs::TypeVisitor; + +const GENERATED_TS_HEADER: &str = "// GENERATED CODE! DO NOT MODIFY BY HAND!\n\n"; +const TS_RS_NOTE: &str = "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n"; +const JSON_SCHEMA_FILENAME: &str = "rollout-line.schema.json"; +const TYPESCRIPT_FILENAME: &str = "rollout-line.schema.ts"; fn main() -> Result<(), Box> { let out_dir = std::env::args_os() .nth(1) .map(PathBuf::from) - .unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("schema/rollout_line")); + .unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("generated")); + + write_rollout_line_artifacts(&out_dir) +} +fn write_rollout_line_artifacts(out_dir: &Path) -> Result<(), Box> { std::fs::create_dir_all(&out_dir)?; - let schema_path = out_dir.join("RolloutLine.schema.json"); + let schema_path = out_dir.join(JSON_SCHEMA_FILENAME); let schema = schemars::schema_for!(RolloutLine); let schema_json = serde_json::to_vec_pretty(&schema)?; std::fs::write(&schema_path, schema_json)?; + let typescript_path = out_dir.join(TYPESCRIPT_FILENAME); + let typescript = generate_typescript_bundle::()?; + std::fs::write(&typescript_path, typescript)?; + println!("wrote {}", schema_path.display()); + println!("wrote {}", typescript_path.display()); + + Ok(()) +} + +fn generate_typescript_bundle() -> Result> { + let mut declarations = BTreeMap::new(); + let mut seen = HashSet::new(); + collect_typescript_declarations::(&mut declarations, &mut seen)?; + + let body = declarations + .into_values() + .collect::>() + .join("\n\n") + .replace("\r\n", "\n") + .replace('\r', "\n"); + Ok(format!("{GENERATED_TS_HEADER}{TS_RS_NOTE}\n{body}\n")) +} + +fn collect_typescript_declarations( + declarations: &mut BTreeMap, + seen: &mut HashSet, +) -> Result<(), Box> { + let Some(output_path) = T::output_path() else { + return Ok(()); + }; + if !seen.insert(TypeId::of::()) { + return Ok(()); + } + + let mut declaration = String::new(); + if let Some(docs) = T::docs() { + declaration.push_str(&docs.replace("\r\n", "\n").replace('\r', "\n")); + } + declaration.push_str("export "); + declaration.push_str(&T::decl().replace("\r\n", "\n").replace('\r', "\n")); + declarations.insert(output_path.components().collect(), declaration); + + let mut visitor = TypeScriptDeclarationCollector { + declarations, + seen, + error: None, + }; + T::visit_dependencies(&mut visitor); + if let Some(error) = visitor.error { + return Err(error); + } Ok(()) } + +struct TypeScriptDeclarationCollector<'a> { + declarations: &'a mut BTreeMap, + seen: &'a mut HashSet, + error: Option>, +} + +impl TypeVisitor for TypeScriptDeclarationCollector<'_> { + fn visit(&mut self) { + if self.error.is_some() { + return; + } + + self.error = collect_typescript_declarations::(self.declarations, self.seen).err(); + } +} From 32823bc6c017940d0ad0b1bb95c1408dc2b6f13c Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 21:57:42 -0700 Subject: [PATCH 05/18] simplify --- .../generated/rollout-line.schema.json | 7066 ----------------- .../protocol/generated/rollout-line.schema.ts | 1360 ---- .../bin/codex-write-rollout-line-schema.rs | 103 +- codex-rs/protocol/src/lib.rs | 6 + codex-rs/protocol/src/rollout_line_schema.rs | 126 + justfile | 4 + 6 files changed, 142 insertions(+), 8523 deletions(-) delete mode 100644 codex-rs/protocol/generated/rollout-line.schema.json delete mode 100644 codex-rs/protocol/generated/rollout-line.schema.ts create mode 100644 codex-rs/protocol/src/rollout_line_schema.rs diff --git a/codex-rs/protocol/generated/rollout-line.schema.json b/codex-rs/protocol/generated/rollout-line.schema.json deleted file mode 100644 index c18f84550e9..00000000000 --- a/codex-rs/protocol/generated/rollout-line.schema.json +++ /dev/null @@ -1,7066 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RolloutLine", - "type": "object", - "oneOf": [ - { - "type": "object", - "required": [ - "payload", - "type" - ], - "properties": { - "payload": { - "$ref": "#/definitions/SessionMetaLine" - }, - "type": { - "type": "string", - "enum": [ - "session_meta" - ] - } - } - }, - { - "type": "object", - "required": [ - "payload", - "type" - ], - "properties": { - "payload": { - "$ref": "#/definitions/ResponseItem" - }, - "type": { - "type": "string", - "enum": [ - "response_item" - ] - } - } - }, - { - "type": "object", - "required": [ - "payload", - "type" - ], - "properties": { - "payload": { - "$ref": "#/definitions/CompactedItem" - }, - "type": { - "type": "string", - "enum": [ - "compacted" - ] - } - } - }, - { - "type": "object", - "required": [ - "payload", - "type" - ], - "properties": { - "payload": { - "$ref": "#/definitions/TurnContextItem" - }, - "type": { - "type": "string", - "enum": [ - "turn_context" - ] - } - } - }, - { - "type": "object", - "required": [ - "payload", - "type" - ], - "properties": { - "payload": { - "$ref": "#/definitions/EventMsg" - }, - "type": { - "type": "string", - "enum": [ - "event_msg" - ] - } - } - } - ], - "required": [ - "timestamp" - ], - "properties": { - "timestamp": { - "type": "string" - } - }, - "definitions": { - "AbsolutePathBuf": { - "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.", - "type": "string" - }, - "AgentMessageContent": { - "oneOf": [ - { - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "Text" - ] - } - } - } - ] - }, - "AgentStatus": { - "description": "Agent lifecycle status, derived from emitted events.", - "oneOf": [ - { - "description": "Agent is waiting for initialization.", - "type": "string", - "enum": [ - "pending_init" - ] - }, - { - "description": "Agent is currently running.", - "type": "string", - "enum": [ - "running" - ] - }, - { - "description": "Agent is done. Contains the final assistant message.", - "type": "object", - "required": [ - "completed" - ], - "properties": { - "completed": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - }, - { - "description": "Agent encountered an error.", - "type": "object", - "required": [ - "errored" - ], - "properties": { - "errored": { - "type": "string" - } - }, - "additionalProperties": false - }, - { - "description": "Agent has been shutdown.", - "type": "string", - "enum": [ - "shutdown" - ] - }, - { - "description": "Agent is not found.", - "type": "string", - "enum": [ - "not_found" - ] - } - ] - }, - "AskForApproval": { - "description": "Determines the conditions under which the user is consulted to approve running the command proposed by Codex.", - "oneOf": [ - { - "description": "Under this policy, only \"known safe\" commands—as determined by `is_safe_command()`—that **only read files** are auto‑approved. Everything else will ask the user to approve.", - "type": "string", - "enum": [ - "untrusted" - ] - }, - { - "description": "DEPRECATED: *All* commands are auto‑approved, but they are expected to run inside a sandbox where network access is disabled and writes are confined to a specific set of paths. If the command fails, it will be escalated to the user to approve execution without a sandbox. Prefer `OnRequest` for interactive runs or `Never` for non-interactive runs.", - "type": "string", - "enum": [ - "on-failure" - ] - }, - { - "description": "The model decides when to ask the user for approval.", - "type": "string", - "enum": [ - "on-request" - ] - }, - { - "description": "Fine-grained rejection controls for approval prompts.\n\nWhen a field is `true`, prompts of that category are automatically rejected instead of shown to the user.", - "type": "object", - "required": [ - "reject" - ], - "properties": { - "reject": { - "$ref": "#/definitions/RejectConfig" - } - }, - "additionalProperties": false - }, - { - "description": "Never ask the user to approve commands. Failures are immediately returned to the model, and never escalated to the user for approval.", - "type": "string", - "enum": [ - "never" - ] - } - ] - }, - "ByteRange": { - "type": "object", - "required": [ - "end", - "start" - ], - "properties": { - "end": { - "description": "End byte offset (exclusive) within the UTF-8 text buffer.", - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "start": { - "description": "Start byte offset (inclusive) within the UTF-8 text buffer.", - "type": "integer", - "format": "uint", - "minimum": 0.0 - } - } - }, - "CallToolResult": { - "description": "The server's response to a tool call.", - "type": "object", - "required": [ - "content" - ], - "properties": { - "_meta": true, - "content": { - "type": "array", - "items": true - }, - "isError": { - "type": [ - "boolean", - "null" - ] - }, - "structuredContent": true - } - }, - "CodexErrorInfo": { - "description": "Codex errors that we expose to clients.", - "oneOf": [ - { - "type": "string", - "enum": [ - "context_window_exceeded", - "usage_limit_exceeded", - "server_overloaded", - "internal_server_error", - "unauthorized", - "bad_request", - "sandbox_error", - "thread_rollback_failed", - "other" - ] - }, - { - "type": "object", - "required": [ - "http_connection_failed" - ], - "properties": { - "http_connection_failed": { - "type": "object", - "properties": { - "http_status_code": { - "type": [ - "integer", - "null" - ], - "format": "uint16", - "minimum": 0.0 - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Failed to connect to the response SSE stream.", - "type": "object", - "required": [ - "response_stream_connection_failed" - ], - "properties": { - "response_stream_connection_failed": { - "type": "object", - "properties": { - "http_status_code": { - "type": [ - "integer", - "null" - ], - "format": "uint16", - "minimum": 0.0 - } - } - } - }, - "additionalProperties": false - }, - { - "description": "The response SSE stream disconnected in the middle of a turnbefore completion.", - "type": "object", - "required": [ - "response_stream_disconnected" - ], - "properties": { - "response_stream_disconnected": { - "type": "object", - "properties": { - "http_status_code": { - "type": [ - "integer", - "null" - ], - "format": "uint16", - "minimum": 0.0 - } - } - } - }, - "additionalProperties": false - }, - { - "description": "Reached the retry limit for responses.", - "type": "object", - "required": [ - "response_too_many_failed_attempts" - ], - "properties": { - "response_too_many_failed_attempts": { - "type": "object", - "properties": { - "http_status_code": { - "type": [ - "integer", - "null" - ], - "format": "uint16", - "minimum": 0.0 - } - } - } - }, - "additionalProperties": false - } - ] - }, - "CollabAgentRef": { - "type": "object", - "required": [ - "thread_id" - ], - "properties": { - "agent_nickname": { - "description": "Optional nickname assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "agent_role": { - "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "thread_id": { - "description": "Thread ID of the receiver/new agent.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - } - } - }, - "CollabAgentStatusEntry": { - "type": "object", - "required": [ - "status", - "thread_id" - ], - "properties": { - "agent_nickname": { - "description": "Optional nickname assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "agent_role": { - "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "status": { - "description": "Last known status of the agent.", - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ] - }, - "thread_id": { - "description": "Thread ID of the receiver/new agent.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - } - } - }, - "CollaborationMode": { - "description": "Collaboration mode for a Codex session.", - "type": "object", - "required": [ - "mode", - "settings" - ], - "properties": { - "mode": { - "$ref": "#/definitions/ModeKind" - }, - "settings": { - "$ref": "#/definitions/Settings" - } - } - }, - "CompactedItem": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - }, - "replacement_history": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ResponseItem" - } - } - } - }, - "ContentItem": { - "oneOf": [ - { - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "input_text" - ] - } - } - }, - { - "type": "object", - "required": [ - "image_url", - "type" - ], - "properties": { - "image_url": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "input_image" - ] - } - } - }, - { - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "output_text" - ] - } - } - } - ] - }, - "CreditsSnapshot": { - "type": "object", - "required": [ - "has_credits", - "unlimited" - ], - "properties": { - "balance": { - "type": [ - "string", - "null" - ] - }, - "has_credits": { - "type": "boolean" - }, - "unlimited": { - "type": "boolean" - } - } - }, - "CustomPrompt": { - "type": "object", - "required": [ - "content", - "name", - "path" - ], - "properties": { - "argument_hint": { - "type": [ - "string", - "null" - ] - }, - "content": { - "type": "string" - }, - "description": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" - }, - "path": { - "type": "string" - } - } - }, - "Duration": { - "type": "object", - "required": [ - "nanos", - "secs" - ], - "properties": { - "nanos": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "secs": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - } - }, - "DynamicToolCallOutputContentItem": { - "oneOf": [ - { - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "inputText" - ] - } - } - }, - { - "type": "object", - "required": [ - "imageUrl", - "type" - ], - "properties": { - "imageUrl": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "inputImage" - ] - } - } - } - ] - }, - "DynamicToolSpec": { - "type": "object", - "required": [ - "description", - "inputSchema", - "name" - ], - "properties": { - "description": { - "type": "string" - }, - "inputSchema": true, - "name": { - "type": "string" - } - } - }, - "ElicitationRequest": { - "oneOf": [ - { - "type": "object", - "required": [ - "message", - "mode", - "requested_schema" - ], - "properties": { - "_meta": true, - "message": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": [ - "form" - ] - }, - "requested_schema": true - } - }, - { - "type": "object", - "required": [ - "elicitation_id", - "message", - "mode", - "url" - ], - "properties": { - "_meta": true, - "elicitation_id": { - "type": "string" - }, - "message": { - "type": "string" - }, - "mode": { - "type": "string", - "enum": [ - "url" - ] - }, - "url": { - "type": "string" - } - } - } - ] - }, - "EventMsg": { - "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.", - "oneOf": [ - { - "description": "Error while executing a submission", - "type": "object", - "required": [ - "message", - "type" - ], - "properties": { - "codex_error_info": { - "default": null, - "anyOf": [ - { - "$ref": "#/definitions/CodexErrorInfo" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "error" - ] - } - } - }, - { - "description": "Warning issued while processing a submission. Unlike `Error`, this indicates the turn continued but the user should still be notified.", - "type": "object", - "required": [ - "message", - "type" - ], - "properties": { - "message": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "warning" - ] - } - } - }, - { - "description": "Realtime conversation lifecycle start event.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "session_id": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "realtime_conversation_started" - ] - } - } - }, - { - "description": "Realtime conversation streaming payload event.", - "type": "object", - "required": [ - "payload", - "type" - ], - "properties": { - "payload": { - "$ref": "#/definitions/RealtimeEvent" - }, - "type": { - "type": "string", - "enum": [ - "realtime_conversation_realtime" - ] - } - } - }, - { - "description": "Realtime conversation lifecycle close event.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "reason": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "realtime_conversation_closed" - ] - } - } - }, - { - "description": "Model routing changed from the requested model to a different model.", - "type": "object", - "required": [ - "from_model", - "reason", - "to_model", - "type" - ], - "properties": { - "from_model": { - "type": "string" - }, - "reason": { - "$ref": "#/definitions/ModelRerouteReason" - }, - "to_model": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "model_reroute" - ] - } - } - }, - { - "description": "Conversation history was compacted (either automatically or manually).", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "context_compacted" - ] - } - } - }, - { - "description": "Conversation history was rolled back by dropping the last N user turns.", - "type": "object", - "required": [ - "num_turns", - "type" - ], - "properties": { - "num_turns": { - "description": "Number of user turns that were removed from context.", - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "type": { - "type": "string", - "enum": [ - "thread_rolled_back" - ] - } - } - }, - { - "description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.", - "type": "object", - "required": [ - "turn_id", - "type" - ], - "properties": { - "collaboration_mode_kind": { - "default": "default", - "allOf": [ - { - "$ref": "#/definitions/ModeKind" - } - ] - }, - "model_context_window": { - "type": [ - "integer", - "null" - ], - "format": "int64" - }, - "turn_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "task_started" - ] - } - } - }, - { - "description": "Agent has completed all actions. v1 wire format uses `task_complete`; accept `turn_complete` for v2 interop.", - "type": "object", - "required": [ - "turn_id", - "type" - ], - "properties": { - "last_agent_message": { - "type": [ - "string", - "null" - ] - }, - "turn_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "task_complete" - ] - } - } - }, - { - "description": "Usage update for the current session, including totals and last turn. Optional means unknown — UIs should not display when `None`.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "info": { - "anyOf": [ - { - "$ref": "#/definitions/TokenUsageInfo" - }, - { - "type": "null" - } - ] - }, - "rate_limits": { - "anyOf": [ - { - "$ref": "#/definitions/RateLimitSnapshot" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "token_count" - ] - } - } - }, - { - "description": "Agent text output message", - "type": "object", - "required": [ - "message", - "type" - ], - "properties": { - "message": { - "type": "string" - }, - "phase": { - "default": null, - "anyOf": [ - { - "$ref": "#/definitions/MessagePhase" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "agent_message" - ] - } - } - }, - { - "description": "User/system input message (what was sent to the model)", - "type": "object", - "required": [ - "message", - "type" - ], - "properties": { - "images": { - "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.", - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - } - }, - "local_images": { - "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.", - "default": [], - "type": "array", - "items": { - "type": "string" - } - }, - "message": { - "type": "string" - }, - "text_elements": { - "description": "UI-defined spans within `message` used to render or persist special elements.", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/TextElement" - } - }, - "type": { - "type": "string", - "enum": [ - "user_message" - ] - } - } - }, - { - "description": "Agent text output delta message", - "type": "object", - "required": [ - "delta", - "type" - ], - "properties": { - "delta": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "agent_message_delta" - ] - } - } - }, - { - "description": "Reasoning event from agent.", - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "agent_reasoning" - ] - } - } - }, - { - "description": "Agent reasoning delta event from agent.", - "type": "object", - "required": [ - "delta", - "type" - ], - "properties": { - "delta": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "agent_reasoning_delta" - ] - } - } - }, - { - "description": "Raw chain-of-thought from agent.", - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "agent_reasoning_raw_content" - ] - } - } - }, - { - "description": "Agent reasoning content delta event from agent.", - "type": "object", - "required": [ - "delta", - "type" - ], - "properties": { - "delta": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "agent_reasoning_raw_content_delta" - ] - } - } - }, - { - "description": "Signaled when the model begins a new reasoning summary section (e.g., a new titled block).", - "type": "object", - "required": [ - "type" - ], - "properties": { - "item_id": { - "default": "", - "type": "string" - }, - "summary_index": { - "default": 0, - "type": "integer", - "format": "int64" - }, - "type": { - "type": "string", - "enum": [ - "agent_reasoning_section_break" - ] - } - } - }, - { - "description": "Ack the client's configure message.", - "type": "object", - "required": [ - "approval_policy", - "cwd", - "history_entry_count", - "history_log_id", - "model", - "model_provider_id", - "sandbox_policy", - "session_id", - "type" - ], - "properties": { - "approval_policy": { - "description": "When to escalate for approval for execution", - "allOf": [ - { - "$ref": "#/definitions/AskForApproval" - } - ] - }, - "cwd": { - "description": "Working directory that should be treated as the *root* of the session.", - "type": "string" - }, - "forked_from_id": { - "anyOf": [ - { - "$ref": "#/definitions/ThreadId" - }, - { - "type": "null" - } - ] - }, - "history_entry_count": { - "description": "Current number of entries in the history log.", - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "history_log_id": { - "description": "Identifier of the history log file (inode on Unix, 0 otherwise).", - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "initial_messages": { - "description": "Optional initial messages (as events) for resumed sessions. When present, UIs can use these to seed the history.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/EventMsg" - } - }, - "model": { - "description": "Tell the client what model is being queried.", - "type": "string" - }, - "model_provider_id": { - "type": "string" - }, - "network_proxy": { - "description": "Runtime proxy bind addresses, when the managed proxy was started for this session.", - "anyOf": [ - { - "$ref": "#/definitions/SessionNetworkProxyRuntime" - }, - { - "type": "null" - } - ] - }, - "reasoning_effort": { - "description": "The effort the model is putting into reasoning about the user's request.", - "anyOf": [ - { - "$ref": "#/definitions/ReasoningEffort" - }, - { - "type": "null" - } - ] - }, - "rollout_path": { - "description": "Path in which the rollout is stored. Can be `None` for ephemeral threads", - "type": [ - "string", - "null" - ] - }, - "sandbox_policy": { - "description": "How to sandbox commands executed in the system", - "allOf": [ - { - "$ref": "#/definitions/SandboxPolicy" - } - ] - }, - "service_tier": { - "anyOf": [ - { - "$ref": "#/definitions/ServiceTier" - }, - { - "type": "null" - } - ] - }, - "session_id": { - "$ref": "#/definitions/ThreadId" - }, - "thread_name": { - "description": "Optional user-facing thread name (may be unset).", - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "session_configured" - ] - } - } - }, - { - "description": "Updated session metadata (e.g., thread name changes).", - "type": "object", - "required": [ - "thread_id", - "type" - ], - "properties": { - "thread_id": { - "$ref": "#/definitions/ThreadId" - }, - "thread_name": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "thread_name_updated" - ] - } - } - }, - { - "description": "Incremental MCP startup progress updates.", - "type": "object", - "required": [ - "server", - "status", - "type" - ], - "properties": { - "server": { - "description": "Server name being started.", - "type": "string" - }, - "status": { - "description": "Current startup status.", - "allOf": [ - { - "$ref": "#/definitions/McpStartupStatus" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "mcp_startup_update" - ] - } - } - }, - { - "description": "Aggregate MCP startup completion summary.", - "type": "object", - "required": [ - "cancelled", - "failed", - "ready", - "type" - ], - "properties": { - "cancelled": { - "type": "array", - "items": { - "type": "string" - } - }, - "failed": { - "type": "array", - "items": { - "$ref": "#/definitions/McpStartupFailure" - } - }, - "ready": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string", - "enum": [ - "mcp_startup_complete" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "invocation", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier so this can be paired with the McpToolCallEnd event.", - "type": "string" - }, - "invocation": { - "$ref": "#/definitions/McpInvocation" - }, - "type": { - "type": "string", - "enum": [ - "mcp_tool_call_begin" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "duration", - "invocation", - "result", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the corresponding McpToolCallBegin that finished.", - "type": "string" - }, - "duration": { - "$ref": "#/definitions/Duration" - }, - "invocation": { - "$ref": "#/definitions/McpInvocation" - }, - "result": { - "description": "Result of the tool call. Note this could be an error.", - "allOf": [ - { - "$ref": "#/definitions/Result_of_CallToolResult_or_String" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "mcp_tool_call_end" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "type" - ], - "properties": { - "call_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "web_search_begin" - ] - } - } - }, - { - "type": "object", - "required": [ - "action", - "call_id", - "query", - "type" - ], - "properties": { - "action": { - "$ref": "#/definitions/ResponsesApiWebSearchAction" - }, - "call_id": { - "type": "string" - }, - "query": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "web_search_end" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "type" - ], - "properties": { - "call_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "image_generation_begin" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "result", - "status", - "type" - ], - "properties": { - "call_id": { - "type": "string" - }, - "result": { - "type": "string" - }, - "revised_prompt": { - "type": [ - "string", - "null" - ] - }, - "saved_path": { - "type": [ - "string", - "null" - ] - }, - "status": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "image_generation_end" - ] - } - } - }, - { - "description": "Notification that the server is about to execute a command.", - "type": "object", - "required": [ - "call_id", - "command", - "cwd", - "parsed_cmd", - "turn_id", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier so this can be paired with the ExecCommandEnd event.", - "type": "string" - }, - "command": { - "description": "The command to be executed.", - "type": "array", - "items": { - "type": "string" - } - }, - "cwd": { - "description": "The command's working directory if not the default cwd for the agent.", - "type": "string" - }, - "interaction_input": { - "description": "Raw input sent to a unified exec session (if this is an interaction event).", - "type": [ - "string", - "null" - ] - }, - "parsed_cmd": { - "type": "array", - "items": { - "$ref": "#/definitions/ParsedCommand" - } - }, - "process_id": { - "description": "Identifier for the underlying PTY process (when available).", - "type": [ - "string", - "null" - ] - }, - "source": { - "description": "Where the command originated. Defaults to Agent for backward compatibility.", - "default": "agent", - "allOf": [ - { - "$ref": "#/definitions/ExecCommandSource" - } - ] - }, - "turn_id": { - "description": "Turn ID that this command belongs to.", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "exec_command_begin" - ] - } - } - }, - { - "description": "Incremental chunk of output from a running command.", - "type": "object", - "required": [ - "call_id", - "chunk", - "stream", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the ExecCommandBegin that produced this chunk.", - "type": "string" - }, - "chunk": { - "description": "Raw bytes from the stream (may not be valid UTF-8).", - "type": "string" - }, - "stream": { - "description": "Which stream produced this chunk.", - "allOf": [ - { - "$ref": "#/definitions/ExecOutputStream" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "exec_command_output_delta" - ] - } - } - }, - { - "description": "Terminal interaction for an in-progress command (stdin sent and stdout observed).", - "type": "object", - "required": [ - "call_id", - "process_id", - "stdin", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the ExecCommandBegin that produced this chunk.", - "type": "string" - }, - "process_id": { - "description": "Process id associated with the running command.", - "type": "string" - }, - "stdin": { - "description": "Stdin sent to the running session.", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "terminal_interaction" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "command", - "cwd", - "duration", - "exit_code", - "formatted_output", - "parsed_cmd", - "status", - "stderr", - "stdout", - "turn_id", - "type" - ], - "properties": { - "aggregated_output": { - "description": "Captured aggregated output", - "default": "", - "type": "string" - }, - "call_id": { - "description": "Identifier for the ExecCommandBegin that finished.", - "type": "string" - }, - "command": { - "description": "The command that was executed.", - "type": "array", - "items": { - "type": "string" - } - }, - "cwd": { - "description": "The command's working directory if not the default cwd for the agent.", - "type": "string" - }, - "duration": { - "description": "The duration of the command execution.", - "allOf": [ - { - "$ref": "#/definitions/Duration" - } - ] - }, - "exit_code": { - "description": "The command's exit code.", - "type": "integer", - "format": "int32" - }, - "formatted_output": { - "description": "Formatted output from the command, as seen by the model.", - "type": "string" - }, - "interaction_input": { - "description": "Raw input sent to a unified exec session (if this is an interaction event).", - "type": [ - "string", - "null" - ] - }, - "parsed_cmd": { - "type": "array", - "items": { - "$ref": "#/definitions/ParsedCommand" - } - }, - "process_id": { - "description": "Identifier for the underlying PTY process (when available).", - "type": [ - "string", - "null" - ] - }, - "source": { - "description": "Where the command originated. Defaults to Agent for backward compatibility.", - "default": "agent", - "allOf": [ - { - "$ref": "#/definitions/ExecCommandSource" - } - ] - }, - "status": { - "description": "Completion status for this command execution.", - "allOf": [ - { - "$ref": "#/definitions/ExecCommandStatus" - } - ] - }, - "stderr": { - "description": "Captured stderr", - "type": "string" - }, - "stdout": { - "description": "Captured stdout", - "type": "string" - }, - "turn_id": { - "description": "Turn ID that this command belongs to.", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "exec_command_end" - ] - } - } - }, - { - "description": "Notification that the agent attached a local image via the view_image tool.", - "type": "object", - "required": [ - "call_id", - "path", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the originating tool call.", - "type": "string" - }, - "path": { - "description": "Local filesystem path provided to the tool.", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "view_image_tool_call" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "command", - "cwd", - "parsed_cmd", - "type" - ], - "properties": { - "additional_permissions": { - "description": "Optional additional filesystem permissions requested for this command.", - "anyOf": [ - { - "$ref": "#/definitions/PermissionProfile" - }, - { - "type": "null" - } - ] - }, - "approval_id": { - "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).", - "type": [ - "string", - "null" - ] - }, - "available_decisions": { - "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.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ReviewDecision" - } - }, - "call_id": { - "description": "Identifier for the associated command execution item.", - "type": "string" - }, - "command": { - "description": "The command to be executed.", - "type": "array", - "items": { - "type": "string" - } - }, - "cwd": { - "description": "The command's working directory.", - "type": "string" - }, - "network_approval_context": { - "description": "Optional network context for a blocked request that can be approved.", - "anyOf": [ - { - "$ref": "#/definitions/NetworkApprovalContext" - }, - { - "type": "null" - } - ] - }, - "parsed_cmd": { - "type": "array", - "items": { - "$ref": "#/definitions/ParsedCommand" - } - }, - "proposed_execpolicy_amendment": { - "description": "Proposed execpolicy amendment that can be applied to allow future runs.", - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - } - }, - "proposed_network_policy_amendments": { - "description": "Proposed network policy amendments (for example allow/deny this host in future).", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/NetworkPolicyAmendment" - } - }, - "reason": { - "description": "Optional human-readable reason for the approval (e.g. retry without sandbox).", - "type": [ - "string", - "null" - ] - }, - "skill_metadata": { - "description": "Optional skill metadata when the approval was triggered by a skill script.", - "anyOf": [ - { - "$ref": "#/definitions/ExecApprovalRequestSkillMetadata" - }, - { - "type": "null" - } - ] - }, - "turn_id": { - "description": "Turn ID that this command belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "default": "", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "exec_approval_request" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "permissions", - "type" - ], - "properties": { - "call_id": { - "description": "Responses API call id for the associated tool call, if available.", - "type": "string" - }, - "permissions": { - "$ref": "#/definitions/PermissionProfile" - }, - "reason": { - "type": [ - "string", - "null" - ] - }, - "turn_id": { - "description": "Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "default": "", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "request_permissions" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "questions", - "type" - ], - "properties": { - "call_id": { - "description": "Responses API call id for the associated tool call, if available.", - "type": "string" - }, - "questions": { - "type": "array", - "items": { - "$ref": "#/definitions/RequestUserInputQuestion" - } - }, - "turn_id": { - "description": "Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "default": "", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "request_user_input" - ] - } - } - }, - { - "type": "object", - "required": [ - "arguments", - "callId", - "tool", - "turnId", - "type" - ], - "properties": { - "arguments": true, - "callId": { - "type": "string" - }, - "tool": { - "type": "string" - }, - "turnId": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "dynamic_tool_call_request" - ] - } - } - }, - { - "type": "object", - "required": [ - "arguments", - "call_id", - "content_items", - "duration", - "success", - "tool", - "turn_id", - "type" - ], - "properties": { - "arguments": { - "description": "Dynamic tool call arguments." - }, - "call_id": { - "description": "Identifier for the corresponding DynamicToolCallRequest.", - "type": "string" - }, - "content_items": { - "description": "Dynamic tool response content items.", - "type": "array", - "items": { - "$ref": "#/definitions/DynamicToolCallOutputContentItem" - } - }, - "duration": { - "description": "The duration of the dynamic tool call.", - "allOf": [ - { - "$ref": "#/definitions/Duration" - } - ] - }, - "error": { - "description": "Optional error text when the tool call failed before producing a response.", - "type": [ - "string", - "null" - ] - }, - "success": { - "description": "Whether the tool call succeeded.", - "type": "boolean" - }, - "tool": { - "description": "Dynamic tool name.", - "type": "string" - }, - "turn_id": { - "description": "Turn ID that this dynamic tool call belongs to.", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "dynamic_tool_call_response" - ] - } - } - }, - { - "type": "object", - "required": [ - "id", - "request", - "server_name", - "type" - ], - "properties": { - "id": { - "$ref": "#/definitions/RequestId" - }, - "request": { - "$ref": "#/definitions/ElicitationRequest" - }, - "server_name": { - "type": "string" - }, - "turn_id": { - "description": "Turn ID that this elicitation belongs to, when known.", - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "elicitation_request" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "changes", - "type" - ], - "properties": { - "call_id": { - "description": "Responses API call id for the associated patch apply call, if available.", - "type": "string" - }, - "changes": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/FileChange" - } - }, - "grant_root": { - "description": "When set, the agent is asking the user to allow writes under this root for the remainder of the session.", - "type": [ - "string", - "null" - ] - }, - "reason": { - "description": "Optional explanatory reason (e.g. request for extra write access).", - "type": [ - "string", - "null" - ] - }, - "turn_id": { - "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility with older senders.", - "default": "", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "apply_patch_approval_request" - ] - } - } - }, - { - "description": "Notification advising the user that something they are using has been deprecated and should be phased out.", - "type": "object", - "required": [ - "summary", - "type" - ], - "properties": { - "details": { - "description": "Optional extra guidance, such as migration steps or rationale.", - "type": [ - "string", - "null" - ] - }, - "summary": { - "description": "Concise summary of what is deprecated.", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "deprecation_notice" - ] - } - } - }, - { - "type": "object", - "required": [ - "message", - "type" - ], - "properties": { - "message": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "background_event" - ] - } - } - }, - { - "type": "object", - "required": [ - "type" - ], - "properties": { - "message": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "undo_started" - ] - } - } - }, - { - "type": "object", - "required": [ - "success", - "type" - ], - "properties": { - "message": { - "type": [ - "string", - "null" - ] - }, - "success": { - "type": "boolean" - }, - "type": { - "type": "string", - "enum": [ - "undo_completed" - ] - } - } - }, - { - "description": "Notification that a model stream experienced an error or disconnect and the system is handling it (e.g., retrying with backoff).", - "type": "object", - "required": [ - "message", - "type" - ], - "properties": { - "additional_details": { - "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).", - "default": null, - "type": [ - "string", - "null" - ] - }, - "codex_error_info": { - "default": null, - "anyOf": [ - { - "$ref": "#/definitions/CodexErrorInfo" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "stream_error" - ] - } - } - }, - { - "description": "Notification that the agent is about to apply a code patch. Mirrors `ExecCommandBegin` so front‑ends can show progress indicators.", - "type": "object", - "required": [ - "auto_approved", - "call_id", - "changes", - "type" - ], - "properties": { - "auto_approved": { - "description": "If true, there was no ApplyPatchApprovalRequest for this patch.", - "type": "boolean" - }, - "call_id": { - "description": "Identifier so this can be paired with the PatchApplyEnd event.", - "type": "string" - }, - "changes": { - "description": "The changes to be applied.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/FileChange" - } - }, - "turn_id": { - "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "default": "", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "patch_apply_begin" - ] - } - } - }, - { - "description": "Notification that a patch application has finished.", - "type": "object", - "required": [ - "call_id", - "status", - "stderr", - "stdout", - "success", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the PatchApplyBegin that finished.", - "type": "string" - }, - "changes": { - "description": "The changes that were applied (mirrors PatchApplyBeginEvent::changes).", - "default": {}, - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/FileChange" - } - }, - "status": { - "description": "Completion status for this patch application.", - "allOf": [ - { - "$ref": "#/definitions/PatchApplyStatus" - } - ] - }, - "stderr": { - "description": "Captured stderr (parser errors, IO failures, etc.).", - "type": "string" - }, - "stdout": { - "description": "Captured stdout (summary printed by apply_patch).", - "type": "string" - }, - "success": { - "description": "Whether the patch was applied successfully.", - "type": "boolean" - }, - "turn_id": { - "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "default": "", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "patch_apply_end" - ] - } - } - }, - { - "type": "object", - "required": [ - "type", - "unified_diff" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "turn_diff" - ] - }, - "unified_diff": { - "type": "string" - } - } - }, - { - "description": "Response to GetHistoryEntryRequest.", - "type": "object", - "required": [ - "log_id", - "offset", - "type" - ], - "properties": { - "entry": { - "description": "The entry at the requested offset, if available and parseable.", - "anyOf": [ - { - "$ref": "#/definitions/HistoryEntry" - }, - { - "type": "null" - } - ] - }, - "log_id": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "offset": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "type": { - "type": "string", - "enum": [ - "get_history_entry_response" - ] - } - } - }, - { - "description": "List of MCP tools available to the agent.", - "type": "object", - "required": [ - "auth_statuses", - "resource_templates", - "resources", - "tools", - "type" - ], - "properties": { - "auth_statuses": { - "description": "Authentication status for each configured MCP server.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/McpAuthStatus" - } - }, - "resource_templates": { - "description": "Known resource templates grouped by server name.", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "$ref": "#/definitions/ResourceTemplate" - } - } - }, - "resources": { - "description": "Known resources grouped by server name.", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "$ref": "#/definitions/Resource" - } - } - }, - "tools": { - "description": "Fully qualified tool name -> tool definition.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Tool" - } - }, - "type": { - "type": "string", - "enum": [ - "mcp_list_tools_response" - ] - } - } - }, - { - "description": "List of custom prompts available to the agent.", - "type": "object", - "required": [ - "custom_prompts", - "type" - ], - "properties": { - "custom_prompts": { - "type": "array", - "items": { - "$ref": "#/definitions/CustomPrompt" - } - }, - "type": { - "type": "string", - "enum": [ - "list_custom_prompts_response" - ] - } - } - }, - { - "description": "List of skills available to the agent.", - "type": "object", - "required": [ - "skills", - "type" - ], - "properties": { - "skills": { - "type": "array", - "items": { - "$ref": "#/definitions/SkillsListEntry" - } - }, - "type": { - "type": "string", - "enum": [ - "list_skills_response" - ] - } - } - }, - { - "description": "List of remote skills available to the agent.", - "type": "object", - "required": [ - "skills", - "type" - ], - "properties": { - "skills": { - "type": "array", - "items": { - "$ref": "#/definitions/RemoteSkillSummary" - } - }, - "type": { - "type": "string", - "enum": [ - "list_remote_skills_response" - ] - } - } - }, - { - "description": "Remote skill downloaded to local cache.", - "type": "object", - "required": [ - "id", - "name", - "path", - "type" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "remote_skill_downloaded" - ] - } - } - }, - { - "description": "Notification that skill data may have been updated and clients may want to reload.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "skills_update_available" - ] - } - } - }, - { - "type": "object", - "required": [ - "plan", - "type" - ], - "properties": { - "explanation": { - "description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).", - "default": null, - "type": [ - "string", - "null" - ] - }, - "plan": { - "type": "array", - "items": { - "$ref": "#/definitions/PlanItemArg" - } - }, - "type": { - "type": "string", - "enum": [ - "plan_update" - ] - } - } - }, - { - "type": "object", - "required": [ - "reason", - "type" - ], - "properties": { - "reason": { - "$ref": "#/definitions/TurnAbortReason" - }, - "turn_id": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "turn_aborted" - ] - } - } - }, - { - "description": "Notification that the agent is shutting down.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shutdown_complete" - ] - } - } - }, - { - "description": "Entered review mode.", - "type": "object", - "required": [ - "target", - "type" - ], - "properties": { - "target": { - "$ref": "#/definitions/ReviewTarget" - }, - "type": { - "type": "string", - "enum": [ - "entered_review_mode" - ] - }, - "user_facing_hint": { - "type": [ - "string", - "null" - ] - } - } - }, - { - "description": "Exited review mode with an optional final result to apply.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "review_output": { - "anyOf": [ - { - "$ref": "#/definitions/ReviewOutputEvent" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "exited_review_mode" - ] - } - } - }, - { - "type": "object", - "required": [ - "item", - "type" - ], - "properties": { - "item": { - "$ref": "#/definitions/ResponseItem" - }, - "type": { - "type": "string", - "enum": [ - "raw_response_item" - ] - } - } - }, - { - "type": "object", - "required": [ - "item", - "thread_id", - "turn_id", - "type" - ], - "properties": { - "item": { - "$ref": "#/definitions/TurnItem" - }, - "thread_id": { - "$ref": "#/definitions/ThreadId" - }, - "turn_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "item_started" - ] - } - } - }, - { - "type": "object", - "required": [ - "item", - "thread_id", - "turn_id", - "type" - ], - "properties": { - "item": { - "$ref": "#/definitions/TurnItem" - }, - "thread_id": { - "$ref": "#/definitions/ThreadId" - }, - "turn_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "item_completed" - ] - } - } - }, - { - "type": "object", - "required": [ - "run", - "type" - ], - "properties": { - "run": { - "$ref": "#/definitions/HookRunSummary" - }, - "turn_id": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "hook_started" - ] - } - } - }, - { - "type": "object", - "required": [ - "run", - "type" - ], - "properties": { - "run": { - "$ref": "#/definitions/HookRunSummary" - }, - "turn_id": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "hook_completed" - ] - } - } - }, - { - "type": "object", - "required": [ - "delta", - "item_id", - "thread_id", - "turn_id", - "type" - ], - "properties": { - "delta": { - "type": "string" - }, - "item_id": { - "type": "string" - }, - "thread_id": { - "type": "string" - }, - "turn_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "agent_message_content_delta" - ] - } - } - }, - { - "type": "object", - "required": [ - "delta", - "item_id", - "thread_id", - "turn_id", - "type" - ], - "properties": { - "delta": { - "type": "string" - }, - "item_id": { - "type": "string" - }, - "thread_id": { - "type": "string" - }, - "turn_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "plan_delta" - ] - } - } - }, - { - "type": "object", - "required": [ - "delta", - "item_id", - "thread_id", - "turn_id", - "type" - ], - "properties": { - "delta": { - "type": "string" - }, - "item_id": { - "type": "string" - }, - "summary_index": { - "default": 0, - "type": "integer", - "format": "int64" - }, - "thread_id": { - "type": "string" - }, - "turn_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "reasoning_content_delta" - ] - } - } - }, - { - "type": "object", - "required": [ - "delta", - "item_id", - "thread_id", - "turn_id", - "type" - ], - "properties": { - "content_index": { - "default": 0, - "type": "integer", - "format": "int64" - }, - "delta": { - "type": "string" - }, - "item_id": { - "type": "string" - }, - "thread_id": { - "type": "string" - }, - "turn_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "reasoning_raw_content_delta" - ] - } - } - }, - { - "description": "Collab interaction: agent spawn begin.", - "type": "object", - "required": [ - "call_id", - "model", - "prompt", - "reasoning_effort", - "sender_thread_id", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "model": { - "type": "string" - }, - "prompt": { - "description": "Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning.", - "type": "string" - }, - "reasoning_effort": { - "$ref": "#/definitions/ReasoningEffort" - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "collab_agent_spawn_begin" - ] - } - } - }, - { - "description": "Collab interaction: agent spawn end.", - "type": "object", - "required": [ - "call_id", - "prompt", - "sender_thread_id", - "status", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "new_agent_nickname": { - "description": "Optional nickname assigned to the new agent.", - "type": [ - "string", - "null" - ] - }, - "new_agent_role": { - "description": "Optional role assigned to the new agent.", - "type": [ - "string", - "null" - ] - }, - "new_thread_id": { - "description": "Thread ID of the newly spawned agent, if it was created.", - "anyOf": [ - { - "$ref": "#/definitions/ThreadId" - }, - { - "type": "null" - } - ] - }, - "prompt": { - "description": "Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning.", - "type": "string" - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "status": { - "description": "Last known status of the new agent reported to the sender agent.", - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "collab_agent_spawn_end" - ] - } - } - }, - { - "description": "Collab interaction: agent interaction begin.", - "type": "object", - "required": [ - "call_id", - "prompt", - "receiver_thread_id", - "sender_thread_id", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "prompt": { - "description": "Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning.", - "type": "string" - }, - "receiver_thread_id": { - "description": "Thread ID of the receiver.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "collab_agent_interaction_begin" - ] - } - } - }, - { - "description": "Collab interaction: agent interaction end.", - "type": "object", - "required": [ - "call_id", - "prompt", - "receiver_thread_id", - "sender_thread_id", - "status", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "prompt": { - "description": "Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning.", - "type": "string" - }, - "receiver_agent_nickname": { - "description": "Optional nickname assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_agent_role": { - "description": "Optional role assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_thread_id": { - "description": "Thread ID of the receiver.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "status": { - "description": "Last known status of the receiver agent reported to the sender agent.", - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "collab_agent_interaction_end" - ] - } - } - }, - { - "description": "Collab interaction: waiting begin.", - "type": "object", - "required": [ - "call_id", - "receiver_thread_ids", - "sender_thread_id", - "type" - ], - "properties": { - "call_id": { - "description": "ID of the waiting call.", - "type": "string" - }, - "receiver_agents": { - "description": "Optional nicknames/roles for receivers.", - "type": "array", - "items": { - "$ref": "#/definitions/CollabAgentRef" - } - }, - "receiver_thread_ids": { - "description": "Thread ID of the receivers.", - "type": "array", - "items": { - "$ref": "#/definitions/ThreadId" - } - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "collab_waiting_begin" - ] - } - } - }, - { - "description": "Collab interaction: waiting end.", - "type": "object", - "required": [ - "call_id", - "sender_thread_id", - "statuses", - "type" - ], - "properties": { - "agent_statuses": { - "description": "Optional receiver metadata paired with final statuses.", - "type": "array", - "items": { - "$ref": "#/definitions/CollabAgentStatusEntry" - } - }, - "call_id": { - "description": "ID of the waiting call.", - "type": "string" - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "statuses": { - "description": "Last known status of the receiver agents reported to the sender agent.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/AgentStatus" - } - }, - "type": { - "type": "string", - "enum": [ - "collab_waiting_end" - ] - } - } - }, - { - "description": "Collab interaction: close begin.", - "type": "object", - "required": [ - "call_id", - "receiver_thread_id", - "sender_thread_id", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "receiver_thread_id": { - "description": "Thread ID of the receiver.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "collab_close_begin" - ] - } - } - }, - { - "description": "Collab interaction: close end.", - "type": "object", - "required": [ - "call_id", - "receiver_thread_id", - "sender_thread_id", - "status", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "receiver_agent_nickname": { - "description": "Optional nickname assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_agent_role": { - "description": "Optional role assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_thread_id": { - "description": "Thread ID of the receiver.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "status": { - "description": "Last known status of the receiver agent reported to the sender agent before the close.", - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "collab_close_end" - ] - } - } - }, - { - "description": "Collab interaction: resume begin.", - "type": "object", - "required": [ - "call_id", - "receiver_thread_id", - "sender_thread_id", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "receiver_agent_nickname": { - "description": "Optional nickname assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_agent_role": { - "description": "Optional role assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_thread_id": { - "description": "Thread ID of the receiver.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "collab_resume_begin" - ] - } - } - }, - { - "description": "Collab interaction: resume end.", - "type": "object", - "required": [ - "call_id", - "receiver_thread_id", - "sender_thread_id", - "status", - "type" - ], - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "receiver_agent_nickname": { - "description": "Optional nickname assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_agent_role": { - "description": "Optional role assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_thread_id": { - "description": "Thread ID of the receiver.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "sender_thread_id": { - "description": "Thread ID of the sender.", - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ] - }, - "status": { - "description": "Last known status of the receiver agent reported to the sender agent after resume.", - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "collab_resume_end" - ] - } - } - } - ] - }, - "ExecApprovalRequestSkillMetadata": { - "type": "object", - "required": [ - "path_to_skills_md" - ], - "properties": { - "path_to_skills_md": { - "type": "string" - } - } - }, - "ExecCommandSource": { - "type": "string", - "enum": [ - "agent", - "user_shell", - "unified_exec_startup", - "unified_exec_interaction" - ] - }, - "ExecCommandStatus": { - "type": "string", - "enum": [ - "completed", - "failed", - "declined" - ] - }, - "ExecOutputStream": { - "type": "string", - "enum": [ - "stdout", - "stderr" - ] - }, - "FileChange": { - "oneOf": [ - { - "type": "object", - "required": [ - "content", - "type" - ], - "properties": { - "content": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "add" - ] - } - } - }, - { - "type": "object", - "required": [ - "content", - "type" - ], - "properties": { - "content": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "delete" - ] - } - } - }, - { - "type": "object", - "required": [ - "type", - "unified_diff" - ], - "properties": { - "move_path": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "update" - ] - }, - "unified_diff": { - "type": "string" - } - } - } - ] - }, - "FileSystemPermissions": { - "type": "object", - "properties": { - "read": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/AbsolutePathBuf" - } - }, - "write": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/AbsolutePathBuf" - } - } - } - }, - "FunctionCallOutputBody": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/FunctionCallOutputContentItem" - } - } - ] - }, - "FunctionCallOutputContentItem": { - "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.", - "oneOf": [ - { - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "input_text" - ] - } - } - }, - { - "type": "object", - "required": [ - "image_url", - "type" - ], - "properties": { - "detail": { - "anyOf": [ - { - "$ref": "#/definitions/ImageDetail" - }, - { - "type": "null" - } - ] - }, - "image_url": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "input_image" - ] - } - } - } - ] - }, - "FunctionCallOutputPayload": { - "description": "The payload we send back to OpenAI when reporting a tool call result.\n\n`body` serializes directly as the wire value for `function_call_output.output`. `success` remains internal metadata for downstream handling.", - "type": "object", - "required": [ - "body" - ], - "properties": { - "body": { - "$ref": "#/definitions/FunctionCallOutputBody" - }, - "success": { - "type": [ - "boolean", - "null" - ] - } - } - }, - "GhostCommit": { - "description": "Details of a ghost commit created from a repository state.", - "type": "object", - "required": [ - "id", - "preexisting_untracked_dirs", - "preexisting_untracked_files" - ], - "properties": { - "id": { - "type": "string" - }, - "parent": { - "type": [ - "string", - "null" - ] - }, - "preexisting_untracked_dirs": { - "type": "array", - "items": { - "type": "string" - } - }, - "preexisting_untracked_files": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "GitInfo": { - "type": "object", - "properties": { - "branch": { - "description": "Current branch name", - "type": [ - "string", - "null" - ] - }, - "commit_hash": { - "description": "Current commit hash (SHA)", - "type": [ - "string", - "null" - ] - }, - "repository_url": { - "description": "Repository URL (if available from remote)", - "type": [ - "string", - "null" - ] - } - } - }, - "HistoryEntry": { - "type": "object", - "required": [ - "conversation_id", - "text", - "ts" - ], - "properties": { - "conversation_id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "ts": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - } - }, - "HookEventName": { - "type": "string", - "enum": [ - "session_start", - "stop" - ] - }, - "HookExecutionMode": { - "type": "string", - "enum": [ - "sync", - "async" - ] - }, - "HookHandlerType": { - "type": "string", - "enum": [ - "command", - "prompt", - "agent" - ] - }, - "HookOutputEntry": { - "type": "object", - "required": [ - "kind", - "text" - ], - "properties": { - "kind": { - "$ref": "#/definitions/HookOutputEntryKind" - }, - "text": { - "type": "string" - } - } - }, - "HookOutputEntryKind": { - "type": "string", - "enum": [ - "warning", - "stop", - "feedback", - "context", - "error" - ] - }, - "HookRunStatus": { - "type": "string", - "enum": [ - "running", - "completed", - "failed", - "blocked", - "stopped" - ] - }, - "HookRunSummary": { - "type": "object", - "required": [ - "display_order", - "entries", - "event_name", - "execution_mode", - "handler_type", - "id", - "scope", - "source_path", - "started_at", - "status" - ], - "properties": { - "completed_at": { - "type": [ - "integer", - "null" - ], - "format": "int64" - }, - "display_order": { - "type": "integer", - "format": "int64" - }, - "duration_ms": { - "type": [ - "integer", - "null" - ], - "format": "int64" - }, - "entries": { - "type": "array", - "items": { - "$ref": "#/definitions/HookOutputEntry" - } - }, - "event_name": { - "$ref": "#/definitions/HookEventName" - }, - "execution_mode": { - "$ref": "#/definitions/HookExecutionMode" - }, - "handler_type": { - "$ref": "#/definitions/HookHandlerType" - }, - "id": { - "type": "string" - }, - "scope": { - "$ref": "#/definitions/HookScope" - }, - "source_path": { - "type": "string" - }, - "started_at": { - "type": "integer", - "format": "int64" - }, - "status": { - "$ref": "#/definitions/HookRunStatus" - }, - "status_message": { - "type": [ - "string", - "null" - ] - } - } - }, - "HookScope": { - "type": "string", - "enum": [ - "thread", - "turn" - ] - }, - "ImageDetail": { - "type": "string", - "enum": [ - "auto", - "low", - "high", - "original" - ] - }, - "LocalShellAction": { - "oneOf": [ - { - "type": "object", - "required": [ - "command", - "type" - ], - "properties": { - "command": { - "type": "array", - "items": { - "type": "string" - } - }, - "env": { - "type": [ - "object", - "null" - ], - "additionalProperties": { - "type": "string" - } - }, - "timeout_ms": { - "type": [ - "integer", - "null" - ], - "format": "uint64", - "minimum": 0.0 - }, - "type": { - "type": "string", - "enum": [ - "exec" - ] - }, - "user": { - "type": [ - "string", - "null" - ] - }, - "working_directory": { - "type": [ - "string", - "null" - ] - } - } - } - ] - }, - "LocalShellStatus": { - "type": "string", - "enum": [ - "completed", - "in_progress", - "incomplete" - ] - }, - "MacOsAutomationPermission": { - "oneOf": [ - { - "type": "string", - "enum": [ - "none", - "all" - ] - }, - { - "type": "object", - "required": [ - "bundle_ids" - ], - "properties": { - "bundle_ids": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - } - ] - }, - "MacOsContactsPermission": { - "type": "string", - "enum": [ - "none", - "read_only", - "read_write" - ] - }, - "MacOsPreferencesPermission": { - "type": "string", - "enum": [ - "none", - "read_only", - "read_write" - ] - }, - "MacOsSeatbeltProfileExtensions": { - "type": "object", - "properties": { - "macos_accessibility": { - "default": false, - "type": "boolean" - }, - "macos_automation": { - "default": "none", - "allOf": [ - { - "$ref": "#/definitions/MacOsAutomationPermission" - } - ] - }, - "macos_calendar": { - "default": false, - "type": "boolean" - }, - "macos_contacts": { - "default": "none", - "allOf": [ - { - "$ref": "#/definitions/MacOsContactsPermission" - } - ] - }, - "macos_launch_services": { - "default": false, - "type": "boolean" - }, - "macos_preferences": { - "default": "read_only", - "allOf": [ - { - "$ref": "#/definitions/MacOsPreferencesPermission" - } - ] - }, - "macos_reminders": { - "default": false, - "type": "boolean" - } - } - }, - "McpAuthStatus": { - "type": "string", - "enum": [ - "unsupported", - "not_logged_in", - "bearer_token", - "o_auth" - ] - }, - "McpInvocation": { - "type": "object", - "required": [ - "server", - "tool" - ], - "properties": { - "arguments": { - "description": "Arguments to the tool call." - }, - "server": { - "description": "Name of the MCP server as defined in the config.", - "type": "string" - }, - "tool": { - "description": "Name of the tool as given by the MCP server.", - "type": "string" - } - } - }, - "McpStartupFailure": { - "type": "object", - "required": [ - "error", - "server" - ], - "properties": { - "error": { - "type": "string" - }, - "server": { - "type": "string" - } - } - }, - "McpStartupStatus": { - "oneOf": [ - { - "type": "object", - "required": [ - "state" - ], - "properties": { - "state": { - "type": "string", - "enum": [ - "starting" - ] - } - } - }, - { - "type": "object", - "required": [ - "state" - ], - "properties": { - "state": { - "type": "string", - "enum": [ - "ready" - ] - } - } - }, - { - "type": "object", - "required": [ - "error", - "state" - ], - "properties": { - "error": { - "type": "string" - }, - "state": { - "type": "string", - "enum": [ - "failed" - ] - } - } - }, - { - "type": "object", - "required": [ - "state" - ], - "properties": { - "state": { - "type": "string", - "enum": [ - "cancelled" - ] - } - } - } - ] - }, - "MessagePhase": { - "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", - "oneOf": [ - { - "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", - "type": "string", - "enum": [ - "commentary" - ] - }, - { - "description": "The assistant's terminal answer text for the current turn.", - "type": "string", - "enum": [ - "final_answer" - ] - } - ] - }, - "ModeKind": { - "description": "Initial collaboration mode to use when the TUI starts.", - "type": "string", - "enum": [ - "plan", - "default" - ] - }, - "ModelRerouteReason": { - "type": "string", - "enum": [ - "high_risk_cyber_activity" - ] - }, - "NetworkAccess": { - "description": "Represents whether outbound network access is available to the agent.", - "type": "string", - "enum": [ - "restricted", - "enabled" - ] - }, - "NetworkApprovalContext": { - "type": "object", - "required": [ - "host", - "protocol" - ], - "properties": { - "host": { - "type": "string" - }, - "protocol": { - "$ref": "#/definitions/NetworkApprovalProtocol" - } - } - }, - "NetworkApprovalProtocol": { - "type": "string", - "enum": [ - "http", - "https", - "socks5_tcp", - "socks5_udp" - ] - }, - "NetworkPermissions": { - "type": "object", - "properties": { - "enabled": { - "type": [ - "boolean", - "null" - ] - } - } - }, - "NetworkPolicyAmendment": { - "type": "object", - "required": [ - "action", - "host" - ], - "properties": { - "action": { - "$ref": "#/definitions/NetworkPolicyRuleAction" - }, - "host": { - "type": "string" - } - } - }, - "NetworkPolicyRuleAction": { - "type": "string", - "enum": [ - "allow", - "deny" - ] - }, - "ParsedCommand": { - "oneOf": [ - { - "type": "object", - "required": [ - "cmd", - "name", - "path", - "type" - ], - "properties": { - "cmd": { - "type": "string" - }, - "name": { - "type": "string" - }, - "path": { - "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": "string" - }, - "type": { - "type": "string", - "enum": [ - "read" - ] - } - } - }, - { - "type": "object", - "required": [ - "cmd", - "type" - ], - "properties": { - "cmd": { - "type": "string" - }, - "path": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "list_files" - ] - } - } - }, - { - "type": "object", - "required": [ - "cmd", - "type" - ], - "properties": { - "cmd": { - "type": "string" - }, - "path": { - "type": [ - "string", - "null" - ] - }, - "query": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "search" - ] - } - } - }, - { - "type": "object", - "required": [ - "cmd", - "type" - ], - "properties": { - "cmd": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "unknown" - ] - } - } - } - ] - }, - "PatchApplyStatus": { - "type": "string", - "enum": [ - "completed", - "failed", - "declined" - ] - }, - "PermissionProfile": { - "type": "object", - "properties": { - "file_system": { - "anyOf": [ - { - "$ref": "#/definitions/FileSystemPermissions" - }, - { - "type": "null" - } - ] - }, - "macos": { - "anyOf": [ - { - "$ref": "#/definitions/MacOsSeatbeltProfileExtensions" - }, - { - "type": "null" - } - ] - }, - "network": { - "anyOf": [ - { - "$ref": "#/definitions/NetworkPermissions" - }, - { - "type": "null" - } - ] - } - } - }, - "Personality": { - "type": "string", - "enum": [ - "none", - "friendly", - "pragmatic" - ] - }, - "PlanItemArg": { - "type": "object", - "required": [ - "status", - "step" - ], - "properties": { - "status": { - "$ref": "#/definitions/StepStatus" - }, - "step": { - "type": "string" - } - }, - "additionalProperties": false - }, - "PlanType": { - "type": "string", - "enum": [ - "free", - "go", - "plus", - "pro", - "team", - "business", - "enterprise", - "edu", - "unknown" - ] - }, - "RateLimitSnapshot": { - "type": "object", - "properties": { - "credits": { - "anyOf": [ - { - "$ref": "#/definitions/CreditsSnapshot" - }, - { - "type": "null" - } - ] - }, - "limit_id": { - "type": [ - "string", - "null" - ] - }, - "limit_name": { - "type": [ - "string", - "null" - ] - }, - "plan_type": { - "anyOf": [ - { - "$ref": "#/definitions/PlanType" - }, - { - "type": "null" - } - ] - }, - "primary": { - "anyOf": [ - { - "$ref": "#/definitions/RateLimitWindow" - }, - { - "type": "null" - } - ] - }, - "secondary": { - "anyOf": [ - { - "$ref": "#/definitions/RateLimitWindow" - }, - { - "type": "null" - } - ] - } - } - }, - "RateLimitWindow": { - "type": "object", - "required": [ - "used_percent" - ], - "properties": { - "resets_at": { - "description": "Unix timestamp (seconds since epoch) when the window resets.", - "type": [ - "integer", - "null" - ], - "format": "int64" - }, - "used_percent": { - "description": "Percentage (0-100) of the window that has been consumed.", - "type": "number", - "format": "double" - }, - "window_minutes": { - "description": "Rolling window duration, in minutes.", - "type": [ - "integer", - "null" - ], - "format": "int64" - } - } - }, - "ReadOnlyAccess": { - "description": "Determines how read-only file access is granted inside a restricted sandbox.", - "oneOf": [ - { - "description": "Restrict reads to an explicit set of roots.\n\nWhen `include_platform_defaults` is `true`, platform defaults required for basic execution are included in addition to `readable_roots`.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "include_platform_defaults": { - "description": "Include built-in platform read roots required for basic process execution.", - "default": true, - "type": "boolean" - }, - "readable_roots": { - "description": "Additional absolute roots that should be readable.", - "type": "array", - "items": { - "$ref": "#/definitions/AbsolutePathBuf" - } - }, - "type": { - "type": "string", - "enum": [ - "restricted" - ] - } - } - }, - { - "description": "Allow unrestricted file reads.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "full-access" - ] - } - } - } - ] - }, - "RealtimeAudioFrame": { - "type": "object", - "required": [ - "data", - "num_channels", - "sample_rate" - ], - "properties": { - "data": { - "type": "string" - }, - "num_channels": { - "type": "integer", - "format": "uint16", - "minimum": 0.0 - }, - "sample_rate": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "samples_per_channel": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 - } - } - }, - "RealtimeEvent": { - "oneOf": [ - { - "type": "object", - "required": [ - "SessionUpdated" - ], - "properties": { - "SessionUpdated": { - "type": "object", - "required": [ - "session_id" - ], - "properties": { - "instructions": { - "type": [ - "string", - "null" - ] - }, - "session_id": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "InputTranscriptDelta" - ], - "properties": { - "InputTranscriptDelta": { - "$ref": "#/definitions/RealtimeTranscriptDelta" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "OutputTranscriptDelta" - ], - "properties": { - "OutputTranscriptDelta": { - "$ref": "#/definitions/RealtimeTranscriptDelta" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "AudioOut" - ], - "properties": { - "AudioOut": { - "$ref": "#/definitions/RealtimeAudioFrame" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "ConversationItemAdded" - ], - "properties": { - "ConversationItemAdded": true - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "ConversationItemDone" - ], - "properties": { - "ConversationItemDone": { - "type": "object", - "required": [ - "item_id" - ], - "properties": { - "item_id": { - "type": "string" - } - } - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "HandoffRequested" - ], - "properties": { - "HandoffRequested": { - "$ref": "#/definitions/RealtimeHandoffRequested" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "Error" - ], - "properties": { - "Error": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "RealtimeHandoffRequested": { - "type": "object", - "required": [ - "active_transcript", - "handoff_id", - "input_transcript", - "item_id" - ], - "properties": { - "active_transcript": { - "type": "array", - "items": { - "$ref": "#/definitions/RealtimeTranscriptEntry" - } - }, - "handoff_id": { - "type": "string" - }, - "input_transcript": { - "type": "string" - }, - "item_id": { - "type": "string" - } - } - }, - "RealtimeTranscriptDelta": { - "type": "object", - "required": [ - "delta" - ], - "properties": { - "delta": { - "type": "string" - } - } - }, - "RealtimeTranscriptEntry": { - "type": "object", - "required": [ - "role", - "text" - ], - "properties": { - "role": { - "type": "string" - }, - "text": { - "type": "string" - } - } - }, - "ReasoningEffort": { - "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", - "type": "string", - "enum": [ - "none", - "minimal", - "low", - "medium", - "high", - "xhigh" - ] - }, - "ReasoningItemContent": { - "oneOf": [ - { - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "reasoning_text" - ] - } - } - }, - { - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "text" - ] - } - } - } - ] - }, - "ReasoningItemReasoningSummary": { - "oneOf": [ - { - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "summary_text" - ] - } - } - } - ] - }, - "ReasoningSummary": { - "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", - "oneOf": [ - { - "type": "string", - "enum": [ - "auto", - "concise", - "detailed" - ] - }, - { - "description": "Option to disable reasoning summaries.", - "type": "string", - "enum": [ - "none" - ] - } - ] - }, - "RejectConfig": { - "type": "object", - "required": [ - "mcp_elicitations", - "rules", - "sandbox_approval" - ], - "properties": { - "mcp_elicitations": { - "description": "Reject MCP elicitation prompts.", - "type": "boolean" - }, - "request_permissions": { - "description": "Reject approval prompts related to built-in permission requests.", - "default": false, - "type": "boolean" - }, - "rules": { - "description": "Reject prompts triggered by execpolicy `prompt` rules.", - "type": "boolean" - }, - "sandbox_approval": { - "description": "Reject approval prompts related to sandbox escalation.", - "type": "boolean" - }, - "skill_approval": { - "description": "Reject approval prompts triggered by skill script execution.", - "default": false, - "type": "boolean" - } - } - }, - "RemoteSkillSummary": { - "type": "object", - "required": [ - "description", - "id", - "name" - ], - "properties": { - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "RequestId": { - "description": "ID of a request, which can be either a string or an integer.", - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64" - } - ] - }, - "RequestUserInputQuestion": { - "type": "object", - "required": [ - "header", - "id", - "question" - ], - "properties": { - "header": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isOther": { - "default": false, - "type": "boolean" - }, - "isSecret": { - "default": false, - "type": "boolean" - }, - "options": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/RequestUserInputQuestionOption" - } - }, - "question": { - "type": "string" - } - } - }, - "RequestUserInputQuestionOption": { - "type": "object", - "required": [ - "description", - "label" - ], - "properties": { - "description": { - "type": "string" - }, - "label": { - "type": "string" - } - } - }, - "Resource": { - "description": "A known resource that the server is capable of reading.", - "type": "object", - "required": [ - "name", - "uri" - ], - "properties": { - "_meta": true, - "annotations": true, - "description": { - "type": [ - "string", - "null" - ] - }, - "icons": { - "type": [ - "array", - "null" - ], - "items": true - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" - }, - "size": { - "type": [ - "integer", - "null" - ], - "format": "int64" - }, - "title": { - "type": [ - "string", - "null" - ] - }, - "uri": { - "type": "string" - } - } - }, - "ResourceTemplate": { - "description": "A template description for resources available on the server.", - "type": "object", - "required": [ - "name", - "uriTemplate" - ], - "properties": { - "annotations": true, - "description": { - "type": [ - "string", - "null" - ] - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" - }, - "title": { - "type": [ - "string", - "null" - ] - }, - "uriTemplate": { - "type": "string" - } - } - }, - "ResponseItem": { - "oneOf": [ - { - "type": "object", - "required": [ - "content", - "role", - "type" - ], - "properties": { - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/ContentItem" - } - }, - "end_turn": { - "type": [ - "boolean", - "null" - ] - }, - "id": { - "writeOnly": true, - "type": [ - "string", - "null" - ] - }, - "phase": { - "anyOf": [ - { - "$ref": "#/definitions/MessagePhase" - }, - { - "type": "null" - } - ] - }, - "role": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "message" - ] - } - } - }, - { - "type": "object", - "required": [ - "id", - "summary", - "type" - ], - "properties": { - "content": { - "default": null, - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/ReasoningItemContent" - } - }, - "encrypted_content": { - "type": [ - "string", - "null" - ] - }, - "id": { - "writeOnly": true, - "type": "string" - }, - "summary": { - "type": "array", - "items": { - "$ref": "#/definitions/ReasoningItemReasoningSummary" - } - }, - "type": { - "type": "string", - "enum": [ - "reasoning" - ] - } - } - }, - { - "type": "object", - "required": [ - "action", - "status", - "type" - ], - "properties": { - "action": { - "$ref": "#/definitions/LocalShellAction" - }, - "call_id": { - "description": "Set when using the Responses API.", - "type": [ - "string", - "null" - ] - }, - "id": { - "description": "Legacy id field retained for compatibility with older payloads.", - "writeOnly": true, - "type": [ - "string", - "null" - ] - }, - "status": { - "$ref": "#/definitions/LocalShellStatus" - }, - "type": { - "type": "string", - "enum": [ - "local_shell_call" - ] - } - } - }, - { - "type": "object", - "required": [ - "arguments", - "call_id", - "name", - "type" - ], - "properties": { - "arguments": { - "type": "string" - }, - "call_id": { - "type": "string" - }, - "id": { - "writeOnly": true, - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "function_call" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "output", - "type" - ], - "properties": { - "call_id": { - "type": "string" - }, - "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" - }, - "type": { - "type": "string", - "enum": [ - "function_call_output" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "input", - "name", - "type" - ], - "properties": { - "call_id": { - "type": "string" - }, - "id": { - "writeOnly": true, - "type": [ - "string", - "null" - ] - }, - "input": { - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "custom_tool_call" - ] - } - } - }, - { - "type": "object", - "required": [ - "call_id", - "output", - "type" - ], - "properties": { - "call_id": { - "type": "string" - }, - "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" - }, - "type": { - "type": "string", - "enum": [ - "custom_tool_call_output" - ] - } - } - }, - { - "type": "object", - "required": [ - "type" - ], - "properties": { - "action": { - "anyOf": [ - { - "$ref": "#/definitions/ResponsesApiWebSearchAction" - }, - { - "type": "null" - } - ] - }, - "id": { - "writeOnly": true, - "type": [ - "string", - "null" - ] - }, - "status": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "web_search_call" - ] - } - } - }, - { - "type": "object", - "required": [ - "id", - "result", - "status", - "type" - ], - "properties": { - "id": { - "type": "string" - }, - "result": { - "type": "string" - }, - "revised_prompt": { - "type": [ - "string", - "null" - ] - }, - "status": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "image_generation_call" - ] - } - } - }, - { - "type": "object", - "required": [ - "ghost_commit", - "type" - ], - "properties": { - "ghost_commit": { - "$ref": "#/definitions/GhostCommit" - }, - "type": { - "type": "string", - "enum": [ - "ghost_snapshot" - ] - } - } - }, - { - "type": "object", - "required": [ - "encrypted_content", - "type" - ], - "properties": { - "encrypted_content": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "compaction" - ] - } - } - }, - { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "other" - ] - } - } - } - ] - }, - "ResponsesApiWebSearchAction": { - "oneOf": [ - { - "type": "object", - "required": [ - "type" - ], - "properties": { - "queries": { - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - } - }, - "query": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "search" - ] - } - } - }, - { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "open_page" - ] - }, - "url": { - "type": [ - "string", - "null" - ] - } - } - }, - { - "type": "object", - "required": [ - "type" - ], - "properties": { - "pattern": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "find_in_page" - ] - }, - "url": { - "type": [ - "string", - "null" - ] - } - } - }, - { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "other" - ] - } - } - } - ] - }, - "Result_of_CallToolResult_or_String": { - "oneOf": [ - { - "type": "object", - "required": [ - "Ok" - ], - "properties": { - "Ok": { - "$ref": "#/definitions/CallToolResult" - } - } - }, - { - "type": "object", - "required": [ - "Err" - ], - "properties": { - "Err": { - "type": "string" - } - } - } - ] - }, - "ReviewCodeLocation": { - "description": "Location of the code related to a review finding.", - "type": "object", - "required": [ - "absolute_file_path", - "line_range" - ], - "properties": { - "absolute_file_path": { - "type": "string" - }, - "line_range": { - "$ref": "#/definitions/ReviewLineRange" - } - } - }, - "ReviewDecision": { - "description": "User's decision in response to an ExecApprovalRequest.", - "oneOf": [ - { - "description": "User has approved this command and the agent should execute it.", - "type": "string", - "enum": [ - "approved" - ] - }, - { - "description": "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", - "type": "object", - "required": [ - "approved_execpolicy_amendment" - ], - "properties": { - "approved_execpolicy_amendment": { - "type": "object", - "required": [ - "proposed_execpolicy_amendment" - ], - "properties": { - "proposed_execpolicy_amendment": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "additionalProperties": false - }, - { - "description": "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", - "type": "string", - "enum": [ - "approved_for_session" - ] - }, - { - "description": "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", - "type": "object", - "required": [ - "network_policy_amendment" - ], - "properties": { - "network_policy_amendment": { - "type": "object", - "required": [ - "network_policy_amendment" - ], - "properties": { - "network_policy_amendment": { - "$ref": "#/definitions/NetworkPolicyAmendment" - } - } - } - }, - "additionalProperties": false - }, - { - "description": "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", - "type": "string", - "enum": [ - "denied" - ] - }, - { - "description": "User has denied this command and the agent should not do anything until the user's next command.", - "type": "string", - "enum": [ - "abort" - ] - } - ] - }, - "ReviewFinding": { - "description": "A single review finding describing an observed issue or recommendation.", - "type": "object", - "required": [ - "body", - "code_location", - "confidence_score", - "priority", - "title" - ], - "properties": { - "body": { - "type": "string" - }, - "code_location": { - "$ref": "#/definitions/ReviewCodeLocation" - }, - "confidence_score": { - "type": "number", - "format": "float" - }, - "priority": { - "type": "integer", - "format": "int32" - }, - "title": { - "type": "string" - } - } - }, - "ReviewLineRange": { - "description": "Inclusive line range in a file associated with the finding.", - "type": "object", - "required": [ - "end", - "start" - ], - "properties": { - "end": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "start": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - } - } - }, - "ReviewOutputEvent": { - "description": "Structured review result produced by a child review session.", - "type": "object", - "required": [ - "findings", - "overall_confidence_score", - "overall_correctness", - "overall_explanation" - ], - "properties": { - "findings": { - "type": "array", - "items": { - "$ref": "#/definitions/ReviewFinding" - } - }, - "overall_confidence_score": { - "type": "number", - "format": "float" - }, - "overall_correctness": { - "type": "string" - }, - "overall_explanation": { - "type": "string" - } - } - }, - "ReviewTarget": { - "oneOf": [ - { - "description": "Review the working tree: staged, unstaged, and untracked files.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "uncommittedChanges" - ] - } - } - }, - { - "description": "Review changes between the current branch and the given base branch.", - "type": "object", - "required": [ - "branch", - "type" - ], - "properties": { - "branch": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "baseBranch" - ] - } - } - }, - { - "description": "Review the changes introduced by a specific commit.", - "type": "object", - "required": [ - "sha", - "type" - ], - "properties": { - "sha": { - "type": "string" - }, - "title": { - "description": "Optional human-readable label (e.g., commit subject) for UIs.", - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string", - "enum": [ - "commit" - ] - } - } - }, - { - "description": "Arbitrary instructions provided by the user.", - "type": "object", - "required": [ - "instructions", - "type" - ], - "properties": { - "instructions": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "custom" - ] - } - } - } - ] - }, - "SandboxPolicy": { - "description": "Determines execution restrictions for model shell commands.", - "oneOf": [ - { - "description": "No restrictions whatsoever. Use with caution.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "danger-full-access" - ] - } - } - }, - { - "description": "Read-only access configuration.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "access": { - "description": "Read access granted while running under this policy.", - "allOf": [ - { - "$ref": "#/definitions/ReadOnlyAccess" - } - ] - }, - "network_access": { - "description": "When set to `true`, outbound network access is allowed. `false` by default.", - "type": "boolean" - }, - "type": { - "type": "string", - "enum": [ - "read-only" - ] - } - } - }, - { - "description": "Indicates the process is already in an external sandbox. Allows full disk access while honoring the provided network setting.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "network_access": { - "description": "Whether the external sandbox permits outbound network traffic.", - "default": "restricted", - "allOf": [ - { - "$ref": "#/definitions/NetworkAccess" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "external-sandbox" - ] - } - } - }, - { - "description": "Same as `ReadOnly` but additionally grants write access to the current working directory (\"workspace\").", - "type": "object", - "required": [ - "type" - ], - "properties": { - "exclude_slash_tmp": { - "description": "When set to `true`, will NOT include the `/tmp` among the default writable roots on UNIX. Defaults to `false`.", - "default": false, - "type": "boolean" - }, - "exclude_tmpdir_env_var": { - "description": "When set to `true`, will NOT include the per-user `TMPDIR` environment variable among the default writable roots. Defaults to `false`.", - "default": false, - "type": "boolean" - }, - "network_access": { - "description": "When set to `true`, outbound network access is allowed. `false` by default.", - "default": false, - "type": "boolean" - }, - "read_only_access": { - "description": "Read access granted while running under this policy.", - "allOf": [ - { - "$ref": "#/definitions/ReadOnlyAccess" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "workspace-write" - ] - }, - "writable_roots": { - "description": "Additional folders (beyond cwd and possibly TMPDIR) that should be writable from within the sandbox.", - "type": "array", - "items": { - "$ref": "#/definitions/AbsolutePathBuf" - } - } - } - } - ] - }, - "ServiceTier": { - "type": "string", - "enum": [ - "fast", - "flex" - ] - }, - "SessionMetaLine": { - "description": "SessionMeta contains session-level data that doesn't correspond to a specific turn.\n\nNOTE: There used to be an `instructions` field here, which stored user_instructions, but we now save that on TurnContext. base_instructions stores the base instructions for the session, and should be used when there is no config override.", - "type": "object", - "required": [ - "cli_version", - "cwd", - "id", - "originator", - "timestamp" - ], - "properties": { - "agent_nickname": { - "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "agent_role": { - "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "base_instructions": { - "description": "base_instructions for the session. This *should* always be present when creating a new session, but may be missing for older sessions. If not present, fall back to rendering the base_instructions from ModelsManager.", - "anyOf": [ - { - "$ref": "#/definitions/base_instructions" - }, - { - "type": "null" - } - ] - }, - "cli_version": { - "type": "string" - }, - "cwd": { - "type": "string" - }, - "dynamic_tools": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/DynamicToolSpec" - } - }, - "forked_from_id": { - "anyOf": [ - { - "$ref": "#/definitions/ThreadId" - }, - { - "type": "null" - } - ] - }, - "git": { - "anyOf": [ - { - "$ref": "#/definitions/GitInfo" - }, - { - "type": "null" - } - ] - }, - "id": { - "$ref": "#/definitions/ThreadId" - }, - "memory_mode": { - "type": [ - "string", - "null" - ] - }, - "model_provider": { - "type": [ - "string", - "null" - ] - }, - "originator": { - "type": "string" - }, - "source": { - "default": "vscode", - "allOf": [ - { - "$ref": "#/definitions/SessionSource" - } - ] - }, - "timestamp": { - "type": "string" - } - } - }, - "SessionNetworkProxyRuntime": { - "type": "object", - "required": [ - "http_addr", - "socks_addr" - ], - "properties": { - "http_addr": { - "type": "string" - }, - "socks_addr": { - "type": "string" - } - } - }, - "SessionSource": { - "oneOf": [ - { - "type": "string", - "enum": [ - "cli", - "vscode", - "exec", - "mcp", - "unknown" - ] - }, - { - "type": "object", - "required": [ - "subagent" - ], - "properties": { - "subagent": { - "$ref": "#/definitions/SubAgentSource" - } - }, - "additionalProperties": false - } - ] - }, - "Settings": { - "description": "Settings for a collaboration mode.", - "type": "object", - "required": [ - "model" - ], - "properties": { - "developer_instructions": { - "type": [ - "string", - "null" - ] - }, - "model": { - "type": "string" - }, - "reasoning_effort": { - "anyOf": [ - { - "$ref": "#/definitions/ReasoningEffort" - }, - { - "type": "null" - } - ] - } - } - }, - "SkillDependencies": { - "type": "object", - "required": [ - "tools" - ], - "properties": { - "tools": { - "type": "array", - "items": { - "$ref": "#/definitions/SkillToolDependency" - } - } - } - }, - "SkillErrorInfo": { - "type": "object", - "required": [ - "message", - "path" - ], - "properties": { - "message": { - "type": "string" - }, - "path": { - "type": "string" - } - } - }, - "SkillInterface": { - "type": "object", - "properties": { - "brand_color": { - "type": [ - "string", - "null" - ] - }, - "default_prompt": { - "type": [ - "string", - "null" - ] - }, - "display_name": { - "type": [ - "string", - "null" - ] - }, - "icon_large": { - "type": [ - "string", - "null" - ] - }, - "icon_small": { - "type": [ - "string", - "null" - ] - }, - "short_description": { - "type": [ - "string", - "null" - ] - } - } - }, - "SkillMetadata": { - "type": "object", - "required": [ - "description", - "enabled", - "name", - "path", - "scope" - ], - "properties": { - "dependencies": { - "anyOf": [ - { - "$ref": "#/definitions/SkillDependencies" - }, - { - "type": "null" - } - ] - }, - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "interface": { - "anyOf": [ - { - "$ref": "#/definitions/SkillInterface" - }, - { - "type": "null" - } - ] - }, - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "scope": { - "$ref": "#/definitions/SkillScope" - }, - "short_description": { - "description": "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", - "type": [ - "string", - "null" - ] - } - } - }, - "SkillScope": { - "type": "string", - "enum": [ - "user", - "repo", - "system", - "admin" - ] - }, - "SkillToolDependency": { - "type": "object", - "required": [ - "type", - "value" - ], - "properties": { - "command": { - "type": [ - "string", - "null" - ] - }, - "description": { - "type": [ - "string", - "null" - ] - }, - "transport": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string" - }, - "url": { - "type": [ - "string", - "null" - ] - }, - "value": { - "type": "string" - } - } - }, - "SkillsListEntry": { - "type": "object", - "required": [ - "cwd", - "errors", - "skills" - ], - "properties": { - "cwd": { - "type": "string" - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/definitions/SkillErrorInfo" - } - }, - "skills": { - "type": "array", - "items": { - "$ref": "#/definitions/SkillMetadata" - } - } - } - }, - "StepStatus": { - "type": "string", - "enum": [ - "pending", - "in_progress", - "completed" - ] - }, - "SubAgentSource": { - "oneOf": [ - { - "type": "string", - "enum": [ - "review", - "compact", - "memory_consolidation" - ] - }, - { - "type": "object", - "required": [ - "thread_spawn" - ], - "properties": { - "thread_spawn": { - "type": "object", - "required": [ - "depth", - "parent_thread_id" - ], - "properties": { - "agent_nickname": { - "default": null, - "type": [ - "string", - "null" - ] - }, - "agent_role": { - "default": null, - "type": [ - "string", - "null" - ] - }, - "depth": { - "type": "integer", - "format": "int32" - }, - "parent_thread_id": { - "$ref": "#/definitions/ThreadId" - } - } - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "other" - ], - "properties": { - "other": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "TextElement": { - "type": "object", - "required": [ - "byte_range" - ], - "properties": { - "byte_range": { - "description": "Byte range in the parent `text` buffer that this element occupies.", - "allOf": [ - { - "$ref": "#/definitions/ByteRange" - } - ] - }, - "placeholder": { - "description": "Optional human-readable placeholder for the element, displayed in the UI.", - "type": [ - "string", - "null" - ] - } - } - }, - "ThreadId": { - "type": "string" - }, - "TokenUsage": { - "type": "object", - "required": [ - "cached_input_tokens", - "input_tokens", - "output_tokens", - "reasoning_output_tokens", - "total_tokens" - ], - "properties": { - "cached_input_tokens": { - "type": "integer", - "format": "int64" - }, - "input_tokens": { - "type": "integer", - "format": "int64" - }, - "output_tokens": { - "type": "integer", - "format": "int64" - }, - "reasoning_output_tokens": { - "type": "integer", - "format": "int64" - }, - "total_tokens": { - "type": "integer", - "format": "int64" - } - } - }, - "TokenUsageInfo": { - "type": "object", - "required": [ - "last_token_usage", - "total_token_usage" - ], - "properties": { - "last_token_usage": { - "$ref": "#/definitions/TokenUsage" - }, - "model_context_window": { - "type": [ - "integer", - "null" - ], - "format": "int64" - }, - "total_token_usage": { - "$ref": "#/definitions/TokenUsage" - } - } - }, - "Tool": { - "description": "Definition for a tool the client can call.", - "type": "object", - "required": [ - "inputSchema", - "name" - ], - "properties": { - "_meta": true, - "annotations": true, - "description": { - "type": [ - "string", - "null" - ] - }, - "icons": { - "type": [ - "array", - "null" - ], - "items": true - }, - "inputSchema": true, - "name": { - "type": "string" - }, - "outputSchema": true, - "title": { - "type": [ - "string", - "null" - ] - } - } - }, - "TruncationPolicy": { - "oneOf": [ - { - "type": "object", - "required": [ - "limit", - "mode" - ], - "properties": { - "limit": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "mode": { - "type": "string", - "enum": [ - "bytes" - ] - } - } - }, - { - "type": "object", - "required": [ - "limit", - "mode" - ], - "properties": { - "limit": { - "type": "integer", - "format": "uint", - "minimum": 0.0 - }, - "mode": { - "type": "string", - "enum": [ - "tokens" - ] - } - } - } - ] - }, - "TurnAbortReason": { - "type": "string", - "enum": [ - "interrupted", - "replaced", - "review_ended" - ] - }, - "TurnContextItem": { - "description": "Persist once per real user turn after computing that turn's model-visible context updates, and again after mid-turn compaction when replacement history re-establishes full context, so resume/fork replay can recover the latest durable baseline.", - "type": "object", - "required": [ - "approval_policy", - "cwd", - "model", - "sandbox_policy", - "summary" - ], - "properties": { - "approval_policy": { - "$ref": "#/definitions/AskForApproval" - }, - "collaboration_mode": { - "anyOf": [ - { - "$ref": "#/definitions/CollaborationMode" - }, - { - "type": "null" - } - ] - }, - "current_date": { - "type": [ - "string", - "null" - ] - }, - "cwd": { - "type": "string" - }, - "developer_instructions": { - "type": [ - "string", - "null" - ] - }, - "effort": { - "anyOf": [ - { - "$ref": "#/definitions/ReasoningEffort" - }, - { - "type": "null" - } - ] - }, - "final_output_json_schema": true, - "model": { - "type": "string" - }, - "network": { - "anyOf": [ - { - "$ref": "#/definitions/TurnContextNetworkItem" - }, - { - "type": "null" - } - ] - }, - "personality": { - "anyOf": [ - { - "$ref": "#/definitions/Personality" - }, - { - "type": "null" - } - ] - }, - "realtime_active": { - "type": [ - "boolean", - "null" - ] - }, - "sandbox_policy": { - "$ref": "#/definitions/SandboxPolicy" - }, - "summary": { - "$ref": "#/definitions/ReasoningSummary" - }, - "timezone": { - "type": [ - "string", - "null" - ] - }, - "trace_id": { - "type": [ - "string", - "null" - ] - }, - "truncation_policy": { - "anyOf": [ - { - "$ref": "#/definitions/TruncationPolicy" - }, - { - "type": "null" - } - ] - }, - "turn_id": { - "type": [ - "string", - "null" - ] - }, - "user_instructions": { - "type": [ - "string", - "null" - ] - } - } - }, - "TurnContextNetworkItem": { - "type": "object", - "required": [ - "allowed_domains", - "denied_domains" - ], - "properties": { - "allowed_domains": { - "type": "array", - "items": { - "type": "string" - } - }, - "denied_domains": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "TurnItem": { - "oneOf": [ - { - "type": "object", - "required": [ - "content", - "id", - "type" - ], - "properties": { - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/UserInput" - } - }, - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "UserMessage" - ] - } - } - }, - { - "description": "Assistant-authored message payload used in turn-item streams.\n\n`phase` is optional because not all providers/models emit it. Consumers should use it when present, but retain legacy completion semantics when it is `None`.", - "type": "object", - "required": [ - "content", - "id", - "type" - ], - "properties": { - "content": { - "type": "array", - "items": { - "$ref": "#/definitions/AgentMessageContent" - } - }, - "id": { - "type": "string" - }, - "phase": { - "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.", - "anyOf": [ - { - "$ref": "#/definitions/MessagePhase" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string", - "enum": [ - "AgentMessage" - ] - } - } - }, - { - "type": "object", - "required": [ - "id", - "text", - "type" - ], - "properties": { - "id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "Plan" - ] - } - } - }, - { - "type": "object", - "required": [ - "id", - "summary_text", - "type" - ], - "properties": { - "id": { - "type": "string" - }, - "raw_content": { - "default": [], - "type": "array", - "items": { - "type": "string" - } - }, - "summary_text": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string", - "enum": [ - "Reasoning" - ] - } - } - }, - { - "type": "object", - "required": [ - "action", - "id", - "query", - "type" - ], - "properties": { - "action": { - "$ref": "#/definitions/ResponsesApiWebSearchAction" - }, - "id": { - "type": "string" - }, - "query": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "WebSearch" - ] - } - } - }, - { - "type": "object", - "required": [ - "id", - "result", - "status", - "type" - ], - "properties": { - "id": { - "type": "string" - }, - "result": { - "type": "string" - }, - "revised_prompt": { - "type": [ - "string", - "null" - ] - }, - "saved_path": { - "type": [ - "string", - "null" - ] - }, - "status": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "ImageGeneration" - ] - } - } - }, - { - "type": "object", - "required": [ - "id", - "type" - ], - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "ContextCompaction" - ] - } - } - } - ] - }, - "UserInput": { - "description": "User input", - "oneOf": [ - { - "type": "object", - "required": [ - "text", - "type" - ], - "properties": { - "text": { - "type": "string" - }, - "text_elements": { - "description": "UI-defined spans within `text` that should be treated as special elements. These are byte ranges into the UTF-8 `text` buffer and are used to render or persist rich input markers (e.g., image placeholders) across history and resume without mutating the literal text.", - "default": [], - "type": "array", - "items": { - "$ref": "#/definitions/TextElement" - } - }, - "type": { - "type": "string", - "enum": [ - "text" - ] - } - } - }, - { - "description": "Pre‑encoded data: URI image.", - "type": "object", - "required": [ - "image_url", - "type" - ], - "properties": { - "image_url": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "image" - ] - } - } - }, - { - "description": "Local image path provided by the user. This will be converted to an `Image` variant (base64 data URL) during request serialization.", - "type": "object", - "required": [ - "path", - "type" - ], - "properties": { - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "local_image" - ] - } - } - }, - { - "description": "Skill selected by the user (name + path to SKILL.md).", - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "skill" - ] - } - } - }, - { - "description": "Explicit structured mention selected by the user.\n\n`path` identifies the exact mention target, for example `app://` or `plugin://@`.", - "type": "object", - "required": [ - "name", - "path", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "mention" - ] - } - } - } - ] - }, - "base_instructions": { - "description": "Base instructions for the model in a thread. Corresponds to the `instructions` field in the ResponsesAPI.", - "type": "object", - "required": [ - "text" - ], - "properties": { - "text": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/codex-rs/protocol/generated/rollout-line.schema.ts b/codex-rs/protocol/generated/rollout-line.schema.ts deleted file mode 100644 index f221a0e032c..00000000000 --- a/codex-rs/protocol/generated/rollout-line.schema.ts +++ /dev/null @@ -1,1360 +0,0 @@ -// GENERATED CODE! DO NOT MODIFY BY HAND! - -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -/** - * A path that is guaranteed to be absolute and normalized (though it is not - * guaranteed to be canonicalized or exist on the filesystem). - * - * IMPORTANT: 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. - */ -export type AbsolutePathBuf = string; - -export type AgentMessageContent = { "type": "Text", text: string, }; - -export type AgentMessageContentDeltaEvent = { thread_id: string, turn_id: string, item_id: string, delta: string, }; - -export type AgentMessageDeltaEvent = { delta: string, }; - -export type AgentMessageEvent = { message: string, phase: MessagePhase | null, }; - -/** - * Assistant-authored message payload used in turn-item streams. - * - * `phase` is optional because not all providers/models emit it. Consumers - * should use it when present, but retain legacy completion semantics when it - * is `None`. - */ -export type AgentMessageItem = { id: string, content: Array, -/** - * Optional phase metadata carried through from `ResponseItem::Message`. - * - * This is currently used by TUI rendering to distinguish mid-turn - * commentary from a final answer and avoid status-indicator jitter. - */ -phase?: MessagePhase, }; - -export type AgentReasoningDeltaEvent = { delta: string, }; - -export type AgentReasoningEvent = { text: string, }; - -export type AgentReasoningRawContentDeltaEvent = { delta: string, }; - -export type AgentReasoningRawContentEvent = { text: string, }; - -export type AgentReasoningSectionBreakEvent = { item_id: string, summary_index: bigint, }; - -/** - * Agent lifecycle status, derived from emitted events. - */ -export type AgentStatus = "pending_init" | "running" | { "completed": string | null } | { "errored": string } | "shutdown" | "not_found"; - -export type ApplyPatchApprovalRequestEvent = { -/** - * Responses API call id for the associated patch apply call, if available. - */ -call_id: string, -/** - * Turn ID that this patch belongs to. - * Uses `#[serde(default)]` for backwards compatibility with older senders. - */ -turn_id: string, changes: { [key in string]?: FileChange }, -/** - * Optional explanatory reason (e.g. request for extra write access). - */ -reason: string | null, -/** - * When set, the agent is asking the user to allow writes under this root for the remainder of the session. - */ -grant_root: string | null, }; - -/** - * Determines the conditions under which the user is consulted to approve - * running the command proposed by Codex. - */ -export type AskForApproval = "untrusted" | "on-failure" | "on-request" | { "reject": RejectConfig } | "never"; - -export type BackgroundEventEvent = { message: string, }; - -export type ByteRange = { -/** - * Start byte offset (inclusive) within the UTF-8 text buffer. - */ -start: number, -/** - * End byte offset (exclusive) within the UTF-8 text buffer. - */ -end: number, }; - -/** - * The server's response to a tool call. - */ -export type CallToolResult = { content: Array, structuredContent?: JsonValue, isError?: boolean, _meta?: JsonValue, }; - -/** - * Codex errors that we expose to clients. - */ -export type CodexErrorInfo = "context_window_exceeded" | "usage_limit_exceeded" | "server_overloaded" | { "http_connection_failed": { http_status_code: number | null, } } | { "response_stream_connection_failed": { http_status_code: number | null, } } | "internal_server_error" | "unauthorized" | "bad_request" | "sandbox_error" | { "response_stream_disconnected": { http_status_code: number | null, } } | { "response_too_many_failed_attempts": { http_status_code: number | null, } } | "thread_rollback_failed" | "other"; - -export type CollabAgentInteractionBeginEvent = { -/** - * Identifier for the collab tool call. - */ -call_id: string, -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * Thread ID of the receiver. - */ -receiver_thread_id: ThreadId, -/** - * Prompt sent from the sender to the receiver. Can be empty to prevent CoT - * leaking at the beginning. - */ -prompt: string, }; - -export type CollabAgentInteractionEndEvent = { -/** - * Identifier for the collab tool call. - */ -call_id: string, -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * Thread ID of the receiver. - */ -receiver_thread_id: ThreadId, -/** - * Optional nickname assigned to the receiver agent. - */ -receiver_agent_nickname?: string | null, -/** - * Optional role assigned to the receiver agent. - */ -receiver_agent_role?: string | null, -/** - * Prompt sent from the sender to the receiver. Can be empty to prevent CoT - * leaking at the beginning. - */ -prompt: string, -/** - * Last known status of the receiver agent reported to the sender agent. - */ -status: AgentStatus, }; - -export type CollabAgentRef = { -/** - * Thread ID of the receiver/new agent. - */ -thread_id: ThreadId, -/** - * Optional nickname assigned to an AgentControl-spawned sub-agent. - */ -agent_nickname?: string | null, -/** - * Optional role (agent_role) assigned to an AgentControl-spawned sub-agent. - */ -agent_role?: string | null, }; - -export type CollabAgentSpawnBeginEvent = { -/** - * Identifier for the collab tool call. - */ -call_id: string, -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the - * beginning. - */ -prompt: string, model: string, reasoning_effort: ReasoningEffort, }; - -export type CollabAgentSpawnEndEvent = { -/** - * Identifier for the collab tool call. - */ -call_id: string, -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * Thread ID of the newly spawned agent, if it was created. - */ -new_thread_id: ThreadId | null, -/** - * Optional nickname assigned to the new agent. - */ -new_agent_nickname?: string | null, -/** - * Optional role assigned to the new agent. - */ -new_agent_role?: string | null, -/** - * Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the - * beginning. - */ -prompt: string, -/** - * Last known status of the new agent reported to the sender agent. - */ -status: AgentStatus, }; - -export type CollabAgentStatusEntry = { -/** - * Thread ID of the receiver/new agent. - */ -thread_id: ThreadId, -/** - * Optional nickname assigned to an AgentControl-spawned sub-agent. - */ -agent_nickname?: string | null, -/** - * Optional role (agent_role) assigned to an AgentControl-spawned sub-agent. - */ -agent_role?: string | null, -/** - * Last known status of the agent. - */ -status: AgentStatus, }; - -export type CollabCloseBeginEvent = { -/** - * Identifier for the collab tool call. - */ -call_id: string, -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * Thread ID of the receiver. - */ -receiver_thread_id: ThreadId, }; - -export type CollabCloseEndEvent = { -/** - * Identifier for the collab tool call. - */ -call_id: string, -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * Thread ID of the receiver. - */ -receiver_thread_id: ThreadId, -/** - * Optional nickname assigned to the receiver agent. - */ -receiver_agent_nickname?: string | null, -/** - * Optional role assigned to the receiver agent. - */ -receiver_agent_role?: string | null, -/** - * Last known status of the receiver agent reported to the sender agent before - * the close. - */ -status: AgentStatus, }; - -export type CollabResumeBeginEvent = { -/** - * Identifier for the collab tool call. - */ -call_id: string, -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * Thread ID of the receiver. - */ -receiver_thread_id: ThreadId, -/** - * Optional nickname assigned to the receiver agent. - */ -receiver_agent_nickname?: string | null, -/** - * Optional role assigned to the receiver agent. - */ -receiver_agent_role?: string | null, }; - -export type CollabResumeEndEvent = { -/** - * Identifier for the collab tool call. - */ -call_id: string, -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * Thread ID of the receiver. - */ -receiver_thread_id: ThreadId, -/** - * Optional nickname assigned to the receiver agent. - */ -receiver_agent_nickname?: string | null, -/** - * Optional role assigned to the receiver agent. - */ -receiver_agent_role?: string | null, -/** - * Last known status of the receiver agent reported to the sender agent after - * resume. - */ -status: AgentStatus, }; - -export type CollabWaitingBeginEvent = { -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * Thread ID of the receivers. - */ -receiver_thread_ids: Array, -/** - * Optional nicknames/roles for receivers. - */ -receiver_agents?: Array, -/** - * ID of the waiting call. - */ -call_id: string, }; - -export type CollabWaitingEndEvent = { -/** - * Thread ID of the sender. - */ -sender_thread_id: ThreadId, -/** - * ID of the waiting call. - */ -call_id: string, -/** - * Optional receiver metadata paired with final statuses. - */ -agent_statuses?: Array, -/** - * Last known status of the receiver agents reported to the sender agent. - */ -statuses: { [key in ThreadId]?: AgentStatus }, }; - -/** - * Collaboration mode for a Codex session. - */ -export type CollaborationMode = { mode: ModeKind, settings: Settings, }; - -export type CompactedItem = { message: string, replacement_history?: Array | null, }; - -export type ContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, } | { "type": "output_text", text: string, }; - -export type ContextCompactedEvent = null; - -export type ContextCompactionItem = { id: string, }; - -export type CreditsSnapshot = { has_credits: boolean, unlimited: boolean, balance: string | null, }; - -export type CustomPrompt = { name: string, path: string, content: string, description: string | null, argument_hint: string | null, }; - -export type DeprecationNoticeEvent = { -/** - * Concise summary of what is deprecated. - */ -summary: string, -/** - * Optional extra guidance, such as migration steps or rationale. - */ -details: string | null, }; - -export type DynamicToolCallOutputContentItem = { "type": "inputText", text: string, } | { "type": "inputImage", imageUrl: string, }; - -export type DynamicToolCallRequest = { callId: string, turnId: string, tool: string, arguments: JsonValue, }; - -export type DynamicToolCallResponseEvent = { -/** - * Identifier for the corresponding DynamicToolCallRequest. - */ -call_id: string, -/** - * Turn ID that this dynamic tool call belongs to. - */ -turn_id: string, -/** - * Dynamic tool name. - */ -tool: string, -/** - * Dynamic tool call arguments. - */ -arguments: JsonValue, -/** - * Dynamic tool response content items. - */ -content_items: Array, -/** - * Whether the tool call succeeded. - */ -success: boolean, -/** - * Optional error text when the tool call failed before producing a response. - */ -error: string | null, -/** - * The duration of the dynamic tool call. - */ -duration: string, }; - -export type DynamicToolSpec = { name: string, description: string, inputSchema: JsonValue, }; - -export type ElicitationRequest = { "mode": "form", _meta?: JsonValue, message: string, requested_schema: JsonValue, } | { "mode": "url", _meta?: JsonValue, message: string, url: string, elicitation_id: string, }; - -export type ElicitationRequestEvent = { -/** - * Turn ID that this elicitation belongs to, when known. - */ -turn_id?: string, server_name: string, id: string | number, request: ElicitationRequest, }; - -export type ErrorEvent = { message: string, codex_error_info: CodexErrorInfo | null, }; - -/** - * Response event from the agent - * NOTE: Make sure none of these values have optional types, as it will mess up the extension code-gen. - */ -export type EventMsg = { "type": "error" } & ErrorEvent | { "type": "warning" } & WarningEvent | { "type": "realtime_conversation_started" } & RealtimeConversationStartedEvent | { "type": "realtime_conversation_realtime" } & RealtimeConversationRealtimeEvent | { "type": "realtime_conversation_closed" } & RealtimeConversationClosedEvent | { "type": "model_reroute" } & ModelRerouteEvent | { "type": "context_compacted" } & ContextCompactedEvent | { "type": "thread_rolled_back" } & ThreadRolledBackEvent | { "type": "task_started" } & TurnStartedEvent | { "type": "task_complete" } & TurnCompleteEvent | { "type": "token_count" } & TokenCountEvent | { "type": "agent_message" } & AgentMessageEvent | { "type": "user_message" } & UserMessageEvent | { "type": "agent_message_delta" } & AgentMessageDeltaEvent | { "type": "agent_reasoning" } & AgentReasoningEvent | { "type": "agent_reasoning_delta" } & AgentReasoningDeltaEvent | { "type": "agent_reasoning_raw_content" } & AgentReasoningRawContentEvent | { "type": "agent_reasoning_raw_content_delta" } & AgentReasoningRawContentDeltaEvent | { "type": "agent_reasoning_section_break" } & AgentReasoningSectionBreakEvent | { "type": "session_configured" } & SessionConfiguredEvent | { "type": "thread_name_updated" } & ThreadNameUpdatedEvent | { "type": "mcp_startup_update" } & McpStartupUpdateEvent | { "type": "mcp_startup_complete" } & McpStartupCompleteEvent | { "type": "mcp_tool_call_begin" } & McpToolCallBeginEvent | { "type": "mcp_tool_call_end" } & McpToolCallEndEvent | { "type": "web_search_begin" } & WebSearchBeginEvent | { "type": "web_search_end" } & WebSearchEndEvent | { "type": "image_generation_begin" } & ImageGenerationBeginEvent | { "type": "image_generation_end" } & ImageGenerationEndEvent | { "type": "exec_command_begin" } & ExecCommandBeginEvent | { "type": "exec_command_output_delta" } & ExecCommandOutputDeltaEvent | { "type": "terminal_interaction" } & TerminalInteractionEvent | { "type": "exec_command_end" } & ExecCommandEndEvent | { "type": "view_image_tool_call" } & ViewImageToolCallEvent | { "type": "exec_approval_request" } & ExecApprovalRequestEvent | { "type": "request_permissions" } & RequestPermissionsEvent | { "type": "request_user_input" } & RequestUserInputEvent | { "type": "dynamic_tool_call_request" } & DynamicToolCallRequest | { "type": "dynamic_tool_call_response" } & DynamicToolCallResponseEvent | { "type": "elicitation_request" } & ElicitationRequestEvent | { "type": "apply_patch_approval_request" } & ApplyPatchApprovalRequestEvent | { "type": "deprecation_notice" } & DeprecationNoticeEvent | { "type": "background_event" } & BackgroundEventEvent | { "type": "undo_started" } & UndoStartedEvent | { "type": "undo_completed" } & UndoCompletedEvent | { "type": "stream_error" } & StreamErrorEvent | { "type": "patch_apply_begin" } & PatchApplyBeginEvent | { "type": "patch_apply_end" } & PatchApplyEndEvent | { "type": "turn_diff" } & TurnDiffEvent | { "type": "get_history_entry_response" } & GetHistoryEntryResponseEvent | { "type": "mcp_list_tools_response" } & McpListToolsResponseEvent | { "type": "list_custom_prompts_response" } & ListCustomPromptsResponseEvent | { "type": "list_skills_response" } & ListSkillsResponseEvent | { "type": "list_remote_skills_response" } & ListRemoteSkillsResponseEvent | { "type": "remote_skill_downloaded" } & RemoteSkillDownloadedEvent | { "type": "skills_update_available" } | { "type": "plan_update" } & UpdatePlanArgs | { "type": "turn_aborted" } & TurnAbortedEvent | { "type": "shutdown_complete" } | { "type": "entered_review_mode" } & ReviewRequest | { "type": "exited_review_mode" } & ExitedReviewModeEvent | { "type": "raw_response_item" } & RawResponseItemEvent | { "type": "item_started" } & ItemStartedEvent | { "type": "item_completed" } & ItemCompletedEvent | { "type": "hook_started" } & HookStartedEvent | { "type": "hook_completed" } & HookCompletedEvent | { "type": "agent_message_content_delta" } & AgentMessageContentDeltaEvent | { "type": "plan_delta" } & PlanDeltaEvent | { "type": "reasoning_content_delta" } & ReasoningContentDeltaEvent | { "type": "reasoning_raw_content_delta" } & ReasoningRawContentDeltaEvent | { "type": "collab_agent_spawn_begin" } & CollabAgentSpawnBeginEvent | { "type": "collab_agent_spawn_end" } & CollabAgentSpawnEndEvent | { "type": "collab_agent_interaction_begin" } & CollabAgentInteractionBeginEvent | { "type": "collab_agent_interaction_end" } & CollabAgentInteractionEndEvent | { "type": "collab_waiting_begin" } & CollabWaitingBeginEvent | { "type": "collab_waiting_end" } & CollabWaitingEndEvent | { "type": "collab_close_begin" } & CollabCloseBeginEvent | { "type": "collab_close_end" } & CollabCloseEndEvent | { "type": "collab_resume_begin" } & CollabResumeBeginEvent | { "type": "collab_resume_end" } & CollabResumeEndEvent; - -export type ExecApprovalRequestEvent = { -/** - * Identifier for the associated command execution item. - */ -call_id: string, -/** - * Identifier for this specific approval callback. - * - * When absent, the approval is for the command item itself (`call_id`). - * This is present for subcommand approvals (via execve intercept). - */ -approval_id?: string, -/** - * Turn ID that this command belongs to. - * Uses `#[serde(default)]` for backwards compatibility. - */ -turn_id: string, -/** - * The command to be executed. - */ -command: Array, -/** - * The command's working directory. - */ -cwd: string, -/** - * Optional human-readable reason for the approval (e.g. retry without sandbox). - */ -reason: string | null, -/** - * Optional network context for a blocked request that can be approved. - */ -network_approval_context?: NetworkApprovalContext, -/** - * Proposed execpolicy amendment that can be applied to allow future runs. - */ -proposed_execpolicy_amendment?: ExecPolicyAmendment, -/** - * Proposed network policy amendments (for example allow/deny this host in future). - */ -proposed_network_policy_amendments?: Array, -/** - * Optional additional filesystem permissions requested for this command. - */ -additional_permissions?: PermissionProfile, -/** - * Optional skill metadata when the approval was triggered by a skill script. - */ -skill_metadata?: ExecApprovalRequestSkillMetadata, -/** - * Ordered list of decisions the client may present for this prompt. - * - * When absent, clients should derive the legacy default set from the - * other fields on this request. - */ -available_decisions?: Array, parsed_cmd: Array, }; - -export type ExecApprovalRequestSkillMetadata = { path_to_skills_md: string, }; - -export type ExecCommandBeginEvent = { -/** - * Identifier so this can be paired with the ExecCommandEnd event. - */ -call_id: string, -/** - * Identifier for the underlying PTY process (when available). - */ -process_id?: string, -/** - * Turn ID that this command belongs to. - */ -turn_id: string, -/** - * The command to be executed. - */ -command: Array, -/** - * The command's working directory if not the default cwd for the agent. - */ -cwd: string, parsed_cmd: Array, -/** - * Where the command originated. Defaults to Agent for backward compatibility. - */ -source: ExecCommandSource, -/** - * Raw input sent to a unified exec session (if this is an interaction event). - */ -interaction_input?: string, }; - -export type ExecCommandEndEvent = { -/** - * Identifier for the ExecCommandBegin that finished. - */ -call_id: string, -/** - * Identifier for the underlying PTY process (when available). - */ -process_id?: string, -/** - * Turn ID that this command belongs to. - */ -turn_id: string, -/** - * The command that was executed. - */ -command: Array, -/** - * The command's working directory if not the default cwd for the agent. - */ -cwd: string, parsed_cmd: Array, -/** - * Where the command originated. Defaults to Agent for backward compatibility. - */ -source: ExecCommandSource, -/** - * Raw input sent to a unified exec session (if this is an interaction event). - */ -interaction_input?: string, -/** - * Captured stdout - */ -stdout: string, -/** - * Captured stderr - */ -stderr: string, -/** - * Captured aggregated output - */ -aggregated_output: string, -/** - * The command's exit code. - */ -exit_code: number, -/** - * The duration of the command execution. - */ -duration: string, -/** - * Formatted output from the command, as seen by the model. - */ -formatted_output: string, -/** - * Completion status for this command execution. - */ -status: ExecCommandStatus, }; - -export type ExecCommandOutputDeltaEvent = { -/** - * Identifier for the ExecCommandBegin that produced this chunk. - */ -call_id: string, -/** - * Which stream produced this chunk. - */ -stream: ExecOutputStream, -/** - * Raw bytes from the stream (may not be valid UTF-8). - */ -chunk: string, }; - -export type ExecCommandSource = "agent" | "user_shell" | "unified_exec_startup" | "unified_exec_interaction"; - -export type ExecCommandStatus = "completed" | "failed" | "declined"; - -export type ExecOutputStream = "stdout" | "stderr"; - -/** - * Proposed execpolicy change to allow commands starting with this prefix. - * - * The `command` tokens form the prefix that would be added as an execpolicy - * `prefix_rule(..., decision="allow")`, letting the agent bypass approval for - * commands that start with this token sequence. - */ -export type ExecPolicyAmendment = Array; - -export type ExitedReviewModeEvent = { review_output: ReviewOutputEvent | null, }; - -export type FileChange = { "type": "add", content: string, } | { "type": "delete", content: string, } | { "type": "update", unified_diff: string, move_path: string | null, }; - -export type FileSystemPermissions = { read: Array | null, write: Array | null, }; - -export type FunctionCallOutputBody = string | Array; - -/** - * 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. - */ -export type FunctionCallOutputContentItem = { "type": "input_text", text: string, } | { "type": "input_image", image_url: string, detail?: ImageDetail, }; - -/** - * The payload we send back to OpenAI when reporting a tool call result. - * - * `body` serializes directly as the wire value for `function_call_output.output`. - * `success` remains internal metadata for downstream handling. - */ -export type FunctionCallOutputPayload = { body: FunctionCallOutputBody, success: boolean | null, }; - -export type GetHistoryEntryResponseEvent = { offset: number, log_id: bigint, -/** - * The entry at the requested offset, if available and parseable. - */ -entry: HistoryEntry | null, }; - -/** - * Details of a ghost commit created from a repository state. - */ -export type GhostCommit = { id: string, parent: string | null, preexisting_untracked_files: Array, preexisting_untracked_dirs: Array, }; - -export type GitInfo = { -/** - * Current commit hash (SHA) - */ -commit_hash: string | null, -/** - * Current branch name - */ -branch: string | null, -/** - * Repository URL (if available from remote) - */ -repository_url: string | null, }; - -export type HistoryEntry = { conversation_id: string, ts: bigint, text: string, }; - -export type HookCompletedEvent = { turn_id: string | null, run: HookRunSummary, }; - -export type HookEventName = "session_start" | "stop"; - -export type HookExecutionMode = "sync" | "async"; - -export type HookHandlerType = "command" | "prompt" | "agent"; - -export type HookOutputEntry = { kind: HookOutputEntryKind, text: string, }; - -export type HookOutputEntryKind = "warning" | "stop" | "feedback" | "context" | "error"; - -export type HookRunStatus = "running" | "completed" | "failed" | "blocked" | "stopped"; - -export type HookRunSummary = { id: string, event_name: HookEventName, handler_type: HookHandlerType, execution_mode: HookExecutionMode, scope: HookScope, source_path: string, display_order: bigint, status: HookRunStatus, status_message: string | null, started_at: number, completed_at: number | null, duration_ms: number | null, entries: Array, }; - -export type HookScope = "thread" | "turn"; - -export type HookStartedEvent = { turn_id: string | null, run: HookRunSummary, }; - -export type ImageDetail = "auto" | "low" | "high" | "original"; - -export type ImageGenerationBeginEvent = { call_id: string, }; - -export type ImageGenerationEndEvent = { call_id: string, status: string, revised_prompt?: string, result: string, saved_path?: string, }; - -export type ImageGenerationItem = { id: string, status: string, revised_prompt?: string, result: string, saved_path?: string, }; - -export type ItemCompletedEvent = { thread_id: ThreadId, turn_id: string, item: TurnItem, }; - -export type ItemStartedEvent = { thread_id: ThreadId, turn_id: string, item: TurnItem, }; - -/** - * Response payload for `Op::ListCustomPrompts`. - */ -export type ListCustomPromptsResponseEvent = { custom_prompts: Array, }; - -/** - * Response payload for `Op::ListRemoteSkills`. - */ -export type ListRemoteSkillsResponseEvent = { skills: Array, }; - -/** - * Response payload for `Op::ListSkills`. - */ -export type ListSkillsResponseEvent = { skills: Array, }; - -export type LocalShellAction = { "type": "exec" } & LocalShellExecAction; - -export type LocalShellExecAction = { command: Array, timeout_ms: bigint | null, working_directory: string | null, env: { [key in string]?: string } | null, user: string | null, }; - -export type LocalShellStatus = "completed" | "in_progress" | "incomplete"; - -export type MacOsAutomationPermission = "none" | "all" | { "bundle_ids": Array }; - -export type MacOsContactsPermission = "none" | "read_only" | "read_write"; - -export type MacOsPreferencesPermission = "none" | "read_only" | "read_write"; - -export type MacOsSeatbeltProfileExtensions = { macos_preferences: MacOsPreferencesPermission, macos_automation: MacOsAutomationPermission, macos_launch_services: boolean, macos_accessibility: boolean, macos_calendar: boolean, macos_reminders: boolean, macos_contacts: MacOsContactsPermission, }; - -export type McpAuthStatus = "unsupported" | "not_logged_in" | "bearer_token" | "o_auth"; - -export type McpInvocation = { -/** - * Name of the MCP server as defined in the config. - */ -server: string, -/** - * Name of the tool as given by the MCP server. - */ -tool: string, -/** - * Arguments to the tool call. - */ -arguments: JsonValue | null, }; - -export type McpListToolsResponseEvent = { -/** - * Fully qualified tool name -> tool definition. - */ -tools: { [key in string]?: Tool }, -/** - * Known resources grouped by server name. - */ -resources: { [key in string]?: Array }, -/** - * Known resource templates grouped by server name. - */ -resource_templates: { [key in string]?: Array }, -/** - * Authentication status for each configured MCP server. - */ -auth_statuses: { [key in string]?: McpAuthStatus }, }; - -export type McpStartupCompleteEvent = { ready: Array, failed: Array, cancelled: Array, }; - -export type McpStartupFailure = { server: string, error: string, }; - -export type McpStartupStatus = { "state": "starting" } | { "state": "ready" } | { "state": "failed", error: string, } | { "state": "cancelled" }; - -export type McpStartupUpdateEvent = { -/** - * Server name being started. - */ -server: string, -/** - * Current startup status. - */ -status: McpStartupStatus, }; - -export type McpToolCallBeginEvent = { -/** - * Identifier so this can be paired with the McpToolCallEnd event. - */ -call_id: string, invocation: McpInvocation, }; - -export type McpToolCallEndEvent = { -/** - * Identifier for the corresponding McpToolCallBegin that finished. - */ -call_id: string, invocation: McpInvocation, duration: string, -/** - * Result of the tool call. Note this could be an error. - */ -result: { Ok : CallToolResult } | { Err : string }, }; - -/** - * Classifies an assistant message as interim commentary or final answer text. - * - * Providers do not emit this consistently, so callers must treat `None` as - * "phase unknown" and keep compatibility behavior for legacy models. - */ -export type MessagePhase = "commentary" | "final_answer"; - -/** - * Initial collaboration mode to use when the TUI starts. - */ -export type ModeKind = "plan" | "default"; - -export type ModelRerouteEvent = { from_model: string, to_model: string, reason: ModelRerouteReason, }; - -export type ModelRerouteReason = "high_risk_cyber_activity"; - -/** - * Represents whether outbound network access is available to the agent. - */ -export type NetworkAccess = "restricted" | "enabled"; - -export type NetworkApprovalContext = { host: string, protocol: NetworkApprovalProtocol, }; - -export type NetworkApprovalProtocol = "http" | "https" | "socks5_tcp" | "socks5_udp"; - -export type NetworkPermissions = { enabled: boolean | null, }; - -export type NetworkPolicyAmendment = { host: string, action: NetworkPolicyRuleAction, }; - -export type NetworkPolicyRuleAction = "allow" | "deny"; - -export type ParsedCommand = { "type": "read", cmd: string, name: string, -/** - * (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. - */ -path: string, } | { "type": "list_files", cmd: string, path: string | null, } | { "type": "search", cmd: string, query: string | null, path: string | null, } | { "type": "unknown", cmd: string, }; - -export type PatchApplyBeginEvent = { -/** - * Identifier so this can be paired with the PatchApplyEnd event. - */ -call_id: string, -/** - * Turn ID that this patch belongs to. - * Uses `#[serde(default)]` for backwards compatibility. - */ -turn_id: string, -/** - * If true, there was no ApplyPatchApprovalRequest for this patch. - */ -auto_approved: boolean, -/** - * The changes to be applied. - */ -changes: { [key in string]?: FileChange }, }; - -export type PatchApplyEndEvent = { -/** - * Identifier for the PatchApplyBegin that finished. - */ -call_id: string, -/** - * Turn ID that this patch belongs to. - * Uses `#[serde(default)]` for backwards compatibility. - */ -turn_id: string, -/** - * Captured stdout (summary printed by apply_patch). - */ -stdout: string, -/** - * Captured stderr (parser errors, IO failures, etc.). - */ -stderr: string, -/** - * Whether the patch was applied successfully. - */ -success: boolean, -/** - * The changes that were applied (mirrors PatchApplyBeginEvent::changes). - */ -changes: { [key in string]?: FileChange }, -/** - * Completion status for this patch application. - */ -status: PatchApplyStatus, }; - -export type PatchApplyStatus = "completed" | "failed" | "declined"; - -export type PermissionProfile = { network: NetworkPermissions | null, file_system: FileSystemPermissions | null, macos: MacOsSeatbeltProfileExtensions | null, }; - -export type Personality = "none" | "friendly" | "pragmatic"; - -export type PlanDeltaEvent = { thread_id: string, turn_id: string, item_id: string, delta: string, }; - -export type PlanItem = { id: string, text: string, }; - -export type PlanItemArg = { step: string, status: StepStatus, }; - -export type PlanType = "free" | "go" | "plus" | "pro" | "team" | "business" | "enterprise" | "edu" | "unknown"; - -export type RateLimitSnapshot = { limit_id: string | null, limit_name: string | null, primary: RateLimitWindow | null, secondary: RateLimitWindow | null, credits: CreditsSnapshot | null, plan_type: PlanType | null, }; - -export type RateLimitWindow = { -/** - * Percentage (0-100) of the window that has been consumed. - */ -used_percent: number, -/** - * Rolling window duration, in minutes. - */ -window_minutes: number | null, -/** - * Unix timestamp (seconds since epoch) when the window resets. - */ -resets_at: number | null, }; - -export type RawResponseItemEvent = { item: ResponseItem, }; - -/** - * Determines how read-only file access is granted inside a restricted - * sandbox. - */ -export type ReadOnlyAccess = { "type": "restricted", -/** - * Include built-in platform read roots required for basic process - * execution. - */ -include_platform_defaults: boolean, -/** - * Additional absolute roots that should be readable. - */ -readable_roots?: Array, } | { "type": "full-access" }; - -export type RealtimeAudioFrame = { data: string, sample_rate: number, num_channels: number, samples_per_channel: number | null, }; - -export type RealtimeConversationClosedEvent = { reason: string | null, }; - -export type RealtimeConversationRealtimeEvent = { payload: RealtimeEvent, }; - -export type RealtimeConversationStartedEvent = { session_id: string | null, }; - -export type RealtimeEvent = { "SessionUpdated": { session_id: string, instructions: string | null, } } | { "InputTranscriptDelta": RealtimeTranscriptDelta } | { "OutputTranscriptDelta": RealtimeTranscriptDelta } | { "AudioOut": RealtimeAudioFrame } | { "ConversationItemAdded": JsonValue } | { "ConversationItemDone": { item_id: string, } } | { "HandoffRequested": RealtimeHandoffRequested } | { "Error": string }; - -export type RealtimeHandoffRequested = { handoff_id: string, item_id: string, input_transcript: string, active_transcript: Array, }; - -export type RealtimeTranscriptDelta = { delta: string, }; - -export type RealtimeTranscriptEntry = { role: string, text: string, }; - -export type ReasoningContentDeltaEvent = { thread_id: string, turn_id: string, item_id: string, delta: string, summary_index: bigint, }; - -/** - * See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning - */ -export type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh"; - -export type ReasoningItem = { id: string, summary_text: Array, raw_content: Array, }; - -export type ReasoningItemContent = { "type": "reasoning_text", text: string, } | { "type": "text", text: string, }; - -export type ReasoningItemReasoningSummary = { "type": "summary_text", text: string, }; - -export type ReasoningRawContentDeltaEvent = { thread_id: string, turn_id: string, item_id: string, delta: string, content_index: bigint, }; - -/** - * 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 - */ -export type ReasoningSummary = "auto" | "concise" | "detailed" | "none"; - -export type RejectConfig = { -/** - * Reject approval prompts related to sandbox escalation. - */ -sandbox_approval: boolean, -/** - * Reject prompts triggered by execpolicy `prompt` rules. - */ -rules: boolean, -/** - * Reject approval prompts triggered by skill script execution. - */ -skill_approval: boolean, -/** - * Reject approval prompts related to built-in permission requests. - */ -request_permissions: boolean, -/** - * Reject MCP elicitation prompts. - */ -mcp_elicitations: boolean, }; - -/** - * Response payload for `Op::DownloadRemoteSkill`. - */ -export type RemoteSkillDownloadedEvent = { id: string, name: string, path: string, }; - -export type RemoteSkillSummary = { id: string, name: string, description: string, }; - -export type RequestPermissionsEvent = { -/** - * Responses API call id for the associated tool call, if available. - */ -call_id: string, -/** - * Turn ID that this request belongs to. - * Uses `#[serde(default)]` for backwards compatibility. - */ -turn_id: string, reason: string | null, permissions: PermissionProfile, }; - -export type RequestUserInputEvent = { -/** - * Responses API call id for the associated tool call, if available. - */ -call_id: string, -/** - * Turn ID that this request belongs to. - * Uses `#[serde(default)]` for backwards compatibility. - */ -turn_id: string, questions: Array, }; - -export type RequestUserInputQuestion = { id: string, header: string, question: string, isOther: boolean, isSecret: boolean, options: Array | null, }; - -export type RequestUserInputQuestionOption = { label: string, description: string, }; - -/** - * A known resource that the server is capable of reading. - */ -export type Resource = { annotations?: JsonValue, description?: string, mimeType?: string, name: string, size?: number, title?: string, uri: string, icons?: Array, _meta?: JsonValue, }; - -/** - * A template description for resources available on the server. - */ -export type ResourceTemplate = { annotations?: JsonValue, uriTemplate: string, name: string, title?: string, description?: string, mimeType?: string, }; - -export type ResponseItem = { "type": "message", role: string, content: Array, end_turn?: boolean, phase?: MessagePhase, } | { "type": "reasoning", summary: Array, content?: Array, encrypted_content: string | null, } | { "type": "local_shell_call", -/** - * Set when using the Responses API. - */ -call_id: string | null, status: LocalShellStatus, action: LocalShellAction, } | { "type": "function_call", name: string, arguments: string, call_id: string, } | { "type": "function_call_output", call_id: string, output: FunctionCallOutputPayload, } | { "type": "custom_tool_call", status?: string, call_id: string, name: string, input: string, } | { "type": "custom_tool_call_output", call_id: string, output: FunctionCallOutputPayload, } | { "type": "web_search_call", status?: string, action?: WebSearchAction, } | { "type": "image_generation_call", id: string, status: string, revised_prompt?: string, result: string, } | { "type": "ghost_snapshot", ghost_commit: GhostCommit, } | { "type": "compaction", encrypted_content: string, } | { "type": "other" }; - -/** - * Location of the code related to a review finding. - */ -export type ReviewCodeLocation = { absolute_file_path: string, line_range: ReviewLineRange, }; - -/** - * User's decision in response to an ExecApprovalRequest. - */ -export type ReviewDecision = "approved" | { "approved_execpolicy_amendment": { proposed_execpolicy_amendment: ExecPolicyAmendment, } } | "approved_for_session" | { "network_policy_amendment": { network_policy_amendment: NetworkPolicyAmendment, } } | "denied" | "abort"; - -/** - * A single review finding describing an observed issue or recommendation. - */ -export type ReviewFinding = { title: string, body: string, confidence_score: number, priority: number, code_location: ReviewCodeLocation, }; - -/** - * Inclusive line range in a file associated with the finding. - */ -export type ReviewLineRange = { start: number, end: number, }; - -/** - * Structured review result produced by a child review session. - */ -export type ReviewOutputEvent = { findings: Array, overall_correctness: string, overall_explanation: string, overall_confidence_score: number, }; - -/** - * Review request sent to the review session. - */ -export type ReviewRequest = { target: ReviewTarget, user_facing_hint?: string, }; - -export type ReviewTarget = { "type": "uncommittedChanges" } | { "type": "baseBranch", branch: string, } | { "type": "commit", sha: string, -/** - * Optional human-readable label (e.g., commit subject) for UIs. - */ -title: string | null, } | { "type": "custom", instructions: string, }; - -export type RolloutLine = { timestamp: string, } & ({ "type": "session_meta", "payload": SessionMetaLine } | { "type": "response_item", "payload": ResponseItem } | { "type": "compacted", "payload": CompactedItem } | { "type": "turn_context", "payload": TurnContextItem } | { "type": "event_msg", "payload": EventMsg }); - -/** - * Determines execution restrictions for model shell commands. - */ -export type SandboxPolicy = { "type": "danger-full-access" } | { "type": "read-only", -/** - * Read access granted while running under this policy. - */ -access?: ReadOnlyAccess, -/** - * When set to `true`, outbound network access is allowed. `false` by - * default. - */ -network_access?: boolean, } | { "type": "external-sandbox", -/** - * Whether the external sandbox permits outbound network traffic. - */ -network_access: NetworkAccess, } | { "type": "workspace-write", -/** - * Additional folders (beyond cwd and possibly TMPDIR) that should be - * writable from within the sandbox. - */ -writable_roots?: Array, -/** - * Read access granted while running under this policy. - */ -read_only_access?: ReadOnlyAccess, -/** - * When set to `true`, outbound network access is allowed. `false` by - * default. - */ -network_access: boolean, -/** - * When set to `true`, will NOT include the per-user `TMPDIR` - * environment variable among the default writable roots. Defaults to - * `false`. - */ -exclude_tmpdir_env_var: boolean, -/** - * When set to `true`, will NOT include the `/tmp` among the default - * writable roots on UNIX. Defaults to `false`. - */ -exclude_slash_tmp: boolean, }; - -export type ServiceTier = "fast" | "flex"; - -export type SessionConfiguredEvent = { session_id: ThreadId, forked_from_id: ThreadId | null, -/** - * Optional user-facing thread name (may be unset). - */ -thread_name?: string, -/** - * Tell the client what model is being queried. - */ -model: string, model_provider_id: string, service_tier: ServiceTier | null, -/** - * When to escalate for approval for execution - */ -approval_policy: AskForApproval, -/** - * How to sandbox commands executed in the system - */ -sandbox_policy: SandboxPolicy, -/** - * Working directory that should be treated as the *root* of the - * session. - */ -cwd: string, -/** - * The effort the model is putting into reasoning about the user's request. - */ -reasoning_effort: ReasoningEffort | null, -/** - * Identifier of the history log file (inode on Unix, 0 otherwise). - */ -history_log_id: bigint, -/** - * Current number of entries in the history log. - */ -history_entry_count: number, -/** - * Optional initial messages (as events) for resumed sessions. - * When present, UIs can use these to seed the history. - */ -initial_messages: Array | null, -/** - * Runtime proxy bind addresses, when the managed proxy was started for this session. - */ -network_proxy?: SessionNetworkProxyRuntime, -/** - * Path in which the rollout is stored. Can be `None` for ephemeral threads - */ -rollout_path: string | null, }; - -export type SessionMetaLine = { git: GitInfo | null, id: ThreadId, forked_from_id: ThreadId | null, timestamp: string, cwd: string, originator: string, cli_version: string, source: SessionSource, -/** - * Optional random unique nickname assigned to an AgentControl-spawned sub-agent. - */ -agent_nickname: string | null, -/** - * Optional role (agent_role) assigned to an AgentControl-spawned sub-agent. - */ -agent_role?: string | null, model_provider: string | null, -/** - * base_instructions for the session. This *should* always be present when creating a new session, - * but may be missing for older sessions. If not present, fall back to rendering the base_instructions - * from ModelsManager. - */ -base_instructions: base_instructions | null, dynamic_tools: Array | null, memory_mode: string | null, }; - -export type SessionNetworkProxyRuntime = { http_addr: string, socks_addr: string, }; - -export type SessionSource = "cli" | "vscode" | "exec" | "mcp" | { "subagent": SubAgentSource } | "unknown"; - -/** - * Settings for a collaboration mode. - */ -export type Settings = { model: string, reasoning_effort: ReasoningEffort | null, developer_instructions: string | null, }; - -export type SkillDependencies = { tools: Array, }; - -export type SkillErrorInfo = { path: string, message: string, }; - -export type SkillInterface = { display_name?: string, short_description?: string, icon_small?: string, icon_large?: string, brand_color?: string, default_prompt?: string, }; - -export type SkillMetadata = { name: string, description: string, -/** - * Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description. - */ -short_description?: string, interface?: SkillInterface, dependencies?: SkillDependencies, path: string, scope: SkillScope, enabled: boolean, }; - -export type SkillScope = "user" | "repo" | "system" | "admin"; - -export type SkillToolDependency = { type: string, value: string, description?: string, transport?: string, command?: string, url?: string, }; - -export type SkillsListEntry = { cwd: string, skills: Array, errors: Array, }; - -export type StepStatus = "pending" | "in_progress" | "completed"; - -export type StreamErrorEvent = { message: string, codex_error_info: CodexErrorInfo | null, -/** - * Optional details about the underlying stream failure (often the same - * human-readable message that is surfaced as the terminal error if retries - * are exhausted). - */ -additional_details: string | null, }; - -export type SubAgentSource = "review" | "compact" | { "thread_spawn": { parent_thread_id: ThreadId, depth: number, agent_nickname: string | null, agent_role: string | null, } } | "memory_consolidation" | { "other": string }; - -export type TerminalInteractionEvent = { -/** - * Identifier for the ExecCommandBegin that produced this chunk. - */ -call_id: string, -/** - * Process id associated with the running command. - */ -process_id: string, -/** - * Stdin sent to the running session. - */ -stdin: string, }; - -export type TextElement = { -/** - * Byte range in the parent `text` buffer that this element occupies. - */ -byte_range: ByteRange, -/** - * Optional human-readable placeholder for the element, displayed in the UI. - */ -placeholder: string | null, }; - -export type ThreadId = string; - -export type ThreadNameUpdatedEvent = { thread_id: ThreadId, thread_name?: string, }; - -export type ThreadRolledBackEvent = { -/** - * Number of user turns that were removed from context. - */ -num_turns: number, }; - -export type TokenCountEvent = { info: TokenUsageInfo | null, rate_limits: RateLimitSnapshot | null, }; - -export type TokenUsage = { input_tokens: number, cached_input_tokens: number, output_tokens: number, reasoning_output_tokens: number, total_tokens: number, }; - -export type TokenUsageInfo = { total_token_usage: TokenUsage, last_token_usage: TokenUsage, model_context_window: number | null, }; - -/** - * Definition for a tool the client can call. - */ -export type Tool = { name: string, title?: string, description?: string, inputSchema: JsonValue, outputSchema?: JsonValue, annotations?: JsonValue, icons?: Array, _meta?: JsonValue, }; - -export type TruncationPolicy = { "mode": "bytes", "limit": number } | { "mode": "tokens", "limit": number }; - -export type TurnAbortReason = "interrupted" | "replaced" | "review_ended"; - -export type TurnAbortedEvent = { turn_id: string | null, reason: TurnAbortReason, }; - -export type TurnCompleteEvent = { turn_id: string, last_agent_message: string | null, }; - -/** - * Persist once per real user turn after computing that turn's model-visible - * context updates, and again after mid-turn compaction when replacement - * history re-establishes full context, so resume/fork replay can recover the - * latest durable baseline. - */ -export type TurnContextItem = { turn_id?: string | null, trace_id?: string | null, cwd: string, current_date?: string | null, timezone?: string | null, approval_policy: AskForApproval, sandbox_policy: SandboxPolicy, network: TurnContextNetworkItem | null, model: string, personality: Personality | null, collaboration_mode?: CollaborationMode | null, realtime_active?: boolean | null, effort: ReasoningEffort | null, summary: ReasoningSummary, user_instructions: string | null, developer_instructions: string | null, final_output_json_schema: JsonValue | null, truncation_policy: TruncationPolicy | null, }; - -export type TurnContextNetworkItem = { allowed_domains: Array, denied_domains: Array, }; - -export type TurnDiffEvent = { unified_diff: string, }; - -export type TurnItem = { "type": "UserMessage" } & UserMessageItem | { "type": "AgentMessage" } & AgentMessageItem | { "type": "Plan" } & PlanItem | { "type": "Reasoning" } & ReasoningItem | { "type": "WebSearch" } & WebSearchItem | { "type": "ImageGeneration" } & ImageGenerationItem | { "type": "ContextCompaction" } & ContextCompactionItem; - -export type TurnStartedEvent = { turn_id: string, model_context_window: bigint | null, collaboration_mode_kind: ModeKind, }; - -export type UndoCompletedEvent = { success: boolean, message: string | null, }; - -export type UndoStartedEvent = { message: string | null, }; - -export type UpdatePlanArgs = { -/** - * Arguments for the `update_plan` todo/checklist tool (not plan mode). - */ -explanation: string | null, plan: Array, }; - -/** - * User input - */ -export type UserInput = { "type": "text", text: string, -/** - * UI-defined spans within `text` that should be treated as special elements. - * These are byte ranges into the UTF-8 `text` buffer and are used to render - * or persist rich input markers (e.g., image placeholders) across history - * and resume without mutating the literal text. - */ -text_elements: Array, } | { "type": "image", image_url: string, } | { "type": "local_image", path: string, } | { "type": "skill", name: string, path: string, } | { "type": "mention", name: string, path: string, }; - -export type UserMessageEvent = { message: string, -/** - * Image URLs sourced from `UserInput::Image`. These are safe - * to replay in legacy UI history events and correspond to images sent to - * the model. - */ -images: Array | null, -/** - * 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. - */ -local_images: Array, -/** - * UI-defined spans within `message` used to render or persist special elements. - */ -text_elements: Array, }; - -export type UserMessageItem = { id: string, content: Array, }; - -export type ViewImageToolCallEvent = { -/** - * Identifier for the originating tool call. - */ -call_id: string, -/** - * Local filesystem path provided to the tool. - */ -path: string, }; - -export type WarningEvent = { message: string, }; - -export type WebSearchAction = { "type": "search", query?: string, queries?: Array, } | { "type": "open_page", url?: string, } | { "type": "find_in_page", url?: string, pattern?: string, } | { "type": "other" }; - -export type WebSearchBeginEvent = { call_id: string, }; - -export type WebSearchEndEvent = { call_id: string, query: string, action: WebSearchAction, }; - -export type WebSearchItem = { id: string, query: string, action: WebSearchAction, }; - -/** - * Base instructions for the model in a thread. Corresponds to the `instructions` field in the ResponsesAPI. - */ -export type base_instructions = { text: string, }; - -export type JsonValue = number | string | boolean | Array | { [key in string]?: JsonValue } | null; diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs index b796167c252..81d5abad80e 100644 --- a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs +++ b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs @@ -1,104 +1,13 @@ -use std::any::TypeId; -use std::collections::BTreeMap; -use std::collections::HashSet; -use std::error::Error; -use std::path::Path; +use std::io; use std::path::PathBuf; -use codex_protocol::protocol::RolloutLine; -use ts_rs::TS; -use ts_rs::TypeVisitor; +use codex_protocol::default_rollout_line_schema_dir; +use codex_protocol::write_rollout_line_schema_artifacts; -const GENERATED_TS_HEADER: &str = "// GENERATED CODE! DO NOT MODIFY BY HAND!\n\n"; -const TS_RS_NOTE: &str = "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n"; -const JSON_SCHEMA_FILENAME: &str = "rollout-line.schema.json"; -const TYPESCRIPT_FILENAME: &str = "rollout-line.schema.ts"; - -fn main() -> Result<(), Box> { +fn main() -> io::Result<()> { let out_dir = std::env::args_os() .nth(1) .map(PathBuf::from) - .unwrap_or_else(|| PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("generated")); - - write_rollout_line_artifacts(&out_dir) -} - -fn write_rollout_line_artifacts(out_dir: &Path) -> Result<(), Box> { - std::fs::create_dir_all(&out_dir)?; - - let schema_path = out_dir.join(JSON_SCHEMA_FILENAME); - let schema = schemars::schema_for!(RolloutLine); - let schema_json = serde_json::to_vec_pretty(&schema)?; - std::fs::write(&schema_path, schema_json)?; - - let typescript_path = out_dir.join(TYPESCRIPT_FILENAME); - let typescript = generate_typescript_bundle::()?; - std::fs::write(&typescript_path, typescript)?; - - println!("wrote {}", schema_path.display()); - println!("wrote {}", typescript_path.display()); - - Ok(()) -} - -fn generate_typescript_bundle() -> Result> { - let mut declarations = BTreeMap::new(); - let mut seen = HashSet::new(); - collect_typescript_declarations::(&mut declarations, &mut seen)?; - - let body = declarations - .into_values() - .collect::>() - .join("\n\n") - .replace("\r\n", "\n") - .replace('\r', "\n"); - Ok(format!("{GENERATED_TS_HEADER}{TS_RS_NOTE}\n{body}\n")) -} - -fn collect_typescript_declarations( - declarations: &mut BTreeMap, - seen: &mut HashSet, -) -> Result<(), Box> { - let Some(output_path) = T::output_path() else { - return Ok(()); - }; - if !seen.insert(TypeId::of::()) { - return Ok(()); - } - - let mut declaration = String::new(); - if let Some(docs) = T::docs() { - declaration.push_str(&docs.replace("\r\n", "\n").replace('\r', "\n")); - } - declaration.push_str("export "); - declaration.push_str(&T::decl().replace("\r\n", "\n").replace('\r', "\n")); - declarations.insert(output_path.components().collect(), declaration); - - let mut visitor = TypeScriptDeclarationCollector { - declarations, - seen, - error: None, - }; - T::visit_dependencies(&mut visitor); - if let Some(error) = visitor.error { - return Err(error); - } - - Ok(()) -} - -struct TypeScriptDeclarationCollector<'a> { - declarations: &'a mut BTreeMap, - seen: &'a mut HashSet, - error: Option>, -} - -impl TypeVisitor for TypeScriptDeclarationCollector<'_> { - fn visit(&mut self) { - if self.error.is_some() { - return; - } - - self.error = collect_typescript_declarations::(self.declarations, self.seen).err(); - } + .unwrap_or_else(default_rollout_line_schema_dir); + write_rollout_line_schema_artifacts(&out_dir) } diff --git a/codex-rs/protocol/src/lib.rs b/codex-rs/protocol/src/lib.rs index d6adf2c5858..72ded8dfd4b 100644 --- a/codex-rs/protocol/src/lib.rs +++ b/codex-rs/protocol/src/lib.rs @@ -17,4 +17,10 @@ pub mod plan_tool; pub mod protocol; pub mod request_permissions; pub mod request_user_input; +mod rollout_line_schema; pub mod user_input; + +#[doc(hidden)] +pub use rollout_line_schema::default_rollout_line_schema_dir; +#[doc(hidden)] +pub use rollout_line_schema::write_rollout_line_schema_artifacts; diff --git a/codex-rs/protocol/src/rollout_line_schema.rs b/codex-rs/protocol/src/rollout_line_schema.rs new file mode 100644 index 00000000000..8af156ed9a3 --- /dev/null +++ b/codex-rs/protocol/src/rollout_line_schema.rs @@ -0,0 +1,126 @@ +use std::any::TypeId; +use std::collections::BTreeMap; +use std::collections::HashSet; +use std::io; +use std::path::Path; +use std::path::PathBuf; + +use schemars::JsonSchema; +use schemars::r#gen::SchemaSettings; +use schemars::schema::RootSchema; +use serde_json::Map; +use serde_json::Value; +use ts_rs::TS; +use ts_rs::TypeVisitor; + +use crate::protocol::RolloutLine; + +const GENERATED_TS_HEADER: &str = "// GENERATED CODE! DO NOT MODIFY BY HAND!\n\n"; +const TS_RS_NOTE: &str = "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n"; +const JSON_SCHEMA_FILENAME: &str = "rollout-line.schema.json"; +const TYPESCRIPT_FILENAME: &str = "rollout-line.schema.ts"; + +pub fn default_rollout_line_schema_dir() -> PathBuf { + let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + let codex_rs_dir = manifest_dir.parent().unwrap_or(manifest_dir); + codex_rs_dir.join("out/rollout-line-schema") +} + +pub fn write_rollout_line_schema_artifacts(out_dir: &Path) -> io::Result<()> { + std::fs::create_dir_all(out_dir)?; + + let schema_path = out_dir.join(JSON_SCHEMA_FILENAME); + std::fs::write(&schema_path, rollout_line_schema_json()?)?; + + let typescript_path = out_dir.join(TYPESCRIPT_FILENAME); + std::fs::write(&typescript_path, rollout_line_schema_typescript())?; + + Ok(()) +} + +fn rollout_line_schema_json() -> io::Result> { + let schema = schema_for_type::(); + let value = serde_json::to_value(schema).map_err(io::Error::other)?; + let value = canonicalize_json(&value); + serde_json::to_vec_pretty(&value).map_err(io::Error::other) +} + +fn rollout_line_schema_typescript() -> String { + generate_typescript_bundle::() +} + +fn schema_for_type() -> RootSchema +where + T: JsonSchema, +{ + SchemaSettings::draft07() + .with(|settings| { + settings.option_add_null_type = false; + }) + .into_generator() + .into_root_schema_for::() +} + +fn canonicalize_json(value: &Value) -> Value { + match value { + Value::Array(items) => Value::Array(items.iter().map(canonicalize_json).collect()), + Value::Object(map) => { + let mut entries: Vec<_> = map.iter().collect(); + entries.sort_by(|(left, _), (right, _)| left.cmp(right)); + let mut sorted = Map::with_capacity(map.len()); + for (key, child) in entries { + sorted.insert(key.clone(), canonicalize_json(child)); + } + Value::Object(sorted) + } + _ => value.clone(), + } +} + +fn generate_typescript_bundle() -> String { + let mut declarations = BTreeMap::new(); + let mut seen = HashSet::new(); + collect_typescript_declarations::(&mut declarations, &mut seen); + + let body = declarations + .into_values() + .collect::>() + .join("\n\n") + .replace("\r\n", "\n") + .replace('\r', "\n"); + format!("{GENERATED_TS_HEADER}{TS_RS_NOTE}\n{body}\n") +} + +fn collect_typescript_declarations( + declarations: &mut BTreeMap, + seen: &mut HashSet, +) { + let Some(output_path) = T::output_path() else { + return; + }; + if !seen.insert(TypeId::of::()) { + return; + } + + let mut declaration = String::new(); + if let Some(docs) = T::docs() { + declaration.push_str(&docs.replace("\r\n", "\n").replace('\r', "\n")); + } + declaration.push_str("export "); + declaration.push_str(&T::decl().replace("\r\n", "\n").replace('\r', "\n")); + declarations.insert(output_path.components().collect(), declaration); + + let mut visitor = TypeScriptDeclarationCollector { declarations, seen }; + T::visit_dependencies(&mut visitor); +} + +struct TypeScriptDeclarationCollector<'a> { + declarations: &'a mut BTreeMap, + seen: &'a mut HashSet, +} + +impl TypeVisitor for TypeScriptDeclarationCollector<'_> { + fn visit(&mut self) { + collect_typescript_declarations::(self.declarations, self.seen); + } +} diff --git a/justfile b/justfile index e32a96181e7..87705d46381 100644 --- a/justfile +++ b/justfile @@ -78,6 +78,10 @@ mcp-server-run *args: write-config-schema: cargo run -p codex-core --bin codex-write-config-schema +# Generate RolloutLine schema artifacts. +write-rollout-line-schema *args: + cargo run -p codex-protocol --bin codex-write-rollout-line-schema -- "$@" + # Regenerate vendored app-server protocol schema artifacts. write-app-server-schema *args: cargo run -p codex-app-server-protocol --bin write_schema_fixtures -- "$@" From 1b5ae0a9d0937db6fcaad6a082434acf99b998ca Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 22:07:43 -0700 Subject: [PATCH 06/18] . --- .../protocol/src/bin/codex-write-rollout-line-schema.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs index 81d5abad80e..172ef76f972 100644 --- a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs +++ b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs @@ -4,10 +4,17 @@ use std::path::PathBuf; use codex_protocol::default_rollout_line_schema_dir; use codex_protocol::write_rollout_line_schema_artifacts; +const JSON_SCHEMA_FILENAME: &str = "rollout-line.schema.json"; +const TYPESCRIPT_FILENAME: &str = "rollout-line.schema.ts"; + fn main() -> io::Result<()> { let out_dir = std::env::args_os() .nth(1) .map(PathBuf::from) .unwrap_or_else(default_rollout_line_schema_dir); - write_rollout_line_schema_artifacts(&out_dir) + write_rollout_line_schema_artifacts(&out_dir)?; + for filename in [JSON_SCHEMA_FILENAME, TYPESCRIPT_FILENAME] { + println!("Wrote {}", out_dir.join(filename).display()); + } + Ok(()) } From 3eb63ea73a5f5862c78ff31b15219d6ec9f48d13 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 22:20:44 -0700 Subject: [PATCH 07/18] simplify --- .../bin/codex-write-rollout-line-schema.rs | 122 ++++++++++++++++- codex-rs/protocol/src/lib.rs | 6 - codex-rs/protocol/src/rollout_line_schema.rs | 126 ------------------ 3 files changed, 119 insertions(+), 135 deletions(-) delete mode 100644 codex-rs/protocol/src/rollout_line_schema.rs diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs index 172ef76f972..fee04faff80 100644 --- a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs +++ b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs @@ -1,9 +1,20 @@ +use codex_protocol::protocol::RolloutLine; +use schemars::JsonSchema; +use schemars::r#gen::SchemaSettings; +use schemars::schema::RootSchema; +use serde_json::Map; +use serde_json::Value; +use std::any::TypeId; +use std::collections::BTreeMap; +use std::collections::HashSet; use std::io; +use std::path::Path; use std::path::PathBuf; +use ts_rs::TS; +use ts_rs::TypeVisitor; -use codex_protocol::default_rollout_line_schema_dir; -use codex_protocol::write_rollout_line_schema_artifacts; - +const GENERATED_TS_HEADER: &str = "// GENERATED CODE! DO NOT MODIFY BY HAND!\n\n"; +const TS_RS_NOTE: &str = "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n"; const JSON_SCHEMA_FILENAME: &str = "rollout-line.schema.json"; const TYPESCRIPT_FILENAME: &str = "rollout-line.schema.ts"; @@ -18,3 +29,108 @@ fn main() -> io::Result<()> { } Ok(()) } + +fn default_rollout_line_schema_dir() -> PathBuf { + let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + let codex_rs_dir = manifest_dir.parent().unwrap_or(manifest_dir); + codex_rs_dir.join("out/rollout-line-schema") +} + +fn write_rollout_line_schema_artifacts(out_dir: &Path) -> io::Result<()> { + std::fs::create_dir_all(out_dir)?; + + let schema_path = out_dir.join(JSON_SCHEMA_FILENAME); + std::fs::write(&schema_path, rollout_line_schema_json()?)?; + + let typescript_path = out_dir.join(TYPESCRIPT_FILENAME); + std::fs::write(&typescript_path, rollout_line_schema_typescript())?; + + Ok(()) +} + +fn rollout_line_schema_json() -> io::Result> { + let schema = schema_for_type::(); + let value = serde_json::to_value(schema).map_err(io::Error::other)?; + let value = canonicalize_json(&value); + serde_json::to_vec_pretty(&value).map_err(io::Error::other) +} + +fn rollout_line_schema_typescript() -> String { + generate_typescript_bundle::() +} + +fn schema_for_type() -> RootSchema +where + T: JsonSchema, +{ + SchemaSettings::draft07() + .with(|settings| { + settings.option_add_null_type = false; + }) + .into_generator() + .into_root_schema_for::() +} + +fn canonicalize_json(value: &Value) -> Value { + match value { + Value::Array(items) => Value::Array(items.iter().map(canonicalize_json).collect()), + Value::Object(map) => { + let mut entries: Vec<_> = map.iter().collect(); + entries.sort_by(|(left, _), (right, _)| left.cmp(right)); + let mut sorted = Map::with_capacity(map.len()); + for (key, child) in entries { + sorted.insert(key.clone(), canonicalize_json(child)); + } + Value::Object(sorted) + } + _ => value.clone(), + } +} + +fn generate_typescript_bundle() -> String { + let mut declarations = BTreeMap::new(); + let mut seen = HashSet::new(); + collect_typescript_declarations::(&mut declarations, &mut seen); + + let body = declarations + .into_values() + .collect::>() + .join("\n\n") + .replace("\r\n", "\n") + .replace('\r', "\n"); + format!("{GENERATED_TS_HEADER}{TS_RS_NOTE}\n{body}\n") +} + +fn collect_typescript_declarations( + declarations: &mut BTreeMap, + seen: &mut HashSet, +) { + let Some(output_path) = T::output_path() else { + return; + }; + if !seen.insert(TypeId::of::()) { + return; + } + + let mut declaration = String::new(); + if let Some(docs) = T::docs() { + declaration.push_str(&docs.replace("\r\n", "\n").replace('\r', "\n")); + } + declaration.push_str("export "); + declaration.push_str(&T::decl().replace("\r\n", "\n").replace('\r', "\n")); + declarations.insert(output_path.components().collect(), declaration); + + let mut visitor = TypeScriptDeclarationCollector { declarations, seen }; + T::visit_dependencies(&mut visitor); +} + +struct TypeScriptDeclarationCollector<'a> { + declarations: &'a mut BTreeMap, + seen: &'a mut HashSet, +} + +impl TypeVisitor for TypeScriptDeclarationCollector<'_> { + fn visit(&mut self) { + collect_typescript_declarations::(self.declarations, self.seen); + } +} diff --git a/codex-rs/protocol/src/lib.rs b/codex-rs/protocol/src/lib.rs index 72ded8dfd4b..d6adf2c5858 100644 --- a/codex-rs/protocol/src/lib.rs +++ b/codex-rs/protocol/src/lib.rs @@ -17,10 +17,4 @@ pub mod plan_tool; pub mod protocol; pub mod request_permissions; pub mod request_user_input; -mod rollout_line_schema; pub mod user_input; - -#[doc(hidden)] -pub use rollout_line_schema::default_rollout_line_schema_dir; -#[doc(hidden)] -pub use rollout_line_schema::write_rollout_line_schema_artifacts; diff --git a/codex-rs/protocol/src/rollout_line_schema.rs b/codex-rs/protocol/src/rollout_line_schema.rs deleted file mode 100644 index 8af156ed9a3..00000000000 --- a/codex-rs/protocol/src/rollout_line_schema.rs +++ /dev/null @@ -1,126 +0,0 @@ -use std::any::TypeId; -use std::collections::BTreeMap; -use std::collections::HashSet; -use std::io; -use std::path::Path; -use std::path::PathBuf; - -use schemars::JsonSchema; -use schemars::r#gen::SchemaSettings; -use schemars::schema::RootSchema; -use serde_json::Map; -use serde_json::Value; -use ts_rs::TS; -use ts_rs::TypeVisitor; - -use crate::protocol::RolloutLine; - -const GENERATED_TS_HEADER: &str = "// GENERATED CODE! DO NOT MODIFY BY HAND!\n\n"; -const TS_RS_NOTE: &str = "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n"; -const JSON_SCHEMA_FILENAME: &str = "rollout-line.schema.json"; -const TYPESCRIPT_FILENAME: &str = "rollout-line.schema.ts"; - -pub fn default_rollout_line_schema_dir() -> PathBuf { - let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); - let codex_rs_dir = manifest_dir.parent().unwrap_or(manifest_dir); - codex_rs_dir.join("out/rollout-line-schema") -} - -pub fn write_rollout_line_schema_artifacts(out_dir: &Path) -> io::Result<()> { - std::fs::create_dir_all(out_dir)?; - - let schema_path = out_dir.join(JSON_SCHEMA_FILENAME); - std::fs::write(&schema_path, rollout_line_schema_json()?)?; - - let typescript_path = out_dir.join(TYPESCRIPT_FILENAME); - std::fs::write(&typescript_path, rollout_line_schema_typescript())?; - - Ok(()) -} - -fn rollout_line_schema_json() -> io::Result> { - let schema = schema_for_type::(); - let value = serde_json::to_value(schema).map_err(io::Error::other)?; - let value = canonicalize_json(&value); - serde_json::to_vec_pretty(&value).map_err(io::Error::other) -} - -fn rollout_line_schema_typescript() -> String { - generate_typescript_bundle::() -} - -fn schema_for_type() -> RootSchema -where - T: JsonSchema, -{ - SchemaSettings::draft07() - .with(|settings| { - settings.option_add_null_type = false; - }) - .into_generator() - .into_root_schema_for::() -} - -fn canonicalize_json(value: &Value) -> Value { - match value { - Value::Array(items) => Value::Array(items.iter().map(canonicalize_json).collect()), - Value::Object(map) => { - let mut entries: Vec<_> = map.iter().collect(); - entries.sort_by(|(left, _), (right, _)| left.cmp(right)); - let mut sorted = Map::with_capacity(map.len()); - for (key, child) in entries { - sorted.insert(key.clone(), canonicalize_json(child)); - } - Value::Object(sorted) - } - _ => value.clone(), - } -} - -fn generate_typescript_bundle() -> String { - let mut declarations = BTreeMap::new(); - let mut seen = HashSet::new(); - collect_typescript_declarations::(&mut declarations, &mut seen); - - let body = declarations - .into_values() - .collect::>() - .join("\n\n") - .replace("\r\n", "\n") - .replace('\r', "\n"); - format!("{GENERATED_TS_HEADER}{TS_RS_NOTE}\n{body}\n") -} - -fn collect_typescript_declarations( - declarations: &mut BTreeMap, - seen: &mut HashSet, -) { - let Some(output_path) = T::output_path() else { - return; - }; - if !seen.insert(TypeId::of::()) { - return; - } - - let mut declaration = String::new(); - if let Some(docs) = T::docs() { - declaration.push_str(&docs.replace("\r\n", "\n").replace('\r', "\n")); - } - declaration.push_str("export "); - declaration.push_str(&T::decl().replace("\r\n", "\n").replace('\r', "\n")); - declarations.insert(output_path.components().collect(), declaration); - - let mut visitor = TypeScriptDeclarationCollector { declarations, seen }; - T::visit_dependencies(&mut visitor); -} - -struct TypeScriptDeclarationCollector<'a> { - declarations: &'a mut BTreeMap, - seen: &'a mut HashSet, -} - -impl TypeVisitor for TypeScriptDeclarationCollector<'_> { - fn visit(&mut self) { - collect_typescript_declarations::(self.declarations, self.seen); - } -} From 62b6ca7f3b26e9208ab52f8daf792ad019fd8592 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 22:28:26 -0700 Subject: [PATCH 08/18] up 1017 - Wed Mar 11 2026 22:28:26 --- .../bin/codex-write-rollout-line-schema.rs | 59 +++++++------------ 1 file changed, 21 insertions(+), 38 deletions(-) diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs index fee04faff80..cafd37f4caf 100644 --- a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs +++ b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs @@ -1,7 +1,5 @@ use codex_protocol::protocol::RolloutLine; -use schemars::JsonSchema; use schemars::r#gen::SchemaSettings; -use schemars::schema::RootSchema; use serde_json::Map; use serde_json::Value; use std::any::TypeId; @@ -22,53 +20,38 @@ fn main() -> io::Result<()> { let out_dir = std::env::args_os() .nth(1) .map(PathBuf::from) - .unwrap_or_else(default_rollout_line_schema_dir); - write_rollout_line_schema_artifacts(&out_dir)?; + .unwrap_or_else(|| { + let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); + let codex_rs_dir = manifest_dir.parent().unwrap_or(manifest_dir); + codex_rs_dir.join("out/rollout-line-schema") + }); + + std::fs::create_dir_all(&out_dir)?; + std::fs::write( + out_dir.join(JSON_SCHEMA_FILENAME), + rollout_line_schema_json()?, + )?; + std::fs::write( + out_dir.join(TYPESCRIPT_FILENAME), + generate_typescript_bundle::(), + )?; + for filename in [JSON_SCHEMA_FILENAME, TYPESCRIPT_FILENAME] { println!("Wrote {}", out_dir.join(filename).display()); } Ok(()) } -fn default_rollout_line_schema_dir() -> PathBuf { - let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); - let codex_rs_dir = manifest_dir.parent().unwrap_or(manifest_dir); - codex_rs_dir.join("out/rollout-line-schema") -} - -fn write_rollout_line_schema_artifacts(out_dir: &Path) -> io::Result<()> { - std::fs::create_dir_all(out_dir)?; - - let schema_path = out_dir.join(JSON_SCHEMA_FILENAME); - std::fs::write(&schema_path, rollout_line_schema_json()?)?; - - let typescript_path = out_dir.join(TYPESCRIPT_FILENAME); - std::fs::write(&typescript_path, rollout_line_schema_typescript())?; - - Ok(()) -} - fn rollout_line_schema_json() -> io::Result> { - let schema = schema_for_type::(); - let value = serde_json::to_value(schema).map_err(io::Error::other)?; - let value = canonicalize_json(&value); - serde_json::to_vec_pretty(&value).map_err(io::Error::other) -} - -fn rollout_line_schema_typescript() -> String { - generate_typescript_bundle::() -} - -fn schema_for_type() -> RootSchema -where - T: JsonSchema, -{ - SchemaSettings::draft07() + let schema = SchemaSettings::draft07() .with(|settings| { settings.option_add_null_type = false; }) .into_generator() - .into_root_schema_for::() + .into_root_schema_for::(); + let value = serde_json::to_value(schema).map_err(io::Error::other)?; + let value = canonicalize_json(&value); + serde_json::to_vec_pretty(&value).map_err(io::Error::other) } fn canonicalize_json(value: &Value) -> Value { From 12ae824a6b8073d4085c6906a20fe2fb84f2eddc Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 22:32:50 -0700 Subject: [PATCH 09/18] up 1018 - Wed Mar 11 2026 22:32:50 --- codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs index cafd37f4caf..424b7526bf8 100644 --- a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs +++ b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs @@ -6,7 +6,6 @@ use std::any::TypeId; use std::collections::BTreeMap; use std::collections::HashSet; use std::io; -use std::path::Path; use std::path::PathBuf; use ts_rs::TS; use ts_rs::TypeVisitor; @@ -21,8 +20,8 @@ fn main() -> io::Result<()> { .nth(1) .map(PathBuf::from) .unwrap_or_else(|| { - let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR")); - let codex_rs_dir = manifest_dir.parent().unwrap_or(manifest_dir); + let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + let codex_rs_dir = manifest_dir.parent().unwrap_or(&manifest_dir); codex_rs_dir.join("out/rollout-line-schema") }); From 5a51eedb7422111116856b99ce5ffae7bb499d8a Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Wed, 11 Mar 2026 22:39:06 -0700 Subject: [PATCH 10/18] up 1019 - Wed Mar 11 2026 22:39:06 --- codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs index 424b7526bf8..10d9231cc57 100644 --- a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs +++ b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs @@ -43,9 +43,6 @@ fn main() -> io::Result<()> { fn rollout_line_schema_json() -> io::Result> { let schema = SchemaSettings::draft07() - .with(|settings| { - settings.option_add_null_type = false; - }) .into_generator() .into_root_schema_for::(); let value = serde_json::to_value(schema).map_err(io::Error::other)?; From eed8c0616c74f3b351f7b1eb6d4b388f6a790b62 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Thu, 12 Mar 2026 23:32:42 -0700 Subject: [PATCH 11/18] no js --- .../bin/codex-write-rollout-line-schema.rs | 66 +------------------ codex-rs/protocol/src/protocol.rs | 2 +- 2 files changed, 2 insertions(+), 66 deletions(-) diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs index 10d9231cc57..540ef09bdef 100644 --- a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs +++ b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs @@ -2,18 +2,9 @@ use codex_protocol::protocol::RolloutLine; use schemars::r#gen::SchemaSettings; use serde_json::Map; use serde_json::Value; -use std::any::TypeId; -use std::collections::BTreeMap; -use std::collections::HashSet; use std::io; use std::path::PathBuf; -use ts_rs::TS; -use ts_rs::TypeVisitor; - -const GENERATED_TS_HEADER: &str = "// GENERATED CODE! DO NOT MODIFY BY HAND!\n\n"; -const TS_RS_NOTE: &str = "// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.\n"; const JSON_SCHEMA_FILENAME: &str = "rollout-line.schema.json"; -const TYPESCRIPT_FILENAME: &str = "rollout-line.schema.ts"; fn main() -> io::Result<()> { let out_dir = std::env::args_os() @@ -30,14 +21,7 @@ fn main() -> io::Result<()> { out_dir.join(JSON_SCHEMA_FILENAME), rollout_line_schema_json()?, )?; - std::fs::write( - out_dir.join(TYPESCRIPT_FILENAME), - generate_typescript_bundle::(), - )?; - - for filename in [JSON_SCHEMA_FILENAME, TYPESCRIPT_FILENAME] { - println!("Wrote {}", out_dir.join(filename).display()); - } + println!("Wrote {}", out_dir.join(JSON_SCHEMA_FILENAME).display()); Ok(()) } @@ -65,51 +49,3 @@ fn canonicalize_json(value: &Value) -> Value { _ => value.clone(), } } - -fn generate_typescript_bundle() -> String { - let mut declarations = BTreeMap::new(); - let mut seen = HashSet::new(); - collect_typescript_declarations::(&mut declarations, &mut seen); - - let body = declarations - .into_values() - .collect::>() - .join("\n\n") - .replace("\r\n", "\n") - .replace('\r', "\n"); - format!("{GENERATED_TS_HEADER}{TS_RS_NOTE}\n{body}\n") -} - -fn collect_typescript_declarations( - declarations: &mut BTreeMap, - seen: &mut HashSet, -) { - let Some(output_path) = T::output_path() else { - return; - }; - if !seen.insert(TypeId::of::()) { - return; - } - - let mut declaration = String::new(); - if let Some(docs) = T::docs() { - declaration.push_str(&docs.replace("\r\n", "\n").replace('\r', "\n")); - } - declaration.push_str("export "); - declaration.push_str(&T::decl().replace("\r\n", "\n").replace('\r', "\n")); - declarations.insert(output_path.components().collect(), declaration); - - let mut visitor = TypeScriptDeclarationCollector { declarations, seen }; - T::visit_dependencies(&mut visitor); -} - -struct TypeScriptDeclarationCollector<'a> { - declarations: &'a mut BTreeMap, - seen: &'a mut HashSet, -} - -impl TypeVisitor for TypeScriptDeclarationCollector<'_> { - fn visit(&mut self) { - collect_typescript_declarations::(self.declarations, self.seen); - } -} diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs index 6867df59484..152743b3e13 100644 --- a/codex-rs/protocol/src/protocol.rs +++ b/codex-rs/protocol/src/protocol.rs @@ -2501,7 +2501,7 @@ pub enum TruncationPolicy { Tokens(usize), } -#[derive(Serialize, Deserialize, Clone, JsonSchema, TS)] +#[derive(Serialize, Deserialize, Clone, JsonSchema)] pub struct RolloutLine { pub timestamp: String, #[serde(flatten)] From 226d4e3a6cfdb914416f5929903152772f202c84 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Thu, 12 Mar 2026 23:59:50 -0700 Subject: [PATCH 12/18] up 1037 - Thu Mar 12 2026 23:59:50 --- .../schema/json/internal/RolloutLine.json | 7498 +++++++++++++++++ codex-rs/app-server-protocol/src/export.rs | 6 + 2 files changed, 7504 insertions(+) create mode 100644 codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json diff --git a/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json b/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json new file mode 100644 index 00000000000..536f5ce8ec9 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json @@ -0,0 +1,7498 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "definitions": { + "AbsolutePathBuf": { + "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.", + "type": "string" + }, + "AgentMessageContent": { + "oneOf": [ + { + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "Text" + ], + "title": "TextAgentMessageContentType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "TextAgentMessageContent", + "type": "object" + } + ] + }, + "AgentStatus": { + "description": "Agent lifecycle status, derived from emitted events.", + "oneOf": [ + { + "description": "Agent is waiting for initialization.", + "enum": [ + "pending_init" + ], + "type": "string" + }, + { + "description": "Agent is currently running.", + "enum": [ + "running" + ], + "type": "string" + }, + { + "additionalProperties": false, + "description": "Agent is done. Contains the final assistant message.", + "properties": { + "completed": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "completed" + ], + "title": "CompletedAgentStatus", + "type": "object" + }, + { + "additionalProperties": false, + "description": "Agent encountered an error.", + "properties": { + "errored": { + "type": "string" + } + }, + "required": [ + "errored" + ], + "title": "ErroredAgentStatus", + "type": "object" + }, + { + "description": "Agent has been shutdown.", + "enum": [ + "shutdown" + ], + "type": "string" + }, + { + "description": "Agent is not found.", + "enum": [ + "not_found" + ], + "type": "string" + } + ] + }, + "AskForApproval": { + "description": "Determines the conditions under which the user is consulted to approve running the command proposed by Codex.", + "oneOf": [ + { + "description": "Under this policy, only \"known safe\" commands—as determined by `is_safe_command()`—that **only read files** are auto‑approved. Everything else will ask the user to approve.", + "enum": [ + "untrusted" + ], + "type": "string" + }, + { + "description": "DEPRECATED: *All* commands are auto‑approved, but they are expected to run inside a sandbox where network access is disabled and writes are confined to a specific set of paths. If the command fails, it will be escalated to the user to approve execution without a sandbox. Prefer `OnRequest` for interactive runs or `Never` for non-interactive runs.", + "enum": [ + "on-failure" + ], + "type": "string" + }, + { + "description": "The model decides when to ask the user for approval.", + "enum": [ + "on-request" + ], + "type": "string" + }, + { + "additionalProperties": false, + "description": "Fine-grained controls for individual approval flows.\n\nWhen a field is `true`, commands in that category are allowed. When it is `false`, those requests are automatically rejected instead of shown to the user.", + "properties": { + "granular": { + "$ref": "#/definitions/GranularApprovalConfig" + } + }, + "required": [ + "granular" + ], + "title": "GranularAskForApproval", + "type": "object" + }, + { + "description": "Never ask the user to approve commands. Failures are immediately returned to the model, and never escalated to the user for approval.", + "enum": [ + "never" + ], + "type": "string" + } + ] + }, + "ByteRange": { + "properties": { + "end": { + "description": "End byte offset (exclusive) within the UTF-8 text buffer.", + "format": "uint", + "minimum": 0.0, + "type": "integer" + }, + "start": { + "description": "Start byte offset (inclusive) within the UTF-8 text buffer.", + "format": "uint", + "minimum": 0.0, + "type": "integer" + } + }, + "required": [ + "end", + "start" + ], + "type": "object" + }, + "CallToolResult": { + "description": "The server's response to a tool call.", + "properties": { + "_meta": true, + "content": { + "items": true, + "type": "array" + }, + "isError": { + "type": [ + "boolean", + "null" + ] + }, + "structuredContent": true + }, + "required": [ + "content" + ], + "type": "object" + }, + "CodexErrorInfo": { + "description": "Codex errors that we expose to clients.", + "oneOf": [ + { + "enum": [ + "context_window_exceeded", + "usage_limit_exceeded", + "server_overloaded", + "internal_server_error", + "unauthorized", + "bad_request", + "sandbox_error", + "thread_rollback_failed", + "other" + ], + "type": "string" + }, + { + "additionalProperties": false, + "properties": { + "http_connection_failed": { + "properties": { + "http_status_code": { + "format": "uint16", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + } + }, + "type": "object" + } + }, + "required": [ + "http_connection_failed" + ], + "title": "HttpConnectionFailedCodexErrorInfo", + "type": "object" + }, + { + "additionalProperties": false, + "description": "Failed to connect to the response SSE stream.", + "properties": { + "response_stream_connection_failed": { + "properties": { + "http_status_code": { + "format": "uint16", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + } + }, + "type": "object" + } + }, + "required": [ + "response_stream_connection_failed" + ], + "title": "ResponseStreamConnectionFailedCodexErrorInfo", + "type": "object" + }, + { + "additionalProperties": false, + "description": "The response SSE stream disconnected in the middle of a turnbefore completion.", + "properties": { + "response_stream_disconnected": { + "properties": { + "http_status_code": { + "format": "uint16", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + } + }, + "type": "object" + } + }, + "required": [ + "response_stream_disconnected" + ], + "title": "ResponseStreamDisconnectedCodexErrorInfo", + "type": "object" + }, + { + "additionalProperties": false, + "description": "Reached the retry limit for responses.", + "properties": { + "response_too_many_failed_attempts": { + "properties": { + "http_status_code": { + "format": "uint16", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + } + }, + "type": "object" + } + }, + "required": [ + "response_too_many_failed_attempts" + ], + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo", + "type": "object" + } + ] + }, + "CollabAgentRef": { + "properties": { + "agent_nickname": { + "description": "Optional nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agent_role": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the receiver/new agent." + } + }, + "required": [ + "thread_id" + ], + "type": "object" + }, + "CollabAgentStatusEntry": { + "properties": { + "agent_nickname": { + "description": "Optional nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agent_role": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ], + "description": "Last known status of the agent." + }, + "thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the receiver/new agent." + } + }, + "required": [ + "status", + "thread_id" + ], + "type": "object" + }, + "CollaborationMode": { + "description": "Collaboration mode for a Codex session.", + "properties": { + "mode": { + "$ref": "#/definitions/ModeKind" + }, + "settings": { + "$ref": "#/definitions/Settings" + } + }, + "required": [ + "mode", + "settings" + ], + "type": "object" + }, + "CompactedItem": { + "properties": { + "message": { + "type": "string" + }, + "replacement_history": { + "items": { + "$ref": "#/definitions/ResponseItem" + }, + "type": [ + "array", + "null" + ] + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "ContentItem": { + "oneOf": [ + { + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "input_text" + ], + "title": "InputTextContentItemType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "InputTextContentItem", + "type": "object" + }, + { + "properties": { + "image_url": { + "type": "string" + }, + "type": { + "enum": [ + "input_image" + ], + "title": "InputImageContentItemType", + "type": "string" + } + }, + "required": [ + "image_url", + "type" + ], + "title": "InputImageContentItem", + "type": "object" + }, + { + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "output_text" + ], + "title": "OutputTextContentItemType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "OutputTextContentItem", + "type": "object" + } + ] + }, + "CreditsSnapshot": { + "properties": { + "balance": { + "type": [ + "string", + "null" + ] + }, + "has_credits": { + "type": "boolean" + }, + "unlimited": { + "type": "boolean" + } + }, + "required": [ + "has_credits", + "unlimited" + ], + "type": "object" + }, + "CustomPrompt": { + "properties": { + "argument_hint": { + "type": [ + "string", + "null" + ] + }, + "content": { + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "required": [ + "content", + "name", + "path" + ], + "type": "object" + }, + "Duration": { + "properties": { + "nanos": { + "format": "uint32", + "minimum": 0.0, + "type": "integer" + }, + "secs": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + } + }, + "required": [ + "nanos", + "secs" + ], + "type": "object" + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "InputTextDynamicToolCallOutputContentItem", + "type": "object" + }, + { + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType", + "type": "string" + } + }, + "required": [ + "imageUrl", + "type" + ], + "title": "InputImageDynamicToolCallOutputContentItem", + "type": "object" + } + ] + }, + "DynamicToolSpec": { + "properties": { + "description": { + "type": "string" + }, + "inputSchema": true, + "name": { + "type": "string" + } + }, + "required": [ + "description", + "inputSchema", + "name" + ], + "type": "object" + }, + "ElicitationRequest": { + "oneOf": [ + { + "properties": { + "_meta": true, + "message": { + "type": "string" + }, + "mode": { + "enum": [ + "form" + ], + "type": "string" + }, + "requested_schema": true + }, + "required": [ + "message", + "mode", + "requested_schema" + ], + "type": "object" + }, + { + "properties": { + "_meta": true, + "elicitation_id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "mode": { + "enum": [ + "url" + ], + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "elicitation_id", + "message", + "mode", + "url" + ], + "type": "object" + } + ] + }, + "EventMsg": { + "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.", + "oneOf": [ + { + "description": "Error while executing a submission", + "properties": { + "codex_error_info": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ], + "default": null + }, + "message": { + "type": "string" + }, + "type": { + "enum": [ + "error" + ], + "title": "ErrorEventMsgType", + "type": "string" + } + }, + "required": [ + "message", + "type" + ], + "title": "ErrorEventMsg", + "type": "object" + }, + { + "description": "Warning issued while processing a submission. Unlike `Error`, this indicates the turn continued but the user should still be notified.", + "properties": { + "message": { + "type": "string" + }, + "type": { + "enum": [ + "warning" + ], + "title": "WarningEventMsgType", + "type": "string" + } + }, + "required": [ + "message", + "type" + ], + "title": "WarningEventMsg", + "type": "object" + }, + { + "description": "Realtime conversation lifecycle start event.", + "properties": { + "session_id": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "realtime_conversation_started" + ], + "title": "RealtimeConversationStartedEventMsgType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "RealtimeConversationStartedEventMsg", + "type": "object" + }, + { + "description": "Realtime conversation streaming payload event.", + "properties": { + "payload": { + "$ref": "#/definitions/RealtimeEvent" + }, + "type": { + "enum": [ + "realtime_conversation_realtime" + ], + "title": "RealtimeConversationRealtimeEventMsgType", + "type": "string" + } + }, + "required": [ + "payload", + "type" + ], + "title": "RealtimeConversationRealtimeEventMsg", + "type": "object" + }, + { + "description": "Realtime conversation lifecycle close event.", + "properties": { + "reason": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "realtime_conversation_closed" + ], + "title": "RealtimeConversationClosedEventMsgType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "RealtimeConversationClosedEventMsg", + "type": "object" + }, + { + "description": "Model routing changed from the requested model to a different model.", + "properties": { + "from_model": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/ModelRerouteReason" + }, + "to_model": { + "type": "string" + }, + "type": { + "enum": [ + "model_reroute" + ], + "title": "ModelRerouteEventMsgType", + "type": "string" + } + }, + "required": [ + "from_model", + "reason", + "to_model", + "type" + ], + "title": "ModelRerouteEventMsg", + "type": "object" + }, + { + "description": "Conversation history was compacted (either automatically or manually).", + "properties": { + "type": { + "enum": [ + "context_compacted" + ], + "title": "ContextCompactedEventMsgType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ContextCompactedEventMsg", + "type": "object" + }, + { + "description": "Conversation history was rolled back by dropping the last N user turns.", + "properties": { + "num_turns": { + "description": "Number of user turns that were removed from context.", + "format": "uint32", + "minimum": 0.0, + "type": "integer" + }, + "type": { + "enum": [ + "thread_rolled_back" + ], + "title": "ThreadRolledBackEventMsgType", + "type": "string" + } + }, + "required": [ + "num_turns", + "type" + ], + "title": "ThreadRolledBackEventMsg", + "type": "object" + }, + { + "description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.", + "properties": { + "collaboration_mode_kind": { + "allOf": [ + { + "$ref": "#/definitions/ModeKind" + } + ], + "default": "default" + }, + "model_context_window": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "turn_id": { + "type": "string" + }, + "type": { + "enum": [ + "task_started" + ], + "title": "TaskStartedEventMsgType", + "type": "string" + } + }, + "required": [ + "turn_id", + "type" + ], + "title": "TaskStartedEventMsg", + "type": "object" + }, + { + "description": "Agent has completed all actions. v1 wire format uses `task_complete`; accept `turn_complete` for v2 interop.", + "properties": { + "last_agent_message": { + "type": [ + "string", + "null" + ] + }, + "turn_id": { + "type": "string" + }, + "type": { + "enum": [ + "task_complete" + ], + "title": "TaskCompleteEventMsgType", + "type": "string" + } + }, + "required": [ + "turn_id", + "type" + ], + "title": "TaskCompleteEventMsg", + "type": "object" + }, + { + "description": "Usage update for the current session, including totals and last turn. Optional means unknown — UIs should not display when `None`.", + "properties": { + "info": { + "anyOf": [ + { + "$ref": "#/definitions/TokenUsageInfo" + }, + { + "type": "null" + } + ] + }, + "rate_limits": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitSnapshot" + }, + { + "type": "null" + } + ] + }, + "type": { + "enum": [ + "token_count" + ], + "title": "TokenCountEventMsgType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "TokenCountEventMsg", + "type": "object" + }, + { + "description": "Agent text output message", + "properties": { + "message": { + "type": "string" + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ], + "default": null + }, + "type": { + "enum": [ + "agent_message" + ], + "title": "AgentMessageEventMsgType", + "type": "string" + } + }, + "required": [ + "message", + "type" + ], + "title": "AgentMessageEventMsg", + "type": "object" + }, + { + "description": "User/system input message (what was sent to the model)", + "properties": { + "images": { + "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.", + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] + }, + "local_images": { + "default": [], + "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.", + "items": { + "type": "string" + }, + "type": "array" + }, + "message": { + "type": "string" + }, + "text_elements": { + "default": [], + "description": "UI-defined spans within `message` used to render or persist special elements.", + "items": { + "$ref": "#/definitions/TextElement" + }, + "type": "array" + }, + "type": { + "enum": [ + "user_message" + ], + "title": "UserMessageEventMsgType", + "type": "string" + } + }, + "required": [ + "message", + "type" + ], + "title": "UserMessageEventMsg", + "type": "object" + }, + { + "description": "Agent text output delta message", + "properties": { + "delta": { + "type": "string" + }, + "type": { + "enum": [ + "agent_message_delta" + ], + "title": "AgentMessageDeltaEventMsgType", + "type": "string" + } + }, + "required": [ + "delta", + "type" + ], + "title": "AgentMessageDeltaEventMsg", + "type": "object" + }, + { + "description": "Reasoning event from agent.", + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "agent_reasoning" + ], + "title": "AgentReasoningEventMsgType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "AgentReasoningEventMsg", + "type": "object" + }, + { + "description": "Agent reasoning delta event from agent.", + "properties": { + "delta": { + "type": "string" + }, + "type": { + "enum": [ + "agent_reasoning_delta" + ], + "title": "AgentReasoningDeltaEventMsgType", + "type": "string" + } + }, + "required": [ + "delta", + "type" + ], + "title": "AgentReasoningDeltaEventMsg", + "type": "object" + }, + { + "description": "Raw chain-of-thought from agent.", + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "agent_reasoning_raw_content" + ], + "title": "AgentReasoningRawContentEventMsgType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "AgentReasoningRawContentEventMsg", + "type": "object" + }, + { + "description": "Agent reasoning content delta event from agent.", + "properties": { + "delta": { + "type": "string" + }, + "type": { + "enum": [ + "agent_reasoning_raw_content_delta" + ], + "title": "AgentReasoningRawContentDeltaEventMsgType", + "type": "string" + } + }, + "required": [ + "delta", + "type" + ], + "title": "AgentReasoningRawContentDeltaEventMsg", + "type": "object" + }, + { + "description": "Signaled when the model begins a new reasoning summary section (e.g., a new titled block).", + "properties": { + "item_id": { + "default": "", + "type": "string" + }, + "summary_index": { + "default": 0, + "format": "int64", + "type": "integer" + }, + "type": { + "enum": [ + "agent_reasoning_section_break" + ], + "title": "AgentReasoningSectionBreakEventMsgType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "AgentReasoningSectionBreakEventMsg", + "type": "object" + }, + { + "description": "Ack the client's configure message.", + "properties": { + "approval_policy": { + "allOf": [ + { + "$ref": "#/definitions/AskForApproval" + } + ], + "description": "When to escalate for approval for execution" + }, + "cwd": { + "description": "Working directory that should be treated as the *root* of the session.", + "type": "string" + }, + "forked_from_id": { + "anyOf": [ + { + "$ref": "#/definitions/ThreadId" + }, + { + "type": "null" + } + ] + }, + "history_entry_count": { + "description": "Current number of entries in the history log.", + "format": "uint", + "minimum": 0.0, + "type": "integer" + }, + "history_log_id": { + "description": "Identifier of the history log file (inode on Unix, 0 otherwise).", + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "initial_messages": { + "description": "Optional initial messages (as events) for resumed sessions. When present, UIs can use these to seed the history.", + "items": { + "$ref": "#/definitions/EventMsg" + }, + "type": [ + "array", + "null" + ] + }, + "model": { + "description": "Tell the client what model is being queried.", + "type": "string" + }, + "model_provider_id": { + "type": "string" + }, + "network_proxy": { + "anyOf": [ + { + "$ref": "#/definitions/SessionNetworkProxyRuntime" + }, + { + "type": "null" + } + ], + "description": "Runtime proxy bind addresses, when the managed proxy was started for this session." + }, + "reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ], + "description": "The effort the model is putting into reasoning about the user's request." + }, + "rollout_path": { + "description": "Path in which the rollout is stored. Can be `None` for ephemeral threads", + "type": [ + "string", + "null" + ] + }, + "sandbox_policy": { + "allOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + } + ], + "description": "How to sandbox commands executed in the system" + }, + "service_tier": { + "anyOf": [ + { + "$ref": "#/definitions/ServiceTier" + }, + { + "type": "null" + } + ] + }, + "session_id": { + "$ref": "#/definitions/ThreadId" + }, + "thread_name": { + "description": "Optional user-facing thread name (may be unset).", + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "session_configured" + ], + "title": "SessionConfiguredEventMsgType", + "type": "string" + } + }, + "required": [ + "approval_policy", + "cwd", + "history_entry_count", + "history_log_id", + "model", + "model_provider_id", + "sandbox_policy", + "session_id", + "type" + ], + "title": "SessionConfiguredEventMsg", + "type": "object" + }, + { + "description": "Updated session metadata (e.g., thread name changes).", + "properties": { + "thread_id": { + "$ref": "#/definitions/ThreadId" + }, + "thread_name": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "thread_name_updated" + ], + "title": "ThreadNameUpdatedEventMsgType", + "type": "string" + } + }, + "required": [ + "thread_id", + "type" + ], + "title": "ThreadNameUpdatedEventMsg", + "type": "object" + }, + { + "description": "Incremental MCP startup progress updates.", + "properties": { + "server": { + "description": "Server name being started.", + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/McpStartupStatus" + } + ], + "description": "Current startup status." + }, + "type": { + "enum": [ + "mcp_startup_update" + ], + "title": "McpStartupUpdateEventMsgType", + "type": "string" + } + }, + "required": [ + "server", + "status", + "type" + ], + "title": "McpStartupUpdateEventMsg", + "type": "object" + }, + { + "description": "Aggregate MCP startup completion summary.", + "properties": { + "cancelled": { + "items": { + "type": "string" + }, + "type": "array" + }, + "failed": { + "items": { + "$ref": "#/definitions/McpStartupFailure" + }, + "type": "array" + }, + "ready": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "enum": [ + "mcp_startup_complete" + ], + "title": "McpStartupCompleteEventMsgType", + "type": "string" + } + }, + "required": [ + "cancelled", + "failed", + "ready", + "type" + ], + "title": "McpStartupCompleteEventMsg", + "type": "object" + }, + { + "properties": { + "call_id": { + "description": "Identifier so this can be paired with the McpToolCallEnd event.", + "type": "string" + }, + "invocation": { + "$ref": "#/definitions/McpInvocation" + }, + "type": { + "enum": [ + "mcp_tool_call_begin" + ], + "title": "McpToolCallBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "invocation", + "type" + ], + "title": "McpToolCallBeginEventMsg", + "type": "object" + }, + { + "properties": { + "call_id": { + "description": "Identifier for the corresponding McpToolCallBegin that finished.", + "type": "string" + }, + "duration": { + "$ref": "#/definitions/Duration" + }, + "invocation": { + "$ref": "#/definitions/McpInvocation" + }, + "result": { + "allOf": [ + { + "$ref": "#/definitions/Result_of_CallToolResult_or_String" + } + ], + "description": "Result of the tool call. Note this could be an error." + }, + "type": { + "enum": [ + "mcp_tool_call_end" + ], + "title": "McpToolCallEndEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "duration", + "invocation", + "result", + "type" + ], + "title": "McpToolCallEndEventMsg", + "type": "object" + }, + { + "properties": { + "call_id": { + "type": "string" + }, + "type": { + "enum": [ + "web_search_begin" + ], + "title": "WebSearchBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "type" + ], + "title": "WebSearchBeginEventMsg", + "type": "object" + }, + { + "properties": { + "action": { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + "call_id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "enum": [ + "web_search_end" + ], + "title": "WebSearchEndEventMsgType", + "type": "string" + } + }, + "required": [ + "action", + "call_id", + "query", + "type" + ], + "title": "WebSearchEndEventMsg", + "type": "object" + }, + { + "properties": { + "call_id": { + "type": "string" + }, + "type": { + "enum": [ + "image_generation_begin" + ], + "title": "ImageGenerationBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "type" + ], + "title": "ImageGenerationBeginEventMsg", + "type": "object" + }, + { + "properties": { + "call_id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "saved_path": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "enum": [ + "image_generation_end" + ], + "title": "ImageGenerationEndEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "result", + "status", + "type" + ], + "title": "ImageGenerationEndEventMsg", + "type": "object" + }, + { + "description": "Notification that the server is about to execute a command.", + "properties": { + "call_id": { + "description": "Identifier so this can be paired with the ExecCommandEnd event.", + "type": "string" + }, + "command": { + "description": "The command to be executed.", + "items": { + "type": "string" + }, + "type": "array" + }, + "cwd": { + "description": "The command's working directory if not the default cwd for the agent.", + "type": "string" + }, + "interaction_input": { + "description": "Raw input sent to a unified exec session (if this is an interaction event).", + "type": [ + "string", + "null" + ] + }, + "parsed_cmd": { + "items": { + "$ref": "#/definitions/ParsedCommand" + }, + "type": "array" + }, + "process_id": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "allOf": [ + { + "$ref": "#/definitions/ExecCommandSource" + } + ], + "default": "agent", + "description": "Where the command originated. Defaults to Agent for backward compatibility." + }, + "turn_id": { + "description": "Turn ID that this command belongs to.", + "type": "string" + }, + "type": { + "enum": [ + "exec_command_begin" + ], + "title": "ExecCommandBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "command", + "cwd", + "parsed_cmd", + "turn_id", + "type" + ], + "title": "ExecCommandBeginEventMsg", + "type": "object" + }, + { + "description": "Incremental chunk of output from a running command.", + "properties": { + "call_id": { + "description": "Identifier for the ExecCommandBegin that produced this chunk.", + "type": "string" + }, + "chunk": { + "description": "Raw bytes from the stream (may not be valid UTF-8).", + "type": "string" + }, + "stream": { + "allOf": [ + { + "$ref": "#/definitions/ExecOutputStream" + } + ], + "description": "Which stream produced this chunk." + }, + "type": { + "enum": [ + "exec_command_output_delta" + ], + "title": "ExecCommandOutputDeltaEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "chunk", + "stream", + "type" + ], + "title": "ExecCommandOutputDeltaEventMsg", + "type": "object" + }, + { + "description": "Terminal interaction for an in-progress command (stdin sent and stdout observed).", + "properties": { + "call_id": { + "description": "Identifier for the ExecCommandBegin that produced this chunk.", + "type": "string" + }, + "process_id": { + "description": "Process id associated with the running command.", + "type": "string" + }, + "stdin": { + "description": "Stdin sent to the running session.", + "type": "string" + }, + "type": { + "enum": [ + "terminal_interaction" + ], + "title": "TerminalInteractionEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "process_id", + "stdin", + "type" + ], + "title": "TerminalInteractionEventMsg", + "type": "object" + }, + { + "properties": { + "aggregated_output": { + "default": "", + "description": "Captured aggregated output", + "type": "string" + }, + "call_id": { + "description": "Identifier for the ExecCommandBegin that finished.", + "type": "string" + }, + "command": { + "description": "The command that was executed.", + "items": { + "type": "string" + }, + "type": "array" + }, + "cwd": { + "description": "The command's working directory if not the default cwd for the agent.", + "type": "string" + }, + "duration": { + "allOf": [ + { + "$ref": "#/definitions/Duration" + } + ], + "description": "The duration of the command execution." + }, + "exit_code": { + "description": "The command's exit code.", + "format": "int32", + "type": "integer" + }, + "formatted_output": { + "description": "Formatted output from the command, as seen by the model.", + "type": "string" + }, + "interaction_input": { + "description": "Raw input sent to a unified exec session (if this is an interaction event).", + "type": [ + "string", + "null" + ] + }, + "parsed_cmd": { + "items": { + "$ref": "#/definitions/ParsedCommand" + }, + "type": "array" + }, + "process_id": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "allOf": [ + { + "$ref": "#/definitions/ExecCommandSource" + } + ], + "default": "agent", + "description": "Where the command originated. Defaults to Agent for backward compatibility." + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/ExecCommandStatus" + } + ], + "description": "Completion status for this command execution." + }, + "stderr": { + "description": "Captured stderr", + "type": "string" + }, + "stdout": { + "description": "Captured stdout", + "type": "string" + }, + "turn_id": { + "description": "Turn ID that this command belongs to.", + "type": "string" + }, + "type": { + "enum": [ + "exec_command_end" + ], + "title": "ExecCommandEndEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "command", + "cwd", + "duration", + "exit_code", + "formatted_output", + "parsed_cmd", + "status", + "stderr", + "stdout", + "turn_id", + "type" + ], + "title": "ExecCommandEndEventMsg", + "type": "object" + }, + { + "description": "Notification that the agent attached a local image via the view_image tool.", + "properties": { + "call_id": { + "description": "Identifier for the originating tool call.", + "type": "string" + }, + "path": { + "description": "Local filesystem path provided to the tool.", + "type": "string" + }, + "type": { + "enum": [ + "view_image_tool_call" + ], + "title": "ViewImageToolCallEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "path", + "type" + ], + "title": "ViewImageToolCallEventMsg", + "type": "object" + }, + { + "properties": { + "additional_permissions": { + "anyOf": [ + { + "$ref": "#/definitions/PermissionProfile" + }, + { + "type": "null" + } + ], + "description": "Optional additional filesystem permissions requested for this command." + }, + "approval_id": { + "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).", + "type": [ + "string", + "null" + ] + }, + "available_decisions": { + "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.", + "items": { + "$ref": "#/definitions/ReviewDecision" + }, + "type": [ + "array", + "null" + ] + }, + "call_id": { + "description": "Identifier for the associated command execution item.", + "type": "string" + }, + "command": { + "description": "The command to be executed.", + "items": { + "type": "string" + }, + "type": "array" + }, + "cwd": { + "description": "The command's working directory.", + "type": "string" + }, + "network_approval_context": { + "anyOf": [ + { + "$ref": "#/definitions/NetworkApprovalContext" + }, + { + "type": "null" + } + ], + "description": "Optional network context for a blocked request that can be approved." + }, + "parsed_cmd": { + "items": { + "$ref": "#/definitions/ParsedCommand" + }, + "type": "array" + }, + "proposed_execpolicy_amendment": { + "description": "Proposed execpolicy amendment that can be applied to allow future runs.", + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] + }, + "proposed_network_policy_amendments": { + "description": "Proposed network policy amendments (for example allow/deny this host in future).", + "items": { + "$ref": "#/definitions/NetworkPolicyAmendment" + }, + "type": [ + "array", + "null" + ] + }, + "reason": { + "description": "Optional human-readable reason for the approval (e.g. retry without sandbox).", + "type": [ + "string", + "null" + ] + }, + "skill_metadata": { + "anyOf": [ + { + "$ref": "#/definitions/ExecApprovalRequestSkillMetadata" + }, + { + "type": "null" + } + ], + "description": "Optional skill metadata when the approval was triggered by a skill script." + }, + "turn_id": { + "default": "", + "description": "Turn ID that this command belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "type": "string" + }, + "type": { + "enum": [ + "exec_approval_request" + ], + "title": "ExecApprovalRequestEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "command", + "cwd", + "parsed_cmd", + "type" + ], + "title": "ExecApprovalRequestEventMsg", + "type": "object" + }, + { + "properties": { + "call_id": { + "description": "Responses API call id for the associated tool call, if available.", + "type": "string" + }, + "permissions": { + "$ref": "#/definitions/RequestPermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "turn_id": { + "default": "", + "description": "Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "type": "string" + }, + "type": { + "enum": [ + "request_permissions" + ], + "title": "RequestPermissionsEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "permissions", + "type" + ], + "title": "RequestPermissionsEventMsg", + "type": "object" + }, + { + "properties": { + "call_id": { + "description": "Responses API call id for the associated tool call, if available.", + "type": "string" + }, + "questions": { + "items": { + "$ref": "#/definitions/RequestUserInputQuestion" + }, + "type": "array" + }, + "turn_id": { + "default": "", + "description": "Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "type": "string" + }, + "type": { + "enum": [ + "request_user_input" + ], + "title": "RequestUserInputEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "questions", + "type" + ], + "title": "RequestUserInputEventMsg", + "type": "object" + }, + { + "properties": { + "arguments": true, + "callId": { + "type": "string" + }, + "tool": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "type": { + "enum": [ + "dynamic_tool_call_request" + ], + "title": "DynamicToolCallRequestEventMsgType", + "type": "string" + } + }, + "required": [ + "arguments", + "callId", + "tool", + "turnId", + "type" + ], + "title": "DynamicToolCallRequestEventMsg", + "type": "object" + }, + { + "properties": { + "arguments": { + "description": "Dynamic tool call arguments." + }, + "call_id": { + "description": "Identifier for the corresponding DynamicToolCallRequest.", + "type": "string" + }, + "content_items": { + "description": "Dynamic tool response content items.", + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + }, + "type": "array" + }, + "duration": { + "allOf": [ + { + "$ref": "#/definitions/Duration" + } + ], + "description": "The duration of the dynamic tool call." + }, + "error": { + "description": "Optional error text when the tool call failed before producing a response.", + "type": [ + "string", + "null" + ] + }, + "success": { + "description": "Whether the tool call succeeded.", + "type": "boolean" + }, + "tool": { + "description": "Dynamic tool name.", + "type": "string" + }, + "turn_id": { + "description": "Turn ID that this dynamic tool call belongs to.", + "type": "string" + }, + "type": { + "enum": [ + "dynamic_tool_call_response" + ], + "title": "DynamicToolCallResponseEventMsgType", + "type": "string" + } + }, + "required": [ + "arguments", + "call_id", + "content_items", + "duration", + "success", + "tool", + "turn_id", + "type" + ], + "title": "DynamicToolCallResponseEventMsg", + "type": "object" + }, + { + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "request": { + "$ref": "#/definitions/ElicitationRequest" + }, + "server_name": { + "type": "string" + }, + "turn_id": { + "description": "Turn ID that this elicitation belongs to, when known.", + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "elicitation_request" + ], + "title": "ElicitationRequestEventMsgType", + "type": "string" + } + }, + "required": [ + "id", + "request", + "server_name", + "type" + ], + "title": "ElicitationRequestEventMsg", + "type": "object" + }, + { + "properties": { + "call_id": { + "description": "Responses API call id for the associated patch apply call, if available.", + "type": "string" + }, + "changes": { + "additionalProperties": { + "$ref": "#/definitions/FileChange" + }, + "type": "object" + }, + "grant_root": { + "description": "When set, the agent is asking the user to allow writes under this root for the remainder of the session.", + "type": [ + "string", + "null" + ] + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for extra write access).", + "type": [ + "string", + "null" + ] + }, + "turn_id": { + "default": "", + "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility with older senders.", + "type": "string" + }, + "type": { + "enum": [ + "apply_patch_approval_request" + ], + "title": "ApplyPatchApprovalRequestEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "changes", + "type" + ], + "title": "ApplyPatchApprovalRequestEventMsg", + "type": "object" + }, + { + "description": "Notification advising the user that something they are using has been deprecated and should be phased out.", + "properties": { + "details": { + "description": "Optional extra guidance, such as migration steps or rationale.", + "type": [ + "string", + "null" + ] + }, + "summary": { + "description": "Concise summary of what is deprecated.", + "type": "string" + }, + "type": { + "enum": [ + "deprecation_notice" + ], + "title": "DeprecationNoticeEventMsgType", + "type": "string" + } + }, + "required": [ + "summary", + "type" + ], + "title": "DeprecationNoticeEventMsg", + "type": "object" + }, + { + "properties": { + "message": { + "type": "string" + }, + "type": { + "enum": [ + "background_event" + ], + "title": "BackgroundEventEventMsgType", + "type": "string" + } + }, + "required": [ + "message", + "type" + ], + "title": "BackgroundEventEventMsg", + "type": "object" + }, + { + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "undo_started" + ], + "title": "UndoStartedEventMsgType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "UndoStartedEventMsg", + "type": "object" + }, + { + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "success": { + "type": "boolean" + }, + "type": { + "enum": [ + "undo_completed" + ], + "title": "UndoCompletedEventMsgType", + "type": "string" + } + }, + "required": [ + "success", + "type" + ], + "title": "UndoCompletedEventMsg", + "type": "object" + }, + { + "description": "Notification that a model stream experienced an error or disconnect and the system is handling it (e.g., retrying with backoff).", + "properties": { + "additional_details": { + "default": null, + "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).", + "type": [ + "string", + "null" + ] + }, + "codex_error_info": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ], + "default": null + }, + "message": { + "type": "string" + }, + "type": { + "enum": [ + "stream_error" + ], + "title": "StreamErrorEventMsgType", + "type": "string" + } + }, + "required": [ + "message", + "type" + ], + "title": "StreamErrorEventMsg", + "type": "object" + }, + { + "description": "Notification that the agent is about to apply a code patch. Mirrors `ExecCommandBegin` so front‑ends can show progress indicators.", + "properties": { + "auto_approved": { + "description": "If true, there was no ApplyPatchApprovalRequest for this patch.", + "type": "boolean" + }, + "call_id": { + "description": "Identifier so this can be paired with the PatchApplyEnd event.", + "type": "string" + }, + "changes": { + "additionalProperties": { + "$ref": "#/definitions/FileChange" + }, + "description": "The changes to be applied.", + "type": "object" + }, + "turn_id": { + "default": "", + "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "type": "string" + }, + "type": { + "enum": [ + "patch_apply_begin" + ], + "title": "PatchApplyBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "auto_approved", + "call_id", + "changes", + "type" + ], + "title": "PatchApplyBeginEventMsg", + "type": "object" + }, + { + "description": "Notification that a patch application has finished.", + "properties": { + "call_id": { + "description": "Identifier for the PatchApplyBegin that finished.", + "type": "string" + }, + "changes": { + "additionalProperties": { + "$ref": "#/definitions/FileChange" + }, + "default": {}, + "description": "The changes that were applied (mirrors PatchApplyBeginEvent::changes).", + "type": "object" + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/PatchApplyStatus" + } + ], + "description": "Completion status for this patch application." + }, + "stderr": { + "description": "Captured stderr (parser errors, IO failures, etc.).", + "type": "string" + }, + "stdout": { + "description": "Captured stdout (summary printed by apply_patch).", + "type": "string" + }, + "success": { + "description": "Whether the patch was applied successfully.", + "type": "boolean" + }, + "turn_id": { + "default": "", + "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility.", + "type": "string" + }, + "type": { + "enum": [ + "patch_apply_end" + ], + "title": "PatchApplyEndEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "status", + "stderr", + "stdout", + "success", + "type" + ], + "title": "PatchApplyEndEventMsg", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "turn_diff" + ], + "title": "TurnDiffEventMsgType", + "type": "string" + }, + "unified_diff": { + "type": "string" + } + }, + "required": [ + "type", + "unified_diff" + ], + "title": "TurnDiffEventMsg", + "type": "object" + }, + { + "description": "Response to GetHistoryEntryRequest.", + "properties": { + "entry": { + "anyOf": [ + { + "$ref": "#/definitions/HistoryEntry" + }, + { + "type": "null" + } + ], + "description": "The entry at the requested offset, if available and parseable." + }, + "log_id": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + }, + "offset": { + "format": "uint", + "minimum": 0.0, + "type": "integer" + }, + "type": { + "enum": [ + "get_history_entry_response" + ], + "title": "GetHistoryEntryResponseEventMsgType", + "type": "string" + } + }, + "required": [ + "log_id", + "offset", + "type" + ], + "title": "GetHistoryEntryResponseEventMsg", + "type": "object" + }, + { + "description": "List of MCP tools available to the agent.", + "properties": { + "auth_statuses": { + "additionalProperties": { + "$ref": "#/definitions/McpAuthStatus" + }, + "description": "Authentication status for each configured MCP server.", + "type": "object" + }, + "resource_templates": { + "additionalProperties": { + "items": { + "$ref": "#/definitions/ResourceTemplate" + }, + "type": "array" + }, + "description": "Known resource templates grouped by server name.", + "type": "object" + }, + "resources": { + "additionalProperties": { + "items": { + "$ref": "#/definitions/Resource" + }, + "type": "array" + }, + "description": "Known resources grouped by server name.", + "type": "object" + }, + "tools": { + "additionalProperties": { + "$ref": "#/definitions/Tool" + }, + "description": "Fully qualified tool name -> tool definition.", + "type": "object" + }, + "type": { + "enum": [ + "mcp_list_tools_response" + ], + "title": "McpListToolsResponseEventMsgType", + "type": "string" + } + }, + "required": [ + "auth_statuses", + "resource_templates", + "resources", + "tools", + "type" + ], + "title": "McpListToolsResponseEventMsg", + "type": "object" + }, + { + "description": "List of custom prompts available to the agent.", + "properties": { + "custom_prompts": { + "items": { + "$ref": "#/definitions/CustomPrompt" + }, + "type": "array" + }, + "type": { + "enum": [ + "list_custom_prompts_response" + ], + "title": "ListCustomPromptsResponseEventMsgType", + "type": "string" + } + }, + "required": [ + "custom_prompts", + "type" + ], + "title": "ListCustomPromptsResponseEventMsg", + "type": "object" + }, + { + "description": "List of skills available to the agent.", + "properties": { + "skills": { + "items": { + "$ref": "#/definitions/SkillsListEntry" + }, + "type": "array" + }, + "type": { + "enum": [ + "list_skills_response" + ], + "title": "ListSkillsResponseEventMsgType", + "type": "string" + } + }, + "required": [ + "skills", + "type" + ], + "title": "ListSkillsResponseEventMsg", + "type": "object" + }, + { + "description": "List of remote skills available to the agent.", + "properties": { + "skills": { + "items": { + "$ref": "#/definitions/RemoteSkillSummary" + }, + "type": "array" + }, + "type": { + "enum": [ + "list_remote_skills_response" + ], + "title": "ListRemoteSkillsResponseEventMsgType", + "type": "string" + } + }, + "required": [ + "skills", + "type" + ], + "title": "ListRemoteSkillsResponseEventMsg", + "type": "object" + }, + { + "description": "Remote skill downloaded to local cache.", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "enum": [ + "remote_skill_downloaded" + ], + "title": "RemoteSkillDownloadedEventMsgType", + "type": "string" + } + }, + "required": [ + "id", + "name", + "path", + "type" + ], + "title": "RemoteSkillDownloadedEventMsg", + "type": "object" + }, + { + "description": "Notification that skill data may have been updated and clients may want to reload.", + "properties": { + "type": { + "enum": [ + "skills_update_available" + ], + "title": "SkillsUpdateAvailableEventMsgType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "SkillsUpdateAvailableEventMsg", + "type": "object" + }, + { + "properties": { + "explanation": { + "default": null, + "description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).", + "type": [ + "string", + "null" + ] + }, + "plan": { + "items": { + "$ref": "#/definitions/PlanItemArg" + }, + "type": "array" + }, + "type": { + "enum": [ + "plan_update" + ], + "title": "PlanUpdateEventMsgType", + "type": "string" + } + }, + "required": [ + "plan", + "type" + ], + "title": "PlanUpdateEventMsg", + "type": "object" + }, + { + "properties": { + "reason": { + "$ref": "#/definitions/TurnAbortReason" + }, + "turn_id": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "turn_aborted" + ], + "title": "TurnAbortedEventMsgType", + "type": "string" + } + }, + "required": [ + "reason", + "type" + ], + "title": "TurnAbortedEventMsg", + "type": "object" + }, + { + "description": "Notification that the agent is shutting down.", + "properties": { + "type": { + "enum": [ + "shutdown_complete" + ], + "title": "ShutdownCompleteEventMsgType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ShutdownCompleteEventMsg", + "type": "object" + }, + { + "description": "Entered review mode.", + "properties": { + "target": { + "$ref": "#/definitions/ReviewTarget" + }, + "type": { + "enum": [ + "entered_review_mode" + ], + "title": "EnteredReviewModeEventMsgType", + "type": "string" + }, + "user_facing_hint": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "target", + "type" + ], + "title": "EnteredReviewModeEventMsg", + "type": "object" + }, + { + "description": "Exited review mode with an optional final result to apply.", + "properties": { + "review_output": { + "anyOf": [ + { + "$ref": "#/definitions/ReviewOutputEvent" + }, + { + "type": "null" + } + ] + }, + "type": { + "enum": [ + "exited_review_mode" + ], + "title": "ExitedReviewModeEventMsgType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ExitedReviewModeEventMsg", + "type": "object" + }, + { + "properties": { + "item": { + "$ref": "#/definitions/ResponseItem" + }, + "type": { + "enum": [ + "raw_response_item" + ], + "title": "RawResponseItemEventMsgType", + "type": "string" + } + }, + "required": [ + "item", + "type" + ], + "title": "RawResponseItemEventMsg", + "type": "object" + }, + { + "properties": { + "item": { + "$ref": "#/definitions/TurnItem" + }, + "thread_id": { + "$ref": "#/definitions/ThreadId" + }, + "turn_id": { + "type": "string" + }, + "type": { + "enum": [ + "item_started" + ], + "title": "ItemStartedEventMsgType", + "type": "string" + } + }, + "required": [ + "item", + "thread_id", + "turn_id", + "type" + ], + "title": "ItemStartedEventMsg", + "type": "object" + }, + { + "properties": { + "item": { + "$ref": "#/definitions/TurnItem" + }, + "thread_id": { + "$ref": "#/definitions/ThreadId" + }, + "turn_id": { + "type": "string" + }, + "type": { + "enum": [ + "item_completed" + ], + "title": "ItemCompletedEventMsgType", + "type": "string" + } + }, + "required": [ + "item", + "thread_id", + "turn_id", + "type" + ], + "title": "ItemCompletedEventMsg", + "type": "object" + }, + { + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "turn_id": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "hook_started" + ], + "title": "HookStartedEventMsgType", + "type": "string" + } + }, + "required": [ + "run", + "type" + ], + "title": "HookStartedEventMsg", + "type": "object" + }, + { + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "turn_id": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "hook_completed" + ], + "title": "HookCompletedEventMsgType", + "type": "string" + } + }, + "required": [ + "run", + "type" + ], + "title": "HookCompletedEventMsg", + "type": "object" + }, + { + "properties": { + "delta": { + "type": "string" + }, + "item_id": { + "type": "string" + }, + "thread_id": { + "type": "string" + }, + "turn_id": { + "type": "string" + }, + "type": { + "enum": [ + "agent_message_content_delta" + ], + "title": "AgentMessageContentDeltaEventMsgType", + "type": "string" + } + }, + "required": [ + "delta", + "item_id", + "thread_id", + "turn_id", + "type" + ], + "title": "AgentMessageContentDeltaEventMsg", + "type": "object" + }, + { + "properties": { + "delta": { + "type": "string" + }, + "item_id": { + "type": "string" + }, + "thread_id": { + "type": "string" + }, + "turn_id": { + "type": "string" + }, + "type": { + "enum": [ + "plan_delta" + ], + "title": "PlanDeltaEventMsgType", + "type": "string" + } + }, + "required": [ + "delta", + "item_id", + "thread_id", + "turn_id", + "type" + ], + "title": "PlanDeltaEventMsg", + "type": "object" + }, + { + "properties": { + "delta": { + "type": "string" + }, + "item_id": { + "type": "string" + }, + "summary_index": { + "default": 0, + "format": "int64", + "type": "integer" + }, + "thread_id": { + "type": "string" + }, + "turn_id": { + "type": "string" + }, + "type": { + "enum": [ + "reasoning_content_delta" + ], + "title": "ReasoningContentDeltaEventMsgType", + "type": "string" + } + }, + "required": [ + "delta", + "item_id", + "thread_id", + "turn_id", + "type" + ], + "title": "ReasoningContentDeltaEventMsg", + "type": "object" + }, + { + "properties": { + "content_index": { + "default": 0, + "format": "int64", + "type": "integer" + }, + "delta": { + "type": "string" + }, + "item_id": { + "type": "string" + }, + "thread_id": { + "type": "string" + }, + "turn_id": { + "type": "string" + }, + "type": { + "enum": [ + "reasoning_raw_content_delta" + ], + "title": "ReasoningRawContentDeltaEventMsgType", + "type": "string" + } + }, + "required": [ + "delta", + "item_id", + "thread_id", + "turn_id", + "type" + ], + "title": "ReasoningRawContentDeltaEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: agent spawn begin.", + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "model": { + "type": "string" + }, + "prompt": { + "description": "Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning.", + "type": "string" + }, + "reasoning_effort": { + "$ref": "#/definitions/ReasoningEffort" + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "type": { + "enum": [ + "collab_agent_spawn_begin" + ], + "title": "CollabAgentSpawnBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "model", + "prompt", + "reasoning_effort", + "sender_thread_id", + "type" + ], + "title": "CollabAgentSpawnBeginEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: agent spawn end.", + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent.", + "type": "string" + }, + "new_agent_nickname": { + "description": "Optional nickname assigned to the new agent.", + "type": [ + "string", + "null" + ] + }, + "new_agent_role": { + "description": "Optional role assigned to the new agent.", + "type": [ + "string", + "null" + ] + }, + "new_thread_id": { + "anyOf": [ + { + "$ref": "#/definitions/ThreadId" + }, + { + "type": "null" + } + ], + "description": "Thread ID of the newly spawned agent, if it was created." + }, + "prompt": { + "description": "Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning.", + "type": "string" + }, + "reasoning_effort": { + "allOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + } + ], + "description": "Reasoning effort requested for the spawned agent." + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ], + "description": "Last known status of the new agent reported to the sender agent." + }, + "type": { + "enum": [ + "collab_agent_spawn_end" + ], + "title": "CollabAgentSpawnEndEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "model", + "prompt", + "reasoning_effort", + "sender_thread_id", + "status", + "type" + ], + "title": "CollabAgentSpawnEndEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: agent interaction begin.", + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "prompt": { + "description": "Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning.", + "type": "string" + }, + "receiver_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the receiver." + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "type": { + "enum": [ + "collab_agent_interaction_begin" + ], + "title": "CollabAgentInteractionBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "prompt", + "receiver_thread_id", + "sender_thread_id", + "type" + ], + "title": "CollabAgentInteractionBeginEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: agent interaction end.", + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "prompt": { + "description": "Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning.", + "type": "string" + }, + "receiver_agent_nickname": { + "description": "Optional nickname assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_agent_role": { + "description": "Optional role assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the receiver." + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ], + "description": "Last known status of the receiver agent reported to the sender agent." + }, + "type": { + "enum": [ + "collab_agent_interaction_end" + ], + "title": "CollabAgentInteractionEndEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "prompt", + "receiver_thread_id", + "sender_thread_id", + "status", + "type" + ], + "title": "CollabAgentInteractionEndEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: waiting begin.", + "properties": { + "call_id": { + "description": "ID of the waiting call.", + "type": "string" + }, + "receiver_agents": { + "description": "Optional nicknames/roles for receivers.", + "items": { + "$ref": "#/definitions/CollabAgentRef" + }, + "type": "array" + }, + "receiver_thread_ids": { + "description": "Thread ID of the receivers.", + "items": { + "$ref": "#/definitions/ThreadId" + }, + "type": "array" + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "type": { + "enum": [ + "collab_waiting_begin" + ], + "title": "CollabWaitingBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "receiver_thread_ids", + "sender_thread_id", + "type" + ], + "title": "CollabWaitingBeginEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: waiting end.", + "properties": { + "agent_statuses": { + "description": "Optional receiver metadata paired with final statuses.", + "items": { + "$ref": "#/definitions/CollabAgentStatusEntry" + }, + "type": "array" + }, + "call_id": { + "description": "ID of the waiting call.", + "type": "string" + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "statuses": { + "additionalProperties": { + "$ref": "#/definitions/AgentStatus" + }, + "description": "Last known status of the receiver agents reported to the sender agent.", + "type": "object" + }, + "type": { + "enum": [ + "collab_waiting_end" + ], + "title": "CollabWaitingEndEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "sender_thread_id", + "statuses", + "type" + ], + "title": "CollabWaitingEndEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: close begin.", + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "receiver_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the receiver." + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "type": { + "enum": [ + "collab_close_begin" + ], + "title": "CollabCloseBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "receiver_thread_id", + "sender_thread_id", + "type" + ], + "title": "CollabCloseBeginEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: close end.", + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "receiver_agent_nickname": { + "description": "Optional nickname assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_agent_role": { + "description": "Optional role assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the receiver." + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ], + "description": "Last known status of the receiver agent reported to the sender agent before the close." + }, + "type": { + "enum": [ + "collab_close_end" + ], + "title": "CollabCloseEndEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "receiver_thread_id", + "sender_thread_id", + "status", + "type" + ], + "title": "CollabCloseEndEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: resume begin.", + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "receiver_agent_nickname": { + "description": "Optional nickname assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_agent_role": { + "description": "Optional role assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the receiver." + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "type": { + "enum": [ + "collab_resume_begin" + ], + "title": "CollabResumeBeginEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "receiver_thread_id", + "sender_thread_id", + "type" + ], + "title": "CollabResumeBeginEventMsg", + "type": "object" + }, + { + "description": "Collab interaction: resume end.", + "properties": { + "call_id": { + "description": "Identifier for the collab tool call.", + "type": "string" + }, + "receiver_agent_nickname": { + "description": "Optional nickname assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_agent_role": { + "description": "Optional role assigned to the receiver agent.", + "type": [ + "string", + "null" + ] + }, + "receiver_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the receiver." + }, + "sender_thread_id": { + "allOf": [ + { + "$ref": "#/definitions/ThreadId" + } + ], + "description": "Thread ID of the sender." + }, + "status": { + "allOf": [ + { + "$ref": "#/definitions/AgentStatus" + } + ], + "description": "Last known status of the receiver agent reported to the sender agent after resume." + }, + "type": { + "enum": [ + "collab_resume_end" + ], + "title": "CollabResumeEndEventMsgType", + "type": "string" + } + }, + "required": [ + "call_id", + "receiver_thread_id", + "sender_thread_id", + "status", + "type" + ], + "title": "CollabResumeEndEventMsg", + "type": "object" + } + ] + }, + "ExecApprovalRequestSkillMetadata": { + "properties": { + "path_to_skills_md": { + "type": "string" + } + }, + "required": [ + "path_to_skills_md" + ], + "type": "object" + }, + "ExecCommandSource": { + "enum": [ + "agent", + "user_shell", + "unified_exec_startup", + "unified_exec_interaction" + ], + "type": "string" + }, + "ExecCommandStatus": { + "enum": [ + "completed", + "failed", + "declined" + ], + "type": "string" + }, + "ExecOutputStream": { + "enum": [ + "stdout", + "stderr" + ], + "type": "string" + }, + "FileChange": { + "oneOf": [ + { + "properties": { + "content": { + "type": "string" + }, + "type": { + "enum": [ + "add" + ], + "title": "AddFileChangeType", + "type": "string" + } + }, + "required": [ + "content", + "type" + ], + "title": "AddFileChange", + "type": "object" + }, + { + "properties": { + "content": { + "type": "string" + }, + "type": { + "enum": [ + "delete" + ], + "title": "DeleteFileChangeType", + "type": "string" + } + }, + "required": [ + "content", + "type" + ], + "title": "DeleteFileChange", + "type": "object" + }, + { + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "update" + ], + "title": "UpdateFileChangeType", + "type": "string" + }, + "unified_diff": { + "type": "string" + } + }, + "required": [ + "type", + "unified_diff" + ], + "title": "UpdateFileChange", + "type": "object" + } + ] + }, + "FileSystemPermissions": { + "properties": { + "read": { + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": [ + "array", + "null" + ] + }, + "write": { + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": [ + "array", + "null" + ] + } + }, + "type": "object" + }, + "FunctionCallOutputBody": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/definitions/FunctionCallOutputContentItem" + }, + "type": "array" + } + ] + }, + "FunctionCallOutputContentItem": { + "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.", + "oneOf": [ + { + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "input_text" + ], + "title": "InputTextFunctionCallOutputContentItemType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "InputTextFunctionCallOutputContentItem", + "type": "object" + }, + { + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "enum": [ + "input_image" + ], + "title": "InputImageFunctionCallOutputContentItemType", + "type": "string" + } + }, + "required": [ + "image_url", + "type" + ], + "title": "InputImageFunctionCallOutputContentItem", + "type": "object" + } + ] + }, + "FunctionCallOutputPayload": { + "description": "The payload we send back to OpenAI when reporting a tool call result.\n\n`body` serializes directly as the wire value for `function_call_output.output`. `success` remains internal metadata for downstream handling.", + "properties": { + "body": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "success": { + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "body" + ], + "type": "object" + }, + "GhostCommit": { + "description": "Details of a ghost commit created from a repository state.", + "properties": { + "id": { + "type": "string" + }, + "parent": { + "type": [ + "string", + "null" + ] + }, + "preexisting_untracked_dirs": { + "items": { + "type": "string" + }, + "type": "array" + }, + "preexisting_untracked_files": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "id", + "preexisting_untracked_dirs", + "preexisting_untracked_files" + ], + "type": "object" + }, + "GitInfo": { + "properties": { + "branch": { + "description": "Current branch name", + "type": [ + "string", + "null" + ] + }, + "commit_hash": { + "description": "Current commit hash (SHA)", + "type": [ + "string", + "null" + ] + }, + "repository_url": { + "description": "Repository URL (if available from remote)", + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "GranularApprovalConfig": { + "properties": { + "mcp_elicitations": { + "description": "Whether to allow MCP elicitation prompts.", + "type": "boolean" + }, + "request_permissions": { + "default": false, + "description": "Whether to allow prompts triggered by the `request_permissions` tool.", + "type": "boolean" + }, + "rules": { + "description": "Whether to allow prompts triggered by execpolicy `prompt` rules.", + "type": "boolean" + }, + "sandbox_approval": { + "description": "Whether to allow shell command approval requests, including inline `with_additional_permissions` and `require_escalated` requests.", + "type": "boolean" + }, + "skill_approval": { + "default": false, + "description": "Whether to allow approval prompts triggered by skill script execution.", + "type": "boolean" + } + }, + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "type": "object" + }, + "HistoryEntry": { + "properties": { + "conversation_id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "ts": { + "format": "uint64", + "minimum": 0.0, + "type": "integer" + } + }, + "required": [ + "conversation_id", + "text", + "ts" + ], + "type": "object" + }, + "HookEventName": { + "enum": [ + "session_start", + "stop" + ], + "type": "string" + }, + "HookExecutionMode": { + "enum": [ + "sync", + "async" + ], + "type": "string" + }, + "HookHandlerType": { + "enum": [ + "command", + "prompt", + "agent" + ], + "type": "string" + }, + "HookOutputEntry": { + "properties": { + "kind": { + "$ref": "#/definitions/HookOutputEntryKind" + }, + "text": { + "type": "string" + } + }, + "required": [ + "kind", + "text" + ], + "type": "object" + }, + "HookOutputEntryKind": { + "enum": [ + "warning", + "stop", + "feedback", + "context", + "error" + ], + "type": "string" + }, + "HookRunStatus": { + "enum": [ + "running", + "completed", + "failed", + "blocked", + "stopped" + ], + "type": "string" + }, + "HookRunSummary": { + "properties": { + "completed_at": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "display_order": { + "format": "int64", + "type": "integer" + }, + "duration_ms": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "entries": { + "items": { + "$ref": "#/definitions/HookOutputEntry" + }, + "type": "array" + }, + "event_name": { + "$ref": "#/definitions/HookEventName" + }, + "execution_mode": { + "$ref": "#/definitions/HookExecutionMode" + }, + "handler_type": { + "$ref": "#/definitions/HookHandlerType" + }, + "id": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/HookScope" + }, + "source_path": { + "type": "string" + }, + "started_at": { + "format": "int64", + "type": "integer" + }, + "status": { + "$ref": "#/definitions/HookRunStatus" + }, + "status_message": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "display_order", + "entries", + "event_name", + "execution_mode", + "handler_type", + "id", + "scope", + "source_path", + "started_at", + "status" + ], + "type": "object" + }, + "HookScope": { + "enum": [ + "thread", + "turn" + ], + "type": "string" + }, + "ImageDetail": { + "enum": [ + "auto", + "low", + "high", + "original" + ], + "type": "string" + }, + "LocalShellAction": { + "oneOf": [ + { + "properties": { + "command": { + "items": { + "type": "string" + }, + "type": "array" + }, + "env": { + "additionalProperties": { + "type": "string" + }, + "type": [ + "object", + "null" + ] + }, + "timeout_ms": { + "format": "uint64", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + }, + "type": { + "enum": [ + "exec" + ], + "title": "ExecLocalShellActionType", + "type": "string" + }, + "user": { + "type": [ + "string", + "null" + ] + }, + "working_directory": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "command", + "type" + ], + "title": "ExecLocalShellAction", + "type": "object" + } + ] + }, + "LocalShellStatus": { + "enum": [ + "completed", + "in_progress", + "incomplete" + ], + "type": "string" + }, + "MacOsAutomationPermission": { + "oneOf": [ + { + "enum": [ + "none", + "all" + ], + "type": "string" + }, + { + "additionalProperties": false, + "properties": { + "bundle_ids": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "bundle_ids" + ], + "title": "BundleIdsMacOsAutomationPermission", + "type": "object" + } + ] + }, + "MacOsContactsPermission": { + "enum": [ + "none", + "read_only", + "read_write" + ], + "type": "string" + }, + "MacOsPreferencesPermission": { + "enum": [ + "none", + "read_only", + "read_write" + ], + "type": "string" + }, + "MacOsSeatbeltProfileExtensions": { + "properties": { + "macos_accessibility": { + "default": false, + "type": "boolean" + }, + "macos_automation": { + "allOf": [ + { + "$ref": "#/definitions/MacOsAutomationPermission" + } + ], + "default": "none" + }, + "macos_calendar": { + "default": false, + "type": "boolean" + }, + "macos_contacts": { + "allOf": [ + { + "$ref": "#/definitions/MacOsContactsPermission" + } + ], + "default": "none" + }, + "macos_launch_services": { + "default": false, + "type": "boolean" + }, + "macos_preferences": { + "allOf": [ + { + "$ref": "#/definitions/MacOsPreferencesPermission" + } + ], + "default": "read_only" + }, + "macos_reminders": { + "default": false, + "type": "boolean" + } + }, + "type": "object" + }, + "McpAuthStatus": { + "enum": [ + "unsupported", + "not_logged_in", + "bearer_token", + "o_auth" + ], + "type": "string" + }, + "McpInvocation": { + "properties": { + "arguments": { + "description": "Arguments to the tool call." + }, + "server": { + "description": "Name of the MCP server as defined in the config.", + "type": "string" + }, + "tool": { + "description": "Name of the tool as given by the MCP server.", + "type": "string" + } + }, + "required": [ + "server", + "tool" + ], + "type": "object" + }, + "McpStartupFailure": { + "properties": { + "error": { + "type": "string" + }, + "server": { + "type": "string" + } + }, + "required": [ + "error", + "server" + ], + "type": "object" + }, + "McpStartupStatus": { + "oneOf": [ + { + "properties": { + "state": { + "enum": [ + "starting" + ], + "type": "string" + } + }, + "required": [ + "state" + ], + "title": "StartingMcpStartupStatus", + "type": "object" + }, + { + "properties": { + "state": { + "enum": [ + "ready" + ], + "type": "string" + } + }, + "required": [ + "state" + ], + "title": "ReadyMcpStartupStatus", + "type": "object" + }, + { + "properties": { + "error": { + "type": "string" + }, + "state": { + "enum": [ + "failed" + ], + "type": "string" + } + }, + "required": [ + "error", + "state" + ], + "type": "object" + }, + { + "properties": { + "state": { + "enum": [ + "cancelled" + ], + "type": "string" + } + }, + "required": [ + "state" + ], + "title": "CancelledMcpStartupStatus", + "type": "object" + } + ] + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "enum": [ + "commentary" + ], + "type": "string" + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "enum": [ + "final_answer" + ], + "type": "string" + } + ] + }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "enum": [ + "plan", + "default" + ], + "type": "string" + }, + "ModelRerouteReason": { + "enum": [ + "high_risk_cyber_activity" + ], + "type": "string" + }, + "NetworkAccess": { + "description": "Represents whether outbound network access is available to the agent.", + "enum": [ + "restricted", + "enabled" + ], + "type": "string" + }, + "NetworkApprovalContext": { + "properties": { + "host": { + "type": "string" + }, + "protocol": { + "$ref": "#/definitions/NetworkApprovalProtocol" + } + }, + "required": [ + "host", + "protocol" + ], + "type": "object" + }, + "NetworkApprovalProtocol": { + "enum": [ + "http", + "https", + "socks5_tcp", + "socks5_udp" + ], + "type": "string" + }, + "NetworkPermissions": { + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + }, + "type": "object" + }, + "NetworkPolicyAmendment": { + "properties": { + "action": { + "$ref": "#/definitions/NetworkPolicyRuleAction" + }, + "host": { + "type": "string" + } + }, + "required": [ + "action", + "host" + ], + "type": "object" + }, + "NetworkPolicyRuleAction": { + "enum": [ + "allow", + "deny" + ], + "type": "string" + }, + "ParsedCommand": { + "oneOf": [ + { + "properties": { + "cmd": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "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": "string" + }, + "type": { + "enum": [ + "read" + ], + "title": "ReadParsedCommandType", + "type": "string" + } + }, + "required": [ + "cmd", + "name", + "path", + "type" + ], + "title": "ReadParsedCommand", + "type": "object" + }, + { + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "list_files" + ], + "title": "ListFilesParsedCommandType", + "type": "string" + } + }, + "required": [ + "cmd", + "type" + ], + "title": "ListFilesParsedCommand", + "type": "object" + }, + { + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "search" + ], + "title": "SearchParsedCommandType", + "type": "string" + } + }, + "required": [ + "cmd", + "type" + ], + "title": "SearchParsedCommand", + "type": "object" + }, + { + "properties": { + "cmd": { + "type": "string" + }, + "type": { + "enum": [ + "unknown" + ], + "title": "UnknownParsedCommandType", + "type": "string" + } + }, + "required": [ + "cmd", + "type" + ], + "title": "UnknownParsedCommand", + "type": "object" + } + ] + }, + "PatchApplyStatus": { + "enum": [ + "completed", + "failed", + "declined" + ], + "type": "string" + }, + "PermissionProfile": { + "properties": { + "file_system": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "macos": { + "anyOf": [ + { + "$ref": "#/definitions/MacOsSeatbeltProfileExtensions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/NetworkPermissions" + }, + { + "type": "null" + } + ] + } + }, + "type": "object" + }, + "Personality": { + "enum": [ + "none", + "friendly", + "pragmatic" + ], + "type": "string" + }, + "PlanItemArg": { + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/StepStatus" + }, + "step": { + "type": "string" + } + }, + "required": [ + "status", + "step" + ], + "type": "object" + }, + "PlanType": { + "enum": [ + "free", + "go", + "plus", + "pro", + "team", + "business", + "enterprise", + "edu", + "unknown" + ], + "type": "string" + }, + "RateLimitSnapshot": { + "properties": { + "credits": { + "anyOf": [ + { + "$ref": "#/definitions/CreditsSnapshot" + }, + { + "type": "null" + } + ] + }, + "limit_id": { + "type": [ + "string", + "null" + ] + }, + "limit_name": { + "type": [ + "string", + "null" + ] + }, + "plan_type": { + "anyOf": [ + { + "$ref": "#/definitions/PlanType" + }, + { + "type": "null" + } + ] + }, + "primary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + }, + "secondary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + } + }, + "type": "object" + }, + "RateLimitWindow": { + "properties": { + "resets_at": { + "description": "Unix timestamp (seconds since epoch) when the window resets.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "used_percent": { + "description": "Percentage (0-100) of the window that has been consumed.", + "format": "double", + "type": "number" + }, + "window_minutes": { + "description": "Rolling window duration, in minutes.", + "format": "int64", + "type": [ + "integer", + "null" + ] + } + }, + "required": [ + "used_percent" + ], + "type": "object" + }, + "ReadOnlyAccess": { + "description": "Determines how read-only file access is granted inside a restricted sandbox.", + "oneOf": [ + { + "description": "Restrict reads to an explicit set of roots.\n\nWhen `include_platform_defaults` is `true`, platform defaults required for basic execution are included in addition to `readable_roots`.", + "properties": { + "include_platform_defaults": { + "default": true, + "description": "Include built-in platform read roots required for basic process execution.", + "type": "boolean" + }, + "readable_roots": { + "description": "Additional absolute roots that should be readable.", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": "array" + }, + "type": { + "enum": [ + "restricted" + ], + "title": "RestrictedReadOnlyAccessType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "RestrictedReadOnlyAccess", + "type": "object" + }, + { + "description": "Allow unrestricted file reads.", + "properties": { + "type": { + "enum": [ + "full-access" + ], + "title": "FullAccessReadOnlyAccessType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "FullAccessReadOnlyAccess", + "type": "object" + } + ] + }, + "RealtimeAudioFrame": { + "properties": { + "data": { + "type": "string" + }, + "num_channels": { + "format": "uint16", + "minimum": 0.0, + "type": "integer" + }, + "sample_rate": { + "format": "uint32", + "minimum": 0.0, + "type": "integer" + }, + "samples_per_channel": { + "format": "uint32", + "minimum": 0.0, + "type": [ + "integer", + "null" + ] + } + }, + "required": [ + "data", + "num_channels", + "sample_rate" + ], + "type": "object" + }, + "RealtimeEvent": { + "oneOf": [ + { + "additionalProperties": false, + "properties": { + "SessionUpdated": { + "properties": { + "instructions": { + "type": [ + "string", + "null" + ] + }, + "session_id": { + "type": "string" + } + }, + "required": [ + "session_id" + ], + "type": "object" + } + }, + "required": [ + "SessionUpdated" + ], + "title": "SessionUpdatedRealtimeEvent", + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "InputTranscriptDelta": { + "$ref": "#/definitions/RealtimeTranscriptDelta" + } + }, + "required": [ + "InputTranscriptDelta" + ], + "title": "InputTranscriptDeltaRealtimeEvent", + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "OutputTranscriptDelta": { + "$ref": "#/definitions/RealtimeTranscriptDelta" + } + }, + "required": [ + "OutputTranscriptDelta" + ], + "title": "OutputTranscriptDeltaRealtimeEvent", + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "AudioOut": { + "$ref": "#/definitions/RealtimeAudioFrame" + } + }, + "required": [ + "AudioOut" + ], + "title": "AudioOutRealtimeEvent", + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "ConversationItemAdded": true + }, + "required": [ + "ConversationItemAdded" + ], + "title": "ConversationItemAddedRealtimeEvent", + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "ConversationItemDone": { + "properties": { + "item_id": { + "type": "string" + } + }, + "required": [ + "item_id" + ], + "type": "object" + } + }, + "required": [ + "ConversationItemDone" + ], + "title": "ConversationItemDoneRealtimeEvent", + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "HandoffRequested": { + "$ref": "#/definitions/RealtimeHandoffRequested" + } + }, + "required": [ + "HandoffRequested" + ], + "title": "HandoffRequestedRealtimeEvent", + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "Error": { + "type": "string" + } + }, + "required": [ + "Error" + ], + "title": "ErrorRealtimeEvent", + "type": "object" + } + ] + }, + "RealtimeHandoffRequested": { + "properties": { + "active_transcript": { + "items": { + "$ref": "#/definitions/RealtimeTranscriptEntry" + }, + "type": "array" + }, + "handoff_id": { + "type": "string" + }, + "input_transcript": { + "type": "string" + }, + "item_id": { + "type": "string" + } + }, + "required": [ + "active_transcript", + "handoff_id", + "input_transcript", + "item_id" + ], + "type": "object" + }, + "RealtimeTranscriptDelta": { + "properties": { + "delta": { + "type": "string" + } + }, + "required": [ + "delta" + ], + "type": "object" + }, + "RealtimeTranscriptEntry": { + "properties": { + "role": { + "type": "string" + }, + "text": { + "type": "string" + } + }, + "required": [ + "role", + "text" + ], + "type": "object" + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ], + "type": "string" + }, + "ReasoningItemContent": { + "oneOf": [ + { + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "reasoning_text" + ], + "title": "ReasoningTextReasoningItemContentType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "ReasoningTextReasoningItemContent", + "type": "object" + }, + { + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "text" + ], + "title": "TextReasoningItemContentType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "TextReasoningItemContent", + "type": "object" + } + ] + }, + "ReasoningItemReasoningSummary": { + "oneOf": [ + { + "properties": { + "text": { + "type": "string" + }, + "type": { + "enum": [ + "summary_text" + ], + "title": "SummaryTextReasoningItemReasoningSummaryType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "SummaryTextReasoningItemReasoningSummary", + "type": "object" + } + ] + }, + "ReasoningSummary": { + "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", + "oneOf": [ + { + "enum": [ + "auto", + "concise", + "detailed" + ], + "type": "string" + }, + { + "description": "Option to disable reasoning summaries.", + "enum": [ + "none" + ], + "type": "string" + } + ] + }, + "RemoteSkillSummary": { + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "description", + "id", + "name" + ], + "type": "object" + }, + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "int64", + "type": "integer" + } + ], + "description": "ID of a request, which can be either a string or an integer." + }, + "RequestPermissionProfile": { + "additionalProperties": false, + "properties": { + "file_system": { + "anyOf": [ + { + "$ref": "#/definitions/FileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/NetworkPermissions" + }, + { + "type": "null" + } + ] + } + }, + "type": "object" + }, + "RequestUserInputQuestion": { + "properties": { + "header": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isOther": { + "default": false, + "type": "boolean" + }, + "isSecret": { + "default": false, + "type": "boolean" + }, + "options": { + "items": { + "$ref": "#/definitions/RequestUserInputQuestionOption" + }, + "type": [ + "array", + "null" + ] + }, + "question": { + "type": "string" + } + }, + "required": [ + "header", + "id", + "question" + ], + "type": "object" + }, + "RequestUserInputQuestionOption": { + "properties": { + "description": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "required": [ + "description", + "label" + ], + "type": "object" + }, + "Resource": { + "description": "A known resource that the server is capable of reading.", + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "items": true, + "type": [ + "array", + "null" + ] + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "size": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + }, + "required": [ + "name", + "uri" + ], + "type": "object" + }, + "ResourceTemplate": { + "description": "A template description for resources available on the server.", + "properties": { + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uriTemplate": { + "type": "string" + } + }, + "required": [ + "name", + "uriTemplate" + ], + "type": "object" + }, + "ResponseItem": { + "oneOf": [ + { + "properties": { + "content": { + "items": { + "$ref": "#/definitions/ContentItem" + }, + "type": "array" + }, + "end_turn": { + "type": [ + "boolean", + "null" + ] + }, + "id": { + "type": [ + "string", + "null" + ], + "writeOnly": true + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "role": { + "type": "string" + }, + "type": { + "enum": [ + "message" + ], + "title": "MessageResponseItemType", + "type": "string" + } + }, + "required": [ + "content", + "role", + "type" + ], + "title": "MessageResponseItem", + "type": "object" + }, + { + "properties": { + "content": { + "default": null, + "items": { + "$ref": "#/definitions/ReasoningItemContent" + }, + "type": [ + "array", + "null" + ] + }, + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string", + "writeOnly": true + }, + "summary": { + "items": { + "$ref": "#/definitions/ReasoningItemReasoningSummary" + }, + "type": "array" + }, + "type": { + "enum": [ + "reasoning" + ], + "title": "ReasoningResponseItemType", + "type": "string" + } + }, + "required": [ + "id", + "summary", + "type" + ], + "title": "ReasoningResponseItem", + "type": "object" + }, + { + "properties": { + "action": { + "$ref": "#/definitions/LocalShellAction" + }, + "call_id": { + "description": "Set when using the Responses API.", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Legacy id field retained for compatibility with older payloads.", + "type": [ + "string", + "null" + ], + "writeOnly": true + }, + "status": { + "$ref": "#/definitions/LocalShellStatus" + }, + "type": { + "enum": [ + "local_shell_call" + ], + "title": "LocalShellCallResponseItemType", + "type": "string" + } + }, + "required": [ + "action", + "status", + "type" + ], + "title": "LocalShellCallResponseItem", + "type": "object" + }, + { + "properties": { + "arguments": { + "type": "string" + }, + "call_id": { + "type": "string" + }, + "id": { + "type": [ + "string", + "null" + ], + "writeOnly": true + }, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "function_call" + ], + "title": "FunctionCallResponseItemType", + "type": "string" + } + }, + "required": [ + "arguments", + "call_id", + "name", + "type" + ], + "title": "FunctionCallResponseItem", + "type": "object" + }, + { + "properties": { + "arguments": true, + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "id": { + "type": [ + "string", + "null" + ], + "writeOnly": true + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "tool_search_call" + ], + "title": "ToolSearchCallResponseItemType", + "type": "string" + } + }, + "required": [ + "arguments", + "execution", + "type" + ], + "title": "ToolSearchCallResponseItem", + "type": "object" + }, + { + "properties": { + "call_id": { + "type": "string" + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputPayload" + }, + "type": { + "enum": [ + "function_call_output" + ], + "title": "FunctionCallOutputResponseItemType", + "type": "string" + } + }, + "required": [ + "call_id", + "output", + "type" + ], + "title": "FunctionCallOutputResponseItem", + "type": "object" + }, + { + "properties": { + "call_id": { + "type": "string" + }, + "id": { + "type": [ + "string", + "null" + ], + "writeOnly": true + }, + "input": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "custom_tool_call" + ], + "title": "CustomToolCallResponseItemType", + "type": "string" + } + }, + "required": [ + "call_id", + "input", + "name", + "type" + ], + "title": "CustomToolCallResponseItem", + "type": "object" + }, + { + "properties": { + "call_id": { + "type": "string" + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputPayload" + }, + "type": { + "enum": [ + "custom_tool_call_output" + ], + "title": "CustomToolCallOutputResponseItemType", + "type": "string" + } + }, + "required": [ + "call_id", + "output", + "type" + ], + "title": "CustomToolCallOutputResponseItem", + "type": "object" + }, + { + "properties": { + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tools": { + "items": true, + "type": "array" + }, + "type": { + "enum": [ + "tool_search_output" + ], + "title": "ToolSearchOutputResponseItemType", + "type": "string" + } + }, + "required": [ + "execution", + "status", + "tools", + "type" + ], + "title": "ToolSearchOutputResponseItem", + "type": "object" + }, + { + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": [ + "string", + "null" + ], + "writeOnly": true + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "web_search_call" + ], + "title": "WebSearchCallResponseItemType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "WebSearchCallResponseItem", + "type": "object" + }, + { + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "enum": [ + "image_generation_call" + ], + "title": "ImageGenerationCallResponseItemType", + "type": "string" + } + }, + "required": [ + "id", + "result", + "status", + "type" + ], + "title": "ImageGenerationCallResponseItem", + "type": "object" + }, + { + "properties": { + "ghost_commit": { + "$ref": "#/definitions/GhostCommit" + }, + "type": { + "enum": [ + "ghost_snapshot" + ], + "title": "GhostSnapshotResponseItemType", + "type": "string" + } + }, + "required": [ + "ghost_commit", + "type" + ], + "title": "GhostSnapshotResponseItem", + "type": "object" + }, + { + "properties": { + "encrypted_content": { + "type": "string" + }, + "type": { + "enum": [ + "compaction" + ], + "title": "CompactionResponseItemType", + "type": "string" + } + }, + "required": [ + "encrypted_content", + "type" + ], + "title": "CompactionResponseItem", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "other" + ], + "title": "OtherResponseItemType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "OtherResponseItem", + "type": "object" + } + ] + }, + "ResponsesApiWebSearchAction": { + "oneOf": [ + { + "properties": { + "queries": { + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "search" + ], + "title": "SearchResponsesApiWebSearchActionType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "SearchResponsesApiWebSearchAction", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "open_page" + ], + "title": "OpenPageResponsesApiWebSearchActionType", + "type": "string" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "type" + ], + "title": "OpenPageResponsesApiWebSearchAction", + "type": "object" + }, + { + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "find_in_page" + ], + "title": "FindInPageResponsesApiWebSearchActionType", + "type": "string" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "type" + ], + "title": "FindInPageResponsesApiWebSearchAction", + "type": "object" + }, + { + "properties": { + "type": { + "enum": [ + "other" + ], + "title": "OtherResponsesApiWebSearchActionType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "OtherResponsesApiWebSearchAction", + "type": "object" + } + ] + }, + "Result_of_CallToolResult_or_String": { + "oneOf": [ + { + "properties": { + "Ok": { + "$ref": "#/definitions/CallToolResult" + } + }, + "required": [ + "Ok" + ], + "title": "OkResult_of_CallToolResult_or_String", + "type": "object" + }, + { + "properties": { + "Err": { + "type": "string" + } + }, + "required": [ + "Err" + ], + "title": "ErrResult_of_CallToolResult_or_String", + "type": "object" + } + ] + }, + "ReviewCodeLocation": { + "description": "Location of the code related to a review finding.", + "properties": { + "absolute_file_path": { + "type": "string" + }, + "line_range": { + "$ref": "#/definitions/ReviewLineRange" + } + }, + "required": [ + "absolute_file_path", + "line_range" + ], + "type": "object" + }, + "ReviewDecision": { + "description": "User's decision in response to an ExecApprovalRequest.", + "oneOf": [ + { + "description": "User has approved this command and the agent should execute it.", + "enum": [ + "approved" + ], + "type": "string" + }, + { + "additionalProperties": false, + "description": "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", + "properties": { + "approved_execpolicy_amendment": { + "properties": { + "proposed_execpolicy_amendment": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "proposed_execpolicy_amendment" + ], + "type": "object" + } + }, + "required": [ + "approved_execpolicy_amendment" + ], + "title": "ApprovedExecpolicyAmendmentReviewDecision", + "type": "object" + }, + { + "description": "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", + "enum": [ + "approved_for_session" + ], + "type": "string" + }, + { + "additionalProperties": false, + "description": "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", + "properties": { + "network_policy_amendment": { + "properties": { + "network_policy_amendment": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + }, + "required": [ + "network_policy_amendment" + ], + "type": "object" + } + }, + "required": [ + "network_policy_amendment" + ], + "title": "NetworkPolicyAmendmentReviewDecision", + "type": "object" + }, + { + "description": "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", + "enum": [ + "denied" + ], + "type": "string" + }, + { + "description": "User has denied this command and the agent should not do anything until the user's next command.", + "enum": [ + "abort" + ], + "type": "string" + } + ] + }, + "ReviewFinding": { + "description": "A single review finding describing an observed issue or recommendation.", + "properties": { + "body": { + "type": "string" + }, + "code_location": { + "$ref": "#/definitions/ReviewCodeLocation" + }, + "confidence_score": { + "format": "float", + "type": "number" + }, + "priority": { + "format": "int32", + "type": "integer" + }, + "title": { + "type": "string" + } + }, + "required": [ + "body", + "code_location", + "confidence_score", + "priority", + "title" + ], + "type": "object" + }, + "ReviewLineRange": { + "description": "Inclusive line range in a file associated with the finding.", + "properties": { + "end": { + "format": "uint32", + "minimum": 0.0, + "type": "integer" + }, + "start": { + "format": "uint32", + "minimum": 0.0, + "type": "integer" + } + }, + "required": [ + "end", + "start" + ], + "type": "object" + }, + "ReviewOutputEvent": { + "description": "Structured review result produced by a child review session.", + "properties": { + "findings": { + "items": { + "$ref": "#/definitions/ReviewFinding" + }, + "type": "array" + }, + "overall_confidence_score": { + "format": "float", + "type": "number" + }, + "overall_correctness": { + "type": "string" + }, + "overall_explanation": { + "type": "string" + } + }, + "required": [ + "findings", + "overall_confidence_score", + "overall_correctness", + "overall_explanation" + ], + "type": "object" + }, + "ReviewTarget": { + "oneOf": [ + { + "description": "Review the working tree: staged, unstaged, and untracked files.", + "properties": { + "type": { + "enum": [ + "uncommittedChanges" + ], + "title": "UncommittedChangesReviewTargetType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "UncommittedChangesReviewTarget", + "type": "object" + }, + { + "description": "Review changes between the current branch and the given base branch.", + "properties": { + "branch": { + "type": "string" + }, + "type": { + "enum": [ + "baseBranch" + ], + "title": "BaseBranchReviewTargetType", + "type": "string" + } + }, + "required": [ + "branch", + "type" + ], + "title": "BaseBranchReviewTarget", + "type": "object" + }, + { + "description": "Review the changes introduced by a specific commit.", + "properties": { + "sha": { + "type": "string" + }, + "title": { + "description": "Optional human-readable label (e.g., commit subject) for UIs.", + "type": [ + "string", + "null" + ] + }, + "type": { + "enum": [ + "commit" + ], + "title": "CommitReviewTargetType", + "type": "string" + } + }, + "required": [ + "sha", + "type" + ], + "title": "CommitReviewTarget", + "type": "object" + }, + { + "description": "Arbitrary instructions provided by the user.", + "properties": { + "instructions": { + "type": "string" + }, + "type": { + "enum": [ + "custom" + ], + "title": "CustomReviewTargetType", + "type": "string" + } + }, + "required": [ + "instructions", + "type" + ], + "title": "CustomReviewTarget", + "type": "object" + } + ] + }, + "SandboxPolicy": { + "description": "Determines execution restrictions for model shell commands.", + "oneOf": [ + { + "description": "No restrictions whatsoever. Use with caution.", + "properties": { + "type": { + "enum": [ + "danger-full-access" + ], + "title": "DangerFullAccessSandboxPolicyType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "DangerFullAccessSandboxPolicy", + "type": "object" + }, + { + "description": "Read-only access configuration.", + "properties": { + "access": { + "allOf": [ + { + "$ref": "#/definitions/ReadOnlyAccess" + } + ], + "description": "Read access granted while running under this policy." + }, + "network_access": { + "description": "When set to `true`, outbound network access is allowed. `false` by default.", + "type": "boolean" + }, + "type": { + "enum": [ + "read-only" + ], + "title": "ReadOnlySandboxPolicyType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ReadOnlySandboxPolicy", + "type": "object" + }, + { + "description": "Indicates the process is already in an external sandbox. Allows full disk access while honoring the provided network setting.", + "properties": { + "network_access": { + "allOf": [ + { + "$ref": "#/definitions/NetworkAccess" + } + ], + "default": "restricted", + "description": "Whether the external sandbox permits outbound network traffic." + }, + "type": { + "enum": [ + "external-sandbox" + ], + "title": "ExternalSandboxSandboxPolicyType", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ExternalSandboxSandboxPolicy", + "type": "object" + }, + { + "description": "Same as `ReadOnly` but additionally grants write access to the current working directory (\"workspace\").", + "properties": { + "exclude_slash_tmp": { + "default": false, + "description": "When set to `true`, will NOT include the `/tmp` among the default writable roots on UNIX. Defaults to `false`.", + "type": "boolean" + }, + "exclude_tmpdir_env_var": { + "default": false, + "description": "When set to `true`, will NOT include the per-user `TMPDIR` environment variable among the default writable roots. Defaults to `false`.", + "type": "boolean" + }, + "network_access": { + "default": false, + "description": "When set to `true`, outbound network access is allowed. `false` by default.", + "type": "boolean" + }, + "read_only_access": { + "allOf": [ + { + "$ref": "#/definitions/ReadOnlyAccess" + } + ], + "description": "Read access granted while running under this policy." + }, + "type": { + "enum": [ + "workspace-write" + ], + "title": "WorkspaceWriteSandboxPolicyType", + "type": "string" + }, + "writable_roots": { + "description": "Additional folders (beyond cwd and possibly TMPDIR) that should be writable from within the sandbox.", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": "array" + } + }, + "required": [ + "type" + ], + "title": "WorkspaceWriteSandboxPolicy", + "type": "object" + } + ] + }, + "ServiceTier": { + "enum": [ + "fast", + "flex" + ], + "type": "string" + }, + "SessionMetaLine": { + "description": "SessionMeta contains session-level data that doesn't correspond to a specific turn.\n\nNOTE: There used to be an `instructions` field here, which stored user_instructions, but we now save that on TurnContext. base_instructions stores the base instructions for the session, and should be used when there is no config override.", + "properties": { + "agent_nickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agent_role": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "base_instructions": { + "anyOf": [ + { + "$ref": "#/definitions/base_instructions" + }, + { + "type": "null" + } + ], + "description": "base_instructions for the session. This *should* always be present when creating a new session, but may be missing for older sessions. If not present, fall back to rendering the base_instructions from ModelsManager." + }, + "cli_version": { + "type": "string" + }, + "cwd": { + "type": "string" + }, + "dynamic_tools": { + "items": { + "$ref": "#/definitions/DynamicToolSpec" + }, + "type": [ + "array", + "null" + ] + }, + "forked_from_id": { + "anyOf": [ + { + "$ref": "#/definitions/ThreadId" + }, + { + "type": "null" + } + ] + }, + "git": { + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "$ref": "#/definitions/ThreadId" + }, + "memory_mode": { + "type": [ + "string", + "null" + ] + }, + "model_provider": { + "type": [ + "string", + "null" + ] + }, + "originator": { + "type": "string" + }, + "source": { + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ], + "default": "vscode" + }, + "timestamp": { + "type": "string" + } + }, + "required": [ + "cli_version", + "cwd", + "id", + "originator", + "timestamp" + ], + "type": "object" + }, + "SessionNetworkProxyRuntime": { + "properties": { + "http_addr": { + "type": "string" + }, + "socks_addr": { + "type": "string" + } + }, + "required": [ + "http_addr", + "socks_addr" + ], + "type": "object" + }, + "SessionSource": { + "oneOf": [ + { + "enum": [ + "cli", + "vscode", + "exec", + "mcp", + "unknown" + ], + "type": "string" + }, + { + "additionalProperties": false, + "properties": { + "subagent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "required": [ + "subagent" + ], + "title": "SubagentSessionSource", + "type": "object" + } + ] + }, + "Settings": { + "description": "Settings for a collaboration mode.", + "properties": { + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": "string" + }, + "reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "model" + ], + "type": "object" + }, + "SkillDependencies": { + "properties": { + "tools": { + "items": { + "$ref": "#/definitions/SkillToolDependency" + }, + "type": "array" + } + }, + "required": [ + "tools" + ], + "type": "object" + }, + "SkillErrorInfo": { + "properties": { + "message": { + "type": "string" + }, + "path": { + "type": "string" + } + }, + "required": [ + "message", + "path" + ], + "type": "object" + }, + "SkillInterface": { + "properties": { + "brand_color": { + "type": [ + "string", + "null" + ] + }, + "default_prompt": { + "type": [ + "string", + "null" + ] + }, + "display_name": { + "type": [ + "string", + "null" + ] + }, + "icon_large": { + "type": [ + "string", + "null" + ] + }, + "icon_small": { + "type": [ + "string", + "null" + ] + }, + "short_description": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "SkillMetadata": { + "properties": { + "dependencies": { + "anyOf": [ + { + "$ref": "#/definitions/SkillDependencies" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/SkillInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/SkillScope" + }, + "short_description": { + "description": "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "description", + "enabled", + "name", + "path", + "scope" + ], + "type": "object" + }, + "SkillScope": { + "enum": [ + "user", + "repo", + "system", + "admin" + ], + "type": "string" + }, + "SkillToolDependency": { + "properties": { + "command": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "transport": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string" + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "value": { + "type": "string" + } + }, + "required": [ + "type", + "value" + ], + "type": "object" + }, + "SkillsListEntry": { + "properties": { + "cwd": { + "type": "string" + }, + "errors": { + "items": { + "$ref": "#/definitions/SkillErrorInfo" + }, + "type": "array" + }, + "skills": { + "items": { + "$ref": "#/definitions/SkillMetadata" + }, + "type": "array" + } + }, + "required": [ + "cwd", + "errors", + "skills" + ], + "type": "object" + }, + "StepStatus": { + "enum": [ + "pending", + "in_progress", + "completed" + ], + "type": "string" + }, + "SubAgentSource": { + "oneOf": [ + { + "enum": [ + "review", + "compact", + "memory_consolidation" + ], + "type": "string" + }, + { + "additionalProperties": false, + "properties": { + "thread_spawn": { + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "format": "int32", + "type": "integer" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + }, + "required": [ + "depth", + "parent_thread_id" + ], + "type": "object" + } + }, + "required": [ + "thread_spawn" + ], + "title": "ThreadSpawnSubAgentSource", + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "other": { + "type": "string" + } + }, + "required": [ + "other" + ], + "title": "OtherSubAgentSource", + "type": "object" + } + ] + }, + "TextElement": { + "properties": { + "byte_range": { + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ], + "description": "Byte range in the parent `text` buffer that this element occupies." + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "byte_range" + ], + "type": "object" + }, + "ThreadId": { + "type": "string" + }, + "TokenUsage": { + "properties": { + "cached_input_tokens": { + "format": "int64", + "type": "integer" + }, + "input_tokens": { + "format": "int64", + "type": "integer" + }, + "output_tokens": { + "format": "int64", + "type": "integer" + }, + "reasoning_output_tokens": { + "format": "int64", + "type": "integer" + }, + "total_tokens": { + "format": "int64", + "type": "integer" + } + }, + "required": [ + "cached_input_tokens", + "input_tokens", + "output_tokens", + "reasoning_output_tokens", + "total_tokens" + ], + "type": "object" + }, + "TokenUsageInfo": { + "properties": { + "last_token_usage": { + "$ref": "#/definitions/TokenUsage" + }, + "model_context_window": { + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "total_token_usage": { + "$ref": "#/definitions/TokenUsage" + } + }, + "required": [ + "last_token_usage", + "total_token_usage" + ], + "type": "object" + }, + "Tool": { + "description": "Definition for a tool the client can call.", + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "items": true, + "type": [ + "array", + "null" + ] + }, + "inputSchema": true, + "name": { + "type": "string" + }, + "outputSchema": true, + "title": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "inputSchema", + "name" + ], + "type": "object" + }, + "TruncationPolicy": { + "oneOf": [ + { + "properties": { + "limit": { + "format": "uint", + "minimum": 0.0, + "type": "integer" + }, + "mode": { + "enum": [ + "bytes" + ], + "type": "string" + } + }, + "required": [ + "limit", + "mode" + ], + "type": "object" + }, + { + "properties": { + "limit": { + "format": "uint", + "minimum": 0.0, + "type": "integer" + }, + "mode": { + "enum": [ + "tokens" + ], + "type": "string" + } + }, + "required": [ + "limit", + "mode" + ], + "type": "object" + } + ] + }, + "TurnAbortReason": { + "enum": [ + "interrupted", + "replaced", + "review_ended" + ], + "type": "string" + }, + "TurnContextItem": { + "description": "Persist once per real user turn after computing that turn's model-visible context updates, and again after mid-turn compaction when replacement history re-establishes full context, so resume/fork replay can recover the latest durable baseline.", + "properties": { + "approval_policy": { + "$ref": "#/definitions/AskForApproval" + }, + "collaboration_mode": { + "anyOf": [ + { + "$ref": "#/definitions/CollaborationMode" + }, + { + "type": "null" + } + ] + }, + "current_date": { + "type": [ + "string", + "null" + ] + }, + "cwd": { + "type": "string" + }, + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "final_output_json_schema": true, + "model": { + "type": "string" + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/TurnContextNetworkItem" + }, + { + "type": "null" + } + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "realtime_active": { + "type": [ + "boolean", + "null" + ] + }, + "sandbox_policy": { + "$ref": "#/definitions/SandboxPolicy" + }, + "summary": { + "$ref": "#/definitions/ReasoningSummary" + }, + "timezone": { + "type": [ + "string", + "null" + ] + }, + "trace_id": { + "type": [ + "string", + "null" + ] + }, + "truncation_policy": { + "anyOf": [ + { + "$ref": "#/definitions/TruncationPolicy" + }, + { + "type": "null" + } + ] + }, + "turn_id": { + "type": [ + "string", + "null" + ] + }, + "user_instructions": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "approval_policy", + "cwd", + "model", + "sandbox_policy", + "summary" + ], + "type": "object" + }, + "TurnContextNetworkItem": { + "properties": { + "allowed_domains": { + "items": { + "type": "string" + }, + "type": "array" + }, + "denied_domains": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "allowed_domains", + "denied_domains" + ], + "type": "object" + }, + "TurnItem": { + "oneOf": [ + { + "properties": { + "content": { + "items": { + "$ref": "#/definitions/UserInput" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "type": { + "enum": [ + "UserMessage" + ], + "title": "UserMessageTurnItemType", + "type": "string" + } + }, + "required": [ + "content", + "id", + "type" + ], + "title": "UserMessageTurnItem", + "type": "object" + }, + { + "description": "Assistant-authored message payload used in turn-item streams.\n\n`phase` is optional because not all providers/models emit it. Consumers should use it when present, but retain legacy completion semantics when it is `None`.", + "properties": { + "content": { + "items": { + "$ref": "#/definitions/AgentMessageContent" + }, + "type": "array" + }, + "id": { + "type": "string" + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ], + "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." + }, + "type": { + "enum": [ + "AgentMessage" + ], + "title": "AgentMessageTurnItemType", + "type": "string" + } + }, + "required": [ + "content", + "id", + "type" + ], + "title": "AgentMessageTurnItem", + "type": "object" + }, + { + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "enum": [ + "Plan" + ], + "title": "PlanTurnItemType", + "type": "string" + } + }, + "required": [ + "id", + "text", + "type" + ], + "title": "PlanTurnItem", + "type": "object" + }, + { + "properties": { + "id": { + "type": "string" + }, + "raw_content": { + "default": [], + "items": { + "type": "string" + }, + "type": "array" + }, + "summary_text": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": { + "enum": [ + "Reasoning" + ], + "title": "ReasoningTurnItemType", + "type": "string" + } + }, + "required": [ + "id", + "summary_text", + "type" + ], + "title": "ReasoningTurnItem", + "type": "object" + }, + { + "properties": { + "action": { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "enum": [ + "WebSearch" + ], + "title": "WebSearchTurnItemType", + "type": "string" + } + }, + "required": [ + "action", + "id", + "query", + "type" + ], + "title": "WebSearchTurnItem", + "type": "object" + }, + { + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "saved_path": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "enum": [ + "ImageGeneration" + ], + "title": "ImageGenerationTurnItemType", + "type": "string" + } + }, + "required": [ + "id", + "result", + "status", + "type" + ], + "title": "ImageGenerationTurnItem", + "type": "object" + }, + { + "properties": { + "id": { + "type": "string" + }, + "type": { + "enum": [ + "ContextCompaction" + ], + "title": "ContextCompactionTurnItemType", + "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "title": "ContextCompactionTurnItem", + "type": "object" + } + ] + }, + "UserInput": { + "description": "User input", + "oneOf": [ + { + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "default": [], + "description": "UI-defined spans within `text` that should be treated as special elements. These are byte ranges into the UTF-8 `text` buffer and are used to render or persist rich input markers (e.g., image placeholders) across history and resume without mutating the literal text.", + "items": { + "$ref": "#/definitions/TextElement" + }, + "type": "array" + }, + "type": { + "enum": [ + "text" + ], + "title": "TextUserInputType", + "type": "string" + } + }, + "required": [ + "text", + "type" + ], + "title": "TextUserInput", + "type": "object" + }, + { + "description": "Pre‑encoded data: URI image.", + "properties": { + "image_url": { + "type": "string" + }, + "type": { + "enum": [ + "image" + ], + "title": "ImageUserInputType", + "type": "string" + } + }, + "required": [ + "image_url", + "type" + ], + "title": "ImageUserInput", + "type": "object" + }, + { + "description": "Local image path provided by the user. This will be converted to an `Image` variant (base64 data URL) during request serialization.", + "properties": { + "path": { + "type": "string" + }, + "type": { + "enum": [ + "local_image" + ], + "title": "LocalImageUserInputType", + "type": "string" + } + }, + "required": [ + "path", + "type" + ], + "title": "LocalImageUserInput", + "type": "object" + }, + { + "description": "Skill selected by the user (name + path to SKILL.md).", + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "enum": [ + "skill" + ], + "title": "SkillUserInputType", + "type": "string" + } + }, + "required": [ + "name", + "path", + "type" + ], + "title": "SkillUserInput", + "type": "object" + }, + { + "description": "Explicit structured mention selected by the user.\n\n`path` identifies the exact mention target, for example `app://` or `plugin://@`.", + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "enum": [ + "mention" + ], + "title": "MentionUserInputType", + "type": "string" + } + }, + "required": [ + "name", + "path", + "type" + ], + "title": "MentionUserInput", + "type": "object" + } + ] + }, + "base_instructions": { + "description": "Base instructions for the model in a thread. Corresponds to the `instructions` field in the ResponsesAPI.", + "properties": { + "text": { + "type": "string" + } + }, + "required": [ + "text" + ], + "type": "object" + } + }, + "oneOf": [ + { + "properties": { + "payload": { + "$ref": "#/definitions/SessionMetaLine" + }, + "type": { + "enum": [ + "session_meta" + ], + "title": "SessionMetaRolloutLineType", + "type": "string" + } + }, + "required": [ + "payload", + "type" + ], + "title": "SessionMetaRolloutLine", + "type": "object" + }, + { + "properties": { + "payload": { + "$ref": "#/definitions/ResponseItem" + }, + "type": { + "enum": [ + "response_item" + ], + "title": "ResponseItemRolloutLineType", + "type": "string" + } + }, + "required": [ + "payload", + "type" + ], + "title": "ResponseItemRolloutLine", + "type": "object" + }, + { + "properties": { + "payload": { + "$ref": "#/definitions/CompactedItem" + }, + "type": { + "enum": [ + "compacted" + ], + "title": "CompactedRolloutLineType", + "type": "string" + } + }, + "required": [ + "payload", + "type" + ], + "title": "CompactedRolloutLine", + "type": "object" + }, + { + "properties": { + "payload": { + "$ref": "#/definitions/TurnContextItem" + }, + "type": { + "enum": [ + "turn_context" + ], + "title": "TurnContextRolloutLineType", + "type": "string" + } + }, + "required": [ + "payload", + "type" + ], + "title": "TurnContextRolloutLine", + "type": "object" + }, + { + "properties": { + "payload": { + "$ref": "#/definitions/EventMsg" + }, + "type": { + "enum": [ + "event_msg" + ], + "title": "EventMsgRolloutLineType", + "type": "string" + } + }, + "required": [ + "payload", + "type" + ], + "title": "EventMsgRolloutLine", + "type": "object" + } + ], + "properties": { + "timestamp": { + "type": "string" + } + }, + "required": [ + "timestamp" + ], + "title": "RolloutLine", + "type": "object" +} \ No newline at end of file diff --git a/codex-rs/app-server-protocol/src/export.rs b/codex-rs/app-server-protocol/src/export.rs index c280bd2e2bd..e73b65f5cc6 100644 --- a/codex-rs/app-server-protocol/src/export.rs +++ b/codex-rs/app-server-protocol/src/export.rs @@ -17,6 +17,7 @@ use crate::protocol::common::EXPERIMENTAL_CLIENT_METHODS; use anyhow::Context; use anyhow::Result; use anyhow::anyhow; +use codex_protocol::protocol::RolloutLine; use schemars::JsonSchema; use schemars::schema_for; use serde::Serialize; @@ -229,6 +230,11 @@ pub fn generate_json_with_experimental(out_dir: &Path, experimental_api: bool) - &flat_v2_bundle, )?; + // internal only (not a public stable API) + let internal_out_dir = out_dir.join("internal"); + ensure_dir(&internal_out_dir)?; + write_json_schema::(&internal_out_dir, "RolloutLine")?; + if !experimental_api { filter_experimental_json_files(out_dir)?; } From b7f5fa1e84918133f0e2d1b5a0b00d53f9d0c65c Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Fri, 13 Mar 2026 00:04:58 -0700 Subject: [PATCH 13/18] up 1038 - Fri Mar 13 2026 00:04:58 --- codex-rs/app-server-protocol/src/export.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/codex-rs/app-server-protocol/src/export.rs b/codex-rs/app-server-protocol/src/export.rs index e73b65f5cc6..5022b72d9d2 100644 --- a/codex-rs/app-server-protocol/src/export.rs +++ b/codex-rs/app-server-protocol/src/export.rs @@ -230,15 +230,15 @@ pub fn generate_json_with_experimental(out_dir: &Path, experimental_api: bool) - &flat_v2_bundle, )?; - // internal only (not a public stable API) - let internal_out_dir = out_dir.join("internal"); - ensure_dir(&internal_out_dir)?; - write_json_schema::(&internal_out_dir, "RolloutLine")?; - if !experimental_api { filter_experimental_json_files(out_dir)?; } + // internal only (not a public stable interface) + let internal_out_dir = out_dir.join("internal"); + ensure_dir(&internal_out_dir)?; + write_json_schema::(&internal_out_dir, "RolloutLine")?; + Ok(()) } From 075aeaed9211bb4641670bb4406f018b6d9dc7de Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Fri, 13 Mar 2026 00:05:59 -0700 Subject: [PATCH 14/18] up 1039 - Fri Mar 13 2026 00:05:59 --- .../bin/codex-write-rollout-line-schema.rs | 51 ------------------- justfile | 4 -- 2 files changed, 55 deletions(-) delete mode 100644 codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs diff --git a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs b/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs deleted file mode 100644 index 540ef09bdef..00000000000 --- a/codex-rs/protocol/src/bin/codex-write-rollout-line-schema.rs +++ /dev/null @@ -1,51 +0,0 @@ -use codex_protocol::protocol::RolloutLine; -use schemars::r#gen::SchemaSettings; -use serde_json::Map; -use serde_json::Value; -use std::io; -use std::path::PathBuf; -const JSON_SCHEMA_FILENAME: &str = "rollout-line.schema.json"; - -fn main() -> io::Result<()> { - let out_dir = std::env::args_os() - .nth(1) - .map(PathBuf::from) - .unwrap_or_else(|| { - let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let codex_rs_dir = manifest_dir.parent().unwrap_or(&manifest_dir); - codex_rs_dir.join("out/rollout-line-schema") - }); - - std::fs::create_dir_all(&out_dir)?; - std::fs::write( - out_dir.join(JSON_SCHEMA_FILENAME), - rollout_line_schema_json()?, - )?; - println!("Wrote {}", out_dir.join(JSON_SCHEMA_FILENAME).display()); - Ok(()) -} - -fn rollout_line_schema_json() -> io::Result> { - let schema = SchemaSettings::draft07() - .into_generator() - .into_root_schema_for::(); - let value = serde_json::to_value(schema).map_err(io::Error::other)?; - let value = canonicalize_json(&value); - serde_json::to_vec_pretty(&value).map_err(io::Error::other) -} - -fn canonicalize_json(value: &Value) -> Value { - match value { - Value::Array(items) => Value::Array(items.iter().map(canonicalize_json).collect()), - Value::Object(map) => { - let mut entries: Vec<_> = map.iter().collect(); - entries.sort_by(|(left, _), (right, _)| left.cmp(right)); - let mut sorted = Map::with_capacity(map.len()); - for (key, child) in entries { - sorted.insert(key.clone(), canonicalize_json(child)); - } - Value::Object(sorted) - } - _ => value.clone(), - } -} diff --git a/justfile b/justfile index 87705d46381..e32a96181e7 100644 --- a/justfile +++ b/justfile @@ -78,10 +78,6 @@ mcp-server-run *args: write-config-schema: cargo run -p codex-core --bin codex-write-config-schema -# Generate RolloutLine schema artifacts. -write-rollout-line-schema *args: - cargo run -p codex-protocol --bin codex-write-rollout-line-schema -- "$@" - # Regenerate vendored app-server protocol schema artifacts. write-app-server-schema *args: cargo run -p codex-app-server-protocol --bin write_schema_fixtures -- "$@" From 9eeb5154fcd3d162108ca650f5e019c5563c1764 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Fri, 13 Mar 2026 02:41:22 -0700 Subject: [PATCH 15/18] fix types --- .../schema/json/ClientRequest.json | 27 ++----------------- .../codex_app_server_protocol.schemas.json | 27 ++----------------- .../codex_app_server_protocol.v2.schemas.json | 27 ++----------------- .../schema/json/internal/RolloutLine.json | 27 ++----------------- .../RawResponseItemCompletedNotification.json | 27 ++----------------- .../schema/json/v2/ThreadResumeParams.json | 27 ++----------------- codex-rs/protocol/src/models.rs | 5 ++++ 7 files changed, 17 insertions(+), 150 deletions(-) diff --git a/codex-rs/app-server-protocol/schema/json/ClientRequest.json b/codex-rs/app-server-protocol/schema/json/ClientRequest.json index dd5c955cfa0..9c2004f057f 100644 --- a/codex-rs/app-server-protocol/schema/json/ClientRequest.json +++ b/codex-rs/app-server-protocol/schema/json/ClientRequest.json @@ -871,24 +871,6 @@ } ] }, - "FunctionCallOutputPayload": { - "description": "The payload we send back to OpenAI when reporting a tool call result.\n\n`body` serializes directly as the wire value for `function_call_output.output`. `success` remains internal metadata for downstream handling.", - "properties": { - "body": { - "$ref": "#/definitions/FunctionCallOutputBody" - }, - "success": { - "type": [ - "boolean", - "null" - ] - } - }, - "required": [ - "body" - ], - "type": "object" - }, "FuzzyFileSearchParams": { "properties": { "cancellationToken": { @@ -1583,10 +1565,6 @@ "null" ] }, - "id": { - "type": "string", - "writeOnly": true - }, "summary": { "items": { "$ref": "#/definitions/ReasoningItemReasoningSummary" @@ -1602,7 +1580,6 @@ } }, "required": [ - "id", "summary", "type" ], @@ -1736,7 +1713,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ @@ -1801,7 +1778,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index 4709bae11c4..e370546dc2f 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -7731,24 +7731,6 @@ } ] }, - "FunctionCallOutputPayload": { - "description": "The payload we send back to OpenAI when reporting a tool call result.\n\n`body` serializes directly as the wire value for `function_call_output.output`. `success` remains internal metadata for downstream handling.", - "properties": { - "body": { - "$ref": "#/definitions/v2/FunctionCallOutputBody" - }, - "success": { - "type": [ - "boolean", - "null" - ] - } - }, - "required": [ - "body" - ], - "type": "object" - }, "GetAccountParams": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { @@ -10195,10 +10177,6 @@ "null" ] }, - "id": { - "type": "string", - "writeOnly": true - }, "summary": { "items": { "$ref": "#/definitions/v2/ReasoningItemReasoningSummary" @@ -10214,7 +10192,6 @@ } }, "required": [ - "id", "summary", "type" ], @@ -10348,7 +10325,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/v2/FunctionCallOutputPayload" + "$ref": "#/definitions/v2/FunctionCallOutputBody" }, "type": { "enum": [ @@ -10413,7 +10390,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/v2/FunctionCallOutputPayload" + "$ref": "#/definitions/v2/FunctionCallOutputBody" }, "type": { "enum": [ diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index 601306fe143..b069d3e5e7e 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -4375,24 +4375,6 @@ } ] }, - "FunctionCallOutputPayload": { - "description": "The payload we send back to OpenAI when reporting a tool call result.\n\n`body` serializes directly as the wire value for `function_call_output.output`. `success` remains internal metadata for downstream handling.", - "properties": { - "body": { - "$ref": "#/definitions/FunctionCallOutputBody" - }, - "success": { - "type": [ - "boolean", - "null" - ] - } - }, - "required": [ - "body" - ], - "type": "object" - }, "FuzzyFileSearchParams": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { @@ -6983,10 +6965,6 @@ "null" ] }, - "id": { - "type": "string", - "writeOnly": true - }, "summary": { "items": { "$ref": "#/definitions/ReasoningItemReasoningSummary" @@ -7002,7 +6980,6 @@ } }, "required": [ - "id", "summary", "type" ], @@ -7136,7 +7113,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ @@ -7201,7 +7178,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ diff --git a/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json b/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json index 536f5ce8ec9..641c0fc0ce5 100644 --- a/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json +++ b/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json @@ -3812,24 +3812,6 @@ } ] }, - "FunctionCallOutputPayload": { - "description": "The payload we send back to OpenAI when reporting a tool call result.\n\n`body` serializes directly as the wire value for `function_call_output.output`. `success` remains internal metadata for downstream handling.", - "properties": { - "body": { - "$ref": "#/definitions/FunctionCallOutputBody" - }, - "success": { - "type": [ - "boolean", - "null" - ] - } - }, - "required": [ - "body" - ], - "type": "object" - }, "GhostCommit": { "description": "Details of a ghost commit created from a repository state.", "properties": { @@ -5350,10 +5332,6 @@ "null" ] }, - "id": { - "type": "string", - "writeOnly": true - }, "summary": { "items": { "$ref": "#/definitions/ReasoningItemReasoningSummary" @@ -5369,7 +5347,6 @@ } }, "required": [ - "id", "summary", "type" ], @@ -5503,7 +5480,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ @@ -5568,7 +5545,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ diff --git a/codex-rs/app-server-protocol/schema/json/v2/RawResponseItemCompletedNotification.json b/codex-rs/app-server-protocol/schema/json/v2/RawResponseItemCompletedNotification.json index 19f0fe34f25..621332c3c22 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/RawResponseItemCompletedNotification.json +++ b/codex-rs/app-server-protocol/schema/json/v2/RawResponseItemCompletedNotification.json @@ -133,24 +133,6 @@ } ] }, - "FunctionCallOutputPayload": { - "description": "The payload we send back to OpenAI when reporting a tool call result.\n\n`body` serializes directly as the wire value for `function_call_output.output`. `success` remains internal metadata for downstream handling.", - "properties": { - "body": { - "$ref": "#/definitions/FunctionCallOutputBody" - }, - "success": { - "type": [ - "boolean", - "null" - ] - } - }, - "required": [ - "body" - ], - "type": "object" - }, "GhostCommit": { "description": "Details of a ghost commit created from a repository state.", "properties": { @@ -413,10 +395,6 @@ "null" ] }, - "id": { - "type": "string", - "writeOnly": true - }, "summary": { "items": { "$ref": "#/definitions/ReasoningItemReasoningSummary" @@ -432,7 +410,6 @@ } }, "required": [ - "id", "summary", "type" ], @@ -566,7 +543,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ @@ -631,7 +608,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ diff --git a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeParams.json b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeParams.json index b21c5a78ee2..3524f86b262 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeParams.json +++ b/codex-rs/app-server-protocol/schema/json/v2/ThreadResumeParams.json @@ -191,24 +191,6 @@ } ] }, - "FunctionCallOutputPayload": { - "description": "The payload we send back to OpenAI when reporting a tool call result.\n\n`body` serializes directly as the wire value for `function_call_output.output`. `success` remains internal metadata for downstream handling.", - "properties": { - "body": { - "$ref": "#/definitions/FunctionCallOutputBody" - }, - "success": { - "type": [ - "boolean", - "null" - ] - } - }, - "required": [ - "body" - ], - "type": "object" - }, "GhostCommit": { "description": "Details of a ghost commit created from a repository state.", "properties": { @@ -479,10 +461,6 @@ "null" ] }, - "id": { - "type": "string", - "writeOnly": true - }, "summary": { "items": { "$ref": "#/definitions/ReasoningItemReasoningSummary" @@ -498,7 +476,6 @@ } }, "required": [ - "id", "summary", "type" ], @@ -632,7 +609,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ @@ -697,7 +674,7 @@ "type": "string" }, "output": { - "$ref": "#/definitions/FunctionCallOutputPayload" + "$ref": "#/definitions/FunctionCallOutputBody" }, "type": { "enum": [ diff --git a/codex-rs/protocol/src/models.rs b/codex-rs/protocol/src/models.rs index 700c1f80e07..31610a257b5 100644 --- a/codex-rs/protocol/src/models.rs +++ b/codex-rs/protocol/src/models.rs @@ -231,6 +231,7 @@ pub enum ResponseInputItem { }, FunctionCallOutput { call_id: String, + #[schemars(with = "FunctionCallOutputBody")] output: FunctionCallOutputPayload, }, McpToolCallOutput { @@ -239,6 +240,7 @@ pub enum ResponseInputItem { }, CustomToolCallOutput { call_id: String, + #[schemars(with = "FunctionCallOutputBody")] output: FunctionCallOutputPayload, }, ToolSearchOutput { @@ -306,6 +308,7 @@ pub enum ResponseItem { Reasoning { #[serde(default, skip_serializing)] #[ts(skip)] + #[schemars(skip)] id: String, summary: Vec, #[serde(default, skip_serializing_if = "should_serialize_reasoning_content")] @@ -356,6 +359,7 @@ pub enum ResponseItem { // We keep this behavior centralized in `FunctionCallOutputPayload`. FunctionCallOutput { call_id: String, + #[schemars(with = "FunctionCallOutputBody")] output: FunctionCallOutputPayload, }, CustomToolCall { @@ -375,6 +379,7 @@ pub enum ResponseItem { // text or structured content items. CustomToolCallOutput { call_id: String, + #[schemars(with = "FunctionCallOutputBody")] output: FunctionCallOutputPayload, }, ToolSearchOutput { From 3e97b48c4ca5a5161be2861c4aad0b5d9fe5be86 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Fri, 13 Mar 2026 15:26:11 -0700 Subject: [PATCH 16/18] up 1047 - Fri Mar 13 2026 15:26:11 --- .../schema/json/internal/RolloutLine.json | 7475 ----------------- codex-rs/app-server-protocol/src/export.rs | 11 +- codex-rs/app-server-protocol/src/lib.rs | 1 + codex-rs/cli/src/main.rs | 14 + 4 files changed, 21 insertions(+), 7480 deletions(-) delete mode 100644 codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json diff --git a/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json b/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json deleted file mode 100644 index 641c0fc0ce5..00000000000 --- a/codex-rs/app-server-protocol/schema/json/internal/RolloutLine.json +++ /dev/null @@ -1,7475 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "AbsolutePathBuf": { - "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.", - "type": "string" - }, - "AgentMessageContent": { - "oneOf": [ - { - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "Text" - ], - "title": "TextAgentMessageContentType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "TextAgentMessageContent", - "type": "object" - } - ] - }, - "AgentStatus": { - "description": "Agent lifecycle status, derived from emitted events.", - "oneOf": [ - { - "description": "Agent is waiting for initialization.", - "enum": [ - "pending_init" - ], - "type": "string" - }, - { - "description": "Agent is currently running.", - "enum": [ - "running" - ], - "type": "string" - }, - { - "additionalProperties": false, - "description": "Agent is done. Contains the final assistant message.", - "properties": { - "completed": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "completed" - ], - "title": "CompletedAgentStatus", - "type": "object" - }, - { - "additionalProperties": false, - "description": "Agent encountered an error.", - "properties": { - "errored": { - "type": "string" - } - }, - "required": [ - "errored" - ], - "title": "ErroredAgentStatus", - "type": "object" - }, - { - "description": "Agent has been shutdown.", - "enum": [ - "shutdown" - ], - "type": "string" - }, - { - "description": "Agent is not found.", - "enum": [ - "not_found" - ], - "type": "string" - } - ] - }, - "AskForApproval": { - "description": "Determines the conditions under which the user is consulted to approve running the command proposed by Codex.", - "oneOf": [ - { - "description": "Under this policy, only \"known safe\" commands—as determined by `is_safe_command()`—that **only read files** are auto‑approved. Everything else will ask the user to approve.", - "enum": [ - "untrusted" - ], - "type": "string" - }, - { - "description": "DEPRECATED: *All* commands are auto‑approved, but they are expected to run inside a sandbox where network access is disabled and writes are confined to a specific set of paths. If the command fails, it will be escalated to the user to approve execution without a sandbox. Prefer `OnRequest` for interactive runs or `Never` for non-interactive runs.", - "enum": [ - "on-failure" - ], - "type": "string" - }, - { - "description": "The model decides when to ask the user for approval.", - "enum": [ - "on-request" - ], - "type": "string" - }, - { - "additionalProperties": false, - "description": "Fine-grained controls for individual approval flows.\n\nWhen a field is `true`, commands in that category are allowed. When it is `false`, those requests are automatically rejected instead of shown to the user.", - "properties": { - "granular": { - "$ref": "#/definitions/GranularApprovalConfig" - } - }, - "required": [ - "granular" - ], - "title": "GranularAskForApproval", - "type": "object" - }, - { - "description": "Never ask the user to approve commands. Failures are immediately returned to the model, and never escalated to the user for approval.", - "enum": [ - "never" - ], - "type": "string" - } - ] - }, - "ByteRange": { - "properties": { - "end": { - "description": "End byte offset (exclusive) within the UTF-8 text buffer.", - "format": "uint", - "minimum": 0.0, - "type": "integer" - }, - "start": { - "description": "Start byte offset (inclusive) within the UTF-8 text buffer.", - "format": "uint", - "minimum": 0.0, - "type": "integer" - } - }, - "required": [ - "end", - "start" - ], - "type": "object" - }, - "CallToolResult": { - "description": "The server's response to a tool call.", - "properties": { - "_meta": true, - "content": { - "items": true, - "type": "array" - }, - "isError": { - "type": [ - "boolean", - "null" - ] - }, - "structuredContent": true - }, - "required": [ - "content" - ], - "type": "object" - }, - "CodexErrorInfo": { - "description": "Codex errors that we expose to clients.", - "oneOf": [ - { - "enum": [ - "context_window_exceeded", - "usage_limit_exceeded", - "server_overloaded", - "internal_server_error", - "unauthorized", - "bad_request", - "sandbox_error", - "thread_rollback_failed", - "other" - ], - "type": "string" - }, - { - "additionalProperties": false, - "properties": { - "http_connection_failed": { - "properties": { - "http_status_code": { - "format": "uint16", - "minimum": 0.0, - "type": [ - "integer", - "null" - ] - } - }, - "type": "object" - } - }, - "required": [ - "http_connection_failed" - ], - "title": "HttpConnectionFailedCodexErrorInfo", - "type": "object" - }, - { - "additionalProperties": false, - "description": "Failed to connect to the response SSE stream.", - "properties": { - "response_stream_connection_failed": { - "properties": { - "http_status_code": { - "format": "uint16", - "minimum": 0.0, - "type": [ - "integer", - "null" - ] - } - }, - "type": "object" - } - }, - "required": [ - "response_stream_connection_failed" - ], - "title": "ResponseStreamConnectionFailedCodexErrorInfo", - "type": "object" - }, - { - "additionalProperties": false, - "description": "The response SSE stream disconnected in the middle of a turnbefore completion.", - "properties": { - "response_stream_disconnected": { - "properties": { - "http_status_code": { - "format": "uint16", - "minimum": 0.0, - "type": [ - "integer", - "null" - ] - } - }, - "type": "object" - } - }, - "required": [ - "response_stream_disconnected" - ], - "title": "ResponseStreamDisconnectedCodexErrorInfo", - "type": "object" - }, - { - "additionalProperties": false, - "description": "Reached the retry limit for responses.", - "properties": { - "response_too_many_failed_attempts": { - "properties": { - "http_status_code": { - "format": "uint16", - "minimum": 0.0, - "type": [ - "integer", - "null" - ] - } - }, - "type": "object" - } - }, - "required": [ - "response_too_many_failed_attempts" - ], - "title": "ResponseTooManyFailedAttemptsCodexErrorInfo", - "type": "object" - } - ] - }, - "CollabAgentRef": { - "properties": { - "agent_nickname": { - "description": "Optional nickname assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "agent_role": { - "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the receiver/new agent." - } - }, - "required": [ - "thread_id" - ], - "type": "object" - }, - "CollabAgentStatusEntry": { - "properties": { - "agent_nickname": { - "description": "Optional nickname assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "agent_role": { - "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "status": { - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ], - "description": "Last known status of the agent." - }, - "thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the receiver/new agent." - } - }, - "required": [ - "status", - "thread_id" - ], - "type": "object" - }, - "CollaborationMode": { - "description": "Collaboration mode for a Codex session.", - "properties": { - "mode": { - "$ref": "#/definitions/ModeKind" - }, - "settings": { - "$ref": "#/definitions/Settings" - } - }, - "required": [ - "mode", - "settings" - ], - "type": "object" - }, - "CompactedItem": { - "properties": { - "message": { - "type": "string" - }, - "replacement_history": { - "items": { - "$ref": "#/definitions/ResponseItem" - }, - "type": [ - "array", - "null" - ] - } - }, - "required": [ - "message" - ], - "type": "object" - }, - "ContentItem": { - "oneOf": [ - { - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "input_text" - ], - "title": "InputTextContentItemType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "InputTextContentItem", - "type": "object" - }, - { - "properties": { - "image_url": { - "type": "string" - }, - "type": { - "enum": [ - "input_image" - ], - "title": "InputImageContentItemType", - "type": "string" - } - }, - "required": [ - "image_url", - "type" - ], - "title": "InputImageContentItem", - "type": "object" - }, - { - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "output_text" - ], - "title": "OutputTextContentItemType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "OutputTextContentItem", - "type": "object" - } - ] - }, - "CreditsSnapshot": { - "properties": { - "balance": { - "type": [ - "string", - "null" - ] - }, - "has_credits": { - "type": "boolean" - }, - "unlimited": { - "type": "boolean" - } - }, - "required": [ - "has_credits", - "unlimited" - ], - "type": "object" - }, - "CustomPrompt": { - "properties": { - "argument_hint": { - "type": [ - "string", - "null" - ] - }, - "content": { - "type": "string" - }, - "description": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" - }, - "path": { - "type": "string" - } - }, - "required": [ - "content", - "name", - "path" - ], - "type": "object" - }, - "Duration": { - "properties": { - "nanos": { - "format": "uint32", - "minimum": 0.0, - "type": "integer" - }, - "secs": { - "format": "uint64", - "minimum": 0.0, - "type": "integer" - } - }, - "required": [ - "nanos", - "secs" - ], - "type": "object" - }, - "DynamicToolCallOutputContentItem": { - "oneOf": [ - { - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "inputText" - ], - "title": "InputTextDynamicToolCallOutputContentItemType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "InputTextDynamicToolCallOutputContentItem", - "type": "object" - }, - { - "properties": { - "imageUrl": { - "type": "string" - }, - "type": { - "enum": [ - "inputImage" - ], - "title": "InputImageDynamicToolCallOutputContentItemType", - "type": "string" - } - }, - "required": [ - "imageUrl", - "type" - ], - "title": "InputImageDynamicToolCallOutputContentItem", - "type": "object" - } - ] - }, - "DynamicToolSpec": { - "properties": { - "description": { - "type": "string" - }, - "inputSchema": true, - "name": { - "type": "string" - } - }, - "required": [ - "description", - "inputSchema", - "name" - ], - "type": "object" - }, - "ElicitationRequest": { - "oneOf": [ - { - "properties": { - "_meta": true, - "message": { - "type": "string" - }, - "mode": { - "enum": [ - "form" - ], - "type": "string" - }, - "requested_schema": true - }, - "required": [ - "message", - "mode", - "requested_schema" - ], - "type": "object" - }, - { - "properties": { - "_meta": true, - "elicitation_id": { - "type": "string" - }, - "message": { - "type": "string" - }, - "mode": { - "enum": [ - "url" - ], - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "elicitation_id", - "message", - "mode", - "url" - ], - "type": "object" - } - ] - }, - "EventMsg": { - "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.", - "oneOf": [ - { - "description": "Error while executing a submission", - "properties": { - "codex_error_info": { - "anyOf": [ - { - "$ref": "#/definitions/CodexErrorInfo" - }, - { - "type": "null" - } - ], - "default": null - }, - "message": { - "type": "string" - }, - "type": { - "enum": [ - "error" - ], - "title": "ErrorEventMsgType", - "type": "string" - } - }, - "required": [ - "message", - "type" - ], - "title": "ErrorEventMsg", - "type": "object" - }, - { - "description": "Warning issued while processing a submission. Unlike `Error`, this indicates the turn continued but the user should still be notified.", - "properties": { - "message": { - "type": "string" - }, - "type": { - "enum": [ - "warning" - ], - "title": "WarningEventMsgType", - "type": "string" - } - }, - "required": [ - "message", - "type" - ], - "title": "WarningEventMsg", - "type": "object" - }, - { - "description": "Realtime conversation lifecycle start event.", - "properties": { - "session_id": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "realtime_conversation_started" - ], - "title": "RealtimeConversationStartedEventMsgType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "RealtimeConversationStartedEventMsg", - "type": "object" - }, - { - "description": "Realtime conversation streaming payload event.", - "properties": { - "payload": { - "$ref": "#/definitions/RealtimeEvent" - }, - "type": { - "enum": [ - "realtime_conversation_realtime" - ], - "title": "RealtimeConversationRealtimeEventMsgType", - "type": "string" - } - }, - "required": [ - "payload", - "type" - ], - "title": "RealtimeConversationRealtimeEventMsg", - "type": "object" - }, - { - "description": "Realtime conversation lifecycle close event.", - "properties": { - "reason": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "realtime_conversation_closed" - ], - "title": "RealtimeConversationClosedEventMsgType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "RealtimeConversationClosedEventMsg", - "type": "object" - }, - { - "description": "Model routing changed from the requested model to a different model.", - "properties": { - "from_model": { - "type": "string" - }, - "reason": { - "$ref": "#/definitions/ModelRerouteReason" - }, - "to_model": { - "type": "string" - }, - "type": { - "enum": [ - "model_reroute" - ], - "title": "ModelRerouteEventMsgType", - "type": "string" - } - }, - "required": [ - "from_model", - "reason", - "to_model", - "type" - ], - "title": "ModelRerouteEventMsg", - "type": "object" - }, - { - "description": "Conversation history was compacted (either automatically or manually).", - "properties": { - "type": { - "enum": [ - "context_compacted" - ], - "title": "ContextCompactedEventMsgType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "ContextCompactedEventMsg", - "type": "object" - }, - { - "description": "Conversation history was rolled back by dropping the last N user turns.", - "properties": { - "num_turns": { - "description": "Number of user turns that were removed from context.", - "format": "uint32", - "minimum": 0.0, - "type": "integer" - }, - "type": { - "enum": [ - "thread_rolled_back" - ], - "title": "ThreadRolledBackEventMsgType", - "type": "string" - } - }, - "required": [ - "num_turns", - "type" - ], - "title": "ThreadRolledBackEventMsg", - "type": "object" - }, - { - "description": "Agent has started a turn. v1 wire format uses `task_started`; accept `turn_started` for v2 interop.", - "properties": { - "collaboration_mode_kind": { - "allOf": [ - { - "$ref": "#/definitions/ModeKind" - } - ], - "default": "default" - }, - "model_context_window": { - "format": "int64", - "type": [ - "integer", - "null" - ] - }, - "turn_id": { - "type": "string" - }, - "type": { - "enum": [ - "task_started" - ], - "title": "TaskStartedEventMsgType", - "type": "string" - } - }, - "required": [ - "turn_id", - "type" - ], - "title": "TaskStartedEventMsg", - "type": "object" - }, - { - "description": "Agent has completed all actions. v1 wire format uses `task_complete`; accept `turn_complete` for v2 interop.", - "properties": { - "last_agent_message": { - "type": [ - "string", - "null" - ] - }, - "turn_id": { - "type": "string" - }, - "type": { - "enum": [ - "task_complete" - ], - "title": "TaskCompleteEventMsgType", - "type": "string" - } - }, - "required": [ - "turn_id", - "type" - ], - "title": "TaskCompleteEventMsg", - "type": "object" - }, - { - "description": "Usage update for the current session, including totals and last turn. Optional means unknown — UIs should not display when `None`.", - "properties": { - "info": { - "anyOf": [ - { - "$ref": "#/definitions/TokenUsageInfo" - }, - { - "type": "null" - } - ] - }, - "rate_limits": { - "anyOf": [ - { - "$ref": "#/definitions/RateLimitSnapshot" - }, - { - "type": "null" - } - ] - }, - "type": { - "enum": [ - "token_count" - ], - "title": "TokenCountEventMsgType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "TokenCountEventMsg", - "type": "object" - }, - { - "description": "Agent text output message", - "properties": { - "message": { - "type": "string" - }, - "phase": { - "anyOf": [ - { - "$ref": "#/definitions/MessagePhase" - }, - { - "type": "null" - } - ], - "default": null - }, - "type": { - "enum": [ - "agent_message" - ], - "title": "AgentMessageEventMsgType", - "type": "string" - } - }, - "required": [ - "message", - "type" - ], - "title": "AgentMessageEventMsg", - "type": "object" - }, - { - "description": "User/system input message (what was sent to the model)", - "properties": { - "images": { - "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.", - "items": { - "type": "string" - }, - "type": [ - "array", - "null" - ] - }, - "local_images": { - "default": [], - "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.", - "items": { - "type": "string" - }, - "type": "array" - }, - "message": { - "type": "string" - }, - "text_elements": { - "default": [], - "description": "UI-defined spans within `message` used to render or persist special elements.", - "items": { - "$ref": "#/definitions/TextElement" - }, - "type": "array" - }, - "type": { - "enum": [ - "user_message" - ], - "title": "UserMessageEventMsgType", - "type": "string" - } - }, - "required": [ - "message", - "type" - ], - "title": "UserMessageEventMsg", - "type": "object" - }, - { - "description": "Agent text output delta message", - "properties": { - "delta": { - "type": "string" - }, - "type": { - "enum": [ - "agent_message_delta" - ], - "title": "AgentMessageDeltaEventMsgType", - "type": "string" - } - }, - "required": [ - "delta", - "type" - ], - "title": "AgentMessageDeltaEventMsg", - "type": "object" - }, - { - "description": "Reasoning event from agent.", - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "agent_reasoning" - ], - "title": "AgentReasoningEventMsgType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "AgentReasoningEventMsg", - "type": "object" - }, - { - "description": "Agent reasoning delta event from agent.", - "properties": { - "delta": { - "type": "string" - }, - "type": { - "enum": [ - "agent_reasoning_delta" - ], - "title": "AgentReasoningDeltaEventMsgType", - "type": "string" - } - }, - "required": [ - "delta", - "type" - ], - "title": "AgentReasoningDeltaEventMsg", - "type": "object" - }, - { - "description": "Raw chain-of-thought from agent.", - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "agent_reasoning_raw_content" - ], - "title": "AgentReasoningRawContentEventMsgType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "AgentReasoningRawContentEventMsg", - "type": "object" - }, - { - "description": "Agent reasoning content delta event from agent.", - "properties": { - "delta": { - "type": "string" - }, - "type": { - "enum": [ - "agent_reasoning_raw_content_delta" - ], - "title": "AgentReasoningRawContentDeltaEventMsgType", - "type": "string" - } - }, - "required": [ - "delta", - "type" - ], - "title": "AgentReasoningRawContentDeltaEventMsg", - "type": "object" - }, - { - "description": "Signaled when the model begins a new reasoning summary section (e.g., a new titled block).", - "properties": { - "item_id": { - "default": "", - "type": "string" - }, - "summary_index": { - "default": 0, - "format": "int64", - "type": "integer" - }, - "type": { - "enum": [ - "agent_reasoning_section_break" - ], - "title": "AgentReasoningSectionBreakEventMsgType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "AgentReasoningSectionBreakEventMsg", - "type": "object" - }, - { - "description": "Ack the client's configure message.", - "properties": { - "approval_policy": { - "allOf": [ - { - "$ref": "#/definitions/AskForApproval" - } - ], - "description": "When to escalate for approval for execution" - }, - "cwd": { - "description": "Working directory that should be treated as the *root* of the session.", - "type": "string" - }, - "forked_from_id": { - "anyOf": [ - { - "$ref": "#/definitions/ThreadId" - }, - { - "type": "null" - } - ] - }, - "history_entry_count": { - "description": "Current number of entries in the history log.", - "format": "uint", - "minimum": 0.0, - "type": "integer" - }, - "history_log_id": { - "description": "Identifier of the history log file (inode on Unix, 0 otherwise).", - "format": "uint64", - "minimum": 0.0, - "type": "integer" - }, - "initial_messages": { - "description": "Optional initial messages (as events) for resumed sessions. When present, UIs can use these to seed the history.", - "items": { - "$ref": "#/definitions/EventMsg" - }, - "type": [ - "array", - "null" - ] - }, - "model": { - "description": "Tell the client what model is being queried.", - "type": "string" - }, - "model_provider_id": { - "type": "string" - }, - "network_proxy": { - "anyOf": [ - { - "$ref": "#/definitions/SessionNetworkProxyRuntime" - }, - { - "type": "null" - } - ], - "description": "Runtime proxy bind addresses, when the managed proxy was started for this session." - }, - "reasoning_effort": { - "anyOf": [ - { - "$ref": "#/definitions/ReasoningEffort" - }, - { - "type": "null" - } - ], - "description": "The effort the model is putting into reasoning about the user's request." - }, - "rollout_path": { - "description": "Path in which the rollout is stored. Can be `None` for ephemeral threads", - "type": [ - "string", - "null" - ] - }, - "sandbox_policy": { - "allOf": [ - { - "$ref": "#/definitions/SandboxPolicy" - } - ], - "description": "How to sandbox commands executed in the system" - }, - "service_tier": { - "anyOf": [ - { - "$ref": "#/definitions/ServiceTier" - }, - { - "type": "null" - } - ] - }, - "session_id": { - "$ref": "#/definitions/ThreadId" - }, - "thread_name": { - "description": "Optional user-facing thread name (may be unset).", - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "session_configured" - ], - "title": "SessionConfiguredEventMsgType", - "type": "string" - } - }, - "required": [ - "approval_policy", - "cwd", - "history_entry_count", - "history_log_id", - "model", - "model_provider_id", - "sandbox_policy", - "session_id", - "type" - ], - "title": "SessionConfiguredEventMsg", - "type": "object" - }, - { - "description": "Updated session metadata (e.g., thread name changes).", - "properties": { - "thread_id": { - "$ref": "#/definitions/ThreadId" - }, - "thread_name": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "thread_name_updated" - ], - "title": "ThreadNameUpdatedEventMsgType", - "type": "string" - } - }, - "required": [ - "thread_id", - "type" - ], - "title": "ThreadNameUpdatedEventMsg", - "type": "object" - }, - { - "description": "Incremental MCP startup progress updates.", - "properties": { - "server": { - "description": "Server name being started.", - "type": "string" - }, - "status": { - "allOf": [ - { - "$ref": "#/definitions/McpStartupStatus" - } - ], - "description": "Current startup status." - }, - "type": { - "enum": [ - "mcp_startup_update" - ], - "title": "McpStartupUpdateEventMsgType", - "type": "string" - } - }, - "required": [ - "server", - "status", - "type" - ], - "title": "McpStartupUpdateEventMsg", - "type": "object" - }, - { - "description": "Aggregate MCP startup completion summary.", - "properties": { - "cancelled": { - "items": { - "type": "string" - }, - "type": "array" - }, - "failed": { - "items": { - "$ref": "#/definitions/McpStartupFailure" - }, - "type": "array" - }, - "ready": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { - "enum": [ - "mcp_startup_complete" - ], - "title": "McpStartupCompleteEventMsgType", - "type": "string" - } - }, - "required": [ - "cancelled", - "failed", - "ready", - "type" - ], - "title": "McpStartupCompleteEventMsg", - "type": "object" - }, - { - "properties": { - "call_id": { - "description": "Identifier so this can be paired with the McpToolCallEnd event.", - "type": "string" - }, - "invocation": { - "$ref": "#/definitions/McpInvocation" - }, - "type": { - "enum": [ - "mcp_tool_call_begin" - ], - "title": "McpToolCallBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "invocation", - "type" - ], - "title": "McpToolCallBeginEventMsg", - "type": "object" - }, - { - "properties": { - "call_id": { - "description": "Identifier for the corresponding McpToolCallBegin that finished.", - "type": "string" - }, - "duration": { - "$ref": "#/definitions/Duration" - }, - "invocation": { - "$ref": "#/definitions/McpInvocation" - }, - "result": { - "allOf": [ - { - "$ref": "#/definitions/Result_of_CallToolResult_or_String" - } - ], - "description": "Result of the tool call. Note this could be an error." - }, - "type": { - "enum": [ - "mcp_tool_call_end" - ], - "title": "McpToolCallEndEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "duration", - "invocation", - "result", - "type" - ], - "title": "McpToolCallEndEventMsg", - "type": "object" - }, - { - "properties": { - "call_id": { - "type": "string" - }, - "type": { - "enum": [ - "web_search_begin" - ], - "title": "WebSearchBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "type" - ], - "title": "WebSearchBeginEventMsg", - "type": "object" - }, - { - "properties": { - "action": { - "$ref": "#/definitions/ResponsesApiWebSearchAction" - }, - "call_id": { - "type": "string" - }, - "query": { - "type": "string" - }, - "type": { - "enum": [ - "web_search_end" - ], - "title": "WebSearchEndEventMsgType", - "type": "string" - } - }, - "required": [ - "action", - "call_id", - "query", - "type" - ], - "title": "WebSearchEndEventMsg", - "type": "object" - }, - { - "properties": { - "call_id": { - "type": "string" - }, - "type": { - "enum": [ - "image_generation_begin" - ], - "title": "ImageGenerationBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "type" - ], - "title": "ImageGenerationBeginEventMsg", - "type": "object" - }, - { - "properties": { - "call_id": { - "type": "string" - }, - "result": { - "type": "string" - }, - "revised_prompt": { - "type": [ - "string", - "null" - ] - }, - "saved_path": { - "type": [ - "string", - "null" - ] - }, - "status": { - "type": "string" - }, - "type": { - "enum": [ - "image_generation_end" - ], - "title": "ImageGenerationEndEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "result", - "status", - "type" - ], - "title": "ImageGenerationEndEventMsg", - "type": "object" - }, - { - "description": "Notification that the server is about to execute a command.", - "properties": { - "call_id": { - "description": "Identifier so this can be paired with the ExecCommandEnd event.", - "type": "string" - }, - "command": { - "description": "The command to be executed.", - "items": { - "type": "string" - }, - "type": "array" - }, - "cwd": { - "description": "The command's working directory if not the default cwd for the agent.", - "type": "string" - }, - "interaction_input": { - "description": "Raw input sent to a unified exec session (if this is an interaction event).", - "type": [ - "string", - "null" - ] - }, - "parsed_cmd": { - "items": { - "$ref": "#/definitions/ParsedCommand" - }, - "type": "array" - }, - "process_id": { - "description": "Identifier for the underlying PTY process (when available).", - "type": [ - "string", - "null" - ] - }, - "source": { - "allOf": [ - { - "$ref": "#/definitions/ExecCommandSource" - } - ], - "default": "agent", - "description": "Where the command originated. Defaults to Agent for backward compatibility." - }, - "turn_id": { - "description": "Turn ID that this command belongs to.", - "type": "string" - }, - "type": { - "enum": [ - "exec_command_begin" - ], - "title": "ExecCommandBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "command", - "cwd", - "parsed_cmd", - "turn_id", - "type" - ], - "title": "ExecCommandBeginEventMsg", - "type": "object" - }, - { - "description": "Incremental chunk of output from a running command.", - "properties": { - "call_id": { - "description": "Identifier for the ExecCommandBegin that produced this chunk.", - "type": "string" - }, - "chunk": { - "description": "Raw bytes from the stream (may not be valid UTF-8).", - "type": "string" - }, - "stream": { - "allOf": [ - { - "$ref": "#/definitions/ExecOutputStream" - } - ], - "description": "Which stream produced this chunk." - }, - "type": { - "enum": [ - "exec_command_output_delta" - ], - "title": "ExecCommandOutputDeltaEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "chunk", - "stream", - "type" - ], - "title": "ExecCommandOutputDeltaEventMsg", - "type": "object" - }, - { - "description": "Terminal interaction for an in-progress command (stdin sent and stdout observed).", - "properties": { - "call_id": { - "description": "Identifier for the ExecCommandBegin that produced this chunk.", - "type": "string" - }, - "process_id": { - "description": "Process id associated with the running command.", - "type": "string" - }, - "stdin": { - "description": "Stdin sent to the running session.", - "type": "string" - }, - "type": { - "enum": [ - "terminal_interaction" - ], - "title": "TerminalInteractionEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "process_id", - "stdin", - "type" - ], - "title": "TerminalInteractionEventMsg", - "type": "object" - }, - { - "properties": { - "aggregated_output": { - "default": "", - "description": "Captured aggregated output", - "type": "string" - }, - "call_id": { - "description": "Identifier for the ExecCommandBegin that finished.", - "type": "string" - }, - "command": { - "description": "The command that was executed.", - "items": { - "type": "string" - }, - "type": "array" - }, - "cwd": { - "description": "The command's working directory if not the default cwd for the agent.", - "type": "string" - }, - "duration": { - "allOf": [ - { - "$ref": "#/definitions/Duration" - } - ], - "description": "The duration of the command execution." - }, - "exit_code": { - "description": "The command's exit code.", - "format": "int32", - "type": "integer" - }, - "formatted_output": { - "description": "Formatted output from the command, as seen by the model.", - "type": "string" - }, - "interaction_input": { - "description": "Raw input sent to a unified exec session (if this is an interaction event).", - "type": [ - "string", - "null" - ] - }, - "parsed_cmd": { - "items": { - "$ref": "#/definitions/ParsedCommand" - }, - "type": "array" - }, - "process_id": { - "description": "Identifier for the underlying PTY process (when available).", - "type": [ - "string", - "null" - ] - }, - "source": { - "allOf": [ - { - "$ref": "#/definitions/ExecCommandSource" - } - ], - "default": "agent", - "description": "Where the command originated. Defaults to Agent for backward compatibility." - }, - "status": { - "allOf": [ - { - "$ref": "#/definitions/ExecCommandStatus" - } - ], - "description": "Completion status for this command execution." - }, - "stderr": { - "description": "Captured stderr", - "type": "string" - }, - "stdout": { - "description": "Captured stdout", - "type": "string" - }, - "turn_id": { - "description": "Turn ID that this command belongs to.", - "type": "string" - }, - "type": { - "enum": [ - "exec_command_end" - ], - "title": "ExecCommandEndEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "command", - "cwd", - "duration", - "exit_code", - "formatted_output", - "parsed_cmd", - "status", - "stderr", - "stdout", - "turn_id", - "type" - ], - "title": "ExecCommandEndEventMsg", - "type": "object" - }, - { - "description": "Notification that the agent attached a local image via the view_image tool.", - "properties": { - "call_id": { - "description": "Identifier for the originating tool call.", - "type": "string" - }, - "path": { - "description": "Local filesystem path provided to the tool.", - "type": "string" - }, - "type": { - "enum": [ - "view_image_tool_call" - ], - "title": "ViewImageToolCallEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "path", - "type" - ], - "title": "ViewImageToolCallEventMsg", - "type": "object" - }, - { - "properties": { - "additional_permissions": { - "anyOf": [ - { - "$ref": "#/definitions/PermissionProfile" - }, - { - "type": "null" - } - ], - "description": "Optional additional filesystem permissions requested for this command." - }, - "approval_id": { - "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).", - "type": [ - "string", - "null" - ] - }, - "available_decisions": { - "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.", - "items": { - "$ref": "#/definitions/ReviewDecision" - }, - "type": [ - "array", - "null" - ] - }, - "call_id": { - "description": "Identifier for the associated command execution item.", - "type": "string" - }, - "command": { - "description": "The command to be executed.", - "items": { - "type": "string" - }, - "type": "array" - }, - "cwd": { - "description": "The command's working directory.", - "type": "string" - }, - "network_approval_context": { - "anyOf": [ - { - "$ref": "#/definitions/NetworkApprovalContext" - }, - { - "type": "null" - } - ], - "description": "Optional network context for a blocked request that can be approved." - }, - "parsed_cmd": { - "items": { - "$ref": "#/definitions/ParsedCommand" - }, - "type": "array" - }, - "proposed_execpolicy_amendment": { - "description": "Proposed execpolicy amendment that can be applied to allow future runs.", - "items": { - "type": "string" - }, - "type": [ - "array", - "null" - ] - }, - "proposed_network_policy_amendments": { - "description": "Proposed network policy amendments (for example allow/deny this host in future).", - "items": { - "$ref": "#/definitions/NetworkPolicyAmendment" - }, - "type": [ - "array", - "null" - ] - }, - "reason": { - "description": "Optional human-readable reason for the approval (e.g. retry without sandbox).", - "type": [ - "string", - "null" - ] - }, - "skill_metadata": { - "anyOf": [ - { - "$ref": "#/definitions/ExecApprovalRequestSkillMetadata" - }, - { - "type": "null" - } - ], - "description": "Optional skill metadata when the approval was triggered by a skill script." - }, - "turn_id": { - "default": "", - "description": "Turn ID that this command belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "type": "string" - }, - "type": { - "enum": [ - "exec_approval_request" - ], - "title": "ExecApprovalRequestEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "command", - "cwd", - "parsed_cmd", - "type" - ], - "title": "ExecApprovalRequestEventMsg", - "type": "object" - }, - { - "properties": { - "call_id": { - "description": "Responses API call id for the associated tool call, if available.", - "type": "string" - }, - "permissions": { - "$ref": "#/definitions/RequestPermissionProfile" - }, - "reason": { - "type": [ - "string", - "null" - ] - }, - "turn_id": { - "default": "", - "description": "Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "type": "string" - }, - "type": { - "enum": [ - "request_permissions" - ], - "title": "RequestPermissionsEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "permissions", - "type" - ], - "title": "RequestPermissionsEventMsg", - "type": "object" - }, - { - "properties": { - "call_id": { - "description": "Responses API call id for the associated tool call, if available.", - "type": "string" - }, - "questions": { - "items": { - "$ref": "#/definitions/RequestUserInputQuestion" - }, - "type": "array" - }, - "turn_id": { - "default": "", - "description": "Turn ID that this request belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "type": "string" - }, - "type": { - "enum": [ - "request_user_input" - ], - "title": "RequestUserInputEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "questions", - "type" - ], - "title": "RequestUserInputEventMsg", - "type": "object" - }, - { - "properties": { - "arguments": true, - "callId": { - "type": "string" - }, - "tool": { - "type": "string" - }, - "turnId": { - "type": "string" - }, - "type": { - "enum": [ - "dynamic_tool_call_request" - ], - "title": "DynamicToolCallRequestEventMsgType", - "type": "string" - } - }, - "required": [ - "arguments", - "callId", - "tool", - "turnId", - "type" - ], - "title": "DynamicToolCallRequestEventMsg", - "type": "object" - }, - { - "properties": { - "arguments": { - "description": "Dynamic tool call arguments." - }, - "call_id": { - "description": "Identifier for the corresponding DynamicToolCallRequest.", - "type": "string" - }, - "content_items": { - "description": "Dynamic tool response content items.", - "items": { - "$ref": "#/definitions/DynamicToolCallOutputContentItem" - }, - "type": "array" - }, - "duration": { - "allOf": [ - { - "$ref": "#/definitions/Duration" - } - ], - "description": "The duration of the dynamic tool call." - }, - "error": { - "description": "Optional error text when the tool call failed before producing a response.", - "type": [ - "string", - "null" - ] - }, - "success": { - "description": "Whether the tool call succeeded.", - "type": "boolean" - }, - "tool": { - "description": "Dynamic tool name.", - "type": "string" - }, - "turn_id": { - "description": "Turn ID that this dynamic tool call belongs to.", - "type": "string" - }, - "type": { - "enum": [ - "dynamic_tool_call_response" - ], - "title": "DynamicToolCallResponseEventMsgType", - "type": "string" - } - }, - "required": [ - "arguments", - "call_id", - "content_items", - "duration", - "success", - "tool", - "turn_id", - "type" - ], - "title": "DynamicToolCallResponseEventMsg", - "type": "object" - }, - { - "properties": { - "id": { - "$ref": "#/definitions/RequestId" - }, - "request": { - "$ref": "#/definitions/ElicitationRequest" - }, - "server_name": { - "type": "string" - }, - "turn_id": { - "description": "Turn ID that this elicitation belongs to, when known.", - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "elicitation_request" - ], - "title": "ElicitationRequestEventMsgType", - "type": "string" - } - }, - "required": [ - "id", - "request", - "server_name", - "type" - ], - "title": "ElicitationRequestEventMsg", - "type": "object" - }, - { - "properties": { - "call_id": { - "description": "Responses API call id for the associated patch apply call, if available.", - "type": "string" - }, - "changes": { - "additionalProperties": { - "$ref": "#/definitions/FileChange" - }, - "type": "object" - }, - "grant_root": { - "description": "When set, the agent is asking the user to allow writes under this root for the remainder of the session.", - "type": [ - "string", - "null" - ] - }, - "reason": { - "description": "Optional explanatory reason (e.g. request for extra write access).", - "type": [ - "string", - "null" - ] - }, - "turn_id": { - "default": "", - "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility with older senders.", - "type": "string" - }, - "type": { - "enum": [ - "apply_patch_approval_request" - ], - "title": "ApplyPatchApprovalRequestEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "changes", - "type" - ], - "title": "ApplyPatchApprovalRequestEventMsg", - "type": "object" - }, - { - "description": "Notification advising the user that something they are using has been deprecated and should be phased out.", - "properties": { - "details": { - "description": "Optional extra guidance, such as migration steps or rationale.", - "type": [ - "string", - "null" - ] - }, - "summary": { - "description": "Concise summary of what is deprecated.", - "type": "string" - }, - "type": { - "enum": [ - "deprecation_notice" - ], - "title": "DeprecationNoticeEventMsgType", - "type": "string" - } - }, - "required": [ - "summary", - "type" - ], - "title": "DeprecationNoticeEventMsg", - "type": "object" - }, - { - "properties": { - "message": { - "type": "string" - }, - "type": { - "enum": [ - "background_event" - ], - "title": "BackgroundEventEventMsgType", - "type": "string" - } - }, - "required": [ - "message", - "type" - ], - "title": "BackgroundEventEventMsg", - "type": "object" - }, - { - "properties": { - "message": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "undo_started" - ], - "title": "UndoStartedEventMsgType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "UndoStartedEventMsg", - "type": "object" - }, - { - "properties": { - "message": { - "type": [ - "string", - "null" - ] - }, - "success": { - "type": "boolean" - }, - "type": { - "enum": [ - "undo_completed" - ], - "title": "UndoCompletedEventMsgType", - "type": "string" - } - }, - "required": [ - "success", - "type" - ], - "title": "UndoCompletedEventMsg", - "type": "object" - }, - { - "description": "Notification that a model stream experienced an error or disconnect and the system is handling it (e.g., retrying with backoff).", - "properties": { - "additional_details": { - "default": null, - "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).", - "type": [ - "string", - "null" - ] - }, - "codex_error_info": { - "anyOf": [ - { - "$ref": "#/definitions/CodexErrorInfo" - }, - { - "type": "null" - } - ], - "default": null - }, - "message": { - "type": "string" - }, - "type": { - "enum": [ - "stream_error" - ], - "title": "StreamErrorEventMsgType", - "type": "string" - } - }, - "required": [ - "message", - "type" - ], - "title": "StreamErrorEventMsg", - "type": "object" - }, - { - "description": "Notification that the agent is about to apply a code patch. Mirrors `ExecCommandBegin` so front‑ends can show progress indicators.", - "properties": { - "auto_approved": { - "description": "If true, there was no ApplyPatchApprovalRequest for this patch.", - "type": "boolean" - }, - "call_id": { - "description": "Identifier so this can be paired with the PatchApplyEnd event.", - "type": "string" - }, - "changes": { - "additionalProperties": { - "$ref": "#/definitions/FileChange" - }, - "description": "The changes to be applied.", - "type": "object" - }, - "turn_id": { - "default": "", - "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "type": "string" - }, - "type": { - "enum": [ - "patch_apply_begin" - ], - "title": "PatchApplyBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "auto_approved", - "call_id", - "changes", - "type" - ], - "title": "PatchApplyBeginEventMsg", - "type": "object" - }, - { - "description": "Notification that a patch application has finished.", - "properties": { - "call_id": { - "description": "Identifier for the PatchApplyBegin that finished.", - "type": "string" - }, - "changes": { - "additionalProperties": { - "$ref": "#/definitions/FileChange" - }, - "default": {}, - "description": "The changes that were applied (mirrors PatchApplyBeginEvent::changes).", - "type": "object" - }, - "status": { - "allOf": [ - { - "$ref": "#/definitions/PatchApplyStatus" - } - ], - "description": "Completion status for this patch application." - }, - "stderr": { - "description": "Captured stderr (parser errors, IO failures, etc.).", - "type": "string" - }, - "stdout": { - "description": "Captured stdout (summary printed by apply_patch).", - "type": "string" - }, - "success": { - "description": "Whether the patch was applied successfully.", - "type": "boolean" - }, - "turn_id": { - "default": "", - "description": "Turn ID that this patch belongs to. Uses `#[serde(default)]` for backwards compatibility.", - "type": "string" - }, - "type": { - "enum": [ - "patch_apply_end" - ], - "title": "PatchApplyEndEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "status", - "stderr", - "stdout", - "success", - "type" - ], - "title": "PatchApplyEndEventMsg", - "type": "object" - }, - { - "properties": { - "type": { - "enum": [ - "turn_diff" - ], - "title": "TurnDiffEventMsgType", - "type": "string" - }, - "unified_diff": { - "type": "string" - } - }, - "required": [ - "type", - "unified_diff" - ], - "title": "TurnDiffEventMsg", - "type": "object" - }, - { - "description": "Response to GetHistoryEntryRequest.", - "properties": { - "entry": { - "anyOf": [ - { - "$ref": "#/definitions/HistoryEntry" - }, - { - "type": "null" - } - ], - "description": "The entry at the requested offset, if available and parseable." - }, - "log_id": { - "format": "uint64", - "minimum": 0.0, - "type": "integer" - }, - "offset": { - "format": "uint", - "minimum": 0.0, - "type": "integer" - }, - "type": { - "enum": [ - "get_history_entry_response" - ], - "title": "GetHistoryEntryResponseEventMsgType", - "type": "string" - } - }, - "required": [ - "log_id", - "offset", - "type" - ], - "title": "GetHistoryEntryResponseEventMsg", - "type": "object" - }, - { - "description": "List of MCP tools available to the agent.", - "properties": { - "auth_statuses": { - "additionalProperties": { - "$ref": "#/definitions/McpAuthStatus" - }, - "description": "Authentication status for each configured MCP server.", - "type": "object" - }, - "resource_templates": { - "additionalProperties": { - "items": { - "$ref": "#/definitions/ResourceTemplate" - }, - "type": "array" - }, - "description": "Known resource templates grouped by server name.", - "type": "object" - }, - "resources": { - "additionalProperties": { - "items": { - "$ref": "#/definitions/Resource" - }, - "type": "array" - }, - "description": "Known resources grouped by server name.", - "type": "object" - }, - "tools": { - "additionalProperties": { - "$ref": "#/definitions/Tool" - }, - "description": "Fully qualified tool name -> tool definition.", - "type": "object" - }, - "type": { - "enum": [ - "mcp_list_tools_response" - ], - "title": "McpListToolsResponseEventMsgType", - "type": "string" - } - }, - "required": [ - "auth_statuses", - "resource_templates", - "resources", - "tools", - "type" - ], - "title": "McpListToolsResponseEventMsg", - "type": "object" - }, - { - "description": "List of custom prompts available to the agent.", - "properties": { - "custom_prompts": { - "items": { - "$ref": "#/definitions/CustomPrompt" - }, - "type": "array" - }, - "type": { - "enum": [ - "list_custom_prompts_response" - ], - "title": "ListCustomPromptsResponseEventMsgType", - "type": "string" - } - }, - "required": [ - "custom_prompts", - "type" - ], - "title": "ListCustomPromptsResponseEventMsg", - "type": "object" - }, - { - "description": "List of skills available to the agent.", - "properties": { - "skills": { - "items": { - "$ref": "#/definitions/SkillsListEntry" - }, - "type": "array" - }, - "type": { - "enum": [ - "list_skills_response" - ], - "title": "ListSkillsResponseEventMsgType", - "type": "string" - } - }, - "required": [ - "skills", - "type" - ], - "title": "ListSkillsResponseEventMsg", - "type": "object" - }, - { - "description": "List of remote skills available to the agent.", - "properties": { - "skills": { - "items": { - "$ref": "#/definitions/RemoteSkillSummary" - }, - "type": "array" - }, - "type": { - "enum": [ - "list_remote_skills_response" - ], - "title": "ListRemoteSkillsResponseEventMsgType", - "type": "string" - } - }, - "required": [ - "skills", - "type" - ], - "title": "ListRemoteSkillsResponseEventMsg", - "type": "object" - }, - { - "description": "Remote skill downloaded to local cache.", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "enum": [ - "remote_skill_downloaded" - ], - "title": "RemoteSkillDownloadedEventMsgType", - "type": "string" - } - }, - "required": [ - "id", - "name", - "path", - "type" - ], - "title": "RemoteSkillDownloadedEventMsg", - "type": "object" - }, - { - "description": "Notification that skill data may have been updated and clients may want to reload.", - "properties": { - "type": { - "enum": [ - "skills_update_available" - ], - "title": "SkillsUpdateAvailableEventMsgType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "SkillsUpdateAvailableEventMsg", - "type": "object" - }, - { - "properties": { - "explanation": { - "default": null, - "description": "Arguments for the `update_plan` todo/checklist tool (not plan mode).", - "type": [ - "string", - "null" - ] - }, - "plan": { - "items": { - "$ref": "#/definitions/PlanItemArg" - }, - "type": "array" - }, - "type": { - "enum": [ - "plan_update" - ], - "title": "PlanUpdateEventMsgType", - "type": "string" - } - }, - "required": [ - "plan", - "type" - ], - "title": "PlanUpdateEventMsg", - "type": "object" - }, - { - "properties": { - "reason": { - "$ref": "#/definitions/TurnAbortReason" - }, - "turn_id": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "turn_aborted" - ], - "title": "TurnAbortedEventMsgType", - "type": "string" - } - }, - "required": [ - "reason", - "type" - ], - "title": "TurnAbortedEventMsg", - "type": "object" - }, - { - "description": "Notification that the agent is shutting down.", - "properties": { - "type": { - "enum": [ - "shutdown_complete" - ], - "title": "ShutdownCompleteEventMsgType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "ShutdownCompleteEventMsg", - "type": "object" - }, - { - "description": "Entered review mode.", - "properties": { - "target": { - "$ref": "#/definitions/ReviewTarget" - }, - "type": { - "enum": [ - "entered_review_mode" - ], - "title": "EnteredReviewModeEventMsgType", - "type": "string" - }, - "user_facing_hint": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "target", - "type" - ], - "title": "EnteredReviewModeEventMsg", - "type": "object" - }, - { - "description": "Exited review mode with an optional final result to apply.", - "properties": { - "review_output": { - "anyOf": [ - { - "$ref": "#/definitions/ReviewOutputEvent" - }, - { - "type": "null" - } - ] - }, - "type": { - "enum": [ - "exited_review_mode" - ], - "title": "ExitedReviewModeEventMsgType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "ExitedReviewModeEventMsg", - "type": "object" - }, - { - "properties": { - "item": { - "$ref": "#/definitions/ResponseItem" - }, - "type": { - "enum": [ - "raw_response_item" - ], - "title": "RawResponseItemEventMsgType", - "type": "string" - } - }, - "required": [ - "item", - "type" - ], - "title": "RawResponseItemEventMsg", - "type": "object" - }, - { - "properties": { - "item": { - "$ref": "#/definitions/TurnItem" - }, - "thread_id": { - "$ref": "#/definitions/ThreadId" - }, - "turn_id": { - "type": "string" - }, - "type": { - "enum": [ - "item_started" - ], - "title": "ItemStartedEventMsgType", - "type": "string" - } - }, - "required": [ - "item", - "thread_id", - "turn_id", - "type" - ], - "title": "ItemStartedEventMsg", - "type": "object" - }, - { - "properties": { - "item": { - "$ref": "#/definitions/TurnItem" - }, - "thread_id": { - "$ref": "#/definitions/ThreadId" - }, - "turn_id": { - "type": "string" - }, - "type": { - "enum": [ - "item_completed" - ], - "title": "ItemCompletedEventMsgType", - "type": "string" - } - }, - "required": [ - "item", - "thread_id", - "turn_id", - "type" - ], - "title": "ItemCompletedEventMsg", - "type": "object" - }, - { - "properties": { - "run": { - "$ref": "#/definitions/HookRunSummary" - }, - "turn_id": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "hook_started" - ], - "title": "HookStartedEventMsgType", - "type": "string" - } - }, - "required": [ - "run", - "type" - ], - "title": "HookStartedEventMsg", - "type": "object" - }, - { - "properties": { - "run": { - "$ref": "#/definitions/HookRunSummary" - }, - "turn_id": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "hook_completed" - ], - "title": "HookCompletedEventMsgType", - "type": "string" - } - }, - "required": [ - "run", - "type" - ], - "title": "HookCompletedEventMsg", - "type": "object" - }, - { - "properties": { - "delta": { - "type": "string" - }, - "item_id": { - "type": "string" - }, - "thread_id": { - "type": "string" - }, - "turn_id": { - "type": "string" - }, - "type": { - "enum": [ - "agent_message_content_delta" - ], - "title": "AgentMessageContentDeltaEventMsgType", - "type": "string" - } - }, - "required": [ - "delta", - "item_id", - "thread_id", - "turn_id", - "type" - ], - "title": "AgentMessageContentDeltaEventMsg", - "type": "object" - }, - { - "properties": { - "delta": { - "type": "string" - }, - "item_id": { - "type": "string" - }, - "thread_id": { - "type": "string" - }, - "turn_id": { - "type": "string" - }, - "type": { - "enum": [ - "plan_delta" - ], - "title": "PlanDeltaEventMsgType", - "type": "string" - } - }, - "required": [ - "delta", - "item_id", - "thread_id", - "turn_id", - "type" - ], - "title": "PlanDeltaEventMsg", - "type": "object" - }, - { - "properties": { - "delta": { - "type": "string" - }, - "item_id": { - "type": "string" - }, - "summary_index": { - "default": 0, - "format": "int64", - "type": "integer" - }, - "thread_id": { - "type": "string" - }, - "turn_id": { - "type": "string" - }, - "type": { - "enum": [ - "reasoning_content_delta" - ], - "title": "ReasoningContentDeltaEventMsgType", - "type": "string" - } - }, - "required": [ - "delta", - "item_id", - "thread_id", - "turn_id", - "type" - ], - "title": "ReasoningContentDeltaEventMsg", - "type": "object" - }, - { - "properties": { - "content_index": { - "default": 0, - "format": "int64", - "type": "integer" - }, - "delta": { - "type": "string" - }, - "item_id": { - "type": "string" - }, - "thread_id": { - "type": "string" - }, - "turn_id": { - "type": "string" - }, - "type": { - "enum": [ - "reasoning_raw_content_delta" - ], - "title": "ReasoningRawContentDeltaEventMsgType", - "type": "string" - } - }, - "required": [ - "delta", - "item_id", - "thread_id", - "turn_id", - "type" - ], - "title": "ReasoningRawContentDeltaEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: agent spawn begin.", - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "model": { - "type": "string" - }, - "prompt": { - "description": "Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning.", - "type": "string" - }, - "reasoning_effort": { - "$ref": "#/definitions/ReasoningEffort" - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "type": { - "enum": [ - "collab_agent_spawn_begin" - ], - "title": "CollabAgentSpawnBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "model", - "prompt", - "reasoning_effort", - "sender_thread_id", - "type" - ], - "title": "CollabAgentSpawnBeginEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: agent spawn end.", - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "model": { - "description": "Model requested for the spawned agent.", - "type": "string" - }, - "new_agent_nickname": { - "description": "Optional nickname assigned to the new agent.", - "type": [ - "string", - "null" - ] - }, - "new_agent_role": { - "description": "Optional role assigned to the new agent.", - "type": [ - "string", - "null" - ] - }, - "new_thread_id": { - "anyOf": [ - { - "$ref": "#/definitions/ThreadId" - }, - { - "type": "null" - } - ], - "description": "Thread ID of the newly spawned agent, if it was created." - }, - "prompt": { - "description": "Initial prompt sent to the agent. Can be empty to prevent CoT leaking at the beginning.", - "type": "string" - }, - "reasoning_effort": { - "allOf": [ - { - "$ref": "#/definitions/ReasoningEffort" - } - ], - "description": "Reasoning effort requested for the spawned agent." - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "status": { - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ], - "description": "Last known status of the new agent reported to the sender agent." - }, - "type": { - "enum": [ - "collab_agent_spawn_end" - ], - "title": "CollabAgentSpawnEndEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "model", - "prompt", - "reasoning_effort", - "sender_thread_id", - "status", - "type" - ], - "title": "CollabAgentSpawnEndEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: agent interaction begin.", - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "prompt": { - "description": "Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning.", - "type": "string" - }, - "receiver_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the receiver." - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "type": { - "enum": [ - "collab_agent_interaction_begin" - ], - "title": "CollabAgentInteractionBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "prompt", - "receiver_thread_id", - "sender_thread_id", - "type" - ], - "title": "CollabAgentInteractionBeginEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: agent interaction end.", - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "prompt": { - "description": "Prompt sent from the sender to the receiver. Can be empty to prevent CoT leaking at the beginning.", - "type": "string" - }, - "receiver_agent_nickname": { - "description": "Optional nickname assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_agent_role": { - "description": "Optional role assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the receiver." - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "status": { - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ], - "description": "Last known status of the receiver agent reported to the sender agent." - }, - "type": { - "enum": [ - "collab_agent_interaction_end" - ], - "title": "CollabAgentInteractionEndEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "prompt", - "receiver_thread_id", - "sender_thread_id", - "status", - "type" - ], - "title": "CollabAgentInteractionEndEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: waiting begin.", - "properties": { - "call_id": { - "description": "ID of the waiting call.", - "type": "string" - }, - "receiver_agents": { - "description": "Optional nicknames/roles for receivers.", - "items": { - "$ref": "#/definitions/CollabAgentRef" - }, - "type": "array" - }, - "receiver_thread_ids": { - "description": "Thread ID of the receivers.", - "items": { - "$ref": "#/definitions/ThreadId" - }, - "type": "array" - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "type": { - "enum": [ - "collab_waiting_begin" - ], - "title": "CollabWaitingBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "receiver_thread_ids", - "sender_thread_id", - "type" - ], - "title": "CollabWaitingBeginEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: waiting end.", - "properties": { - "agent_statuses": { - "description": "Optional receiver metadata paired with final statuses.", - "items": { - "$ref": "#/definitions/CollabAgentStatusEntry" - }, - "type": "array" - }, - "call_id": { - "description": "ID of the waiting call.", - "type": "string" - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "statuses": { - "additionalProperties": { - "$ref": "#/definitions/AgentStatus" - }, - "description": "Last known status of the receiver agents reported to the sender agent.", - "type": "object" - }, - "type": { - "enum": [ - "collab_waiting_end" - ], - "title": "CollabWaitingEndEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "sender_thread_id", - "statuses", - "type" - ], - "title": "CollabWaitingEndEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: close begin.", - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "receiver_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the receiver." - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "type": { - "enum": [ - "collab_close_begin" - ], - "title": "CollabCloseBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "receiver_thread_id", - "sender_thread_id", - "type" - ], - "title": "CollabCloseBeginEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: close end.", - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "receiver_agent_nickname": { - "description": "Optional nickname assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_agent_role": { - "description": "Optional role assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the receiver." - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "status": { - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ], - "description": "Last known status of the receiver agent reported to the sender agent before the close." - }, - "type": { - "enum": [ - "collab_close_end" - ], - "title": "CollabCloseEndEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "receiver_thread_id", - "sender_thread_id", - "status", - "type" - ], - "title": "CollabCloseEndEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: resume begin.", - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "receiver_agent_nickname": { - "description": "Optional nickname assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_agent_role": { - "description": "Optional role assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the receiver." - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "type": { - "enum": [ - "collab_resume_begin" - ], - "title": "CollabResumeBeginEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "receiver_thread_id", - "sender_thread_id", - "type" - ], - "title": "CollabResumeBeginEventMsg", - "type": "object" - }, - { - "description": "Collab interaction: resume end.", - "properties": { - "call_id": { - "description": "Identifier for the collab tool call.", - "type": "string" - }, - "receiver_agent_nickname": { - "description": "Optional nickname assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_agent_role": { - "description": "Optional role assigned to the receiver agent.", - "type": [ - "string", - "null" - ] - }, - "receiver_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the receiver." - }, - "sender_thread_id": { - "allOf": [ - { - "$ref": "#/definitions/ThreadId" - } - ], - "description": "Thread ID of the sender." - }, - "status": { - "allOf": [ - { - "$ref": "#/definitions/AgentStatus" - } - ], - "description": "Last known status of the receiver agent reported to the sender agent after resume." - }, - "type": { - "enum": [ - "collab_resume_end" - ], - "title": "CollabResumeEndEventMsgType", - "type": "string" - } - }, - "required": [ - "call_id", - "receiver_thread_id", - "sender_thread_id", - "status", - "type" - ], - "title": "CollabResumeEndEventMsg", - "type": "object" - } - ] - }, - "ExecApprovalRequestSkillMetadata": { - "properties": { - "path_to_skills_md": { - "type": "string" - } - }, - "required": [ - "path_to_skills_md" - ], - "type": "object" - }, - "ExecCommandSource": { - "enum": [ - "agent", - "user_shell", - "unified_exec_startup", - "unified_exec_interaction" - ], - "type": "string" - }, - "ExecCommandStatus": { - "enum": [ - "completed", - "failed", - "declined" - ], - "type": "string" - }, - "ExecOutputStream": { - "enum": [ - "stdout", - "stderr" - ], - "type": "string" - }, - "FileChange": { - "oneOf": [ - { - "properties": { - "content": { - "type": "string" - }, - "type": { - "enum": [ - "add" - ], - "title": "AddFileChangeType", - "type": "string" - } - }, - "required": [ - "content", - "type" - ], - "title": "AddFileChange", - "type": "object" - }, - { - "properties": { - "content": { - "type": "string" - }, - "type": { - "enum": [ - "delete" - ], - "title": "DeleteFileChangeType", - "type": "string" - } - }, - "required": [ - "content", - "type" - ], - "title": "DeleteFileChange", - "type": "object" - }, - { - "properties": { - "move_path": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "update" - ], - "title": "UpdateFileChangeType", - "type": "string" - }, - "unified_diff": { - "type": "string" - } - }, - "required": [ - "type", - "unified_diff" - ], - "title": "UpdateFileChange", - "type": "object" - } - ] - }, - "FileSystemPermissions": { - "properties": { - "read": { - "items": { - "$ref": "#/definitions/AbsolutePathBuf" - }, - "type": [ - "array", - "null" - ] - }, - "write": { - "items": { - "$ref": "#/definitions/AbsolutePathBuf" - }, - "type": [ - "array", - "null" - ] - } - }, - "type": "object" - }, - "FunctionCallOutputBody": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "$ref": "#/definitions/FunctionCallOutputContentItem" - }, - "type": "array" - } - ] - }, - "FunctionCallOutputContentItem": { - "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.", - "oneOf": [ - { - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "input_text" - ], - "title": "InputTextFunctionCallOutputContentItemType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "InputTextFunctionCallOutputContentItem", - "type": "object" - }, - { - "properties": { - "detail": { - "anyOf": [ - { - "$ref": "#/definitions/ImageDetail" - }, - { - "type": "null" - } - ] - }, - "image_url": { - "type": "string" - }, - "type": { - "enum": [ - "input_image" - ], - "title": "InputImageFunctionCallOutputContentItemType", - "type": "string" - } - }, - "required": [ - "image_url", - "type" - ], - "title": "InputImageFunctionCallOutputContentItem", - "type": "object" - } - ] - }, - "GhostCommit": { - "description": "Details of a ghost commit created from a repository state.", - "properties": { - "id": { - "type": "string" - }, - "parent": { - "type": [ - "string", - "null" - ] - }, - "preexisting_untracked_dirs": { - "items": { - "type": "string" - }, - "type": "array" - }, - "preexisting_untracked_files": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "id", - "preexisting_untracked_dirs", - "preexisting_untracked_files" - ], - "type": "object" - }, - "GitInfo": { - "properties": { - "branch": { - "description": "Current branch name", - "type": [ - "string", - "null" - ] - }, - "commit_hash": { - "description": "Current commit hash (SHA)", - "type": [ - "string", - "null" - ] - }, - "repository_url": { - "description": "Repository URL (if available from remote)", - "type": [ - "string", - "null" - ] - } - }, - "type": "object" - }, - "GranularApprovalConfig": { - "properties": { - "mcp_elicitations": { - "description": "Whether to allow MCP elicitation prompts.", - "type": "boolean" - }, - "request_permissions": { - "default": false, - "description": "Whether to allow prompts triggered by the `request_permissions` tool.", - "type": "boolean" - }, - "rules": { - "description": "Whether to allow prompts triggered by execpolicy `prompt` rules.", - "type": "boolean" - }, - "sandbox_approval": { - "description": "Whether to allow shell command approval requests, including inline `with_additional_permissions` and `require_escalated` requests.", - "type": "boolean" - }, - "skill_approval": { - "default": false, - "description": "Whether to allow approval prompts triggered by skill script execution.", - "type": "boolean" - } - }, - "required": [ - "mcp_elicitations", - "rules", - "sandbox_approval" - ], - "type": "object" - }, - "HistoryEntry": { - "properties": { - "conversation_id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "ts": { - "format": "uint64", - "minimum": 0.0, - "type": "integer" - } - }, - "required": [ - "conversation_id", - "text", - "ts" - ], - "type": "object" - }, - "HookEventName": { - "enum": [ - "session_start", - "stop" - ], - "type": "string" - }, - "HookExecutionMode": { - "enum": [ - "sync", - "async" - ], - "type": "string" - }, - "HookHandlerType": { - "enum": [ - "command", - "prompt", - "agent" - ], - "type": "string" - }, - "HookOutputEntry": { - "properties": { - "kind": { - "$ref": "#/definitions/HookOutputEntryKind" - }, - "text": { - "type": "string" - } - }, - "required": [ - "kind", - "text" - ], - "type": "object" - }, - "HookOutputEntryKind": { - "enum": [ - "warning", - "stop", - "feedback", - "context", - "error" - ], - "type": "string" - }, - "HookRunStatus": { - "enum": [ - "running", - "completed", - "failed", - "blocked", - "stopped" - ], - "type": "string" - }, - "HookRunSummary": { - "properties": { - "completed_at": { - "format": "int64", - "type": [ - "integer", - "null" - ] - }, - "display_order": { - "format": "int64", - "type": "integer" - }, - "duration_ms": { - "format": "int64", - "type": [ - "integer", - "null" - ] - }, - "entries": { - "items": { - "$ref": "#/definitions/HookOutputEntry" - }, - "type": "array" - }, - "event_name": { - "$ref": "#/definitions/HookEventName" - }, - "execution_mode": { - "$ref": "#/definitions/HookExecutionMode" - }, - "handler_type": { - "$ref": "#/definitions/HookHandlerType" - }, - "id": { - "type": "string" - }, - "scope": { - "$ref": "#/definitions/HookScope" - }, - "source_path": { - "type": "string" - }, - "started_at": { - "format": "int64", - "type": "integer" - }, - "status": { - "$ref": "#/definitions/HookRunStatus" - }, - "status_message": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "display_order", - "entries", - "event_name", - "execution_mode", - "handler_type", - "id", - "scope", - "source_path", - "started_at", - "status" - ], - "type": "object" - }, - "HookScope": { - "enum": [ - "thread", - "turn" - ], - "type": "string" - }, - "ImageDetail": { - "enum": [ - "auto", - "low", - "high", - "original" - ], - "type": "string" - }, - "LocalShellAction": { - "oneOf": [ - { - "properties": { - "command": { - "items": { - "type": "string" - }, - "type": "array" - }, - "env": { - "additionalProperties": { - "type": "string" - }, - "type": [ - "object", - "null" - ] - }, - "timeout_ms": { - "format": "uint64", - "minimum": 0.0, - "type": [ - "integer", - "null" - ] - }, - "type": { - "enum": [ - "exec" - ], - "title": "ExecLocalShellActionType", - "type": "string" - }, - "user": { - "type": [ - "string", - "null" - ] - }, - "working_directory": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "command", - "type" - ], - "title": "ExecLocalShellAction", - "type": "object" - } - ] - }, - "LocalShellStatus": { - "enum": [ - "completed", - "in_progress", - "incomplete" - ], - "type": "string" - }, - "MacOsAutomationPermission": { - "oneOf": [ - { - "enum": [ - "none", - "all" - ], - "type": "string" - }, - { - "additionalProperties": false, - "properties": { - "bundle_ids": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "bundle_ids" - ], - "title": "BundleIdsMacOsAutomationPermission", - "type": "object" - } - ] - }, - "MacOsContactsPermission": { - "enum": [ - "none", - "read_only", - "read_write" - ], - "type": "string" - }, - "MacOsPreferencesPermission": { - "enum": [ - "none", - "read_only", - "read_write" - ], - "type": "string" - }, - "MacOsSeatbeltProfileExtensions": { - "properties": { - "macos_accessibility": { - "default": false, - "type": "boolean" - }, - "macos_automation": { - "allOf": [ - { - "$ref": "#/definitions/MacOsAutomationPermission" - } - ], - "default": "none" - }, - "macos_calendar": { - "default": false, - "type": "boolean" - }, - "macos_contacts": { - "allOf": [ - { - "$ref": "#/definitions/MacOsContactsPermission" - } - ], - "default": "none" - }, - "macos_launch_services": { - "default": false, - "type": "boolean" - }, - "macos_preferences": { - "allOf": [ - { - "$ref": "#/definitions/MacOsPreferencesPermission" - } - ], - "default": "read_only" - }, - "macos_reminders": { - "default": false, - "type": "boolean" - } - }, - "type": "object" - }, - "McpAuthStatus": { - "enum": [ - "unsupported", - "not_logged_in", - "bearer_token", - "o_auth" - ], - "type": "string" - }, - "McpInvocation": { - "properties": { - "arguments": { - "description": "Arguments to the tool call." - }, - "server": { - "description": "Name of the MCP server as defined in the config.", - "type": "string" - }, - "tool": { - "description": "Name of the tool as given by the MCP server.", - "type": "string" - } - }, - "required": [ - "server", - "tool" - ], - "type": "object" - }, - "McpStartupFailure": { - "properties": { - "error": { - "type": "string" - }, - "server": { - "type": "string" - } - }, - "required": [ - "error", - "server" - ], - "type": "object" - }, - "McpStartupStatus": { - "oneOf": [ - { - "properties": { - "state": { - "enum": [ - "starting" - ], - "type": "string" - } - }, - "required": [ - "state" - ], - "title": "StartingMcpStartupStatus", - "type": "object" - }, - { - "properties": { - "state": { - "enum": [ - "ready" - ], - "type": "string" - } - }, - "required": [ - "state" - ], - "title": "ReadyMcpStartupStatus", - "type": "object" - }, - { - "properties": { - "error": { - "type": "string" - }, - "state": { - "enum": [ - "failed" - ], - "type": "string" - } - }, - "required": [ - "error", - "state" - ], - "type": "object" - }, - { - "properties": { - "state": { - "enum": [ - "cancelled" - ], - "type": "string" - } - }, - "required": [ - "state" - ], - "title": "CancelledMcpStartupStatus", - "type": "object" - } - ] - }, - "MessagePhase": { - "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", - "oneOf": [ - { - "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", - "enum": [ - "commentary" - ], - "type": "string" - }, - { - "description": "The assistant's terminal answer text for the current turn.", - "enum": [ - "final_answer" - ], - "type": "string" - } - ] - }, - "ModeKind": { - "description": "Initial collaboration mode to use when the TUI starts.", - "enum": [ - "plan", - "default" - ], - "type": "string" - }, - "ModelRerouteReason": { - "enum": [ - "high_risk_cyber_activity" - ], - "type": "string" - }, - "NetworkAccess": { - "description": "Represents whether outbound network access is available to the agent.", - "enum": [ - "restricted", - "enabled" - ], - "type": "string" - }, - "NetworkApprovalContext": { - "properties": { - "host": { - "type": "string" - }, - "protocol": { - "$ref": "#/definitions/NetworkApprovalProtocol" - } - }, - "required": [ - "host", - "protocol" - ], - "type": "object" - }, - "NetworkApprovalProtocol": { - "enum": [ - "http", - "https", - "socks5_tcp", - "socks5_udp" - ], - "type": "string" - }, - "NetworkPermissions": { - "properties": { - "enabled": { - "type": [ - "boolean", - "null" - ] - } - }, - "type": "object" - }, - "NetworkPolicyAmendment": { - "properties": { - "action": { - "$ref": "#/definitions/NetworkPolicyRuleAction" - }, - "host": { - "type": "string" - } - }, - "required": [ - "action", - "host" - ], - "type": "object" - }, - "NetworkPolicyRuleAction": { - "enum": [ - "allow", - "deny" - ], - "type": "string" - }, - "ParsedCommand": { - "oneOf": [ - { - "properties": { - "cmd": { - "type": "string" - }, - "name": { - "type": "string" - }, - "path": { - "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": "string" - }, - "type": { - "enum": [ - "read" - ], - "title": "ReadParsedCommandType", - "type": "string" - } - }, - "required": [ - "cmd", - "name", - "path", - "type" - ], - "title": "ReadParsedCommand", - "type": "object" - }, - { - "properties": { - "cmd": { - "type": "string" - }, - "path": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "list_files" - ], - "title": "ListFilesParsedCommandType", - "type": "string" - } - }, - "required": [ - "cmd", - "type" - ], - "title": "ListFilesParsedCommand", - "type": "object" - }, - { - "properties": { - "cmd": { - "type": "string" - }, - "path": { - "type": [ - "string", - "null" - ] - }, - "query": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "search" - ], - "title": "SearchParsedCommandType", - "type": "string" - } - }, - "required": [ - "cmd", - "type" - ], - "title": "SearchParsedCommand", - "type": "object" - }, - { - "properties": { - "cmd": { - "type": "string" - }, - "type": { - "enum": [ - "unknown" - ], - "title": "UnknownParsedCommandType", - "type": "string" - } - }, - "required": [ - "cmd", - "type" - ], - "title": "UnknownParsedCommand", - "type": "object" - } - ] - }, - "PatchApplyStatus": { - "enum": [ - "completed", - "failed", - "declined" - ], - "type": "string" - }, - "PermissionProfile": { - "properties": { - "file_system": { - "anyOf": [ - { - "$ref": "#/definitions/FileSystemPermissions" - }, - { - "type": "null" - } - ] - }, - "macos": { - "anyOf": [ - { - "$ref": "#/definitions/MacOsSeatbeltProfileExtensions" - }, - { - "type": "null" - } - ] - }, - "network": { - "anyOf": [ - { - "$ref": "#/definitions/NetworkPermissions" - }, - { - "type": "null" - } - ] - } - }, - "type": "object" - }, - "Personality": { - "enum": [ - "none", - "friendly", - "pragmatic" - ], - "type": "string" - }, - "PlanItemArg": { - "additionalProperties": false, - "properties": { - "status": { - "$ref": "#/definitions/StepStatus" - }, - "step": { - "type": "string" - } - }, - "required": [ - "status", - "step" - ], - "type": "object" - }, - "PlanType": { - "enum": [ - "free", - "go", - "plus", - "pro", - "team", - "business", - "enterprise", - "edu", - "unknown" - ], - "type": "string" - }, - "RateLimitSnapshot": { - "properties": { - "credits": { - "anyOf": [ - { - "$ref": "#/definitions/CreditsSnapshot" - }, - { - "type": "null" - } - ] - }, - "limit_id": { - "type": [ - "string", - "null" - ] - }, - "limit_name": { - "type": [ - "string", - "null" - ] - }, - "plan_type": { - "anyOf": [ - { - "$ref": "#/definitions/PlanType" - }, - { - "type": "null" - } - ] - }, - "primary": { - "anyOf": [ - { - "$ref": "#/definitions/RateLimitWindow" - }, - { - "type": "null" - } - ] - }, - "secondary": { - "anyOf": [ - { - "$ref": "#/definitions/RateLimitWindow" - }, - { - "type": "null" - } - ] - } - }, - "type": "object" - }, - "RateLimitWindow": { - "properties": { - "resets_at": { - "description": "Unix timestamp (seconds since epoch) when the window resets.", - "format": "int64", - "type": [ - "integer", - "null" - ] - }, - "used_percent": { - "description": "Percentage (0-100) of the window that has been consumed.", - "format": "double", - "type": "number" - }, - "window_minutes": { - "description": "Rolling window duration, in minutes.", - "format": "int64", - "type": [ - "integer", - "null" - ] - } - }, - "required": [ - "used_percent" - ], - "type": "object" - }, - "ReadOnlyAccess": { - "description": "Determines how read-only file access is granted inside a restricted sandbox.", - "oneOf": [ - { - "description": "Restrict reads to an explicit set of roots.\n\nWhen `include_platform_defaults` is `true`, platform defaults required for basic execution are included in addition to `readable_roots`.", - "properties": { - "include_platform_defaults": { - "default": true, - "description": "Include built-in platform read roots required for basic process execution.", - "type": "boolean" - }, - "readable_roots": { - "description": "Additional absolute roots that should be readable.", - "items": { - "$ref": "#/definitions/AbsolutePathBuf" - }, - "type": "array" - }, - "type": { - "enum": [ - "restricted" - ], - "title": "RestrictedReadOnlyAccessType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "RestrictedReadOnlyAccess", - "type": "object" - }, - { - "description": "Allow unrestricted file reads.", - "properties": { - "type": { - "enum": [ - "full-access" - ], - "title": "FullAccessReadOnlyAccessType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "FullAccessReadOnlyAccess", - "type": "object" - } - ] - }, - "RealtimeAudioFrame": { - "properties": { - "data": { - "type": "string" - }, - "num_channels": { - "format": "uint16", - "minimum": 0.0, - "type": "integer" - }, - "sample_rate": { - "format": "uint32", - "minimum": 0.0, - "type": "integer" - }, - "samples_per_channel": { - "format": "uint32", - "minimum": 0.0, - "type": [ - "integer", - "null" - ] - } - }, - "required": [ - "data", - "num_channels", - "sample_rate" - ], - "type": "object" - }, - "RealtimeEvent": { - "oneOf": [ - { - "additionalProperties": false, - "properties": { - "SessionUpdated": { - "properties": { - "instructions": { - "type": [ - "string", - "null" - ] - }, - "session_id": { - "type": "string" - } - }, - "required": [ - "session_id" - ], - "type": "object" - } - }, - "required": [ - "SessionUpdated" - ], - "title": "SessionUpdatedRealtimeEvent", - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "InputTranscriptDelta": { - "$ref": "#/definitions/RealtimeTranscriptDelta" - } - }, - "required": [ - "InputTranscriptDelta" - ], - "title": "InputTranscriptDeltaRealtimeEvent", - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "OutputTranscriptDelta": { - "$ref": "#/definitions/RealtimeTranscriptDelta" - } - }, - "required": [ - "OutputTranscriptDelta" - ], - "title": "OutputTranscriptDeltaRealtimeEvent", - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "AudioOut": { - "$ref": "#/definitions/RealtimeAudioFrame" - } - }, - "required": [ - "AudioOut" - ], - "title": "AudioOutRealtimeEvent", - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "ConversationItemAdded": true - }, - "required": [ - "ConversationItemAdded" - ], - "title": "ConversationItemAddedRealtimeEvent", - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "ConversationItemDone": { - "properties": { - "item_id": { - "type": "string" - } - }, - "required": [ - "item_id" - ], - "type": "object" - } - }, - "required": [ - "ConversationItemDone" - ], - "title": "ConversationItemDoneRealtimeEvent", - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "HandoffRequested": { - "$ref": "#/definitions/RealtimeHandoffRequested" - } - }, - "required": [ - "HandoffRequested" - ], - "title": "HandoffRequestedRealtimeEvent", - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "Error": { - "type": "string" - } - }, - "required": [ - "Error" - ], - "title": "ErrorRealtimeEvent", - "type": "object" - } - ] - }, - "RealtimeHandoffRequested": { - "properties": { - "active_transcript": { - "items": { - "$ref": "#/definitions/RealtimeTranscriptEntry" - }, - "type": "array" - }, - "handoff_id": { - "type": "string" - }, - "input_transcript": { - "type": "string" - }, - "item_id": { - "type": "string" - } - }, - "required": [ - "active_transcript", - "handoff_id", - "input_transcript", - "item_id" - ], - "type": "object" - }, - "RealtimeTranscriptDelta": { - "properties": { - "delta": { - "type": "string" - } - }, - "required": [ - "delta" - ], - "type": "object" - }, - "RealtimeTranscriptEntry": { - "properties": { - "role": { - "type": "string" - }, - "text": { - "type": "string" - } - }, - "required": [ - "role", - "text" - ], - "type": "object" - }, - "ReasoningEffort": { - "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", - "enum": [ - "none", - "minimal", - "low", - "medium", - "high", - "xhigh" - ], - "type": "string" - }, - "ReasoningItemContent": { - "oneOf": [ - { - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "reasoning_text" - ], - "title": "ReasoningTextReasoningItemContentType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "ReasoningTextReasoningItemContent", - "type": "object" - }, - { - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "text" - ], - "title": "TextReasoningItemContentType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "TextReasoningItemContent", - "type": "object" - } - ] - }, - "ReasoningItemReasoningSummary": { - "oneOf": [ - { - "properties": { - "text": { - "type": "string" - }, - "type": { - "enum": [ - "summary_text" - ], - "title": "SummaryTextReasoningItemReasoningSummaryType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "SummaryTextReasoningItemReasoningSummary", - "type": "object" - } - ] - }, - "ReasoningSummary": { - "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", - "oneOf": [ - { - "enum": [ - "auto", - "concise", - "detailed" - ], - "type": "string" - }, - { - "description": "Option to disable reasoning summaries.", - "enum": [ - "none" - ], - "type": "string" - } - ] - }, - "RemoteSkillSummary": { - "properties": { - "description": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "description", - "id", - "name" - ], - "type": "object" - }, - "RequestId": { - "anyOf": [ - { - "type": "string" - }, - { - "format": "int64", - "type": "integer" - } - ], - "description": "ID of a request, which can be either a string or an integer." - }, - "RequestPermissionProfile": { - "additionalProperties": false, - "properties": { - "file_system": { - "anyOf": [ - { - "$ref": "#/definitions/FileSystemPermissions" - }, - { - "type": "null" - } - ] - }, - "network": { - "anyOf": [ - { - "$ref": "#/definitions/NetworkPermissions" - }, - { - "type": "null" - } - ] - } - }, - "type": "object" - }, - "RequestUserInputQuestion": { - "properties": { - "header": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isOther": { - "default": false, - "type": "boolean" - }, - "isSecret": { - "default": false, - "type": "boolean" - }, - "options": { - "items": { - "$ref": "#/definitions/RequestUserInputQuestionOption" - }, - "type": [ - "array", - "null" - ] - }, - "question": { - "type": "string" - } - }, - "required": [ - "header", - "id", - "question" - ], - "type": "object" - }, - "RequestUserInputQuestionOption": { - "properties": { - "description": { - "type": "string" - }, - "label": { - "type": "string" - } - }, - "required": [ - "description", - "label" - ], - "type": "object" - }, - "Resource": { - "description": "A known resource that the server is capable of reading.", - "properties": { - "_meta": true, - "annotations": true, - "description": { - "type": [ - "string", - "null" - ] - }, - "icons": { - "items": true, - "type": [ - "array", - "null" - ] - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" - }, - "size": { - "format": "int64", - "type": [ - "integer", - "null" - ] - }, - "title": { - "type": [ - "string", - "null" - ] - }, - "uri": { - "type": "string" - } - }, - "required": [ - "name", - "uri" - ], - "type": "object" - }, - "ResourceTemplate": { - "description": "A template description for resources available on the server.", - "properties": { - "annotations": true, - "description": { - "type": [ - "string", - "null" - ] - }, - "mimeType": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": "string" - }, - "title": { - "type": [ - "string", - "null" - ] - }, - "uriTemplate": { - "type": "string" - } - }, - "required": [ - "name", - "uriTemplate" - ], - "type": "object" - }, - "ResponseItem": { - "oneOf": [ - { - "properties": { - "content": { - "items": { - "$ref": "#/definitions/ContentItem" - }, - "type": "array" - }, - "end_turn": { - "type": [ - "boolean", - "null" - ] - }, - "id": { - "type": [ - "string", - "null" - ], - "writeOnly": true - }, - "phase": { - "anyOf": [ - { - "$ref": "#/definitions/MessagePhase" - }, - { - "type": "null" - } - ] - }, - "role": { - "type": "string" - }, - "type": { - "enum": [ - "message" - ], - "title": "MessageResponseItemType", - "type": "string" - } - }, - "required": [ - "content", - "role", - "type" - ], - "title": "MessageResponseItem", - "type": "object" - }, - { - "properties": { - "content": { - "default": null, - "items": { - "$ref": "#/definitions/ReasoningItemContent" - }, - "type": [ - "array", - "null" - ] - }, - "encrypted_content": { - "type": [ - "string", - "null" - ] - }, - "summary": { - "items": { - "$ref": "#/definitions/ReasoningItemReasoningSummary" - }, - "type": "array" - }, - "type": { - "enum": [ - "reasoning" - ], - "title": "ReasoningResponseItemType", - "type": "string" - } - }, - "required": [ - "summary", - "type" - ], - "title": "ReasoningResponseItem", - "type": "object" - }, - { - "properties": { - "action": { - "$ref": "#/definitions/LocalShellAction" - }, - "call_id": { - "description": "Set when using the Responses API.", - "type": [ - "string", - "null" - ] - }, - "id": { - "description": "Legacy id field retained for compatibility with older payloads.", - "type": [ - "string", - "null" - ], - "writeOnly": true - }, - "status": { - "$ref": "#/definitions/LocalShellStatus" - }, - "type": { - "enum": [ - "local_shell_call" - ], - "title": "LocalShellCallResponseItemType", - "type": "string" - } - }, - "required": [ - "action", - "status", - "type" - ], - "title": "LocalShellCallResponseItem", - "type": "object" - }, - { - "properties": { - "arguments": { - "type": "string" - }, - "call_id": { - "type": "string" - }, - "id": { - "type": [ - "string", - "null" - ], - "writeOnly": true - }, - "name": { - "type": "string" - }, - "namespace": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "function_call" - ], - "title": "FunctionCallResponseItemType", - "type": "string" - } - }, - "required": [ - "arguments", - "call_id", - "name", - "type" - ], - "title": "FunctionCallResponseItem", - "type": "object" - }, - { - "properties": { - "arguments": true, - "call_id": { - "type": [ - "string", - "null" - ] - }, - "execution": { - "type": "string" - }, - "id": { - "type": [ - "string", - "null" - ], - "writeOnly": true - }, - "status": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "tool_search_call" - ], - "title": "ToolSearchCallResponseItemType", - "type": "string" - } - }, - "required": [ - "arguments", - "execution", - "type" - ], - "title": "ToolSearchCallResponseItem", - "type": "object" - }, - { - "properties": { - "call_id": { - "type": "string" - }, - "output": { - "$ref": "#/definitions/FunctionCallOutputBody" - }, - "type": { - "enum": [ - "function_call_output" - ], - "title": "FunctionCallOutputResponseItemType", - "type": "string" - } - }, - "required": [ - "call_id", - "output", - "type" - ], - "title": "FunctionCallOutputResponseItem", - "type": "object" - }, - { - "properties": { - "call_id": { - "type": "string" - }, - "id": { - "type": [ - "string", - "null" - ], - "writeOnly": true - }, - "input": { - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "custom_tool_call" - ], - "title": "CustomToolCallResponseItemType", - "type": "string" - } - }, - "required": [ - "call_id", - "input", - "name", - "type" - ], - "title": "CustomToolCallResponseItem", - "type": "object" - }, - { - "properties": { - "call_id": { - "type": "string" - }, - "output": { - "$ref": "#/definitions/FunctionCallOutputBody" - }, - "type": { - "enum": [ - "custom_tool_call_output" - ], - "title": "CustomToolCallOutputResponseItemType", - "type": "string" - } - }, - "required": [ - "call_id", - "output", - "type" - ], - "title": "CustomToolCallOutputResponseItem", - "type": "object" - }, - { - "properties": { - "call_id": { - "type": [ - "string", - "null" - ] - }, - "execution": { - "type": "string" - }, - "status": { - "type": "string" - }, - "tools": { - "items": true, - "type": "array" - }, - "type": { - "enum": [ - "tool_search_output" - ], - "title": "ToolSearchOutputResponseItemType", - "type": "string" - } - }, - "required": [ - "execution", - "status", - "tools", - "type" - ], - "title": "ToolSearchOutputResponseItem", - "type": "object" - }, - { - "properties": { - "action": { - "anyOf": [ - { - "$ref": "#/definitions/ResponsesApiWebSearchAction" - }, - { - "type": "null" - } - ] - }, - "id": { - "type": [ - "string", - "null" - ], - "writeOnly": true - }, - "status": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "web_search_call" - ], - "title": "WebSearchCallResponseItemType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "WebSearchCallResponseItem", - "type": "object" - }, - { - "properties": { - "id": { - "type": "string" - }, - "result": { - "type": "string" - }, - "revised_prompt": { - "type": [ - "string", - "null" - ] - }, - "status": { - "type": "string" - }, - "type": { - "enum": [ - "image_generation_call" - ], - "title": "ImageGenerationCallResponseItemType", - "type": "string" - } - }, - "required": [ - "id", - "result", - "status", - "type" - ], - "title": "ImageGenerationCallResponseItem", - "type": "object" - }, - { - "properties": { - "ghost_commit": { - "$ref": "#/definitions/GhostCommit" - }, - "type": { - "enum": [ - "ghost_snapshot" - ], - "title": "GhostSnapshotResponseItemType", - "type": "string" - } - }, - "required": [ - "ghost_commit", - "type" - ], - "title": "GhostSnapshotResponseItem", - "type": "object" - }, - { - "properties": { - "encrypted_content": { - "type": "string" - }, - "type": { - "enum": [ - "compaction" - ], - "title": "CompactionResponseItemType", - "type": "string" - } - }, - "required": [ - "encrypted_content", - "type" - ], - "title": "CompactionResponseItem", - "type": "object" - }, - { - "properties": { - "type": { - "enum": [ - "other" - ], - "title": "OtherResponseItemType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "OtherResponseItem", - "type": "object" - } - ] - }, - "ResponsesApiWebSearchAction": { - "oneOf": [ - { - "properties": { - "queries": { - "items": { - "type": "string" - }, - "type": [ - "array", - "null" - ] - }, - "query": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "search" - ], - "title": "SearchResponsesApiWebSearchActionType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "SearchResponsesApiWebSearchAction", - "type": "object" - }, - { - "properties": { - "type": { - "enum": [ - "open_page" - ], - "title": "OpenPageResponsesApiWebSearchActionType", - "type": "string" - }, - "url": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "type" - ], - "title": "OpenPageResponsesApiWebSearchAction", - "type": "object" - }, - { - "properties": { - "pattern": { - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "find_in_page" - ], - "title": "FindInPageResponsesApiWebSearchActionType", - "type": "string" - }, - "url": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "type" - ], - "title": "FindInPageResponsesApiWebSearchAction", - "type": "object" - }, - { - "properties": { - "type": { - "enum": [ - "other" - ], - "title": "OtherResponsesApiWebSearchActionType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "OtherResponsesApiWebSearchAction", - "type": "object" - } - ] - }, - "Result_of_CallToolResult_or_String": { - "oneOf": [ - { - "properties": { - "Ok": { - "$ref": "#/definitions/CallToolResult" - } - }, - "required": [ - "Ok" - ], - "title": "OkResult_of_CallToolResult_or_String", - "type": "object" - }, - { - "properties": { - "Err": { - "type": "string" - } - }, - "required": [ - "Err" - ], - "title": "ErrResult_of_CallToolResult_or_String", - "type": "object" - } - ] - }, - "ReviewCodeLocation": { - "description": "Location of the code related to a review finding.", - "properties": { - "absolute_file_path": { - "type": "string" - }, - "line_range": { - "$ref": "#/definitions/ReviewLineRange" - } - }, - "required": [ - "absolute_file_path", - "line_range" - ], - "type": "object" - }, - "ReviewDecision": { - "description": "User's decision in response to an ExecApprovalRequest.", - "oneOf": [ - { - "description": "User has approved this command and the agent should execute it.", - "enum": [ - "approved" - ], - "type": "string" - }, - { - "additionalProperties": false, - "description": "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", - "properties": { - "approved_execpolicy_amendment": { - "properties": { - "proposed_execpolicy_amendment": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "proposed_execpolicy_amendment" - ], - "type": "object" - } - }, - "required": [ - "approved_execpolicy_amendment" - ], - "title": "ApprovedExecpolicyAmendmentReviewDecision", - "type": "object" - }, - { - "description": "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", - "enum": [ - "approved_for_session" - ], - "type": "string" - }, - { - "additionalProperties": false, - "description": "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", - "properties": { - "network_policy_amendment": { - "properties": { - "network_policy_amendment": { - "$ref": "#/definitions/NetworkPolicyAmendment" - } - }, - "required": [ - "network_policy_amendment" - ], - "type": "object" - } - }, - "required": [ - "network_policy_amendment" - ], - "title": "NetworkPolicyAmendmentReviewDecision", - "type": "object" - }, - { - "description": "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", - "enum": [ - "denied" - ], - "type": "string" - }, - { - "description": "User has denied this command and the agent should not do anything until the user's next command.", - "enum": [ - "abort" - ], - "type": "string" - } - ] - }, - "ReviewFinding": { - "description": "A single review finding describing an observed issue or recommendation.", - "properties": { - "body": { - "type": "string" - }, - "code_location": { - "$ref": "#/definitions/ReviewCodeLocation" - }, - "confidence_score": { - "format": "float", - "type": "number" - }, - "priority": { - "format": "int32", - "type": "integer" - }, - "title": { - "type": "string" - } - }, - "required": [ - "body", - "code_location", - "confidence_score", - "priority", - "title" - ], - "type": "object" - }, - "ReviewLineRange": { - "description": "Inclusive line range in a file associated with the finding.", - "properties": { - "end": { - "format": "uint32", - "minimum": 0.0, - "type": "integer" - }, - "start": { - "format": "uint32", - "minimum": 0.0, - "type": "integer" - } - }, - "required": [ - "end", - "start" - ], - "type": "object" - }, - "ReviewOutputEvent": { - "description": "Structured review result produced by a child review session.", - "properties": { - "findings": { - "items": { - "$ref": "#/definitions/ReviewFinding" - }, - "type": "array" - }, - "overall_confidence_score": { - "format": "float", - "type": "number" - }, - "overall_correctness": { - "type": "string" - }, - "overall_explanation": { - "type": "string" - } - }, - "required": [ - "findings", - "overall_confidence_score", - "overall_correctness", - "overall_explanation" - ], - "type": "object" - }, - "ReviewTarget": { - "oneOf": [ - { - "description": "Review the working tree: staged, unstaged, and untracked files.", - "properties": { - "type": { - "enum": [ - "uncommittedChanges" - ], - "title": "UncommittedChangesReviewTargetType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "UncommittedChangesReviewTarget", - "type": "object" - }, - { - "description": "Review changes between the current branch and the given base branch.", - "properties": { - "branch": { - "type": "string" - }, - "type": { - "enum": [ - "baseBranch" - ], - "title": "BaseBranchReviewTargetType", - "type": "string" - } - }, - "required": [ - "branch", - "type" - ], - "title": "BaseBranchReviewTarget", - "type": "object" - }, - { - "description": "Review the changes introduced by a specific commit.", - "properties": { - "sha": { - "type": "string" - }, - "title": { - "description": "Optional human-readable label (e.g., commit subject) for UIs.", - "type": [ - "string", - "null" - ] - }, - "type": { - "enum": [ - "commit" - ], - "title": "CommitReviewTargetType", - "type": "string" - } - }, - "required": [ - "sha", - "type" - ], - "title": "CommitReviewTarget", - "type": "object" - }, - { - "description": "Arbitrary instructions provided by the user.", - "properties": { - "instructions": { - "type": "string" - }, - "type": { - "enum": [ - "custom" - ], - "title": "CustomReviewTargetType", - "type": "string" - } - }, - "required": [ - "instructions", - "type" - ], - "title": "CustomReviewTarget", - "type": "object" - } - ] - }, - "SandboxPolicy": { - "description": "Determines execution restrictions for model shell commands.", - "oneOf": [ - { - "description": "No restrictions whatsoever. Use with caution.", - "properties": { - "type": { - "enum": [ - "danger-full-access" - ], - "title": "DangerFullAccessSandboxPolicyType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "DangerFullAccessSandboxPolicy", - "type": "object" - }, - { - "description": "Read-only access configuration.", - "properties": { - "access": { - "allOf": [ - { - "$ref": "#/definitions/ReadOnlyAccess" - } - ], - "description": "Read access granted while running under this policy." - }, - "network_access": { - "description": "When set to `true`, outbound network access is allowed. `false` by default.", - "type": "boolean" - }, - "type": { - "enum": [ - "read-only" - ], - "title": "ReadOnlySandboxPolicyType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "ReadOnlySandboxPolicy", - "type": "object" - }, - { - "description": "Indicates the process is already in an external sandbox. Allows full disk access while honoring the provided network setting.", - "properties": { - "network_access": { - "allOf": [ - { - "$ref": "#/definitions/NetworkAccess" - } - ], - "default": "restricted", - "description": "Whether the external sandbox permits outbound network traffic." - }, - "type": { - "enum": [ - "external-sandbox" - ], - "title": "ExternalSandboxSandboxPolicyType", - "type": "string" - } - }, - "required": [ - "type" - ], - "title": "ExternalSandboxSandboxPolicy", - "type": "object" - }, - { - "description": "Same as `ReadOnly` but additionally grants write access to the current working directory (\"workspace\").", - "properties": { - "exclude_slash_tmp": { - "default": false, - "description": "When set to `true`, will NOT include the `/tmp` among the default writable roots on UNIX. Defaults to `false`.", - "type": "boolean" - }, - "exclude_tmpdir_env_var": { - "default": false, - "description": "When set to `true`, will NOT include the per-user `TMPDIR` environment variable among the default writable roots. Defaults to `false`.", - "type": "boolean" - }, - "network_access": { - "default": false, - "description": "When set to `true`, outbound network access is allowed. `false` by default.", - "type": "boolean" - }, - "read_only_access": { - "allOf": [ - { - "$ref": "#/definitions/ReadOnlyAccess" - } - ], - "description": "Read access granted while running under this policy." - }, - "type": { - "enum": [ - "workspace-write" - ], - "title": "WorkspaceWriteSandboxPolicyType", - "type": "string" - }, - "writable_roots": { - "description": "Additional folders (beyond cwd and possibly TMPDIR) that should be writable from within the sandbox.", - "items": { - "$ref": "#/definitions/AbsolutePathBuf" - }, - "type": "array" - } - }, - "required": [ - "type" - ], - "title": "WorkspaceWriteSandboxPolicy", - "type": "object" - } - ] - }, - "ServiceTier": { - "enum": [ - "fast", - "flex" - ], - "type": "string" - }, - "SessionMetaLine": { - "description": "SessionMeta contains session-level data that doesn't correspond to a specific turn.\n\nNOTE: There used to be an `instructions` field here, which stored user_instructions, but we now save that on TurnContext. base_instructions stores the base instructions for the session, and should be used when there is no config override.", - "properties": { - "agent_nickname": { - "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "agent_role": { - "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", - "type": [ - "string", - "null" - ] - }, - "base_instructions": { - "anyOf": [ - { - "$ref": "#/definitions/base_instructions" - }, - { - "type": "null" - } - ], - "description": "base_instructions for the session. This *should* always be present when creating a new session, but may be missing for older sessions. If not present, fall back to rendering the base_instructions from ModelsManager." - }, - "cli_version": { - "type": "string" - }, - "cwd": { - "type": "string" - }, - "dynamic_tools": { - "items": { - "$ref": "#/definitions/DynamicToolSpec" - }, - "type": [ - "array", - "null" - ] - }, - "forked_from_id": { - "anyOf": [ - { - "$ref": "#/definitions/ThreadId" - }, - { - "type": "null" - } - ] - }, - "git": { - "anyOf": [ - { - "$ref": "#/definitions/GitInfo" - }, - { - "type": "null" - } - ] - }, - "id": { - "$ref": "#/definitions/ThreadId" - }, - "memory_mode": { - "type": [ - "string", - "null" - ] - }, - "model_provider": { - "type": [ - "string", - "null" - ] - }, - "originator": { - "type": "string" - }, - "source": { - "allOf": [ - { - "$ref": "#/definitions/SessionSource" - } - ], - "default": "vscode" - }, - "timestamp": { - "type": "string" - } - }, - "required": [ - "cli_version", - "cwd", - "id", - "originator", - "timestamp" - ], - "type": "object" - }, - "SessionNetworkProxyRuntime": { - "properties": { - "http_addr": { - "type": "string" - }, - "socks_addr": { - "type": "string" - } - }, - "required": [ - "http_addr", - "socks_addr" - ], - "type": "object" - }, - "SessionSource": { - "oneOf": [ - { - "enum": [ - "cli", - "vscode", - "exec", - "mcp", - "unknown" - ], - "type": "string" - }, - { - "additionalProperties": false, - "properties": { - "subagent": { - "$ref": "#/definitions/SubAgentSource" - } - }, - "required": [ - "subagent" - ], - "title": "SubagentSessionSource", - "type": "object" - } - ] - }, - "Settings": { - "description": "Settings for a collaboration mode.", - "properties": { - "developer_instructions": { - "type": [ - "string", - "null" - ] - }, - "model": { - "type": "string" - }, - "reasoning_effort": { - "anyOf": [ - { - "$ref": "#/definitions/ReasoningEffort" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "model" - ], - "type": "object" - }, - "SkillDependencies": { - "properties": { - "tools": { - "items": { - "$ref": "#/definitions/SkillToolDependency" - }, - "type": "array" - } - }, - "required": [ - "tools" - ], - "type": "object" - }, - "SkillErrorInfo": { - "properties": { - "message": { - "type": "string" - }, - "path": { - "type": "string" - } - }, - "required": [ - "message", - "path" - ], - "type": "object" - }, - "SkillInterface": { - "properties": { - "brand_color": { - "type": [ - "string", - "null" - ] - }, - "default_prompt": { - "type": [ - "string", - "null" - ] - }, - "display_name": { - "type": [ - "string", - "null" - ] - }, - "icon_large": { - "type": [ - "string", - "null" - ] - }, - "icon_small": { - "type": [ - "string", - "null" - ] - }, - "short_description": { - "type": [ - "string", - "null" - ] - } - }, - "type": "object" - }, - "SkillMetadata": { - "properties": { - "dependencies": { - "anyOf": [ - { - "$ref": "#/definitions/SkillDependencies" - }, - { - "type": "null" - } - ] - }, - "description": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "interface": { - "anyOf": [ - { - "$ref": "#/definitions/SkillInterface" - }, - { - "type": "null" - } - ] - }, - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "scope": { - "$ref": "#/definitions/SkillScope" - }, - "short_description": { - "description": "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "description", - "enabled", - "name", - "path", - "scope" - ], - "type": "object" - }, - "SkillScope": { - "enum": [ - "user", - "repo", - "system", - "admin" - ], - "type": "string" - }, - "SkillToolDependency": { - "properties": { - "command": { - "type": [ - "string", - "null" - ] - }, - "description": { - "type": [ - "string", - "null" - ] - }, - "transport": { - "type": [ - "string", - "null" - ] - }, - "type": { - "type": "string" - }, - "url": { - "type": [ - "string", - "null" - ] - }, - "value": { - "type": "string" - } - }, - "required": [ - "type", - "value" - ], - "type": "object" - }, - "SkillsListEntry": { - "properties": { - "cwd": { - "type": "string" - }, - "errors": { - "items": { - "$ref": "#/definitions/SkillErrorInfo" - }, - "type": "array" - }, - "skills": { - "items": { - "$ref": "#/definitions/SkillMetadata" - }, - "type": "array" - } - }, - "required": [ - "cwd", - "errors", - "skills" - ], - "type": "object" - }, - "StepStatus": { - "enum": [ - "pending", - "in_progress", - "completed" - ], - "type": "string" - }, - "SubAgentSource": { - "oneOf": [ - { - "enum": [ - "review", - "compact", - "memory_consolidation" - ], - "type": "string" - }, - { - "additionalProperties": false, - "properties": { - "thread_spawn": { - "properties": { - "agent_nickname": { - "default": null, - "type": [ - "string", - "null" - ] - }, - "agent_role": { - "default": null, - "type": [ - "string", - "null" - ] - }, - "depth": { - "format": "int32", - "type": "integer" - }, - "parent_thread_id": { - "$ref": "#/definitions/ThreadId" - } - }, - "required": [ - "depth", - "parent_thread_id" - ], - "type": "object" - } - }, - "required": [ - "thread_spawn" - ], - "title": "ThreadSpawnSubAgentSource", - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "other": { - "type": "string" - } - }, - "required": [ - "other" - ], - "title": "OtherSubAgentSource", - "type": "object" - } - ] - }, - "TextElement": { - "properties": { - "byte_range": { - "allOf": [ - { - "$ref": "#/definitions/ByteRange" - } - ], - "description": "Byte range in the parent `text` buffer that this element occupies." - }, - "placeholder": { - "description": "Optional human-readable placeholder for the element, displayed in the UI.", - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "byte_range" - ], - "type": "object" - }, - "ThreadId": { - "type": "string" - }, - "TokenUsage": { - "properties": { - "cached_input_tokens": { - "format": "int64", - "type": "integer" - }, - "input_tokens": { - "format": "int64", - "type": "integer" - }, - "output_tokens": { - "format": "int64", - "type": "integer" - }, - "reasoning_output_tokens": { - "format": "int64", - "type": "integer" - }, - "total_tokens": { - "format": "int64", - "type": "integer" - } - }, - "required": [ - "cached_input_tokens", - "input_tokens", - "output_tokens", - "reasoning_output_tokens", - "total_tokens" - ], - "type": "object" - }, - "TokenUsageInfo": { - "properties": { - "last_token_usage": { - "$ref": "#/definitions/TokenUsage" - }, - "model_context_window": { - "format": "int64", - "type": [ - "integer", - "null" - ] - }, - "total_token_usage": { - "$ref": "#/definitions/TokenUsage" - } - }, - "required": [ - "last_token_usage", - "total_token_usage" - ], - "type": "object" - }, - "Tool": { - "description": "Definition for a tool the client can call.", - "properties": { - "_meta": true, - "annotations": true, - "description": { - "type": [ - "string", - "null" - ] - }, - "icons": { - "items": true, - "type": [ - "array", - "null" - ] - }, - "inputSchema": true, - "name": { - "type": "string" - }, - "outputSchema": true, - "title": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "inputSchema", - "name" - ], - "type": "object" - }, - "TruncationPolicy": { - "oneOf": [ - { - "properties": { - "limit": { - "format": "uint", - "minimum": 0.0, - "type": "integer" - }, - "mode": { - "enum": [ - "bytes" - ], - "type": "string" - } - }, - "required": [ - "limit", - "mode" - ], - "type": "object" - }, - { - "properties": { - "limit": { - "format": "uint", - "minimum": 0.0, - "type": "integer" - }, - "mode": { - "enum": [ - "tokens" - ], - "type": "string" - } - }, - "required": [ - "limit", - "mode" - ], - "type": "object" - } - ] - }, - "TurnAbortReason": { - "enum": [ - "interrupted", - "replaced", - "review_ended" - ], - "type": "string" - }, - "TurnContextItem": { - "description": "Persist once per real user turn after computing that turn's model-visible context updates, and again after mid-turn compaction when replacement history re-establishes full context, so resume/fork replay can recover the latest durable baseline.", - "properties": { - "approval_policy": { - "$ref": "#/definitions/AskForApproval" - }, - "collaboration_mode": { - "anyOf": [ - { - "$ref": "#/definitions/CollaborationMode" - }, - { - "type": "null" - } - ] - }, - "current_date": { - "type": [ - "string", - "null" - ] - }, - "cwd": { - "type": "string" - }, - "developer_instructions": { - "type": [ - "string", - "null" - ] - }, - "effort": { - "anyOf": [ - { - "$ref": "#/definitions/ReasoningEffort" - }, - { - "type": "null" - } - ] - }, - "final_output_json_schema": true, - "model": { - "type": "string" - }, - "network": { - "anyOf": [ - { - "$ref": "#/definitions/TurnContextNetworkItem" - }, - { - "type": "null" - } - ] - }, - "personality": { - "anyOf": [ - { - "$ref": "#/definitions/Personality" - }, - { - "type": "null" - } - ] - }, - "realtime_active": { - "type": [ - "boolean", - "null" - ] - }, - "sandbox_policy": { - "$ref": "#/definitions/SandboxPolicy" - }, - "summary": { - "$ref": "#/definitions/ReasoningSummary" - }, - "timezone": { - "type": [ - "string", - "null" - ] - }, - "trace_id": { - "type": [ - "string", - "null" - ] - }, - "truncation_policy": { - "anyOf": [ - { - "$ref": "#/definitions/TruncationPolicy" - }, - { - "type": "null" - } - ] - }, - "turn_id": { - "type": [ - "string", - "null" - ] - }, - "user_instructions": { - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "approval_policy", - "cwd", - "model", - "sandbox_policy", - "summary" - ], - "type": "object" - }, - "TurnContextNetworkItem": { - "properties": { - "allowed_domains": { - "items": { - "type": "string" - }, - "type": "array" - }, - "denied_domains": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "allowed_domains", - "denied_domains" - ], - "type": "object" - }, - "TurnItem": { - "oneOf": [ - { - "properties": { - "content": { - "items": { - "$ref": "#/definitions/UserInput" - }, - "type": "array" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "UserMessage" - ], - "title": "UserMessageTurnItemType", - "type": "string" - } - }, - "required": [ - "content", - "id", - "type" - ], - "title": "UserMessageTurnItem", - "type": "object" - }, - { - "description": "Assistant-authored message payload used in turn-item streams.\n\n`phase` is optional because not all providers/models emit it. Consumers should use it when present, but retain legacy completion semantics when it is `None`.", - "properties": { - "content": { - "items": { - "$ref": "#/definitions/AgentMessageContent" - }, - "type": "array" - }, - "id": { - "type": "string" - }, - "phase": { - "anyOf": [ - { - "$ref": "#/definitions/MessagePhase" - }, - { - "type": "null" - } - ], - "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." - }, - "type": { - "enum": [ - "AgentMessage" - ], - "title": "AgentMessageTurnItemType", - "type": "string" - } - }, - "required": [ - "content", - "id", - "type" - ], - "title": "AgentMessageTurnItem", - "type": "object" - }, - { - "properties": { - "id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "type": { - "enum": [ - "Plan" - ], - "title": "PlanTurnItemType", - "type": "string" - } - }, - "required": [ - "id", - "text", - "type" - ], - "title": "PlanTurnItem", - "type": "object" - }, - { - "properties": { - "id": { - "type": "string" - }, - "raw_content": { - "default": [], - "items": { - "type": "string" - }, - "type": "array" - }, - "summary_text": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { - "enum": [ - "Reasoning" - ], - "title": "ReasoningTurnItemType", - "type": "string" - } - }, - "required": [ - "id", - "summary_text", - "type" - ], - "title": "ReasoningTurnItem", - "type": "object" - }, - { - "properties": { - "action": { - "$ref": "#/definitions/ResponsesApiWebSearchAction" - }, - "id": { - "type": "string" - }, - "query": { - "type": "string" - }, - "type": { - "enum": [ - "WebSearch" - ], - "title": "WebSearchTurnItemType", - "type": "string" - } - }, - "required": [ - "action", - "id", - "query", - "type" - ], - "title": "WebSearchTurnItem", - "type": "object" - }, - { - "properties": { - "id": { - "type": "string" - }, - "result": { - "type": "string" - }, - "revised_prompt": { - "type": [ - "string", - "null" - ] - }, - "saved_path": { - "type": [ - "string", - "null" - ] - }, - "status": { - "type": "string" - }, - "type": { - "enum": [ - "ImageGeneration" - ], - "title": "ImageGenerationTurnItemType", - "type": "string" - } - }, - "required": [ - "id", - "result", - "status", - "type" - ], - "title": "ImageGenerationTurnItem", - "type": "object" - }, - { - "properties": { - "id": { - "type": "string" - }, - "type": { - "enum": [ - "ContextCompaction" - ], - "title": "ContextCompactionTurnItemType", - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "title": "ContextCompactionTurnItem", - "type": "object" - } - ] - }, - "UserInput": { - "description": "User input", - "oneOf": [ - { - "properties": { - "text": { - "type": "string" - }, - "text_elements": { - "default": [], - "description": "UI-defined spans within `text` that should be treated as special elements. These are byte ranges into the UTF-8 `text` buffer and are used to render or persist rich input markers (e.g., image placeholders) across history and resume without mutating the literal text.", - "items": { - "$ref": "#/definitions/TextElement" - }, - "type": "array" - }, - "type": { - "enum": [ - "text" - ], - "title": "TextUserInputType", - "type": "string" - } - }, - "required": [ - "text", - "type" - ], - "title": "TextUserInput", - "type": "object" - }, - { - "description": "Pre‑encoded data: URI image.", - "properties": { - "image_url": { - "type": "string" - }, - "type": { - "enum": [ - "image" - ], - "title": "ImageUserInputType", - "type": "string" - } - }, - "required": [ - "image_url", - "type" - ], - "title": "ImageUserInput", - "type": "object" - }, - { - "description": "Local image path provided by the user. This will be converted to an `Image` variant (base64 data URL) during request serialization.", - "properties": { - "path": { - "type": "string" - }, - "type": { - "enum": [ - "local_image" - ], - "title": "LocalImageUserInputType", - "type": "string" - } - }, - "required": [ - "path", - "type" - ], - "title": "LocalImageUserInput", - "type": "object" - }, - { - "description": "Skill selected by the user (name + path to SKILL.md).", - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "enum": [ - "skill" - ], - "title": "SkillUserInputType", - "type": "string" - } - }, - "required": [ - "name", - "path", - "type" - ], - "title": "SkillUserInput", - "type": "object" - }, - { - "description": "Explicit structured mention selected by the user.\n\n`path` identifies the exact mention target, for example `app://` or `plugin://@`.", - "properties": { - "name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "type": { - "enum": [ - "mention" - ], - "title": "MentionUserInputType", - "type": "string" - } - }, - "required": [ - "name", - "path", - "type" - ], - "title": "MentionUserInput", - "type": "object" - } - ] - }, - "base_instructions": { - "description": "Base instructions for the model in a thread. Corresponds to the `instructions` field in the ResponsesAPI.", - "properties": { - "text": { - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - } - }, - "oneOf": [ - { - "properties": { - "payload": { - "$ref": "#/definitions/SessionMetaLine" - }, - "type": { - "enum": [ - "session_meta" - ], - "title": "SessionMetaRolloutLineType", - "type": "string" - } - }, - "required": [ - "payload", - "type" - ], - "title": "SessionMetaRolloutLine", - "type": "object" - }, - { - "properties": { - "payload": { - "$ref": "#/definitions/ResponseItem" - }, - "type": { - "enum": [ - "response_item" - ], - "title": "ResponseItemRolloutLineType", - "type": "string" - } - }, - "required": [ - "payload", - "type" - ], - "title": "ResponseItemRolloutLine", - "type": "object" - }, - { - "properties": { - "payload": { - "$ref": "#/definitions/CompactedItem" - }, - "type": { - "enum": [ - "compacted" - ], - "title": "CompactedRolloutLineType", - "type": "string" - } - }, - "required": [ - "payload", - "type" - ], - "title": "CompactedRolloutLine", - "type": "object" - }, - { - "properties": { - "payload": { - "$ref": "#/definitions/TurnContextItem" - }, - "type": { - "enum": [ - "turn_context" - ], - "title": "TurnContextRolloutLineType", - "type": "string" - } - }, - "required": [ - "payload", - "type" - ], - "title": "TurnContextRolloutLine", - "type": "object" - }, - { - "properties": { - "payload": { - "$ref": "#/definitions/EventMsg" - }, - "type": { - "enum": [ - "event_msg" - ], - "title": "EventMsgRolloutLineType", - "type": "string" - } - }, - "required": [ - "payload", - "type" - ], - "title": "EventMsgRolloutLine", - "type": "object" - } - ], - "properties": { - "timestamp": { - "type": "string" - } - }, - "required": [ - "timestamp" - ], - "title": "RolloutLine", - "type": "object" -} \ No newline at end of file diff --git a/codex-rs/app-server-protocol/src/export.rs b/codex-rs/app-server-protocol/src/export.rs index 5022b72d9d2..b89f23c666e 100644 --- a/codex-rs/app-server-protocol/src/export.rs +++ b/codex-rs/app-server-protocol/src/export.rs @@ -186,6 +186,12 @@ pub fn generate_json(out_dir: &Path) -> Result<()> { generate_json_with_experimental(out_dir, /*experimental_api*/ false) } +pub fn generate_internal_json_schema(out_dir: &Path) -> Result<()> { + ensure_dir(out_dir)?; + write_json_schema::(out_dir, "RolloutLine")?; + Ok(()) +} + pub fn generate_json_with_experimental(out_dir: &Path, experimental_api: bool) -> Result<()> { ensure_dir(out_dir)?; let envelope_emitters: Vec = vec![ @@ -234,11 +240,6 @@ pub fn generate_json_with_experimental(out_dir: &Path, experimental_api: bool) - filter_experimental_json_files(out_dir)?; } - // internal only (not a public stable interface) - let internal_out_dir = out_dir.join("internal"); - ensure_dir(&internal_out_dir)?; - write_json_schema::(&internal_out_dir, "RolloutLine")?; - Ok(()) } diff --git a/codex-rs/app-server-protocol/src/lib.rs b/codex-rs/app-server-protocol/src/lib.rs index 067dcb0369e..3c5fa6dc2e4 100644 --- a/codex-rs/app-server-protocol/src/lib.rs +++ b/codex-rs/app-server-protocol/src/lib.rs @@ -6,6 +6,7 @@ mod schema_fixtures; pub use experimental_api::*; pub use export::GenerateTsOptions; +pub use export::generate_internal_json_schema; pub use export::generate_json; pub use export::generate_json_with_experimental; pub use export::generate_ts; diff --git a/codex-rs/cli/src/main.rs b/codex-rs/cli/src/main.rs index 972c2854f8c..0b7f182e1e4 100644 --- a/codex-rs/cli/src/main.rs +++ b/codex-rs/cli/src/main.rs @@ -357,6 +357,10 @@ enum AppServerSubcommand { /// [experimental] Generate JSON Schema for the app server protocol. GenerateJsonSchema(GenerateJsonSchemaCommand), + + /// [internal] Generate internal JSON Schema artifacts for Codex tooling. + #[clap(hide = true)] + GenerateInternalJsonSchema(GenerateInternalJsonSchemaCommand), } #[derive(Debug, Args)] @@ -385,6 +389,13 @@ struct GenerateJsonSchemaCommand { experimental: bool, } +#[derive(Debug, Args)] +struct GenerateInternalJsonSchemaCommand { + /// Output directory where internal JSON Schema artifacts will be written + #[arg(short = 'o', long = "out", value_name = "DIR")] + out_dir: PathBuf, +} + #[derive(Debug, Parser)] struct StdioToUdsCommand { /// Path to the Unix domain socket to connect to. @@ -665,6 +676,9 @@ async fn cli_main(arg0_paths: Arg0DispatchPaths) -> anyhow::Result<()> { gen_cli.experimental, )?; } + Some(AppServerSubcommand::GenerateInternalJsonSchema(gen_cli)) => { + codex_app_server_protocol::generate_internal_json_schema(&gen_cli.out_dir)?; + } }, #[cfg(target_os = "macos")] Some(Subcommand::App(app_cli)) => { From 6ce5ac58b71e7f9d6386a519a3a10c3d65e86cf6 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Fri, 13 Mar 2026 17:56:09 -0700 Subject: [PATCH 17/18] disable lint? --- codex-rs/cli/src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/codex-rs/cli/src/main.rs b/codex-rs/cli/src/main.rs index 0b7f182e1e4..05b568b7b7f 100644 --- a/codex-rs/cli/src/main.rs +++ b/codex-rs/cli/src/main.rs @@ -351,6 +351,7 @@ struct AppServerCommand { } #[derive(Debug, clap::Subcommand)] +#[allow(clippy::enum_variant_names)] enum AppServerSubcommand { /// [experimental] Generate TypeScript bindings for the app server protocol. GenerateTs(GenerateTsCommand), From e722a2bfdc827575ac82857314e9baf420f21d63 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Sun, 15 Mar 2026 23:08:10 -0700 Subject: [PATCH 18/18] codex: address PR review feedback (#14434) Align TypeScript codegen with the existing JSON Schema wire override for function and custom tool call outputs. Co-authored-by: Codex --- .../schema/typescript/FunctionCallOutputPayload.ts | 12 ------------ .../schema/typescript/ResponseItem.ts | 4 ++-- .../app-server-protocol/schema/typescript/index.ts | 1 - codex-rs/protocol/src/models.rs | 4 ++++ 4 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 codex-rs/app-server-protocol/schema/typescript/FunctionCallOutputPayload.ts diff --git a/codex-rs/app-server-protocol/schema/typescript/FunctionCallOutputPayload.ts b/codex-rs/app-server-protocol/schema/typescript/FunctionCallOutputPayload.ts deleted file mode 100644 index 6376c5b8eb0..00000000000 --- a/codex-rs/app-server-protocol/schema/typescript/FunctionCallOutputPayload.ts +++ /dev/null @@ -1,12 +0,0 @@ -// GENERATED CODE! DO NOT MODIFY BY HAND! - -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FunctionCallOutputBody } from "./FunctionCallOutputBody"; - -/** - * The payload we send back to OpenAI when reporting a tool call result. - * - * `body` serializes directly as the wire value for `function_call_output.output`. - * `success` remains internal metadata for downstream handling. - */ -export type FunctionCallOutputPayload = { body: FunctionCallOutputBody, success: boolean | null, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/ResponseItem.ts b/codex-rs/app-server-protocol/schema/typescript/ResponseItem.ts index 2464037a501..48e6b69d739 100644 --- a/codex-rs/app-server-protocol/schema/typescript/ResponseItem.ts +++ b/codex-rs/app-server-protocol/schema/typescript/ResponseItem.ts @@ -2,7 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ContentItem } from "./ContentItem"; -import type { FunctionCallOutputPayload } from "./FunctionCallOutputPayload"; +import type { FunctionCallOutputBody } from "./FunctionCallOutputBody"; import type { GhostCommit } from "./GhostCommit"; import type { LocalShellAction } from "./LocalShellAction"; import type { LocalShellStatus } from "./LocalShellStatus"; @@ -15,4 +15,4 @@ export type ResponseItem = { "type": "message", role: string, content: Array