openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
5,772 lines • 152 kB
JavaScript
import { Compile } from "typebox/compile";
//#region extensions/codex/src/app-server/protocol-generated/json/DynamicToolCallParams.json
var DynamicToolCallParams_default = {
$schema: "http://json-schema.org/draft-07/schema#",
properties: {
"arguments": true,
"callId": { "type": "string" },
"namespace": { "type": ["string", "null"] },
"threadId": { "type": "string" },
"tool": { "type": "string" },
"turnId": { "type": "string" }
},
required: [
"arguments",
"callId",
"threadId",
"tool",
"turnId"
],
title: "DynamicToolCallParams",
type: "object"
};
//#endregion
//#region extensions/codex/src/app-server/protocol-generated/json/v2/ErrorNotification.json
var ErrorNotification_default = {
$schema: "http://json-schema.org/draft-07/schema#",
definitions: {
"CodexErrorInfo": {
"description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.",
"oneOf": [
{
"additionalProperties": false,
"properties": { "httpConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["httpConnectionFailed"],
"title": "HttpConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Failed to connect to the response SSE stream.",
"properties": { "responseStreamConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamConnectionFailed"],
"title": "ResponseStreamConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "The response SSE stream disconnected in the middle of a turn before completion.",
"properties": { "responseStreamDisconnected": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamDisconnected"],
"title": "ResponseStreamDisconnectedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Reached the retry limit for responses.",
"properties": { "responseTooManyFailedAttempts": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseTooManyFailedAttempts"],
"title": "ResponseTooManyFailedAttemptsCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.",
"properties": { "activeTurnNotSteerable": {
"properties": { "turnKind": { "$ref": "#/definitions/NonSteerableTurnKind" } },
"required": ["turnKind"],
"type": "object"
} },
"required": ["activeTurnNotSteerable"],
"title": "ActiveTurnNotSteerableCodexErrorInfo",
"type": "object"
},
{
"enum": [
"contextWindowExceeded",
"usageLimitExceeded",
"serverOverloaded",
"cyberPolicy",
"internalServerError",
"unauthorized",
"badRequest",
"threadRollbackFailed",
"sandboxError",
"other"
],
"type": "string"
}
]
},
"NonSteerableTurnKind": {
"enum": ["review", "compact"],
"type": "string"
},
"TurnError": {
"properties": {
"additionalDetails": {
"default": null,
"type": ["string", "null"]
},
"codexErrorInfo": { "anyOf": [{ "$ref": "#/definitions/CodexErrorInfo" }, { "type": "null" }] },
"message": { "type": "string" }
},
"required": ["message"],
"type": "object"
}
},
properties: {
"error": { "$ref": "#/definitions/TurnError" },
"threadId": { "type": "string" },
"turnId": { "type": "string" },
"willRetry": { "type": "boolean" }
},
required: [
"error",
"threadId",
"turnId",
"willRetry"
],
title: "ErrorNotification",
type: "object"
};
//#endregion
//#region extensions/codex/src/app-server/protocol-generated/json/v2/ModelListResponse.json
var ModelListResponse_default = {
$schema: "http://json-schema.org/draft-07/schema#",
definitions: {
"InputModality": {
"description": "Canonical user-input modality tags advertised by a model.",
"oneOf": [{
"description": "Plain text turns and tool payloads.",
"enum": ["text"],
"type": "string"
}, {
"description": "Image attachments included in user turns.",
"enum": ["image"],
"type": "string"
}]
},
"Model": {
"properties": {
"additionalSpeedTiers": {
"default": [],
"description": "Deprecated: use `serviceTiers` instead.",
"items": { "type": "string" },
"type": "array"
},
"availabilityNux": { "anyOf": [{ "$ref": "#/definitions/ModelAvailabilityNux" }, { "type": "null" }] },
"defaultReasoningEffort": { "$ref": "#/definitions/ReasoningEffort" },
"defaultServiceTier": {
"default": null,
"description": "Catalog default service tier id for this model, when one is configured.",
"type": ["string", "null"]
},
"description": { "type": "string" },
"displayName": { "type": "string" },
"hidden": { "type": "boolean" },
"id": { "type": "string" },
"inputModalities": {
"default": ["text", "image"],
"items": { "$ref": "#/definitions/InputModality" },
"type": "array"
},
"isDefault": { "type": "boolean" },
"model": { "type": "string" },
"serviceTiers": {
"default": [],
"items": { "$ref": "#/definitions/ModelServiceTier" },
"type": "array"
},
"supportedReasoningEfforts": {
"items": { "$ref": "#/definitions/ReasoningEffortOption" },
"type": "array"
},
"supportsPersonality": {
"default": false,
"type": "boolean"
},
"upgrade": { "type": ["string", "null"] },
"upgradeInfo": { "anyOf": [{ "$ref": "#/definitions/ModelUpgradeInfo" }, { "type": "null" }] }
},
"required": [
"defaultReasoningEffort",
"description",
"displayName",
"hidden",
"id",
"isDefault",
"model",
"supportedReasoningEfforts"
],
"type": "object"
},
"ModelAvailabilityNux": {
"properties": { "message": { "type": "string" } },
"required": ["message"],
"type": "object"
},
"ModelServiceTier": {
"properties": {
"description": { "type": "string" },
"id": { "type": "string" },
"name": { "type": "string" }
},
"required": [
"description",
"id",
"name"
],
"type": "object"
},
"ModelUpgradeInfo": {
"properties": {
"migrationMarkdown": { "type": ["string", "null"] },
"model": { "type": "string" },
"modelLink": { "type": ["string", "null"] },
"upgradeCopy": { "type": ["string", "null"] }
},
"required": ["model"],
"type": "object"
},
"ReasoningEffort": {
"description": "A non-empty reasoning effort value advertised by the model.",
"minLength": 1,
"type": "string"
},
"ReasoningEffortOption": {
"properties": {
"description": { "type": "string" },
"reasoningEffort": { "$ref": "#/definitions/ReasoningEffort" }
},
"required": ["description", "reasoningEffort"],
"type": "object"
}
},
properties: {
"data": {
"items": { "$ref": "#/definitions/Model" },
"type": "array"
},
"nextCursor": {
"description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.",
"type": ["string", "null"]
}
},
required: ["data"],
title: "ModelListResponse",
type: "object"
};
//#endregion
//#region extensions/codex/src/app-server/protocol-generated/json/v2/ThreadResumeResponse.json
var ThreadResumeResponse_default = {
$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"
},
"ActivePermissionProfile": {
"properties": {
"extends": {
"default": null,
"description": "Parent profile identifier from the selected permissions profile's `extends` setting, when present.",
"type": ["string", "null"]
},
"id": {
"description": "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.<id>]` profile.",
"type": "string"
}
},
"required": ["id"],
"type": "object"
},
"AgentPath": { "type": "string" },
"ApprovalsReviewer": {
"description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.",
"enum": [
"user",
"auto_review",
"guardian_subagent"
],
"type": "string"
},
"AskForApproval": { "oneOf": [{
"additionalProperties": false,
"properties": { "granular": {
"properties": {
"mcp_elicitations": { "type": "boolean" },
"request_permissions": {
"default": false,
"type": "boolean"
},
"rules": { "type": "boolean" },
"sandbox_approval": { "type": "boolean" },
"skill_approval": {
"default": false,
"type": "boolean"
}
},
"required": [
"mcp_elicitations",
"rules",
"sandbox_approval"
],
"type": "object"
} },
"required": ["granular"],
"title": "GranularAskForApproval",
"type": "object"
}, {
"enum": [
"untrusted",
"on-failure",
"on-request",
"never"
],
"type": "string"
}] },
"ByteRange": {
"properties": {
"end": {
"format": "uint",
"minimum": 0,
"type": "integer"
},
"start": {
"format": "uint",
"minimum": 0,
"type": "integer"
}
},
"required": ["end", "start"],
"type": "object"
},
"CodexErrorInfo": {
"description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.",
"oneOf": [
{
"additionalProperties": false,
"properties": { "httpConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["httpConnectionFailed"],
"title": "HttpConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Failed to connect to the response SSE stream.",
"properties": { "responseStreamConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamConnectionFailed"],
"title": "ResponseStreamConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "The response SSE stream disconnected in the middle of a turn before completion.",
"properties": { "responseStreamDisconnected": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamDisconnected"],
"title": "ResponseStreamDisconnectedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Reached the retry limit for responses.",
"properties": { "responseTooManyFailedAttempts": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseTooManyFailedAttempts"],
"title": "ResponseTooManyFailedAttemptsCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.",
"properties": { "activeTurnNotSteerable": {
"properties": { "turnKind": { "$ref": "#/definitions/NonSteerableTurnKind" } },
"required": ["turnKind"],
"type": "object"
} },
"required": ["activeTurnNotSteerable"],
"title": "ActiveTurnNotSteerableCodexErrorInfo",
"type": "object"
},
{
"enum": [
"contextWindowExceeded",
"usageLimitExceeded",
"serverOverloaded",
"cyberPolicy",
"internalServerError",
"unauthorized",
"badRequest",
"threadRollbackFailed",
"sandboxError",
"other"
],
"type": "string"
}
]
},
"CollabAgentState": {
"properties": {
"message": { "type": ["string", "null"] },
"status": { "$ref": "#/definitions/CollabAgentStatus" }
},
"required": ["status"],
"type": "object"
},
"CollabAgentStatus": {
"enum": [
"pendingInit",
"running",
"interrupted",
"completed",
"errored",
"shutdown",
"notFound"
],
"type": "string"
},
"CollabAgentTool": {
"enum": [
"spawnAgent",
"sendInput",
"resumeAgent",
"wait",
"closeAgent"
],
"type": "string"
},
"CollabAgentToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"CommandAction": { "oneOf": [
{
"properties": {
"command": { "type": "string" },
"name": { "type": "string" },
"path": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": {
"enum": ["read"],
"title": "ReadCommandActionType",
"type": "string"
}
},
"required": [
"command",
"name",
"path",
"type"
],
"title": "ReadCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"path": { "type": ["string", "null"] },
"type": {
"enum": ["listFiles"],
"title": "ListFilesCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "ListFilesCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"path": { "type": ["string", "null"] },
"query": { "type": ["string", "null"] },
"type": {
"enum": ["search"],
"title": "SearchCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "SearchCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"type": {
"enum": ["unknown"],
"title": "UnknownCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "UnknownCommandAction",
"type": "object"
}
] },
"CommandExecutionSource": {
"enum": [
"agent",
"userShell",
"unifiedExecStartup",
"unifiedExecInteraction"
],
"type": "string"
},
"CommandExecutionStatus": {
"enum": [
"inProgress",
"completed",
"failed",
"declined"
],
"type": "string"
},
"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"
}] },
"DynamicToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"FileUpdateChange": {
"properties": {
"diff": { "type": "string" },
"kind": { "$ref": "#/definitions/PatchChangeKind" },
"path": { "type": "string" }
},
"required": [
"diff",
"kind",
"path"
],
"type": "object"
},
"GitInfo": {
"properties": {
"branch": { "type": ["string", "null"] },
"originUrl": { "type": ["string", "null"] },
"sha": { "type": ["string", "null"] }
},
"type": "object"
},
"HookPromptFragment": {
"properties": {
"hookRunId": { "type": "string" },
"text": { "type": "string" }
},
"required": ["hookRunId", "text"],
"type": "object"
},
"ImageDetail": {
"enum": [
"auto",
"low",
"high",
"original"
],
"type": "string"
},
"McpToolCallError": {
"properties": { "message": { "type": "string" } },
"required": ["message"],
"type": "object"
},
"McpToolCallResult": {
"properties": {
"_meta": true,
"content": {
"items": true,
"type": "array"
},
"structuredContent": true
},
"required": ["content"],
"type": "object"
},
"McpToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"MemoryCitation": {
"properties": {
"entries": {
"items": { "$ref": "#/definitions/MemoryCitationEntry" },
"type": "array"
},
"threadIds": {
"items": { "type": "string" },
"type": "array"
}
},
"required": ["entries", "threadIds"],
"type": "object"
},
"MemoryCitationEntry": {
"properties": {
"lineEnd": {
"format": "uint32",
"minimum": 0,
"type": "integer"
},
"lineStart": {
"format": "uint32",
"minimum": 0,
"type": "integer"
},
"note": { "type": "string" },
"path": { "type": "string" }
},
"required": [
"lineEnd",
"lineStart",
"note",
"path"
],
"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"
}]
},
"NetworkAccess": {
"enum": ["restricted", "enabled"],
"type": "string"
},
"NonSteerableTurnKind": {
"enum": ["review", "compact"],
"type": "string"
},
"PatchApplyStatus": {
"enum": [
"inProgress",
"completed",
"failed",
"declined"
],
"type": "string"
},
"PatchChangeKind": { "oneOf": [
{
"properties": { "type": {
"enum": ["add"],
"title": "AddPatchChangeKindType",
"type": "string"
} },
"required": ["type"],
"title": "AddPatchChangeKind",
"type": "object"
},
{
"properties": { "type": {
"enum": ["delete"],
"title": "DeletePatchChangeKindType",
"type": "string"
} },
"required": ["type"],
"title": "DeletePatchChangeKind",
"type": "object"
},
{
"properties": {
"move_path": { "type": ["string", "null"] },
"type": {
"enum": ["update"],
"title": "UpdatePatchChangeKindType",
"type": "string"
}
},
"required": ["type"],
"title": "UpdatePatchChangeKind",
"type": "object"
}
] },
"ReasoningEffort": {
"description": "A non-empty reasoning effort value advertised by the model.",
"minLength": 1,
"type": "string"
},
"SandboxPolicy": { "oneOf": [
{
"properties": { "type": {
"enum": ["dangerFullAccess"],
"title": "DangerFullAccessSandboxPolicyType",
"type": "string"
} },
"required": ["type"],
"title": "DangerFullAccessSandboxPolicy",
"type": "object"
},
{
"properties": {
"networkAccess": {
"default": false,
"type": "boolean"
},
"type": {
"enum": ["readOnly"],
"title": "ReadOnlySandboxPolicyType",
"type": "string"
}
},
"required": ["type"],
"title": "ReadOnlySandboxPolicy",
"type": "object"
},
{
"properties": {
"networkAccess": {
"allOf": [{ "$ref": "#/definitions/NetworkAccess" }],
"default": "restricted"
},
"type": {
"enum": ["externalSandbox"],
"title": "ExternalSandboxSandboxPolicyType",
"type": "string"
}
},
"required": ["type"],
"title": "ExternalSandboxSandboxPolicy",
"type": "object"
},
{
"properties": {
"excludeSlashTmp": {
"default": false,
"type": "boolean"
},
"excludeTmpdirEnvVar": {
"default": false,
"type": "boolean"
},
"networkAccess": {
"default": false,
"type": "boolean"
},
"type": {
"enum": ["workspaceWrite"],
"title": "WorkspaceWriteSandboxPolicyType",
"type": "string"
},
"writableRoots": {
"default": [],
"items": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": "array"
}
},
"required": ["type"],
"title": "WorkspaceWriteSandboxPolicy",
"type": "object"
}
] },
"SessionSource": { "oneOf": [
{
"additionalProperties": false,
"properties": { "custom": { "type": "string" } },
"required": ["custom"],
"title": "CustomSessionSource",
"type": "object"
},
{
"additionalProperties": false,
"properties": { "subAgent": { "$ref": "#/definitions/SubAgentSource" } },
"required": ["subAgent"],
"title": "SubAgentSessionSource",
"type": "object"
},
{
"enum": [
"cli",
"vscode",
"exec",
"appServer",
"unknown"
],
"type": "string"
}
] },
"SubAgentSource": { "oneOf": [
{
"additionalProperties": false,
"properties": { "thread_spawn": {
"properties": {
"agent_nickname": {
"default": null,
"type": ["string", "null"]
},
"agent_path": {
"anyOf": [{ "$ref": "#/definitions/AgentPath" }, { "type": "null" }],
"default": 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"
},
{
"enum": [
"review",
"compact",
"memory_consolidation"
],
"type": "string"
}
] },
"TextElement": {
"properties": {
"byteRange": {
"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": ["byteRange"],
"type": "object"
},
"Thread": {
"properties": {
"agentNickname": {
"description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.",
"type": ["string", "null"]
},
"agentRole": {
"description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.",
"type": ["string", "null"]
},
"cliVersion": {
"description": "Version of the CLI that created the thread.",
"type": "string"
},
"createdAt": {
"description": "Unix timestamp (in seconds) when the thread was created.",
"format": "int64",
"type": "integer"
},
"cwd": {
"allOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }],
"description": "Working directory captured for the thread."
},
"ephemeral": {
"description": "Whether the thread is ephemeral and should not be materialized on disk.",
"type": "boolean"
},
"forkedFromId": {
"description": "Source thread id when this thread was created by forking another thread.",
"type": ["string", "null"]
},
"gitInfo": {
"anyOf": [{ "$ref": "#/definitions/GitInfo" }, { "type": "null" }],
"description": "Optional Git metadata captured when the thread was created."
},
"id": { "type": "string" },
"modelProvider": {
"description": "Model provider used for this thread (for example, 'openai').",
"type": "string"
},
"name": {
"description": "Optional user-facing thread title.",
"type": ["string", "null"]
},
"parentThreadId": {
"description": "The ID of the parent thread. This will only be set if this thread is a subagent.",
"type": ["string", "null"]
},
"path": {
"description": "[UNSTABLE] Path to the thread on disk.",
"type": ["string", "null"]
},
"preview": {
"description": "Usually the first user message in the thread, if available.",
"type": "string"
},
"sessionId": {
"description": "Session id shared by threads that belong to the same session tree.",
"type": "string"
},
"source": {
"allOf": [{ "$ref": "#/definitions/SessionSource" }],
"description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)."
},
"status": {
"allOf": [{ "$ref": "#/definitions/ThreadStatus" }],
"description": "Current runtime status for the thread."
},
"threadSource": {
"anyOf": [{ "$ref": "#/definitions/ThreadSource" }, { "type": "null" }],
"description": "Optional analytics source classification for this thread."
},
"turns": {
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
"items": { "$ref": "#/definitions/Turn" },
"type": "array"
},
"updatedAt": {
"description": "Unix timestamp (in seconds) when the thread was last updated.",
"format": "int64",
"type": "integer"
}
},
"required": [
"cliVersion",
"createdAt",
"cwd",
"ephemeral",
"id",
"modelProvider",
"preview",
"sessionId",
"source",
"status",
"turns",
"updatedAt"
],
"type": "object"
},
"ThreadActiveFlag": {
"enum": ["waitingOnApproval", "waitingOnUserInput"],
"type": "string"
},
"ThreadId": { "type": "string" },
"ThreadItem": { "oneOf": [
{
"properties": {
"clientId": { "type": ["string", "null"] },
"content": {
"items": { "$ref": "#/definitions/UserInput" },
"type": "array"
},
"id": { "type": "string" },
"type": {
"enum": ["userMessage"],
"title": "UserMessageThreadItemType",
"type": "string"
}
},
"required": [
"content",
"id",
"type"
],
"title": "UserMessageThreadItem",
"type": "object"
},
{
"properties": {
"fragments": {
"items": { "$ref": "#/definitions/HookPromptFragment" },
"type": "array"
},
"id": { "type": "string" },
"type": {
"enum": ["hookPrompt"],
"title": "HookPromptThreadItemType",
"type": "string"
}
},
"required": [
"fragments",
"id",
"type"
],
"title": "HookPromptThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"memoryCitation": {
"anyOf": [{ "$ref": "#/definitions/MemoryCitation" }, { "type": "null" }],
"default": null
},
"phase": {
"anyOf": [{ "$ref": "#/definitions/MessagePhase" }, { "type": "null" }],
"default": null
},
"text": { "type": "string" },
"type": {
"enum": ["agentMessage"],
"title": "AgentMessageThreadItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "AgentMessageThreadItem",
"type": "object"
},
{
"description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.",
"properties": {
"id": { "type": "string" },
"text": { "type": "string" },
"type": {
"enum": ["plan"],
"title": "PlanThreadItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanThreadItem",
"type": "object"
},
{
"properties": {
"content": {
"default": [],
"items": { "type": "string" },
"type": "array"
},
"id": { "type": "string" },
"summary": {
"default": [],
"items": { "type": "string" },
"type": "array"
},
"type": {
"enum": ["reasoning"],
"title": "ReasoningThreadItemType",
"type": "string"
}
},
"required": ["id", "type"],
"title": "ReasoningThreadItem",
"type": "object"
},
{
"properties": {
"aggregatedOutput": {
"description": "The command's output, aggregated from stdout and stderr.",
"type": ["string", "null"]
},
"command": {
"description": "The command to be executed.",
"type": "string"
},
"commandActions": {
"description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.",
"items": { "$ref": "#/definitions/CommandAction" },
"type": "array"
},
"cwd": {
"allOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }],
"description": "The command's working directory."
},
"durationMs": {
"description": "The duration of the command execution in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"exitCode": {
"description": "The command's exit code.",
"format": "int32",
"type": ["integer", "null"]
},
"id": { "type": "string" },
"processId": {
"description": "Identifier for the underlying PTY process (when available).",
"type": ["string", "null"]
},
"source": {
"allOf": [{ "$ref": "#/definitions/CommandExecutionSource" }],
"default": "agent"
},
"status": { "$ref": "#/definitions/CommandExecutionStatus" },
"type": {
"enum": ["commandExecution"],
"title": "CommandExecutionThreadItemType",
"type": "string"
}
},
"required": [
"command",
"commandActions",
"cwd",
"id",
"status",
"type"
],
"title": "CommandExecutionThreadItem",
"type": "object"
},
{
"properties": {
"changes": {
"items": { "$ref": "#/definitions/FileUpdateChange" },
"type": "array"
},
"id": { "type": "string" },
"status": { "$ref": "#/definitions/PatchApplyStatus" },
"type": {
"enum": ["fileChange"],
"title": "FileChangeThreadItemType",
"type": "string"
}
},
"required": [
"changes",
"id",
"status",
"type"
],
"title": "FileChangeThreadItem",
"type": "object"
},
{
"properties": {
"arguments": true,
"durationMs": {
"description": "The duration of the MCP tool call in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"error": { "anyOf": [{ "$ref": "#/definitions/McpToolCallError" }, { "type": "null" }] },
"id": { "type": "string" },
"mcpAppResourceUri": { "type": ["string", "null"] },
"pluginId": { "type": ["string", "null"] },
"result": { "anyOf": [{ "$ref": "#/definitions/McpToolCallResult" }, { "type": "null" }] },
"server": { "type": "string" },
"status": { "$ref": "#/definitions/McpToolCallStatus" },
"tool": { "type": "string" },
"type": {
"enum": ["mcpToolCall"],
"title": "McpToolCallThreadItemType",
"type": "string"
}
},
"required": [
"arguments",
"id",
"server",
"status",
"tool",
"type"
],
"title": "McpToolCallThreadItem",
"type": "object"
},
{
"properties": {
"arguments": true,
"contentItems": {
"items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" },
"type": ["array", "null"]
},
"durationMs": {
"description": "The duration of the dynamic tool call in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"id": { "type": "string" },
"namespace": { "type": ["string", "null"] },
"status": { "$ref": "#/definitions/DynamicToolCallStatus" },
"success": { "type": ["boolean", "null"] },
"tool": { "type": "string" },
"type": {
"enum": ["dynamicToolCall"],
"title": "DynamicToolCallThreadItemType",
"type": "string"
}
},
"required": [
"arguments",
"id",
"status",
"tool",
"type"
],
"title": "DynamicToolCallThreadItem",
"type": "object"
},
{
"properties": {
"agentsStates": {
"additionalProperties": { "$ref": "#/definitions/CollabAgentState" },
"description": "Last known status of the target agents, when available.",
"type": "object"
},
"id": {
"description": "Unique identifier for this collab tool call.",
"type": "string"
},
"model": {
"description": "Model requested for the spawned agent, when applicable.",
"type": ["string", "null"]
},
"prompt": {
"description": "Prompt text sent as part of the collab tool call, when available.",
"type": ["string", "null"]
},
"reasoningEffort": {
"anyOf": [{ "$ref": "#/definitions/ReasoningEffort" }, { "type": "null" }],
"description": "Reasoning effort requested for the spawned agent, when applicable."
},
"receiverThreadIds": {
"description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.",
"items": { "type": "string" },
"type": "array"
},
"senderThreadId": {
"description": "Thread ID of the agent issuing the collab request.",
"type": "string"
},
"status": {
"allOf": [{ "$ref": "#/definitions/CollabAgentToolCallStatus" }],
"description": "Current status of the collab tool call."
},
"tool": {
"allOf": [{ "$ref": "#/definitions/CollabAgentTool" }],
"description": "Name of the collab tool that was invoked."
},
"type": {
"enum": ["collabAgentToolCall"],
"title": "CollabAgentToolCallThreadItemType",
"type": "string"
}
},
"required": [
"agentsStates",
"id",
"receiverThreadIds",
"senderThreadId",
"status",
"tool",
"type"
],
"title": "CollabAgentToolCallThreadItem",
"type": "object"
},
{
"properties": {
"action": { "anyOf": [{ "$ref": "#/definitions/WebSearchAction" }, { "type": "null" }] },
"id": { "type": "string" },
"query": { "type": "string" },
"type": {
"enum": ["webSearch"],
"title": "WebSearchThreadItemType",
"type": "string"
}
},
"required": [
"id",
"query",
"type"
],
"title": "WebSearchThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"path": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": {
"enum": ["imageView"],
"title": "ImageViewThreadItemType",
"type": "string"
}
},
"required": [
"id",
"path",
"type"
],
"title": "ImageViewThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"result": { "type": "string" },
"revisedPrompt": { "type": ["string", "null"] },
"savedPath": { "anyOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }, { "type": "null" }] },
"status": { "type": "string" },
"type": {
"enum": ["imageGeneration"],
"title": "ImageGenerationThreadItemType",
"type": "string"
}
},
"required": [
"id",
"result",
"status",
"type"
],
"title": "ImageGenerationThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"review": { "type": "string" },
"type": {
"enum": ["enteredReviewMode"],
"title": "EnteredReviewModeThreadItemType",
"type": "string"
}
},
"required": [
"id",
"review",
"type"
],
"title": "EnteredReviewModeThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"review": { "type": "string" },
"type": {
"enum": ["exitedReviewMode"],
"title": "ExitedReviewModeThreadItemType",
"type": "string"
}
},
"required": [
"id",
"review",
"type"
],
"title": "ExitedReviewModeThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"type": {
"enum": ["contextCompaction"],
"title": "ContextCompactionThreadItemType",
"type": "string"
}
},
"required": ["id", "type"],
"title": "ContextCompactionThreadItem",
"type": "object"
}
] },
"ThreadSource": {
"enum": [
"user",
"subagent",
"memory_consolidation"
],
"type": "string"
},
"ThreadStatus": { "oneOf": [
{
"properties": { "type": {
"enum": ["notLoaded"],
"title": "NotLoadedThreadStatusType",
"type": "string"
} },
"required": ["type"],
"title": "NotLoadedThreadStatus",
"type": "object"
},
{
"properties": { "type": {
"enum": ["idle"],
"title": "IdleThreadStatusType",
"type": "string"
} },
"required": ["type"],
"title": "IdleThreadStatus",
"type": "object"
},
{
"properties": { "type": {
"enum": ["systemError"],
"title": "SystemErrorThreadStatusType",
"type": "string"
} },
"required": ["type"],
"title": "SystemErrorThreadStatus",
"type": "object"
},
{
"properties": {
"activeFlags": {
"items": { "$ref": "#/definitions/ThreadActiveFlag" },
"type": "array"
},
"type": {
"enum": ["active"],
"title": "ActiveThreadStatusType",
"type": "string"
}
},
"required": ["activeFlags", "type"],
"title": "ActiveThreadStatus",
"type": "object"
}
] },
"Turn": {
"properties": {
"completedAt": {
"description": "Unix timestamp (in seconds) when the turn completed.",
"format": "int64",
"type": ["integer", "null"]
},
"durationMs": {
"description": "Duration between turn start and completion in milliseconds, if known.",
"format": "int64",
"type": ["integer", "null"]
},
"error": {
"anyOf": [{ "$ref": "#/definitions/TurnError" }, { "type": "null" }],
"description": "Only populated when the Turn's status is failed."
},
"id": { "type": "string" },
"items": {
"description": "Thread items currently included in this turn payload.",
"items": { "$ref": "#/definitions/ThreadItem" },
"type": "array"
},
"itemsView": {
"allOf": [{ "$ref": "#/definitions/TurnItemsView" }],
"default": "full",
"description": "Describes how much of `items` has been loaded for this turn."
},
"startedAt": {
"description": "Unix timestamp (in seconds) when the turn started.",
"format": "int64",
"type": ["integer", "null"]
},
"status": { "$ref": "#/definitions/TurnStatus" }
},
"required": [
"id",
"items",
"status"
],
"type": "object"
},
"TurnError": {
"properties": {
"additionalDetails": {
"default": null,
"type": ["string", "null"]
},
"codexErrorInfo": { "anyOf": [{ "$ref": "#/definitions/CodexErrorInfo" }, { "type": "null" }] },
"message": { "type": "string" }
},
"required": ["message"],
"type": "object"
},
"TurnItemsView": { "oneOf": [
{
"description": "`items` was not loaded for this turn. The field is intentionally empty.",
"enum": ["notLoaded"],
"type": "string"
},
{
"description": "`items` contains only a display summary for this turn.",
"enum": ["summary"],
"type": "string"
},
{
"description": "`items` contains every ThreadItem available from persisted app-server history for this turn.",
"enum": ["full"],
"type": "string"
}
] },
"TurnStatus": {
"enum": [
"completed",
"interrupted",
"failed",
"inProgress"
],
"type": "string"
},
"TurnsPage": {
"properties": {
"backwardsCursor": { "type": ["string", "null"] },
"data": {
"items": { "$ref": "#/definitions/Turn" },
"type": "array"
},
"nextCursor": { "type": ["string", "null"] }
},
"required": ["data"],
"type": "object"
},
"UserInput": { "oneOf": [
{
"properties": {
"text": { "type": "string" },
"text_elements": {
"default": [],
"description": "UI-defined spans within `text` used to render or persist special elements.",
"items": { "$ref": "#/definitions/TextElement" },
"type": "array"
},
"type": {
"enum": ["text"],
"title": "TextUserInputType",
"type": "string"
}
},
"required": ["text", "type"],
"title": "TextUserInput",
"type": "object"
},
{
"properties": {
"detail": {
"anyOf": [{ "$ref": "#/definitions/ImageDetail" }, { "type": "null" }],
"default": null
},
"type": {
"enum": ["image"],
"title": "ImageUserInputType",
"type": "string"
},
"url": { "type": "string" }
},
"required": ["type", "url"],
"title": "ImageUserInput",
"type": "object"
},
{
"properties": {
"detail": {
"anyOf": [{ "$ref": "#/definitions/ImageDetail" }, { "type": "null" }],
"default": null
},
"path": { "type": "string" },
"type": {
"enum": ["localImage"],
"title": "LocalImageUserInputType",
"type": "string"
}
},
"required": ["path", "type"],
"title": "LocalImageUserInput",
"type": "object"
},
{
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"type": {
"enum": ["skill"],
"title": "SkillUserInputType",
"type": "string"
}
},
"required": [
"name",
"path",
"type"
],
"title": "SkillUserInput",
"type": "object"
},
{
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"type": {
"enum": ["mention"],
"title": "MentionUserInputType",
"type": "string"
}
},
"required": [
"name",
"path",
"type"
],
"title": "MentionUserInput",
"type": "object"
}
] },
"WebSearchAction": { "oneOf": [
{
"properties": {
"queries": {
"items": { "type": "string" },
"type": ["array", "null"]
},
"query": { "type": ["string", "null"] },
"type": {
"enum": ["search"],
"title": "SearchWebSearchActionType",
"type": "string"
}
},
"required": ["type"],
"title": "SearchWebSearchAction",
"type": "object"
},
{
"properties": {
"type": {
"enum": ["openPage"],
"title": "OpenPageWebSearchActionType",
"type": "string"
},
"url": { "type": ["string", "null"] }
},
"required": ["type"],
"title": "OpenPageWebSearchAction",
"type": "object"
},
{
"properties": {
"pattern": { "type": ["string", "null"] },
"type": {
"enum": ["findInPage"],
"title": "FindInPageWebSearchActionType",
"type": "string"
},
"url": { "type": ["string", "null"] }
},
"required": ["type"],
"title": "FindInPageWebSearchAction",
"type": "object"
},
{
"properties": { "type": {
"enum": ["other"],
"title": "OtherWebSearchActionType",
"type": "string"
} },
"required": ["type"],
"title": "OtherWebSearchAction",
"type": "object"
}
] }
},
properties: {
"activePermissionProfile": {
"anyOf": [{ "$ref": "#/definitions/ActivePermissionProfile" }, { "type": "null" }],
"default": null,
"description": "Named or implicit built-in profile that produced the active permissions, when known."
},
"approvalPolicy": { "$ref": "#/definitions/AskForApproval" },
"approvalsReviewer": {
"allOf": [{ "$ref": "#/definitions/ApprovalsReviewer" }],
"description": "Reviewer currently used for approval requests on this thread."
},
"cwd": { "$ref": "#/definitions/AbsolutePathBuf" },
"initialTurnsPage": {
"anyOf": [{ "$ref": "#/definitions/TurnsPage" }, { "type": "null" }],
"default": null,
"description": "`thread/turns/list` page returned when requested by `initialTurnsPage`."
},
"instructionSources": {
"default": [],
"description": "Instruction source files currently loaded for this thread.",
"items": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": "array"
},
"model": { "type": "string" },
"modelProvider": { "type": "string" },
"reasoningEffort": { "anyOf": [{ "$ref": "#/definitions/ReasoningEffort" }, { "type": "null" }] },
"runtimeWorkspaceRoots": {
"default": [],
"description": "Thread-scoped runtime workspace roots used to materialize `:workspace_roots`.",
"items": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": "array"
},
"sandbox": {
"allOf": [{ "$ref": "#/definitions/SandboxPolicy" }],
"description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance."
},
"serviceTier": { "type": ["string", "null"] },
"thread": { "$ref": "#/definitions/Thread" }
},
required: [
"approvalPolicy",
"approvalsReviewer",
"cwd",
"model",
"modelProvider",
"sandbox",
"thread"
],
title: "ThreadResumeResponse",
type: "object"
};
//#endregion
//#region extensions/codex/src/app-server/protocol-generated/json/v2/ThreadStartResponse.json
var ThreadStartResponse_default = {
$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"
},
"ActivePermissionProfile": {
"properties": {
"extends": {
"default": null,
"description": "Parent profile identifier from the selected permissions profile's `extends` setting, when present.",
"type": ["string", "null"]
},
"id": {
"description": "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.<id>]` profile.",
"type": "string"
}
},
"required": ["id"],
"type": "object"
},
"AgentPath": { "type": "string" },
"ApprovalsReviewer": {
"description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.",
"enum": [
"user",
"auto_review",
"guardian_subagent"
],
"type": "string"
},
"AskForApproval": { "oneOf": [{
"additionalProperties": false,
"properties": { "granular": {
"properties": {
"mcp_elicitations": { "type": "boolean" },
"request_permissions": {
"default": false,
"type": "boolean"
},
"rules": { "type": "boolean" },
"sandbox_approval": { "type": "boolean" },
"skill_approval": {
"default": false,
"type": "boolean"
}
},
"required": [
"mcp_elicitations",
"rules",
"sandbox_approval"
],
"type": "object"
} },
"required": ["granular"],
"title": "GranularAskForApproval",
"type": "object"
}, {
"enum": [
"untrusted",
"on-failure",
"on-request",
"never"
],
"type": "string"
}] },
"ByteRange": {
"properties": {
"end": {
"format": "uint",
"minimum": 0,
"type": "integer"
},
"start": {
"format": "uint",
"minimum": 0,
"type": "integer"
}
},
"required": ["end", "start"],
"type": "object"
},
"CodexErrorInfo": {
"description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.",
"oneOf": [
{
"additionalProperties": false,
"properties": { "httpConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["httpConnectionFailed"],
"title": "HttpConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Failed to connect to the response SSE stream.",
"properties": { "responseStreamConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamConnectionFailed"],
"title": "ResponseStreamConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "The response SSE stream disconnected in the middle of a turn before completion.",
"properties": { "responseStreamDisconnected": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamDisconnected"],
"title": "ResponseStreamDisconnectedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Reached the retry limit for responses.",
"properties": { "responseTooManyFailedAttempts": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseTooManyFailedAttempts"],
"title": "ResponseTooManyFailedAttemptsCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.",
"properties": { "activeTurnNotSteerable": {
"properties": { "turnKind": { "$ref": "#/definitions/NonSteerableTurnKind" } },
"required": ["turnKind"],
"type": "object"
} },
"required": ["activeTurnNotSteerable"],
"title": "ActiveTurnNotSteerableCodexErrorInfo",
"type": "object"
},
{
"enum": [
"contextWindowExceeded",
"usageLimitExceeded",
"serverOverloaded",
"cyberPolicy",
"internalServerError",
"unauthorized",
"badRequest",
"threadRollbackFailed",
"sandboxError",
"other"
],
"type": "string"
}
]
},
"CollabAgentState": {
"properties": {
"message": { "type": ["string", "null"] },
"status": { "$ref": "#/definitions/CollabAgentStatus" }
},
"required": ["status"],
"type": "object"
},
"CollabAgentStatus": {
"enum": [
"pendingInit",
"running",
"interrupted",
"completed",
"errored",
"shutdown",
"notFound"
],
"type": "string"
},
"CollabAgentTool": {
"enum": [
"spawnAgent",
"sendInput",
"resumeAgent",
"wait",
"closeAgent"
],
"type": "string"
},
"CollabAgentToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"CommandAction": { "oneOf": [
{
"properties": {
"command": { "type": "string" },
"name": { "type": "string" },
"path": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": {
"enum": ["read"],
"title": "ReadCommandActionType",
"type": "string"
}
},
"required": [
"command",
"name",
"path",
"type"
],
"title": "ReadCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"path": { "type": ["string", "null"] },
"type": {
"enum": ["listFiles"],
"title": "ListFilesCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "ListFilesCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"path": { "type": ["string", "null"] },
"query": { "type": ["string", "null"] },
"type": {
"enum": ["search"],
"title": "SearchCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "SearchCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"type": {
"enum": ["unknown"],
"title": "UnknownCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "UnknownCommandAction",
"type": "object"
}
] },
"CommandExecutionSource": {
"enum": [
"agent",
"userShell",
"unifiedExecStartup",
"unifiedExecInteraction"
],
"type": "string"
},
"CommandExecutionStatus": {
"enum": [
"inProgress",
"completed",
"failed",
"declined"
],
"type": "string"
},
"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"
}] },
"DynamicToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"FileUpdateChange": {
"properties": {
"diff": { "type": "string" },
"kind": { "$ref": "#/definitions/PatchChangeKind" },
"path": { "type": "string" }
},
"required": [
"diff",
"kind",
"path"
],
"type": "object"
},
"GitInfo": {
"properties": {
"branch": { "type": ["string", "null"] },
"originUrl": { "type": ["string", "null"] },
"sha": { "type": ["string", "null"] }
},
"type": "object"
},
"HookPromptFragment": {
"properties": {
"hookRunId": { "type": "string" },
"text": { "type": "string" }
},
"required": ["hookRunId", "text"],
"type": "object"
},
"ImageDetail": {
"enum": [
"auto",
"low",
"high",
"original"
],
"type": "string"
},
"McpToolCallError": {
"properties": { "message": { "type": "string" } },
"required": ["message"],
"type": "object"
},
"McpToolCallResult": {
"properties": {
"_meta": true,
"content": {
"items": true,
"type": "array"
},
"structuredContent": true
},
"required": ["content"],
"type": "object"
},
"McpToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"MemoryCitation": {
"properties": {
"entries": {
"items": { "$ref": "#/definitions/MemoryCitationEntry" },
"type": "array"
},
"threadIds": {
"items": { "type": "string" },
"type": "array"
}
},
"required": ["entries", "threadIds"],
"type": "object"
},
"MemoryCitationEntry": {
"properties": {
"lineEnd": {
"format": "uint32",
"minimum": 0,
"type": "integer"
},
"lineStart": {
"format": "uint32",
"minimum": 0,
"type": "integer"
},
"note": { "type": "string" },
"path": { "type": "string" }
},
"required": [
"lineEnd",
"lineStart",
"note",
"path"
],
"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"
}]
},
"NetworkAccess": {
"enum": ["restricted", "enabled"],
"type": "string"
},
"NonSteerableTurnKind": {
"enum": ["review", "compact"],
"type": "string"
},
"PatchApplyStatus": {
"enum": [
"inProgress",
"completed",
"failed",
"declined"
],
"type": "string"
},
"PatchChangeKind": { "oneOf": [
{
"properties": { "type": {
"enum": ["add"],
"title": "AddPatchChangeKindType",
"type": "string"
} },
"required": ["type"],
"title": "AddPatchChangeKind",
"type": "object"
},
{
"properties": { "type": {
"enum": ["delete"],
"title": "DeletePatchChangeKindType",
"type": "string"
} },
"required": ["type"],
"title": "DeletePatchChangeKind",
"type": "object"
},
{
"properties": {
"move_path": { "type": ["string", "null"] },
"type": {
"enum": ["update"],
"title": "UpdatePatchChangeKindType",
"type": "string"
}
},
"required": ["type"],
"title": "UpdatePatchChangeKind",
"type": "object"
}
] },
"ReasoningEffort": {
"description": "A non-empty reasoning effort value advertised by the model.",
"minLength": 1,
"type": "string"
},
"SandboxPolicy": { "oneOf": [
{
"properties": { "type": {
"enum": ["dangerFullAccess"],
"title": "DangerFullAccessSandboxPolicyType",
"type": "string"
} },
"required": ["type"],
"title": "DangerFullAccessSandboxPolicy",
"type": "object"
},
{
"properties": {
"networkAccess": {
"default": false,
"type": "boolean"
},
"type": {
"enum": ["readOnly"],
"title": "ReadOnlySandboxPolicyType",
"type": "string"
}
},
"required": ["type"],
"title": "ReadOnlySandboxPolicy",
"type": "object"
},
{
"properties": {
"networkAccess": {
"allOf": [{ "$ref": "#/definitions/NetworkAccess" }],
"default": "restricted"
},
"type": {
"enum": ["externalSandbox"],
"title": "ExternalSandboxSandboxPolicyType",
"type": "string"
}
},
"required": ["type"],
"title": "ExternalSandboxSandboxPolicy",
"type": "object"
},
{
"properties": {
"excludeSlashTmp": {
"default": false,
"type": "boolean"
},
"excludeTmpdirEnvVar": {
"default": false,
"type": "boolean"
},
"networkAccess": {
"default": false,
"type": "boolean"
},
"type": {
"enum": ["workspaceWrite"],
"title": "WorkspaceWriteSandboxPolicyType",
"type": "string"
},
"writableRoots": {
"default": [],
"items": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": "array"
}
},
"required": ["type"],
"title": "WorkspaceWriteSandboxPolicy",
"type": "object"
}
] },
"SessionSource": { "oneOf": [
{
"additionalProperties": false,
"properties": { "custom": { "type": "string" } },
"required": ["custom"],
"title": "CustomSessionSource",
"type": "object"
},
{
"additionalProperties": false,
"properties": { "subAgent": { "$ref": "#/definitions/SubAgentSource" } },
"required": ["subAgent"],
"title": "SubAgentSessionSource",
"type": "object"
},
{
"enum": [
"cli",
"vscode",
"exec",
"appServer",
"unknown"
],
"type": "string"
}
] },
"SubAgentSource": { "oneOf": [
{
"additionalProperties": false,
"properties": { "thread_spawn": {
"properties": {
"agent_nickname": {
"default": null,
"type": ["string", "null"]
},
"agent_path": {
"anyOf": [{ "$ref": "#/definitions/AgentPath" }, { "type": "null" }],
"default": 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"
},
{
"enum": [
"review",
"compact",
"memory_consolidation"
],
"type": "string"
}
] },
"TextElement": {
"properties": {
"byteRange": {
"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": ["byteRange"],
"type": "object"
},
"Thread": {
"properties": {
"agentNickname": {
"description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.",
"type": ["string", "null"]
},
"agentRole": {
"description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.",
"type": ["string", "null"]
},
"cliVersion": {
"description": "Version of the CLI that created the thread.",
"type": "string"
},
"createdAt": {
"description": "Unix timestamp (in seconds) when the thread was created.",
"format": "int64",
"type": "integer"
},
"cwd": {
"allOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }],
"description": "Working directory captured for the thread."
},
"ephemeral": {
"description": "Whether the thread is ephemeral and should not be materialized on disk.",
"type": "boolean"
},
"forkedFromId": {
"description": "Source thread id when this thread was created by forking another thread.",
"type": ["string", "null"]
},
"gitInfo": {
"anyOf": [{ "$ref": "#/definitions/GitInfo" }, { "type": "null" }],
"description": "Optional Git metadata captured when the thread was created."
},
"id": { "type": "string" },
"modelProvider": {
"description": "Model provider used for this thread (for example, 'openai').",
"type": "string"
},
"name": {
"description": "Optional user-facing thread title.",
"type": ["string", "null"]
},
"parentThreadId": {
"description": "The ID of the parent thread. This will only be set if this thread is a subagent.",
"type": ["string", "null"]
},
"path": {
"description": "[UNSTABLE] Path to the thread on disk.",
"type": ["string", "null"]
},
"preview": {
"description": "Usually the first user message in the thread, if available.",
"type": "string"
},
"sessionId": {
"description": "Session id shared by threads that belong to the same session tree.",
"type": "string"
},
"source": {
"allOf": [{ "$ref": "#/definitions/SessionSource" }],
"description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.)."
},
"status": {
"allOf": [{ "$ref": "#/definitions/ThreadStatus" }],
"description": "Current runtime status for the thread."
},
"threadSource": {
"anyOf": [{ "$ref": "#/definitions/ThreadSource" }, { "type": "null" }],
"description": "Optional analytics source classification for this thread."
},
"turns": {
"description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.",
"items": { "$ref": "#/definitions/Turn" },
"type": "array"
},
"updatedAt": {
"description": "Unix timestamp (in seconds) when the thread was last updated.",
"format": "int64",
"type": "integer"
}
},
"required": [
"cliVersion",
"createdAt",
"cwd",
"ephemeral",
"id",
"modelProvider",
"preview",
"sessionId",
"source",
"status",
"turns",
"updatedAt"
],
"type": "object"
},
"ThreadActiveFlag": {
"enum": ["waitingOnApproval", "waitingOnUserInput"],
"type": "string"
},
"ThreadId": { "type": "string" },
"ThreadItem": { "oneOf": [
{
"properties": {
"clientId": { "type": ["string", "null"] },
"content": {
"items": { "$ref": "#/definitions/UserInput" },
"type": "array"
},
"id": { "type": "string" },
"type": {
"enum": ["userMessage"],
"title": "UserMessageThreadItemType",
"type": "string"
}
},
"required": [
"content",
"id",
"type"
],
"title": "UserMessageThreadItem",
"type": "object"
},
{
"properties": {
"fragments": {
"items": { "$ref": "#/definitions/HookPromptFragment" },
"type": "array"
},
"id": { "type": "string" },
"type": {
"enum": ["hookPrompt"],
"title": "HookPromptThreadItemType",
"type": "string"
}
},
"required": [
"fragments",
"id",
"type"
],
"title": "HookPromptThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"memoryCitation": {
"anyOf": [{ "$ref": "#/definitions/MemoryCitation" }, { "type": "null" }],
"default": null
},
"phase": {
"anyOf": [{ "$ref": "#/definitions/MessagePhase" }, { "type": "null" }],
"default": null
},
"text": { "type": "string" },
"type": {
"enum": ["agentMessage"],
"title": "AgentMessageThreadItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "AgentMessageThreadItem",
"type": "object"
},
{
"description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.",
"properties": {
"id": { "type": "string" },
"text": { "type": "string" },
"type": {
"enum": ["plan"],
"title": "PlanThreadItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanThreadItem",
"type": "object"
},
{
"properties": {
"content": {
"default": [],
"items": { "type": "string" },
"type": "array"
},
"id": { "type": "string" },
"summary": {
"default": [],
"items": { "type": "string" },
"type": "array"
},
"type": {
"enum": ["reasoning"],
"title": "ReasoningThreadItemType",
"type": "string"
}
},
"required": ["id", "type"],
"title": "ReasoningThreadItem",
"type": "object"
},
{
"properties": {
"aggregatedOutput": {
"description": "The command's output, aggregated from stdout and stderr.",
"type": ["string", "null"]
},
"command": {
"description": "The command to be executed.",
"type": "string"
},
"commandActions": {
"description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.",
"items": { "$ref": "#/definitions/CommandAction" },
"type": "array"
},
"cwd": {
"allOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }],
"description": "The command's working directory."
},
"durationMs": {
"description": "The duration of the command execution in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"exitCode": {
"description": "The command's exit code.",
"format": "int32",
"type": ["integer", "null"]
},
"id": { "type": "string" },
"processId": {
"description": "Identifier for the underlying PTY process (when available).",
"type": ["string", "null"]
},
"source": {
"allOf": [{ "$ref": "#/definitions/CommandExecutionSource" }],
"default": "agent"
},
"status": { "$ref": "#/definitions/CommandExecutionStatus" },
"type": {
"enum": ["commandExecution"],
"title": "CommandExecutionThreadItemType",
"type": "string"
}
},
"required": [
"command",
"commandActions",
"cwd",
"id",
"status",
"type"
],
"title": "CommandExecutionThreadItem",
"type": "object"
},
{
"properties": {
"changes": {
"items": { "$ref": "#/definitions/FileUpdateChange" },
"type": "array"
},
"id": { "type": "string" },
"status": { "$ref": "#/definitions/PatchApplyStatus" },
"type": {
"enum": ["fileChange"],
"title": "FileChangeThreadItemType",
"type": "string"
}
},
"required": [
"changes",
"id",
"status",
"type"
],
"title": "FileChangeThreadItem",
"type": "object"
},
{
"properties": {
"arguments": true,
"durationMs": {
"description": "The duration of the MCP tool call in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"error": { "anyOf": [{ "$ref": "#/definitions/McpToolCallError" }, { "type": "null" }] },
"id": { "type": "string" },
"mcpAppResourceUri": { "type": ["string", "null"] },
"pluginId": { "type": ["string", "null"] },
"result": { "anyOf": [{ "$ref": "#/definitions/McpToolCallResult" }, { "type": "null" }] },
"server": { "type": "string" },
"status": { "$ref": "#/definitions/McpToolCallStatus" },
"tool": { "type": "string" },
"type": {
"enum": ["mcpToolCall"],
"title": "McpToolCallThreadItemType",
"type": "string"
}
},
"required": [
"arguments",
"id",
"server",
"status",
"tool",
"type"
],
"title": "McpToolCallThreadItem",
"type": "object"
},
{
"properties": {
"arguments": true,
"contentItems": {
"items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" },
"type": ["array", "null"]
},
"durationMs": {
"description": "The duration of the dynamic tool call in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"id": { "type": "string" },
"namespace": { "type": ["string", "null"] },
"status": { "$ref": "#/definitions/DynamicToolCallStatus" },
"success": { "type": ["boolean", "null"] },
"tool": { "type": "string" },
"type": {
"enum": ["dynamicToolCall"],
"title": "DynamicToolCallThreadItemType",
"type": "string"
}
},
"required": [
"arguments",
"id",
"status",
"tool",
"type"
],
"title": "DynamicToolCallThreadItem",
"type": "object"
},
{
"properties": {
"agentsStates": {
"additionalProperties": { "$ref": "#/definitions/CollabAgentState" },
"description": "Last known status of the target agents, when available.",
"type": "object"
},
"id": {
"description": "Unique identifier for this collab tool call.",
"type": "string"
},
"model": {
"description": "Model requested for the spawned agent, when applicable.",
"type": ["string", "null"]
},
"prompt": {
"description": "Prompt text sent as part of the collab tool call, when available.",
"type": ["string", "null"]
},
"reasoningEffort": {
"anyOf": [{ "$ref": "#/definitions/ReasoningEffort" }, { "type": "null" }],
"description": "Reasoning effort requested for the spawned agent, when applicable."
},
"receiverThreadIds": {
"description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.",
"items": { "type": "string" },
"type": "array"
},
"senderThreadId": {
"description": "Thread ID of the agent issuing the collab request.",
"type": "string"
},
"status": {
"allOf": [{ "$ref": "#/definitions/CollabAgentToolCallStatus" }],
"description": "Current status of the collab tool call."
},
"tool": {
"allOf": [{ "$ref": "#/definitions/CollabAgentTool" }],
"description": "Name of the collab tool that was invoked."
},
"type": {
"enum": ["collabAgentToolCall"],
"title": "CollabAgentToolCallThreadItemType",
"type": "string"
}
},
"required": [
"agentsStates",
"id",
"receiverThreadIds",
"senderThreadId",
"status",
"tool",
"type"
],
"title": "CollabAgentToolCallThreadItem",
"type": "object"
},
{
"properties": {
"action": { "anyOf": [{ "$ref": "#/definitions/WebSearchAction" }, { "type": "null" }] },
"id": { "type": "string" },
"query": { "type": "string" },
"type": {
"enum": ["webSearch"],
"title": "WebSearchThreadItemType",
"type": "string"
}
},
"required": [
"id",
"query",
"type"
],
"title": "WebSearchThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"path": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": {
"enum": ["imageView"],
"title": "ImageViewThreadItemType",
"type": "string"
}
},
"required": [
"id",
"path",
"type"
],
"title": "ImageViewThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"result": { "type": "string" },
"revisedPrompt": { "type": ["string", "null"] },
"savedPath": { "anyOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }, { "type": "null" }] },
"status": { "type": "string" },
"type": {
"enum": ["imageGeneration"],
"title": "ImageGenerationThreadItemType",
"type": "string"
}
},
"required": [
"id",
"result",
"status",
"type"
],
"title": "ImageGenerationThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"review": { "type": "string" },
"type": {
"enum": ["enteredReviewMode"],
"title": "EnteredReviewModeThreadItemType",
"type": "string"
}
},
"required": [
"id",
"review",
"type"
],
"title": "EnteredReviewModeThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"review": { "type": "string" },
"type": {
"enum": ["exitedReviewMode"],
"title": "ExitedReviewModeThreadItemType",
"type": "string"
}
},
"required": [
"id",
"review",
"type"
],
"title": "ExitedReviewModeThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"type": {
"enum": ["contextCompaction"],
"title": "ContextCompactionThreadItemType",
"type": "string"
}
},
"required": ["id", "type"],
"title": "ContextCompactionThreadItem",
"type": "object"
}
] },
"ThreadSource": {
"enum": [
"user",
"subagent",
"memory_consolidation"
],
"type": "string"
},
"ThreadStatus": { "oneOf": [
{
"properties": { "type": {
"enum": ["notLoaded"],
"title": "NotLoadedThreadStatusType",
"type": "string"
} },
"required": ["type"],
"title": "NotLoadedThreadStatus",
"type": "object"
},
{
"properties": { "type": {
"enum": ["idle"],
"title": "IdleThreadStatusType",
"type": "string"
} },
"required": ["type"],
"title": "IdleThreadStatus",
"type": "object"
},
{
"properties": { "type": {
"enum": ["systemError"],
"title": "SystemErrorThreadStatusType",
"type": "string"
} },
"required": ["type"],
"title": "SystemErrorThreadStatus",
"type": "object"
},
{
"properties": {
"activeFlags": {
"items": { "$ref": "#/definitions/ThreadActiveFlag" },
"type": "array"
},
"type": {
"enum": ["active"],
"title": "ActiveThreadStatusType",
"type": "string"
}
},
"required": ["activeFlags", "type"],
"title": "ActiveThreadStatus",
"type": "object"
}
] },
"Turn": {
"properties": {
"completedAt": {
"description": "Unix timestamp (in seconds) when the turn completed.",
"format": "int64",
"type": ["integer", "null"]
},
"durationMs": {
"description": "Duration between turn start and completion in milliseconds, if known.",
"format": "int64",
"type": ["integer", "null"]
},
"error": {
"anyOf": [{ "$ref": "#/definitions/TurnError" }, { "type": "null" }],
"description": "Only populated when the Turn's status is failed."
},
"id": { "type": "string" },
"items": {
"description": "Thread items currently included in this turn payload.",
"items": { "$ref": "#/definitions/ThreadItem" },
"type": "array"
},
"itemsView": {
"allOf": [{ "$ref": "#/definitions/TurnItemsView" }],
"default": "full",
"description": "Describes how much of `items` has been loaded for this turn."
},
"startedAt": {
"description": "Unix timestamp (in seconds) when the turn started.",
"format": "int64",
"type": ["integer", "null"]
},
"status": { "$ref": "#/definitions/TurnStatus" }
},
"required": [
"id",
"items",
"status"
],
"type": "object"
},
"TurnError": {
"properties": {
"additionalDetails": {
"default": null,
"type": ["string", "null"]
},
"codexErrorInfo": { "anyOf": [{ "$ref": "#/definitions/CodexErrorInfo" }, { "type": "null" }] },
"message": { "type": "string" }
},
"required": ["message"],
"type": "object"
},
"TurnItemsView": { "oneOf": [
{
"description": "`items` was not loaded for this turn. The field is intentionally empty.",
"enum": ["notLoaded"],
"type": "string"
},
{
"description": "`items` contains only a display summary for this turn.",
"enum": ["summary"],
"type": "string"
},
{
"description": "`items` contains every ThreadItem available from persisted app-server history for this turn.",
"enum": ["full"],
"type": "string"
}
] },
"TurnStatus": {
"enum": [
"completed",
"interrupted",
"failed",
"inProgress"
],
"type": "string"
},
"UserInput": { "oneOf": [
{
"properties": {
"text": { "type": "string" },
"text_elements": {
"default": [],
"description": "UI-defined spans within `text` used to render or persist special elements.",
"items": { "$ref": "#/definitions/TextElement" },
"type": "array"
},
"type": {
"enum": ["text"],
"title": "TextUserInputType",
"type": "string"
}
},
"required": ["text", "type"],
"title": "TextUserInput",
"type": "object"
},
{
"properties": {
"detail": {
"anyOf": [{ "$ref": "#/definitions/ImageDetail" }, { "type": "null" }],
"default": null
},
"type": {
"enum": ["image"],
"title": "ImageUserInputType",
"type": "string"
},
"url": { "type": "string" }
},
"required": ["type", "url"],
"title": "ImageUserInput",
"type": "object"
},
{
"properties": {
"detail": {
"anyOf": [{ "$ref": "#/definitions/ImageDetail" }, { "type": "null" }],
"default": null
},
"path": { "type": "string" },
"type": {
"enum": ["localImage"],
"title": "LocalImageUserInputType",
"type": "string"
}
},
"required": ["path", "type"],
"title": "LocalImageUserInput",
"type": "object"
},
{
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"type": {
"enum": ["skill"],
"title": "SkillUserInputType",
"type": "string"
}
},
"required": [
"name",
"path",
"type"
],
"title": "SkillUserInput",
"type": "object"
},
{
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"type": {
"enum": ["mention"],
"title": "MentionUserInputType",
"type": "string"
}
},
"required": [
"name",
"path",
"type"
],
"title": "MentionUserInput",
"type": "object"
}
] },
"WebSearchAction": { "oneOf": [
{
"properties": {
"queries": {
"items": { "type": "string" },
"type": ["array", "null"]
},
"query": { "type": ["string", "null"] },
"type": {
"enum": ["search"],
"title": "SearchWebSearchActionType",
"type": "string"
}
},
"required": ["type"],
"title": "SearchWebSearchAction",
"type": "object"
},
{
"properties": {
"type": {
"enum": ["openPage"],
"title": "OpenPageWebSearchActionType",
"type": "string"
},
"url": { "type": ["string", "null"] }
},
"required": ["type"],
"title": "OpenPageWebSearchAction",
"type": "object"
},
{
"properties": {
"pattern": { "type": ["string", "null"] },
"type": {
"enum": ["findInPage"],
"title": "FindInPageWebSearchActionType",
"type": "string"
},
"url": { "type": ["string", "null"] }
},
"required": ["type"],
"title": "FindInPageWebSearchAction",
"type": "object"
},
{
"properties": { "type": {
"enum": ["other"],
"title": "OtherWebSearchActionType",
"type": "string"
} },
"required": ["type"],
"title": "OtherWebSearchAction",
"type": "object"
}
] }
},
properties: {
"activePermissionProfile": {
"anyOf": [{ "$ref": "#/definitions/ActivePermissionProfile" }, { "type": "null" }],
"default": null,
"description": "Named or implicit built-in profile that produced the active permissions, when known."
},
"approvalPolicy": { "$ref": "#/definitions/AskForApproval" },
"approvalsReviewer": {
"allOf": [{ "$ref": "#/definitions/ApprovalsReviewer" }],
"description": "Reviewer currently used for approval requests on this thread."
},
"cwd": { "$ref": "#/definitions/AbsolutePathBuf" },
"instructionSources": {
"default": [],
"description": "Instruction source files currently loaded for this thread.",
"items": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": "array"
},
"model": { "type": "string" },
"modelProvider": { "type": "string" },
"reasoningEffort": { "anyOf": [{ "$ref": "#/definitions/ReasoningEffort" }, { "type": "null" }] },
"runtimeWorkspaceRoots": {
"default": [],
"description": "Thread-scoped runtime workspace roots used to materialize `:workspace_roots`.",
"items": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": "array"
},
"sandbox": {
"allOf": [{ "$ref": "#/definitions/SandboxPolicy" }],
"description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance."
},
"serviceTier": { "type": ["string", "null"] },
"thread": { "$ref": "#/definitions/Thread" }
},
required: [
"approvalPolicy",
"approvalsReviewer",
"cwd",
"model",
"modelProvider",
"sandbox",
"thread"
],
title: "ThreadStartResponse",
type: "object"
};
//#endregion
//#region extensions/codex/src/app-server/protocol-generated/json/v2/TurnCompletedNotification.json
var TurnCompletedNotification_default = {
$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"
},
"ByteRange": {
"properties": {
"end": {
"format": "uint",
"minimum": 0,
"type": "integer"
},
"start": {
"format": "uint",
"minimum": 0,
"type": "integer"
}
},
"required": ["end", "start"],
"type": "object"
},
"CodexErrorInfo": {
"description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.",
"oneOf": [
{
"additionalProperties": false,
"properties": { "httpConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["httpConnectionFailed"],
"title": "HttpConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Failed to connect to the response SSE stream.",
"properties": { "responseStreamConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamConnectionFailed"],
"title": "ResponseStreamConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "The response SSE stream disconnected in the middle of a turn before completion.",
"properties": { "responseStreamDisconnected": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamDisconnected"],
"title": "ResponseStreamDisconnectedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Reached the retry limit for responses.",
"properties": { "responseTooManyFailedAttempts": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseTooManyFailedAttempts"],
"title": "ResponseTooManyFailedAttemptsCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.",
"properties": { "activeTurnNotSteerable": {
"properties": { "turnKind": { "$ref": "#/definitions/NonSteerableTurnKind" } },
"required": ["turnKind"],
"type": "object"
} },
"required": ["activeTurnNotSteerable"],
"title": "ActiveTurnNotSteerableCodexErrorInfo",
"type": "object"
},
{
"enum": [
"contextWindowExceeded",
"usageLimitExceeded",
"serverOverloaded",
"cyberPolicy",
"internalServerError",
"unauthorized",
"badRequest",
"threadRollbackFailed",
"sandboxError",
"other"
],
"type": "string"
}
]
},
"CollabAgentState": {
"properties": {
"message": { "type": ["string", "null"] },
"status": { "$ref": "#/definitions/CollabAgentStatus" }
},
"required": ["status"],
"type": "object"
},
"CollabAgentStatus": {
"enum": [
"pendingInit",
"running",
"interrupted",
"completed",
"errored",
"shutdown",
"notFound"
],
"type": "string"
},
"CollabAgentTool": {
"enum": [
"spawnAgent",
"sendInput",
"resumeAgent",
"wait",
"closeAgent"
],
"type": "string"
},
"CollabAgentToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"CommandAction": { "oneOf": [
{
"properties": {
"command": { "type": "string" },
"name": { "type": "string" },
"path": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": {
"enum": ["read"],
"title": "ReadCommandActionType",
"type": "string"
}
},
"required": [
"command",
"name",
"path",
"type"
],
"title": "ReadCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"path": { "type": ["string", "null"] },
"type": {
"enum": ["listFiles"],
"title": "ListFilesCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "ListFilesCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"path": { "type": ["string", "null"] },
"query": { "type": ["string", "null"] },
"type": {
"enum": ["search"],
"title": "SearchCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "SearchCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"type": {
"enum": ["unknown"],
"title": "UnknownCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "UnknownCommandAction",
"type": "object"
}
] },
"CommandExecutionSource": {
"enum": [
"agent",
"userShell",
"unifiedExecStartup",
"unifiedExecInteraction"
],
"type": "string"
},
"CommandExecutionStatus": {
"enum": [
"inProgress",
"completed",
"failed",
"declined"
],
"type": "string"
},
"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"
}] },
"DynamicToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"FileUpdateChange": {
"properties": {
"diff": { "type": "string" },
"kind": { "$ref": "#/definitions/PatchChangeKind" },
"path": { "type": "string" }
},
"required": [
"diff",
"kind",
"path"
],
"type": "object"
},
"HookPromptFragment": {
"properties": {
"hookRunId": { "type": "string" },
"text": { "type": "string" }
},
"required": ["hookRunId", "text"],
"type": "object"
},
"ImageDetail": {
"enum": [
"auto",
"low",
"high",
"original"
],
"type": "string"
},
"McpToolCallError": {
"properties": { "message": { "type": "string" } },
"required": ["message"],
"type": "object"
},
"McpToolCallResult": {
"properties": {
"_meta": true,
"content": {
"items": true,
"type": "array"
},
"structuredContent": true
},
"required": ["content"],
"type": "object"
},
"McpToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"MemoryCitation": {
"properties": {
"entries": {
"items": { "$ref": "#/definitions/MemoryCitationEntry" },
"type": "array"
},
"threadIds": {
"items": { "type": "string" },
"type": "array"
}
},
"required": ["entries", "threadIds"],
"type": "object"
},
"MemoryCitationEntry": {
"properties": {
"lineEnd": {
"format": "uint32",
"minimum": 0,
"type": "integer"
},
"lineStart": {
"format": "uint32",
"minimum": 0,
"type": "integer"
},
"note": { "type": "string" },
"path": { "type": "string" }
},
"required": [
"lineEnd",
"lineStart",
"note",
"path"
],
"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"
}]
},
"NonSteerableTurnKind": {
"enum": ["review", "compact"],
"type": "string"
},
"PatchApplyStatus": {
"enum": [
"inProgress",
"completed",
"failed",
"declined"
],
"type": "string"
},
"PatchChangeKind": { "oneOf": [
{
"properties": { "type": {
"enum": ["add"],
"title": "AddPatchChangeKindType",
"type": "string"
} },
"required": ["type"],
"title": "AddPatchChangeKind",
"type": "object"
},
{
"properties": { "type": {
"enum": ["delete"],
"title": "DeletePatchChangeKindType",
"type": "string"
} },
"required": ["type"],
"title": "DeletePatchChangeKind",
"type": "object"
},
{
"properties": {
"move_path": { "type": ["string", "null"] },
"type": {
"enum": ["update"],
"title": "UpdatePatchChangeKindType",
"type": "string"
}
},
"required": ["type"],
"title": "UpdatePatchChangeKind",
"type": "object"
}
] },
"ReasoningEffort": {
"description": "A non-empty reasoning effort value advertised by the model.",
"minLength": 1,
"type": "string"
},
"TextElement": {
"properties": {
"byteRange": {
"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": ["byteRange"],
"type": "object"
},
"ThreadItem": { "oneOf": [
{
"properties": {
"clientId": { "type": ["string", "null"] },
"content": {
"items": { "$ref": "#/definitions/UserInput" },
"type": "array"
},
"id": { "type": "string" },
"type": {
"enum": ["userMessage"],
"title": "UserMessageThreadItemType",
"type": "string"
}
},
"required": [
"content",
"id",
"type"
],
"title": "UserMessageThreadItem",
"type": "object"
},
{
"properties": {
"fragments": {
"items": { "$ref": "#/definitions/HookPromptFragment" },
"type": "array"
},
"id": { "type": "string" },
"type": {
"enum": ["hookPrompt"],
"title": "HookPromptThreadItemType",
"type": "string"
}
},
"required": [
"fragments",
"id",
"type"
],
"title": "HookPromptThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"memoryCitation": {
"anyOf": [{ "$ref": "#/definitions/MemoryCitation" }, { "type": "null" }],
"default": null
},
"phase": {
"anyOf": [{ "$ref": "#/definitions/MessagePhase" }, { "type": "null" }],
"default": null
},
"text": { "type": "string" },
"type": {
"enum": ["agentMessage"],
"title": "AgentMessageThreadItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "AgentMessageThreadItem",
"type": "object"
},
{
"description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.",
"properties": {
"id": { "type": "string" },
"text": { "type": "string" },
"type": {
"enum": ["plan"],
"title": "PlanThreadItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanThreadItem",
"type": "object"
},
{
"properties": {
"content": {
"default": [],
"items": { "type": "string" },
"type": "array"
},
"id": { "type": "string" },
"summary": {
"default": [],
"items": { "type": "string" },
"type": "array"
},
"type": {
"enum": ["reasoning"],
"title": "ReasoningThreadItemType",
"type": "string"
}
},
"required": ["id", "type"],
"title": "ReasoningThreadItem",
"type": "object"
},
{
"properties": {
"aggregatedOutput": {
"description": "The command's output, aggregated from stdout and stderr.",
"type": ["string", "null"]
},
"command": {
"description": "The command to be executed.",
"type": "string"
},
"commandActions": {
"description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.",
"items": { "$ref": "#/definitions/CommandAction" },
"type": "array"
},
"cwd": {
"allOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }],
"description": "The command's working directory."
},
"durationMs": {
"description": "The duration of the command execution in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"exitCode": {
"description": "The command's exit code.",
"format": "int32",
"type": ["integer", "null"]
},
"id": { "type": "string" },
"processId": {
"description": "Identifier for the underlying PTY process (when available).",
"type": ["string", "null"]
},
"source": {
"allOf": [{ "$ref": "#/definitions/CommandExecutionSource" }],
"default": "agent"
},
"status": { "$ref": "#/definitions/CommandExecutionStatus" },
"type": {
"enum": ["commandExecution"],
"title": "CommandExecutionThreadItemType",
"type": "string"
}
},
"required": [
"command",
"commandActions",
"cwd",
"id",
"status",
"type"
],
"title": "CommandExecutionThreadItem",
"type": "object"
},
{
"properties": {
"changes": {
"items": { "$ref": "#/definitions/FileUpdateChange" },
"type": "array"
},
"id": { "type": "string" },
"status": { "$ref": "#/definitions/PatchApplyStatus" },
"type": {
"enum": ["fileChange"],
"title": "FileChangeThreadItemType",
"type": "string"
}
},
"required": [
"changes",
"id",
"status",
"type"
],
"title": "FileChangeThreadItem",
"type": "object"
},
{
"properties": {
"arguments": true,
"durationMs": {
"description": "The duration of the MCP tool call in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"error": { "anyOf": [{ "$ref": "#/definitions/McpToolCallError" }, { "type": "null" }] },
"id": { "type": "string" },
"mcpAppResourceUri": { "type": ["string", "null"] },
"pluginId": { "type": ["string", "null"] },
"result": { "anyOf": [{ "$ref": "#/definitions/McpToolCallResult" }, { "type": "null" }] },
"server": { "type": "string" },
"status": { "$ref": "#/definitions/McpToolCallStatus" },
"tool": { "type": "string" },
"type": {
"enum": ["mcpToolCall"],
"title": "McpToolCallThreadItemType",
"type": "string"
}
},
"required": [
"arguments",
"id",
"server",
"status",
"tool",
"type"
],
"title": "McpToolCallThreadItem",
"type": "object"
},
{
"properties": {
"arguments": true,
"contentItems": {
"items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" },
"type": ["array", "null"]
},
"durationMs": {
"description": "The duration of the dynamic tool call in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"id": { "type": "string" },
"namespace": { "type": ["string", "null"] },
"status": { "$ref": "#/definitions/DynamicToolCallStatus" },
"success": { "type": ["boolean", "null"] },
"tool": { "type": "string" },
"type": {
"enum": ["dynamicToolCall"],
"title": "DynamicToolCallThreadItemType",
"type": "string"
}
},
"required": [
"arguments",
"id",
"status",
"tool",
"type"
],
"title": "DynamicToolCallThreadItem",
"type": "object"
},
{
"properties": {
"agentsStates": {
"additionalProperties": { "$ref": "#/definitions/CollabAgentState" },
"description": "Last known status of the target agents, when available.",
"type": "object"
},
"id": {
"description": "Unique identifier for this collab tool call.",
"type": "string"
},
"model": {
"description": "Model requested for the spawned agent, when applicable.",
"type": ["string", "null"]
},
"prompt": {
"description": "Prompt text sent as part of the collab tool call, when available.",
"type": ["string", "null"]
},
"reasoningEffort": {
"anyOf": [{ "$ref": "#/definitions/ReasoningEffort" }, { "type": "null" }],
"description": "Reasoning effort requested for the spawned agent, when applicable."
},
"receiverThreadIds": {
"description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.",
"items": { "type": "string" },
"type": "array"
},
"senderThreadId": {
"description": "Thread ID of the agent issuing the collab request.",
"type": "string"
},
"status": {
"allOf": [{ "$ref": "#/definitions/CollabAgentToolCallStatus" }],
"description": "Current status of the collab tool call."
},
"tool": {
"allOf": [{ "$ref": "#/definitions/CollabAgentTool" }],
"description": "Name of the collab tool that was invoked."
},
"type": {
"enum": ["collabAgentToolCall"],
"title": "CollabAgentToolCallThreadItemType",
"type": "string"
}
},
"required": [
"agentsStates",
"id",
"receiverThreadIds",
"senderThreadId",
"status",
"tool",
"type"
],
"title": "CollabAgentToolCallThreadItem",
"type": "object"
},
{
"properties": {
"action": { "anyOf": [{ "$ref": "#/definitions/WebSearchAction" }, { "type": "null" }] },
"id": { "type": "string" },
"query": { "type": "string" },
"type": {
"enum": ["webSearch"],
"title": "WebSearchThreadItemType",
"type": "string"
}
},
"required": [
"id",
"query",
"type"
],
"title": "WebSearchThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"path": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": {
"enum": ["imageView"],
"title": "ImageViewThreadItemType",
"type": "string"
}
},
"required": [
"id",
"path",
"type"
],
"title": "ImageViewThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"result": { "type": "string" },
"revisedPrompt": { "type": ["string", "null"] },
"savedPath": { "anyOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }, { "type": "null" }] },
"status": { "type": "string" },
"type": {
"enum": ["imageGeneration"],
"title": "ImageGenerationThreadItemType",
"type": "string"
}
},
"required": [
"id",
"result",
"status",
"type"
],
"title": "ImageGenerationThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"review": { "type": "string" },
"type": {
"enum": ["enteredReviewMode"],
"title": "EnteredReviewModeThreadItemType",
"type": "string"
}
},
"required": [
"id",
"review",
"type"
],
"title": "EnteredReviewModeThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"review": { "type": "string" },
"type": {
"enum": ["exitedReviewMode"],
"title": "ExitedReviewModeThreadItemType",
"type": "string"
}
},
"required": [
"id",
"review",
"type"
],
"title": "ExitedReviewModeThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"type": {
"enum": ["contextCompaction"],
"title": "ContextCompactionThreadItemType",
"type": "string"
}
},
"required": ["id", "type"],
"title": "ContextCompactionThreadItem",
"type": "object"
}
] },
"Turn": {
"properties": {
"completedAt": {
"description": "Unix timestamp (in seconds) when the turn completed.",
"format": "int64",
"type": ["integer", "null"]
},
"durationMs": {
"description": "Duration between turn start and completion in milliseconds, if known.",
"format": "int64",
"type": ["integer", "null"]
},
"error": {
"anyOf": [{ "$ref": "#/definitions/TurnError" }, { "type": "null" }],
"description": "Only populated when the Turn's status is failed."
},
"id": { "type": "string" },
"items": {
"description": "Thread items currently included in this turn payload.",
"items": { "$ref": "#/definitions/ThreadItem" },
"type": "array"
},
"itemsView": {
"allOf": [{ "$ref": "#/definitions/TurnItemsView" }],
"default": "full",
"description": "Describes how much of `items` has been loaded for this turn."
},
"startedAt": {
"description": "Unix timestamp (in seconds) when the turn started.",
"format": "int64",
"type": ["integer", "null"]
},
"status": { "$ref": "#/definitions/TurnStatus" }
},
"required": [
"id",
"items",
"status"
],
"type": "object"
},
"TurnError": {
"properties": {
"additionalDetails": {
"default": null,
"type": ["string", "null"]
},
"codexErrorInfo": { "anyOf": [{ "$ref": "#/definitions/CodexErrorInfo" }, { "type": "null" }] },
"message": { "type": "string" }
},
"required": ["message"],
"type": "object"
},
"TurnItemsView": { "oneOf": [
{
"description": "`items` was not loaded for this turn. The field is intentionally empty.",
"enum": ["notLoaded"],
"type": "string"
},
{
"description": "`items` contains only a display summary for this turn.",
"enum": ["summary"],
"type": "string"
},
{
"description": "`items` contains every ThreadItem available from persisted app-server history for this turn.",
"enum": ["full"],
"type": "string"
}
] },
"TurnStatus": {
"enum": [
"completed",
"interrupted",
"failed",
"inProgress"
],
"type": "string"
},
"UserInput": { "oneOf": [
{
"properties": {
"text": { "type": "string" },
"text_elements": {
"default": [],
"description": "UI-defined spans within `text` used to render or persist special elements.",
"items": { "$ref": "#/definitions/TextElement" },
"type": "array"
},
"type": {
"enum": ["text"],
"title": "TextUserInputType",
"type": "string"
}
},
"required": ["text", "type"],
"title": "TextUserInput",
"type": "object"
},
{
"properties": {
"detail": {
"anyOf": [{ "$ref": "#/definitions/ImageDetail" }, { "type": "null" }],
"default": null
},
"type": {
"enum": ["image"],
"title": "ImageUserInputType",
"type": "string"
},
"url": { "type": "string" }
},
"required": ["type", "url"],
"title": "ImageUserInput",
"type": "object"
},
{
"properties": {
"detail": {
"anyOf": [{ "$ref": "#/definitions/ImageDetail" }, { "type": "null" }],
"default": null
},
"path": { "type": "string" },
"type": {
"enum": ["localImage"],
"title": "LocalImageUserInputType",
"type": "string"
}
},
"required": ["path", "type"],
"title": "LocalImageUserInput",
"type": "object"
},
{
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"type": {
"enum": ["skill"],
"title": "SkillUserInputType",
"type": "string"
}
},
"required": [
"name",
"path",
"type"
],
"title": "SkillUserInput",
"type": "object"
},
{
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"type": {
"enum": ["mention"],
"title": "MentionUserInputType",
"type": "string"
}
},
"required": [
"name",
"path",
"type"
],
"title": "MentionUserInput",
"type": "object"
}
] },
"WebSearchAction": { "oneOf": [
{
"properties": {
"queries": {
"items": { "type": "string" },
"type": ["array", "null"]
},
"query": { "type": ["string", "null"] },
"type": {
"enum": ["search"],
"title": "SearchWebSearchActionType",
"type": "string"
}
},
"required": ["type"],
"title": "SearchWebSearchAction",
"type": "object"
},
{
"properties": {
"type": {
"enum": ["openPage"],
"title": "OpenPageWebSearchActionType",
"type": "string"
},
"url": { "type": ["string", "null"] }
},
"required": ["type"],
"title": "OpenPageWebSearchAction",
"type": "object"
},
{
"properties": {
"pattern": { "type": ["string", "null"] },
"type": {
"enum": ["findInPage"],
"title": "FindInPageWebSearchActionType",
"type": "string"
},
"url": { "type": ["string", "null"] }
},
"required": ["type"],
"title": "FindInPageWebSearchAction",
"type": "object"
},
{
"properties": { "type": {
"enum": ["other"],
"title": "OtherWebSearchActionType",
"type": "string"
} },
"required": ["type"],
"title": "OtherWebSearchAction",
"type": "object"
}
] }
},
properties: {
"threadId": { "type": "string" },
"turn": { "$ref": "#/definitions/Turn" }
},
required: ["threadId", "turn"],
title: "TurnCompletedNotification",
type: "object"
};
//#endregion
//#region extensions/codex/src/app-server/protocol-generated/json/v2/TurnStartResponse.json
var TurnStartResponse_default = {
$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"
},
"ByteRange": {
"properties": {
"end": {
"format": "uint",
"minimum": 0,
"type": "integer"
},
"start": {
"format": "uint",
"minimum": 0,
"type": "integer"
}
},
"required": ["end", "start"],
"type": "object"
},
"CodexErrorInfo": {
"description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.",
"oneOf": [
{
"additionalProperties": false,
"properties": { "httpConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["httpConnectionFailed"],
"title": "HttpConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Failed to connect to the response SSE stream.",
"properties": { "responseStreamConnectionFailed": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamConnectionFailed"],
"title": "ResponseStreamConnectionFailedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "The response SSE stream disconnected in the middle of a turn before completion.",
"properties": { "responseStreamDisconnected": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseStreamDisconnected"],
"title": "ResponseStreamDisconnectedCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Reached the retry limit for responses.",
"properties": { "responseTooManyFailedAttempts": {
"properties": { "httpStatusCode": {
"format": "uint16",
"minimum": 0,
"type": ["integer", "null"]
} },
"type": "object"
} },
"required": ["responseTooManyFailedAttempts"],
"title": "ResponseTooManyFailedAttemptsCodexErrorInfo",
"type": "object"
},
{
"additionalProperties": false,
"description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.",
"properties": { "activeTurnNotSteerable": {
"properties": { "turnKind": { "$ref": "#/definitions/NonSteerableTurnKind" } },
"required": ["turnKind"],
"type": "object"
} },
"required": ["activeTurnNotSteerable"],
"title": "ActiveTurnNotSteerableCodexErrorInfo",
"type": "object"
},
{
"enum": [
"contextWindowExceeded",
"usageLimitExceeded",
"serverOverloaded",
"cyberPolicy",
"internalServerError",
"unauthorized",
"badRequest",
"threadRollbackFailed",
"sandboxError",
"other"
],
"type": "string"
}
]
},
"CollabAgentState": {
"properties": {
"message": { "type": ["string", "null"] },
"status": { "$ref": "#/definitions/CollabAgentStatus" }
},
"required": ["status"],
"type": "object"
},
"CollabAgentStatus": {
"enum": [
"pendingInit",
"running",
"interrupted",
"completed",
"errored",
"shutdown",
"notFound"
],
"type": "string"
},
"CollabAgentTool": {
"enum": [
"spawnAgent",
"sendInput",
"resumeAgent",
"wait",
"closeAgent"
],
"type": "string"
},
"CollabAgentToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"CommandAction": { "oneOf": [
{
"properties": {
"command": { "type": "string" },
"name": { "type": "string" },
"path": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": {
"enum": ["read"],
"title": "ReadCommandActionType",
"type": "string"
}
},
"required": [
"command",
"name",
"path",
"type"
],
"title": "ReadCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"path": { "type": ["string", "null"] },
"type": {
"enum": ["listFiles"],
"title": "ListFilesCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "ListFilesCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"path": { "type": ["string", "null"] },
"query": { "type": ["string", "null"] },
"type": {
"enum": ["search"],
"title": "SearchCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "SearchCommandAction",
"type": "object"
},
{
"properties": {
"command": { "type": "string" },
"type": {
"enum": ["unknown"],
"title": "UnknownCommandActionType",
"type": "string"
}
},
"required": ["command", "type"],
"title": "UnknownCommandAction",
"type": "object"
}
] },
"CommandExecutionSource": {
"enum": [
"agent",
"userShell",
"unifiedExecStartup",
"unifiedExecInteraction"
],
"type": "string"
},
"CommandExecutionStatus": {
"enum": [
"inProgress",
"completed",
"failed",
"declined"
],
"type": "string"
},
"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"
}] },
"DynamicToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"FileUpdateChange": {
"properties": {
"diff": { "type": "string" },
"kind": { "$ref": "#/definitions/PatchChangeKind" },
"path": { "type": "string" }
},
"required": [
"diff",
"kind",
"path"
],
"type": "object"
},
"HookPromptFragment": {
"properties": {
"hookRunId": { "type": "string" },
"text": { "type": "string" }
},
"required": ["hookRunId", "text"],
"type": "object"
},
"ImageDetail": {
"enum": [
"auto",
"low",
"high",
"original"
],
"type": "string"
},
"McpToolCallError": {
"properties": { "message": { "type": "string" } },
"required": ["message"],
"type": "object"
},
"McpToolCallResult": {
"properties": {
"_meta": true,
"content": {
"items": true,
"type": "array"
},
"structuredContent": true
},
"required": ["content"],
"type": "object"
},
"McpToolCallStatus": {
"enum": [
"inProgress",
"completed",
"failed"
],
"type": "string"
},
"MemoryCitation": {
"properties": {
"entries": {
"items": { "$ref": "#/definitions/MemoryCitationEntry" },
"type": "array"
},
"threadIds": {
"items": { "type": "string" },
"type": "array"
}
},
"required": ["entries", "threadIds"],
"type": "object"
},
"MemoryCitationEntry": {
"properties": {
"lineEnd": {
"format": "uint32",
"minimum": 0,
"type": "integer"
},
"lineStart": {
"format": "uint32",
"minimum": 0,
"type": "integer"
},
"note": { "type": "string" },
"path": { "type": "string" }
},
"required": [
"lineEnd",
"lineStart",
"note",
"path"
],
"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"
}]
},
"NonSteerableTurnKind": {
"enum": ["review", "compact"],
"type": "string"
},
"PatchApplyStatus": {
"enum": [
"inProgress",
"completed",
"failed",
"declined"
],
"type": "string"
},
"PatchChangeKind": { "oneOf": [
{
"properties": { "type": {
"enum": ["add"],
"title": "AddPatchChangeKindType",
"type": "string"
} },
"required": ["type"],
"title": "AddPatchChangeKind",
"type": "object"
},
{
"properties": { "type": {
"enum": ["delete"],
"title": "DeletePatchChangeKindType",
"type": "string"
} },
"required": ["type"],
"title": "DeletePatchChangeKind",
"type": "object"
},
{
"properties": {
"move_path": { "type": ["string", "null"] },
"type": {
"enum": ["update"],
"title": "UpdatePatchChangeKindType",
"type": "string"
}
},
"required": ["type"],
"title": "UpdatePatchChangeKind",
"type": "object"
}
] },
"ReasoningEffort": {
"description": "A non-empty reasoning effort value advertised by the model.",
"minLength": 1,
"type": "string"
},
"TextElement": {
"properties": {
"byteRange": {
"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": ["byteRange"],
"type": "object"
},
"ThreadItem": { "oneOf": [
{
"properties": {
"clientId": { "type": ["string", "null"] },
"content": {
"items": { "$ref": "#/definitions/UserInput" },
"type": "array"
},
"id": { "type": "string" },
"type": {
"enum": ["userMessage"],
"title": "UserMessageThreadItemType",
"type": "string"
}
},
"required": [
"content",
"id",
"type"
],
"title": "UserMessageThreadItem",
"type": "object"
},
{
"properties": {
"fragments": {
"items": { "$ref": "#/definitions/HookPromptFragment" },
"type": "array"
},
"id": { "type": "string" },
"type": {
"enum": ["hookPrompt"],
"title": "HookPromptThreadItemType",
"type": "string"
}
},
"required": [
"fragments",
"id",
"type"
],
"title": "HookPromptThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"memoryCitation": {
"anyOf": [{ "$ref": "#/definitions/MemoryCitation" }, { "type": "null" }],
"default": null
},
"phase": {
"anyOf": [{ "$ref": "#/definitions/MessagePhase" }, { "type": "null" }],
"default": null
},
"text": { "type": "string" },
"type": {
"enum": ["agentMessage"],
"title": "AgentMessageThreadItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "AgentMessageThreadItem",
"type": "object"
},
{
"description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.",
"properties": {
"id": { "type": "string" },
"text": { "type": "string" },
"type": {
"enum": ["plan"],
"title": "PlanThreadItemType",
"type": "string"
}
},
"required": [
"id",
"text",
"type"
],
"title": "PlanThreadItem",
"type": "object"
},
{
"properties": {
"content": {
"default": [],
"items": { "type": "string" },
"type": "array"
},
"id": { "type": "string" },
"summary": {
"default": [],
"items": { "type": "string" },
"type": "array"
},
"type": {
"enum": ["reasoning"],
"title": "ReasoningThreadItemType",
"type": "string"
}
},
"required": ["id", "type"],
"title": "ReasoningThreadItem",
"type": "object"
},
{
"properties": {
"aggregatedOutput": {
"description": "The command's output, aggregated from stdout and stderr.",
"type": ["string", "null"]
},
"command": {
"description": "The command to be executed.",
"type": "string"
},
"commandActions": {
"description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.",
"items": { "$ref": "#/definitions/CommandAction" },
"type": "array"
},
"cwd": {
"allOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }],
"description": "The command's working directory."
},
"durationMs": {
"description": "The duration of the command execution in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"exitCode": {
"description": "The command's exit code.",
"format": "int32",
"type": ["integer", "null"]
},
"id": { "type": "string" },
"processId": {
"description": "Identifier for the underlying PTY process (when available).",
"type": ["string", "null"]
},
"source": {
"allOf": [{ "$ref": "#/definitions/CommandExecutionSource" }],
"default": "agent"
},
"status": { "$ref": "#/definitions/CommandExecutionStatus" },
"type": {
"enum": ["commandExecution"],
"title": "CommandExecutionThreadItemType",
"type": "string"
}
},
"required": [
"command",
"commandActions",
"cwd",
"id",
"status",
"type"
],
"title": "CommandExecutionThreadItem",
"type": "object"
},
{
"properties": {
"changes": {
"items": { "$ref": "#/definitions/FileUpdateChange" },
"type": "array"
},
"id": { "type": "string" },
"status": { "$ref": "#/definitions/PatchApplyStatus" },
"type": {
"enum": ["fileChange"],
"title": "FileChangeThreadItemType",
"type": "string"
}
},
"required": [
"changes",
"id",
"status",
"type"
],
"title": "FileChangeThreadItem",
"type": "object"
},
{
"properties": {
"arguments": true,
"durationMs": {
"description": "The duration of the MCP tool call in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"error": { "anyOf": [{ "$ref": "#/definitions/McpToolCallError" }, { "type": "null" }] },
"id": { "type": "string" },
"mcpAppResourceUri": { "type": ["string", "null"] },
"pluginId": { "type": ["string", "null"] },
"result": { "anyOf": [{ "$ref": "#/definitions/McpToolCallResult" }, { "type": "null" }] },
"server": { "type": "string" },
"status": { "$ref": "#/definitions/McpToolCallStatus" },
"tool": { "type": "string" },
"type": {
"enum": ["mcpToolCall"],
"title": "McpToolCallThreadItemType",
"type": "string"
}
},
"required": [
"arguments",
"id",
"server",
"status",
"tool",
"type"
],
"title": "McpToolCallThreadItem",
"type": "object"
},
{
"properties": {
"arguments": true,
"contentItems": {
"items": { "$ref": "#/definitions/DynamicToolCallOutputContentItem" },
"type": ["array", "null"]
},
"durationMs": {
"description": "The duration of the dynamic tool call in milliseconds.",
"format": "int64",
"type": ["integer", "null"]
},
"id": { "type": "string" },
"namespace": { "type": ["string", "null"] },
"status": { "$ref": "#/definitions/DynamicToolCallStatus" },
"success": { "type": ["boolean", "null"] },
"tool": { "type": "string" },
"type": {
"enum": ["dynamicToolCall"],
"title": "DynamicToolCallThreadItemType",
"type": "string"
}
},
"required": [
"arguments",
"id",
"status",
"tool",
"type"
],
"title": "DynamicToolCallThreadItem",
"type": "object"
},
{
"properties": {
"agentsStates": {
"additionalProperties": { "$ref": "#/definitions/CollabAgentState" },
"description": "Last known status of the target agents, when available.",
"type": "object"
},
"id": {
"description": "Unique identifier for this collab tool call.",
"type": "string"
},
"model": {
"description": "Model requested for the spawned agent, when applicable.",
"type": ["string", "null"]
},
"prompt": {
"description": "Prompt text sent as part of the collab tool call, when available.",
"type": ["string", "null"]
},
"reasoningEffort": {
"anyOf": [{ "$ref": "#/definitions/ReasoningEffort" }, { "type": "null" }],
"description": "Reasoning effort requested for the spawned agent, when applicable."
},
"receiverThreadIds": {
"description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.",
"items": { "type": "string" },
"type": "array"
},
"senderThreadId": {
"description": "Thread ID of the agent issuing the collab request.",
"type": "string"
},
"status": {
"allOf": [{ "$ref": "#/definitions/CollabAgentToolCallStatus" }],
"description": "Current status of the collab tool call."
},
"tool": {
"allOf": [{ "$ref": "#/definitions/CollabAgentTool" }],
"description": "Name of the collab tool that was invoked."
},
"type": {
"enum": ["collabAgentToolCall"],
"title": "CollabAgentToolCallThreadItemType",
"type": "string"
}
},
"required": [
"agentsStates",
"id",
"receiverThreadIds",
"senderThreadId",
"status",
"tool",
"type"
],
"title": "CollabAgentToolCallThreadItem",
"type": "object"
},
{
"properties": {
"action": { "anyOf": [{ "$ref": "#/definitions/WebSearchAction" }, { "type": "null" }] },
"id": { "type": "string" },
"query": { "type": "string" },
"type": {
"enum": ["webSearch"],
"title": "WebSearchThreadItemType",
"type": "string"
}
},
"required": [
"id",
"query",
"type"
],
"title": "WebSearchThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"path": { "$ref": "#/definitions/AbsolutePathBuf" },
"type": {
"enum": ["imageView"],
"title": "ImageViewThreadItemType",
"type": "string"
}
},
"required": [
"id",
"path",
"type"
],
"title": "ImageViewThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"result": { "type": "string" },
"revisedPrompt": { "type": ["string", "null"] },
"savedPath": { "anyOf": [{ "$ref": "#/definitions/AbsolutePathBuf" }, { "type": "null" }] },
"status": { "type": "string" },
"type": {
"enum": ["imageGeneration"],
"title": "ImageGenerationThreadItemType",
"type": "string"
}
},
"required": [
"id",
"result",
"status",
"type"
],
"title": "ImageGenerationThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"review": { "type": "string" },
"type": {
"enum": ["enteredReviewMode"],
"title": "EnteredReviewModeThreadItemType",
"type": "string"
}
},
"required": [
"id",
"review",
"type"
],
"title": "EnteredReviewModeThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"review": { "type": "string" },
"type": {
"enum": ["exitedReviewMode"],
"title": "ExitedReviewModeThreadItemType",
"type": "string"
}
},
"required": [
"id",
"review",
"type"
],
"title": "ExitedReviewModeThreadItem",
"type": "object"
},
{
"properties": {
"id": { "type": "string" },
"type": {
"enum": ["contextCompaction"],
"title": "ContextCompactionThreadItemType",
"type": "string"
}
},
"required": ["id", "type"],
"title": "ContextCompactionThreadItem",
"type": "object"
}
] },
"Turn": {
"properties": {
"completedAt": {
"description": "Unix timestamp (in seconds) when the turn completed.",
"format": "int64",
"type": ["integer", "null"]
},
"durationMs": {
"description": "Duration between turn start and completion in milliseconds, if known.",
"format": "int64",
"type": ["integer", "null"]
},
"error": {
"anyOf": [{ "$ref": "#/definitions/TurnError" }, { "type": "null" }],
"description": "Only populated when the Turn's status is failed."
},
"id": { "type": "string" },
"items": {
"description": "Thread items currently included in this turn payload.",
"items": { "$ref": "#/definitions/ThreadItem" },
"type": "array"
},
"itemsView": {
"allOf": [{ "$ref": "#/definitions/TurnItemsView" }],
"default": "full",
"description": "Describes how much of `items` has been loaded for this turn."
},
"startedAt": {
"description": "Unix timestamp (in seconds) when the turn started.",
"format": "int64",
"type": ["integer", "null"]
},
"status": { "$ref": "#/definitions/TurnStatus" }
},
"required": [
"id",
"items",
"status"
],
"type": "object"
},
"TurnError": {
"properties": {
"additionalDetails": {
"default": null,
"type": ["string", "null"]
},
"codexErrorInfo": { "anyOf": [{ "$ref": "#/definitions/CodexErrorInfo" }, { "type": "null" }] },
"message": { "type": "string" }
},
"required": ["message"],
"type": "object"
},
"TurnItemsView": { "oneOf": [
{
"description": "`items` was not loaded for this turn. The field is intentionally empty.",
"enum": ["notLoaded"],
"type": "string"
},
{
"description": "`items` contains only a display summary for this turn.",
"enum": ["summary"],
"type": "string"
},
{
"description": "`items` contains every ThreadItem available from persisted app-server history for this turn.",
"enum": ["full"],
"type": "string"
}
] },
"TurnStatus": {
"enum": [
"completed",
"interrupted",
"failed",
"inProgress"
],
"type": "string"
},
"UserInput": { "oneOf": [
{
"properties": {
"text": { "type": "string" },
"text_elements": {
"default": [],
"description": "UI-defined spans within `text` used to render or persist special elements.",
"items": { "$ref": "#/definitions/TextElement" },
"type": "array"
},
"type": {
"enum": ["text"],
"title": "TextUserInputType",
"type": "string"
}
},
"required": ["text", "type"],
"title": "TextUserInput",
"type": "object"
},
{
"properties": {
"detail": {
"anyOf": [{ "$ref": "#/definitions/ImageDetail" }, { "type": "null" }],
"default": null
},
"type": {
"enum": ["image"],
"title": "ImageUserInputType",
"type": "string"
},
"url": { "type": "string" }
},
"required": ["type", "url"],
"title": "ImageUserInput",
"type": "object"
},
{
"properties": {
"detail": {
"anyOf": [{ "$ref": "#/definitions/ImageDetail" }, { "type": "null" }],
"default": null
},
"path": { "type": "string" },
"type": {
"enum": ["localImage"],
"title": "LocalImageUserInputType",
"type": "string"
}
},
"required": ["path", "type"],
"title": "LocalImageUserInput",
"type": "object"
},
{
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"type": {
"enum": ["skill"],
"title": "SkillUserInputType",
"type": "string"
}
},
"required": [
"name",
"path",
"type"
],
"title": "SkillUserInput",
"type": "object"
},
{
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"type": {
"enum": ["mention"],
"title": "MentionUserInputType",
"type": "string"
}
},
"required": [
"name",
"path",
"type"
],
"title": "MentionUserInput",
"type": "object"
}
] },
"WebSearchAction": { "oneOf": [
{
"properties": {
"queries": {
"items": { "type": "string" },
"type": ["array", "null"]
},
"query": { "type": ["string", "null"] },
"type": {
"enum": ["search"],
"title": "SearchWebSearchActionType",
"type": "string"
}
},
"required": ["type"],
"title": "SearchWebSearchAction",
"type": "object"
},
{
"properties": {
"type": {
"enum": ["openPage"],
"title": "OpenPageWebSearchActionType",
"type": "string"
},
"url": { "type": ["string", "null"] }
},
"required": ["type"],
"title": "OpenPageWebSearchAction",
"type": "object"
},
{
"properties": {
"pattern": { "type": ["string", "null"] },
"type": {
"enum": ["findInPage"],
"title": "FindInPageWebSearchActionType",
"type": "string"
},
"url": { "type": ["string", "null"] }
},
"required": ["type"],
"title": "FindInPageWebSearchAction",
"type": "object"
},
{
"properties": { "type": {
"enum": ["other"],
"title": "OtherWebSearchActionType",
"type": "string"
} },
"required": ["type"],
"title": "OtherWebSearchAction",
"type": "object"
}
] }
},
properties: { "turn": { "$ref": "#/definitions/Turn" } },
required: ["turn"],
title: "TurnStartResponse",
type: "object"
};
//#endregion
//#region extensions/codex/src/app-server/protocol-validators.ts
/**
* Runtime validators for Codex app-server protocol payloads, including schema
* normalization for generated JSON Schema before TypeBox compilation.
*/
function compileCodexSchema(schema) {
const validator = Compile(normalizeJsonSchemaNode(schema));
return {
check: (value) => validator.Check(value),
errors: (value) => [...validator.Errors(value)]
};
}
function isRecord(value) {
return Boolean(value && typeof value === "object" && !Array.isArray(value));
}
const schemaMapKeywords = new Set([
"$defs",
"definitions",
"dependentSchemas",
"patternProperties",
"properties"
]);
const schemaValueKeywords = new Set([
"additionalItems",
"additionalProperties",
"contains",
"else",
"if",
"items",
"not",
"propertyNames",
"then",
"unevaluatedItems",
"unevaluatedProperties"
]);
const schemaArrayKeywords = new Set([
"allOf",
"anyOf",
"oneOf",
"prefixItems"
]);
function schemaTypeIncludes(schema, type) {
return schema.type === type || Array.isArray(schema.type) && schema.type.includes(type);
}
function normalizeSchemaMap(value) {
if (!isRecord(value)) return value;
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, normalizeJsonSchemaNode(entry)]));
}
function expandJsonSchemaTypeArray(schema) {
const { type, ...rest } = schema;
if (!Array.isArray(type)) return schema;
return { anyOf: type.map((entry) => Object.assign({}, rest, { type: entry })) };
}
function normalizeJsonSchemaNode(schema) {
if (Array.isArray(schema)) return schema.map((entry) => normalizeJsonSchemaNode(entry));
if (!isRecord(schema)) return schema;
const normalizedSchema = expandJsonSchemaTypeArray(schema);
return Object.fromEntries(Object.entries(normalizedSchema).map(([key, value]) => {
if (schemaMapKeywords.has(key)) return [key, normalizeSchemaMap(value)];
if (schemaValueKeywords.has(key) || schemaArrayKeywords.has(key)) return [key, normalizeJsonSchemaNode(value)];
return [key, value];
}));
}
function readDefault(schema) {
if (!isRecord(schema) || !Object.hasOwn(schema, "default")) return;
return structuredClone(schema.default);
}
function decodePointerSegment(segment) {
return segment.replace(/~1/g, "/").replace(/~0/g, "~");
}
function resolveLocalRef(root, ref) {
if (ref === "#") return root;
if (!ref.startsWith("#/")) return;
let current = root;
for (const segment of ref.slice(2).split("/").map(decodePointerSegment)) {
if (!isRecord(current)) return;
current = current[segment];
}
return current;
}
function applySchemaDefaults(schema, value, root = schema, resolvingRefs = /* @__PURE__ */ new Set()) {
if (value === void 0) {
const defaultValue = readDefault(schema);
if (defaultValue !== void 0) return defaultValue;
}
if (!isRecord(schema)) return value;
let nextValue = value;
if (typeof schema.$ref === "string" && !resolvingRefs.has(schema.$ref)) {
const target = resolveLocalRef(root, schema.$ref);
if (target !== void 0) {
resolvingRefs.add(schema.$ref);
nextValue = applySchemaDefaults(target, nextValue, root, resolvingRefs);
resolvingRefs.delete(schema.$ref);
}
}
for (const key of ["allOf"]) {
const branches = schema[key];
if (Array.isArray(branches)) for (const branch of branches) nextValue = applySchemaDefaults(branch, nextValue, root, resolvingRefs);
}
if (schemaTypeIncludes(schema, "object") && isRecord(nextValue) && isRecord(schema.properties)) {
for (const [key, propertySchema] of Object.entries(schema.properties)) {
const currentValue = nextValue[key];
const defaultedValue = applySchemaDefaults(propertySchema, currentValue, root, resolvingRefs);
if (defaultedValue !== void 0 && defaultedValue !== currentValue) nextValue[key] = defaultedValue;
}
if (isRecord(schema.additionalProperties)) for (const key of Object.keys(nextValue)) {
if (Object.hasOwn(schema.properties, key)) continue;
nextValue[key] = applySchemaDefaults(schema.additionalProperties, nextValue[key], root, resolvingRefs);
}
}
if (schemaTypeIncludes(schema, "array") && Array.isArray(nextValue) && isRecord(schema.items)) return nextValue.map((entry) => applySchemaDefaults(schema.items, entry, root, resolvingRefs));
return nextValue;
}
function normalizeWithDefaults(schema, value) {
if (value === void 0 || value === null) return value;
return applySchemaDefaults(schema, structuredClone(value));
}
const validateDynamicToolCallParams = compileCodexSchema(DynamicToolCallParams_default);
const validateErrorNotification = compileCodexSchema(ErrorNotification_default);
const validateModelListResponse = compileCodexSchema(ModelListResponse_default);
const validateThreadResumeResponse = compileCodexSchema(ThreadResumeResponse_default);
const validateThreadStartResponse = compileCodexSchema(ThreadStartResponse_default);
const validateTurnCompletedNotification = compileCodexSchema(TurnCompletedNotification_default);
const validateTurnStartResponse = compileCodexSchema(TurnStartResponse_default);
/** Asserts and normalizes a Codex thread/start response. */
function assertCodexThreadStartResponse(value) {
return assertCodexShape(validateThreadStartResponse, normalizeWithDefaults(ThreadStartResponse_default, normalizeThreadResponse(value)), "thread/start response");
}
/** Asserts and normalizes a Codex thread/fork response. */
function assertCodexThreadForkResponse(value) {
return assertCodexShape(validateThreadStartResponse, normalizeWithDefaults(ThreadStartResponse_default, normalizeThreadResponse(value)), "thread/fork response");
}
/** Asserts and normalizes a Codex thread/resume response. */
function assertCodexThreadResumeResponse(value) {
return assertCodexShape(validateThreadResumeResponse, normalizeWithDefaults(ThreadResumeResponse_default, normalizeThreadResponse(value)), "thread/resume response");
}
/** Asserts and normalizes a Codex turn/start response. */
function assertCodexTurnStartResponse(value) {
return assertCodexShape(validateTurnStartResponse, normalizeWithDefaults(TurnStartResponse_default, normalizeTurnStartResponse(value)), "turn/start response");
}
/** Reads Codex dynamic-tool call params, returning undefined for invalid payloads. */
function readCodexDynamicToolCallParams(value) {
return readCodexShape(validateDynamicToolCallParams, normalizeWithDefaults(DynamicToolCallParams_default, value));
}
/** Reads a Codex error notification payload if it matches the protocol schema. */
function readCodexErrorNotification(value) {
return readCodexShape(validateErrorNotification, normalizeWithDefaults(ErrorNotification_default, value));
}
/** Reads a Codex model/list response if it matches the protocol schema. */
function readCodexModelListResponse(value) {
return readCodexShape(validateModelListResponse, normalizeWithDefaults(ModelListResponse_default, value));
}
/** Reads and normalizes a Codex turn object. */
function readCodexTurn(value) {
return readCodexShape(validateTurnStartResponse, normalizeWithDefaults(TurnStartResponse_default, { turn: normalizeTurn(value) }))?.turn;
}
/** Reads a Codex turn/completed notification payload if it matches the protocol schema. */
function readCodexTurnCompletedNotification(value) {
return readCodexShape(validateTurnCompletedNotification, normalizeWithDefaults(TurnCompletedNotification_default, normalizeTurnCompletedNotification(value)));
}
function assertCodexShape(validate, value, label) {
if (validate.check(value)) return value;
throw new Error(`Invalid Codex app-server ${label}: ${formatValidationErrors(validate, value)}`);
}
function readCodexShape(validate, value) {
return validate.check(value) ? value : void 0;
}
function normalizeTurn(value) {
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
return {
error: null,
startedAt: null,
completedAt: null,
durationMs: null,
...value,
items: Array.isArray(value.items) ? value.items.map(normalizeThreadItem) : []
};
}
function normalizeThreadItem(value) {
if (!value || typeof value !== "object" || Array.isArray(value)) return value;
switch (value.type) {
case "agentMessage": return {
phase: null,
memoryCitation: null,
...value
};
case "plan": return {
text: "",
...value
};
case "reasoning": return {
summary: [],
content: [],
...value
};
case "dynamicToolCall": return {
namespace: null,
arguments: null,
status: "completed",
contentItems: null,
success: null,
durationMs: null,
...value
};
default: return value;
}
}
function normalizeThreadResponse(value) {
if (!value || typeof value !== "object" || Array.isArray(value) || !("thread" in value)) return value;
const thread = value.thread;
if (thread && typeof thread === "object" && !Array.isArray(thread)) {
const t = thread;
if (typeof t.id === "string" && typeof t.sessionId !== "string") return {
...value,
thread: {
...thread,
sessionId: t.id
}
};
if (typeof t.sessionId === "string" && typeof t.id !== "string") return {
...value,
thread: {
...thread,
id: t.sessionId
}
};
}
return value;
}
function normalizeTurnStartResponse(value) {
if (!value || typeof value !== "object" || Array.isArray(value) || !("turn" in value)) return value;
return {
...value,
turn: normalizeTurn(value.turn)
};
}
function normalizeTurnCompletedNotification(value) {
if (!value || typeof value !== "object" || Array.isArray(value) || !("turn" in value)) return value;
return {
...value,
turn: normalizeTurn(value.turn)
};
}
function formatValidationErrors(validate, value) {
const errors = validate.errors(value);
if (!errors || errors.length === 0) return "schema validation failed";
return errors.map((error) => {
const message = error.message?.trim() || "schema validation failed";
return error.instancePath ? `${error.instancePath} ${message}` : message;
}).join("; ");
}
//#endregion
export { readCodexDynamicToolCallParams as a, readCodexTurn as c, assertCodexTurnStartResponse as i, readCodexTurnCompletedNotification as l, assertCodexThreadResumeResponse as n, readCodexErrorNotification as o, assertCodexThreadStartResponse as r, readCodexModelListResponse as s, assertCodexThreadForkResponse as t };