{
  "$ref": "#/definitions/SessionEvent",
  "definitions": {
    "AbortData": {
      "type": "object",
      "properties": {
        "reason": {
          "$ref": "#/definitions/AbortReason",
          "description": "Finite reason code describing why the current turn was aborted"
        }
      },
      "required": [
        "reason"
      ],
      "additionalProperties": false,
      "description": "Turn abort information including the reason for termination",
      "title": "AbortData"
    },
    "AbortEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "abort",
          "description": "Type discriminator. Always \"abort\"."
        },
        "data": {
          "$ref": "#/definitions/AbortData",
          "description": "Turn abort information including the reason for termination"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"abort\". Turn abort information including the reason for termination",
      "title": "AbortEvent"
    },
    "AbortReason": {
      "type": "string",
      "enum": [
        "user_initiated",
        "remote_command",
        "user_abort"
      ],
      "description": "Finite reason code describing why the current turn was aborted",
      "title": "AbortReason",
      "x-enumDescriptions": {
        "user_initiated": "The local user requested the abort, for example by pressing Ctrl+C in the CLI.",
        "remote_command": "A remote command requested the abort.",
        "user_abort": "An MCP server delivered a user.abort notification."
      }
    },
    "AssistantIntentData": {
      "type": "object",
      "properties": {
        "intent": {
          "type": "string",
          "description": "Short description of what the agent is currently doing or planning to do"
        }
      },
      "required": [
        "intent"
      ],
      "additionalProperties": false,
      "description": "Agent intent description for current activity or plan",
      "title": "AssistantIntentData"
    },
    "AssistantIntentEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.intent",
          "description": "Type discriminator. Always \"assistant.intent\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantIntentData",
          "description": "Agent intent description for current activity or plan"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.intent\". Agent intent description for current activity or plan",
      "title": "AssistantIntentEvent"
    },
    "AssistantMessageData": {
      "type": "object",
      "properties": {
        "messageId": {
          "type": "string",
          "description": "Unique identifier for this assistant message"
        },
        "model": {
          "type": "string",
          "description": "Model that produced this assistant message, if known"
        },
        "content": {
          "type": "string",
          "description": "The assistant's text response content"
        },
        "toolRequests": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AssistantMessageToolRequest",
            "description": "A tool invocation request from the assistant"
          },
          "description": "Tool invocations requested by the assistant in this message"
        },
        "reasoningOpaque": {
          "type": "string",
          "description": "Opaque/encrypted extended thinking data from Anthropic models. Session-bound and stripped on resume."
        },
        "reasoningText": {
          "type": "string",
          "description": "Readable reasoning text from the model's extended thinking"
        },
        "encryptedContent": {
          "type": "string",
          "description": "Encrypted reasoning content from OpenAI models. Session-bound and stripped on resume."
        },
        "phase": {
          "type": "string",
          "description": "Generation phase for phased-output models (e.g., thinking vs. response phases)"
        },
        "outputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Actual output token count from the API response (completion_tokens), used for accurate token accounting"
        },
        "interactionId": {
          "type": "string",
          "description": "CAPI interaction ID for correlating this message with upstream telemetry"
        },
        "requestId": {
          "type": "string",
          "description": "GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs"
        },
        "serviceRequestId": {
          "type": "string",
          "description": "Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation"
        },
        "apiCallId": {
          "type": "string",
          "description": "Provider's completion / response identifier; shared across all chunks of a single API call. Used to group multi-chunk assistant utterances."
        },
        "serverTools": {
          "$ref": "#/definitions/AssistantMessageServerTools",
          "description": "Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping"
        },
        "turnId": {
          "type": "string",
          "description": "Identifier for the agent loop turn that produced this message, matching the corresponding assistant.turn_start event"
        },
        "parentToolCallId": {
          "type": "string",
          "description": "Tool call ID of the parent tool invocation when this event originates from a sub-agent",
          "deprecated": true
        }
      },
      "required": [
        "messageId",
        "content"
      ],
      "additionalProperties": false,
      "description": "Assistant response containing text content, optional tool requests, and interaction metadata",
      "title": "AssistantMessageData"
    },
    "AssistantMessageDeltaData": {
      "type": "object",
      "properties": {
        "messageId": {
          "type": "string",
          "description": "Message ID this delta belongs to, matching the corresponding assistant.message event"
        },
        "deltaContent": {
          "type": "string",
          "description": "Incremental text chunk to append to the message content"
        },
        "parentToolCallId": {
          "type": "string",
          "description": "Tool call ID of the parent tool invocation when this event originates from a sub-agent",
          "deprecated": true
        }
      },
      "required": [
        "messageId",
        "deltaContent"
      ],
      "additionalProperties": false,
      "description": "Streaming assistant message delta for incremental response updates",
      "title": "AssistantMessageDeltaData"
    },
    "AssistantMessageDeltaEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.message_delta",
          "description": "Type discriminator. Always \"assistant.message_delta\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantMessageDeltaData",
          "description": "Streaming assistant message delta for incremental response updates"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.message_delta\". Streaming assistant message delta for incremental response updates",
      "title": "AssistantMessageDeltaEvent"
    },
    "AssistantMessageEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.message",
          "description": "Type discriminator. Always \"assistant.message\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantMessageData",
          "description": "Assistant response containing text content, optional tool requests, and interaction metadata"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.message\". Assistant response containing text content, optional tool requests, and interaction metadata",
      "title": "AssistantMessageEvent"
    },
    "AssistantMessageServerTools": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string"
        },
        "items": {
          "type": "array",
          "items": {
            "x-opaque-json": true
          }
        },
        "functionCallNamespaces": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "rawContentBlocks": {
          "type": "array",
          "items": {
            "x-opaque-json": true
          }
        },
        "advisorModel": {
          "type": "string"
        }
      },
      "required": [
        "provider"
      ],
      "additionalProperties": false,
      "description": "Neutral provider-tagged server-side tool-use payload (tool search, advisor) for verbatim round-tripping",
      "title": "AssistantMessageServerTools",
      "stability": "experimental"
    },
    "AssistantMessageStartData": {
      "type": "object",
      "properties": {
        "messageId": {
          "type": "string",
          "description": "Message ID this start event belongs to, matching subsequent deltas and assistant.message"
        },
        "phase": {
          "type": "string",
          "description": "Generation phase this message belongs to for phased-output models"
        }
      },
      "required": [
        "messageId"
      ],
      "additionalProperties": false,
      "description": "Streaming assistant message start metadata",
      "title": "AssistantMessageStartData"
    },
    "AssistantMessageStartEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.message_start",
          "description": "Type discriminator. Always \"assistant.message_start\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantMessageStartData",
          "description": "Streaming assistant message start metadata"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.message_start\". Streaming assistant message start metadata",
      "title": "AssistantMessageStartEvent"
    },
    "AssistantMessageToolRequest": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Unique identifier for this tool call"
        },
        "name": {
          "type": "string",
          "description": "Name of the tool being invoked"
        },
        "arguments": {
          "description": "Arguments to pass to the tool, format depends on the tool",
          "x-opaque-json": true
        },
        "type": {
          "$ref": "#/definitions/AssistantMessageToolRequestType",
          "description": "Tool call type: \"function\" for standard tool calls, \"custom\" for grammar-based tool calls. Defaults to \"function\" when absent."
        },
        "toolTitle": {
          "type": "string",
          "description": "Human-readable display title for the tool"
        },
        "mcpServerName": {
          "type": "string",
          "description": "Name of the MCP server hosting this tool, when the tool is an MCP tool"
        },
        "mcpToolName": {
          "type": "string",
          "description": "Original tool name on the MCP server, when the tool is an MCP tool"
        },
        "intentionSummary": {
          "type": [
            "string",
            "null"
          ],
          "description": "Resolved intention summary describing what this specific call does"
        }
      },
      "required": [
        "toolCallId",
        "name"
      ],
      "additionalProperties": false,
      "description": "A tool invocation request from the assistant",
      "title": "AssistantMessageToolRequest"
    },
    "AssistantMessageToolRequestType": {
      "type": "string",
      "enum": [
        "function",
        "custom"
      ],
      "description": "Tool call type: \"function\" for standard tool calls, \"custom\" for grammar-based tool calls. Defaults to \"function\" when absent.",
      "title": "AssistantMessageToolRequestType",
      "x-enumDescriptions": {
        "function": "Standard function-style tool call.",
        "custom": "Custom grammar-based tool call."
      }
    },
    "AssistantReasoningData": {
      "type": "object",
      "properties": {
        "reasoningId": {
          "type": "string",
          "description": "Unique identifier for this reasoning block"
        },
        "content": {
          "type": "string",
          "description": "The complete extended thinking text from the model"
        }
      },
      "required": [
        "reasoningId",
        "content"
      ],
      "additionalProperties": false,
      "description": "Assistant reasoning content for timeline display with complete thinking text",
      "title": "AssistantReasoningData"
    },
    "AssistantReasoningDeltaData": {
      "type": "object",
      "properties": {
        "reasoningId": {
          "type": "string",
          "description": "Reasoning block ID this delta belongs to, matching the corresponding assistant.reasoning event"
        },
        "deltaContent": {
          "type": "string",
          "description": "Incremental text chunk to append to the reasoning content"
        }
      },
      "required": [
        "reasoningId",
        "deltaContent"
      ],
      "additionalProperties": false,
      "description": "Streaming reasoning delta for incremental extended thinking updates",
      "title": "AssistantReasoningDeltaData"
    },
    "AssistantReasoningDeltaEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.reasoning_delta",
          "description": "Type discriminator. Always \"assistant.reasoning_delta\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantReasoningDeltaData",
          "description": "Streaming reasoning delta for incremental extended thinking updates"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.reasoning_delta\". Streaming reasoning delta for incremental extended thinking updates",
      "title": "AssistantReasoningDeltaEvent"
    },
    "AssistantReasoningEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.reasoning",
          "description": "Type discriminator. Always \"assistant.reasoning\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantReasoningData",
          "description": "Assistant reasoning content for timeline display with complete thinking text"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.reasoning\". Assistant reasoning content for timeline display with complete thinking text",
      "title": "AssistantReasoningEvent"
    },
    "AssistantStreamingDeltaData": {
      "type": "object",
      "properties": {
        "totalResponseSizeBytes": {
          "type": "integer",
          "minimum": 0,
          "description": "Cumulative total bytes received from the streaming response so far"
        }
      },
      "required": [
        "totalResponseSizeBytes"
      ],
      "additionalProperties": false,
      "description": "Streaming response progress with cumulative byte count",
      "title": "AssistantStreamingDeltaData"
    },
    "AssistantStreamingDeltaEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.streaming_delta",
          "description": "Type discriminator. Always \"assistant.streaming_delta\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantStreamingDeltaData",
          "description": "Streaming response progress with cumulative byte count"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.streaming_delta\". Streaming response progress with cumulative byte count",
      "title": "AssistantStreamingDeltaEvent"
    },
    "AssistantTurnEndData": {
      "type": "object",
      "properties": {
        "turnId": {
          "type": "string",
          "description": "Identifier of the turn that has ended, matching the corresponding assistant.turn_start event"
        }
      },
      "required": [
        "turnId"
      ],
      "additionalProperties": false,
      "description": "Turn completion metadata including the turn identifier",
      "title": "AssistantTurnEndData"
    },
    "AssistantTurnEndEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.turn_end",
          "description": "Type discriminator. Always \"assistant.turn_end\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantTurnEndData",
          "description": "Turn completion metadata including the turn identifier"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.turn_end\". Turn completion metadata including the turn identifier",
      "title": "AssistantTurnEndEvent"
    },
    "AssistantTurnStartData": {
      "type": "object",
      "properties": {
        "turnId": {
          "type": "string",
          "description": "Identifier for this turn within the agentic loop, typically a stringified turn number"
        },
        "interactionId": {
          "type": "string",
          "description": "CAPI interaction ID for correlating this turn with upstream telemetry"
        }
      },
      "required": [
        "turnId"
      ],
      "additionalProperties": false,
      "description": "Turn initialization metadata including identifier and interaction tracking",
      "title": "AssistantTurnStartData"
    },
    "AssistantTurnStartEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.turn_start",
          "description": "Type discriminator. Always \"assistant.turn_start\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantTurnStartData",
          "description": "Turn initialization metadata including identifier and interaction tracking"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.turn_start\". Turn initialization metadata including identifier and interaction tracking",
      "title": "AssistantTurnStartEvent"
    },
    "AssistantUsageApiEndpoint": {
      "type": "string",
      "enum": [
        "/chat/completions",
        "/v1/messages",
        "/responses",
        "ws:/responses"
      ],
      "description": "API endpoint used for this model call, matching CAPI supported_endpoints vocabulary",
      "title": "AssistantUsageApiEndpoint",
      "x-enumDescriptions": {
        "/chat/completions": "Chat Completions API endpoint.",
        "/v1/messages": "Anthropic Messages API endpoint.",
        "/responses": "Responses API endpoint.",
        "ws:/responses": "WebSocket Responses API endpoint."
      }
    },
    "AssistantUsageCopilotUsage": {
      "type": "object",
      "properties": {
        "tokenDetails": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AssistantUsageCopilotUsageTokenDetail",
            "description": "Token usage detail for a single billing category"
          },
          "description": "Itemized token usage breakdown"
        },
        "totalNanoAiu": {
          "type": "number",
          "minimum": 0,
          "description": "Total cost in nano-AI units for this request"
        }
      },
      "required": [
        "tokenDetails",
        "totalNanoAiu"
      ],
      "additionalProperties": false,
      "description": "Per-request cost and usage data from the CAPI copilot_usage response field",
      "title": "AssistantUsageCopilotUsage",
      "visibility": "internal"
    },
    "AssistantUsageCopilotUsageTokenDetail": {
      "type": "object",
      "properties": {
        "batchSize": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of tokens in this billing batch"
        },
        "costPerBatch": {
          "type": "integer",
          "minimum": 0,
          "description": "Cost per batch of tokens"
        },
        "tokenCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total token count for this entry"
        },
        "tokenType": {
          "type": "string",
          "description": "Token category (e.g., \"input\", \"output\")"
        }
      },
      "required": [
        "batchSize",
        "costPerBatch",
        "tokenCount",
        "tokenType"
      ],
      "additionalProperties": false,
      "description": "Token usage detail for a single billing category",
      "title": "AssistantUsageCopilotUsageTokenDetail"
    },
    "AssistantUsageData": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "description": "Model identifier used for this API call"
        },
        "inputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of input tokens consumed"
        },
        "outputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of output tokens produced"
        },
        "cacheReadTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of tokens read from prompt cache"
        },
        "cacheWriteTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of tokens written to prompt cache"
        },
        "reasoningTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of output tokens used for reasoning (e.g., chain-of-thought)"
        },
        "cost": {
          "type": "number",
          "description": "Model multiplier cost for billing purposes",
          "stability": "experimental"
        },
        "duration": {
          "type": "integer",
          "minimum": 0,
          "description": "Duration of the API call in milliseconds",
          "format": "duration"
        },
        "timeToFirstTokenMs": {
          "type": "integer",
          "minimum": 0,
          "description": "Time to first token in milliseconds. Only available for streaming requests",
          "format": "duration"
        },
        "interTokenLatencyMs": {
          "type": "number",
          "minimum": 0,
          "description": "Average inter-token latency in milliseconds. Only available for streaming requests",
          "format": "duration"
        },
        "initiator": {
          "type": "string",
          "description": "What initiated this API call (e.g., \"sub-agent\", \"mcp-sampling\"); absent for user-initiated calls"
        },
        "apiCallId": {
          "type": "string",
          "description": "Completion ID from the model provider (e.g., chatcmpl-abc123)"
        },
        "providerCallId": {
          "type": "string",
          "description": "GitHub request tracing ID (x-github-request-id header) for server-side log correlation"
        },
        "serviceRequestId": {
          "type": "string",
          "description": "Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation"
        },
        "apiEndpoint": {
          "$ref": "#/definitions/AssistantUsageApiEndpoint",
          "description": "API endpoint used for this model call, matching CAPI supported_endpoints vocabulary"
        },
        "parentToolCallId": {
          "type": "string",
          "description": "Parent tool call ID when this usage originates from a sub-agent",
          "deprecated": true
        },
        "quotaSnapshots": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/AssistantUsageQuotaSnapshot",
            "visibility": "internal"
          },
          "description": "Per-quota resource usage snapshots, keyed by quota identifier",
          "visibility": "internal"
        },
        "copilotUsage": {
          "$ref": "#/definitions/AssistantUsageCopilotUsage",
          "description": "Per-request cost and usage data from the CAPI copilot_usage response field",
          "visibility": "internal"
        },
        "reasoningEffort": {
          "type": "string",
          "description": "Reasoning effort level used for model calls, if applicable (e.g. \"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\")"
        }
      },
      "required": [
        "model"
      ],
      "additionalProperties": false,
      "description": "LLM API call usage metrics including tokens, costs, quotas, and billing information",
      "title": "AssistantUsageData"
    },
    "AssistantUsageEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "assistant.usage",
          "description": "Type discriminator. Always \"assistant.usage\"."
        },
        "data": {
          "$ref": "#/definitions/AssistantUsageData",
          "description": "LLM API call usage metrics including tokens, costs, quotas, and billing information"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"assistant.usage\". LLM API call usage metrics including tokens, costs, quotas, and billing information",
      "title": "AssistantUsageEvent"
    },
    "AssistantUsageQuotaSnapshot": {
      "type": "object",
      "properties": {
        "isUnlimitedEntitlement": {
          "type": "boolean",
          "description": "Whether the user has an unlimited usage entitlement",
          "visibility": "internal"
        },
        "entitlementRequests": {
          "type": "integer",
          "minimum": -1,
          "description": "Total requests allowed by the entitlement",
          "visibility": "internal"
        },
        "usedRequests": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of requests already consumed",
          "visibility": "internal"
        },
        "usageAllowedWithExhaustedQuota": {
          "type": "boolean",
          "description": "Whether usage is still permitted after quota exhaustion",
          "visibility": "internal"
        },
        "overage": {
          "type": "number",
          "minimum": 0,
          "description": "Number of additional usage requests made this period",
          "visibility": "internal"
        },
        "overageAllowedWithExhaustedQuota": {
          "type": "boolean",
          "description": "Whether additional usage is allowed when quota is exhausted",
          "visibility": "internal"
        },
        "remainingPercentage": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Percentage of quota remaining (0 to 100)",
          "visibility": "internal"
        },
        "resetDate": {
          "type": "string",
          "format": "date-time",
          "description": "Date when the quota resets",
          "visibility": "internal"
        }
      },
      "required": [
        "isUnlimitedEntitlement",
        "entitlementRequests",
        "usedRequests",
        "usageAllowedWithExhaustedQuota",
        "overage",
        "overageAllowedWithExhaustedQuota",
        "remainingPercentage"
      ],
      "additionalProperties": false,
      "title": "AssistantUsageQuotaSnapshot",
      "visibility": "internal",
      "description": "Schema for the `AssistantUsageQuotaSnapshot` type."
    },
    "Attachment": {
      "anyOf": [
        {
          "$ref": "#/definitions/AttachmentFile",
          "description": "File attachment"
        },
        {
          "$ref": "#/definitions/AttachmentDirectory",
          "description": "Directory attachment"
        },
        {
          "$ref": "#/definitions/AttachmentSelection",
          "description": "Code selection attachment from an editor"
        },
        {
          "$ref": "#/definitions/AttachmentGitHubReference",
          "description": "GitHub issue, pull request, or discussion reference"
        },
        {
          "$ref": "#/definitions/AttachmentBlob",
          "description": "Blob attachment with inline base64-encoded data"
        },
        {
          "$ref": "#/definitions/AttachmentExtensionContext",
          "description": "Structured context contributed by an extension. Composer pills displayed in the host are forwarded back through session.send.attachments, then rendered into the model prompt as an <extension_context> XML block."
        }
      ],
      "description": "A user message attachment — a file, directory, code selection, blob, GitHub reference, or extension-supplied context payload",
      "title": "Attachment"
    },
    "AttachmentBlob": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "blob",
          "description": "Attachment type discriminator"
        },
        "data": {
          "type": "string",
          "description": "Base64-encoded content",
          "contentEncoding": "base64"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the inline data"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the attachment"
        }
      },
      "required": [
        "type",
        "data",
        "mimeType"
      ],
      "additionalProperties": false,
      "description": "Blob attachment with inline base64-encoded data",
      "title": "AttachmentBlob"
    },
    "AttachmentDirectory": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "directory",
          "description": "Attachment type discriminator"
        },
        "path": {
          "type": "string",
          "description": "Absolute directory path"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the attachment"
        }
      },
      "required": [
        "type",
        "path",
        "displayName"
      ],
      "additionalProperties": false,
      "description": "Directory attachment",
      "title": "AttachmentDirectory"
    },
    "AttachmentExtensionContext": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "extension_context",
          "description": "Attachment type discriminator"
        },
        "extensionId": {
          "type": "string",
          "description": "Owning extension identifier. Runtime-derived from the caller's connection when produced via session.extensions.sendAttachmentsToMessage; preserved verbatim on subsequent transports."
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier when the push was bound to a canvas instance"
        },
        "instanceId": {
          "type": "string",
          "description": "Open canvas instance identifier when the push was bound to a canvas instance"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "description": "Human-readable composer pill label"
        },
        "payload": {
          "description": "Caller-supplied JSON payload",
          "x-opaque-json": true
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp captured by the runtime when the push was accepted"
        }
      },
      "required": [
        "type",
        "extensionId",
        "title",
        "capturedAt"
      ],
      "additionalProperties": false,
      "description": "Structured context contributed by an extension. Composer pills displayed in the host are forwarded back through session.send.attachments, then rendered into the model prompt as an <extension_context> XML block.",
      "title": "AttachmentExtensionContext"
    },
    "AttachmentFile": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "file",
          "description": "Attachment type discriminator"
        },
        "path": {
          "type": "string",
          "description": "Absolute file path"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the attachment"
        },
        "lineRange": {
          "$ref": "#/definitions/AttachmentFileLineRange",
          "description": "Optional line range to scope the attachment to a specific section of the file"
        }
      },
      "required": [
        "type",
        "path",
        "displayName"
      ],
      "additionalProperties": false,
      "description": "File attachment",
      "title": "AttachmentFile"
    },
    "AttachmentFileLineRange": {
      "type": "object",
      "properties": {
        "start": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Start line number (1-based)"
        },
        "end": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "End line number (1-based, inclusive)"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false,
      "description": "Optional line range to scope the attachment to a specific section of the file",
      "title": "AttachmentFileLineRange"
    },
    "AttachmentGitHubReference": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_reference",
          "description": "Attachment type discriminator"
        },
        "number": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Issue, pull request, or discussion number"
        },
        "title": {
          "type": "string",
          "description": "Title of the referenced item"
        },
        "referenceType": {
          "$ref": "#/definitions/AttachmentGitHubReferenceType",
          "description": "Type of GitHub reference"
        },
        "state": {
          "type": "string",
          "description": "Current state of the referenced item (e.g., open, closed, merged)"
        },
        "url": {
          "type": "string",
          "description": "URL to the referenced item on GitHub"
        }
      },
      "required": [
        "type",
        "number",
        "title",
        "referenceType",
        "state",
        "url"
      ],
      "additionalProperties": false,
      "description": "GitHub issue, pull request, or discussion reference",
      "title": "AttachmentGitHubReference"
    },
    "AttachmentGitHubReferenceType": {
      "type": "string",
      "enum": [
        "issue",
        "pr",
        "discussion"
      ],
      "description": "Type of GitHub reference",
      "title": "AttachmentGitHubReferenceType",
      "x-enumDescriptions": {
        "issue": "GitHub issue reference.",
        "pr": "GitHub pull request reference.",
        "discussion": "GitHub discussion reference."
      }
    },
    "AttachmentSelection": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "selection",
          "description": "Attachment type discriminator"
        },
        "filePath": {
          "type": "string",
          "description": "Absolute path to the file containing the selection"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the selection"
        },
        "text": {
          "type": "string",
          "description": "The selected text content"
        },
        "selection": {
          "$ref": "#/definitions/AttachmentSelectionDetails",
          "description": "Position range of the selection within the file"
        }
      },
      "required": [
        "type",
        "filePath",
        "displayName",
        "text",
        "selection"
      ],
      "additionalProperties": false,
      "description": "Code selection attachment from an editor",
      "title": "AttachmentSelection"
    },
    "AttachmentSelectionDetails": {
      "type": "object",
      "properties": {
        "start": {
          "$ref": "#/definitions/AttachmentSelectionDetailsStart",
          "description": "Start position of the selection"
        },
        "end": {
          "$ref": "#/definitions/AttachmentSelectionDetailsEnd",
          "description": "End position of the selection"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false,
      "description": "Position range of the selection within the file",
      "title": "AttachmentSelectionDetails"
    },
    "AttachmentSelectionDetailsEnd": {
      "type": "object",
      "properties": {
        "line": {
          "type": "integer",
          "minimum": 0,
          "description": "End line number (0-based)"
        },
        "character": {
          "type": "integer",
          "minimum": 0,
          "description": "End character offset within the line (0-based)"
        }
      },
      "required": [
        "line",
        "character"
      ],
      "additionalProperties": false,
      "description": "End position of the selection",
      "title": "AttachmentSelectionDetailsEnd"
    },
    "AttachmentSelectionDetailsStart": {
      "type": "object",
      "properties": {
        "line": {
          "type": "integer",
          "minimum": 0,
          "description": "Start line number (0-based)"
        },
        "character": {
          "type": "integer",
          "minimum": 0,
          "description": "Start character offset within the line (0-based)"
        }
      },
      "required": [
        "line",
        "character"
      ],
      "additionalProperties": false,
      "description": "Start position of the selection",
      "title": "AttachmentSelectionDetailsStart"
    },
    "AutoModeSwitchCompletedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the resolved request; clients should dismiss any UI for this request"
        },
        "response": {
          "$ref": "#/definitions/AutoModeSwitchResponse",
          "description": "The user's auto-mode-switch choice"
        }
      },
      "required": [
        "requestId",
        "response"
      ],
      "additionalProperties": false,
      "description": "Auto mode switch completion notification",
      "title": "AutoModeSwitchCompletedData"
    },
    "AutoModeSwitchCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "auto_mode_switch.completed",
          "description": "Type discriminator. Always \"auto_mode_switch.completed\"."
        },
        "data": {
          "$ref": "#/definitions/AutoModeSwitchCompletedData",
          "description": "Auto mode switch completion notification"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"auto_mode_switch.completed\". Auto mode switch completion notification",
      "title": "AutoModeSwitchCompletedEvent"
    },
    "AutoModeSwitchRequestedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for this request; used to respond via session.respondToAutoModeSwitch()"
        },
        "errorCode": {
          "type": "string",
          "description": "The rate limit error code that triggered this request"
        },
        "retryAfterSeconds": {
          "type": "integer",
          "minimum": 0,
          "description": "Seconds until the rate limit resets, when known. Lets clients render a humanized reset time alongside the prompt.",
          "format": "duration"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "Auto mode switch request notification requiring user approval",
      "title": "AutoModeSwitchRequestedData"
    },
    "AutoModeSwitchRequestedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "auto_mode_switch.requested",
          "description": "Type discriminator. Always \"auto_mode_switch.requested\"."
        },
        "data": {
          "$ref": "#/definitions/AutoModeSwitchRequestedData",
          "description": "Auto mode switch request notification requiring user approval"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"auto_mode_switch.requested\". Auto mode switch request notification requiring user approval",
      "title": "AutoModeSwitchRequestedEvent"
    },
    "AutoModeSwitchResponse": {
      "type": "string",
      "enum": [
        "yes",
        "yes_always",
        "no"
      ],
      "description": "The user's auto-mode-switch choice",
      "title": "AutoModeSwitchResponse",
      "x-enumDescriptions": {
        "yes": "Switch models for this request.",
        "yes_always": "Switch models now and keep using the replacement automatically.",
        "no": "Do not switch models."
      }
    },
    "AutopilotObjectiveChangedData": {
      "type": "object",
      "properties": {
        "operation": {
          "$ref": "#/definitions/AutopilotObjectiveChangedOperation",
          "description": "The type of operation performed on the autopilot objective state file"
        },
        "id": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Current autopilot objective id, if one exists"
        },
        "status": {
          "$ref": "#/definitions/AutopilotObjectiveChangedStatus",
          "description": "Current autopilot objective status, if one exists"
        }
      },
      "required": [
        "operation"
      ],
      "additionalProperties": false,
      "description": "Autopilot objective state file operation details indicating what changed",
      "title": "AutopilotObjectiveChangedData"
    },
    "AutopilotObjectiveChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.autopilot_objective_changed",
          "description": "Type discriminator. Always \"session.autopilot_objective_changed\"."
        },
        "data": {
          "$ref": "#/definitions/AutopilotObjectiveChangedData",
          "description": "Autopilot objective state file operation details indicating what changed"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.autopilot_objective_changed\". Autopilot objective state file operation details indicating what changed",
      "title": "AutopilotObjectiveChangedEvent"
    },
    "AutopilotObjectiveChangedOperation": {
      "type": "string",
      "enum": [
        "create",
        "update",
        "delete"
      ],
      "description": "The type of operation performed on the autopilot objective state file",
      "title": "AutopilotObjectiveChangedOperation",
      "x-enumDescriptions": {
        "create": "Autopilot objective state file was created for a new objective.",
        "update": "Autopilot objective state file was updated for an existing objective.",
        "delete": "Autopilot objective state file was deleted or cleared."
      }
    },
    "AutopilotObjectiveChangedStatus": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "cap_reached",
        "completed"
      ],
      "description": "Current autopilot objective status, if one exists",
      "title": "AutopilotObjectiveChangedStatus",
      "x-enumDescriptions": {
        "active": "Objective is active and can drive autopilot continuations.",
        "paused": "Objective is paused and will not drive autopilot continuations.",
        "cap_reached": "Legacy objective state indicating the previous continuation cap was reached.",
        "completed": "Objective was completed by the agent."
      }
    },
    "BackgroundTasksChangedData": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "title": "BackgroundTasksChangedData",
      "description": "Schema for the `BackgroundTasksChangedData` type."
    },
    "BackgroundTasksChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.background_tasks_changed",
          "description": "Type discriminator. Always \"session.background_tasks_changed\"."
        },
        "data": {
          "$ref": "#/definitions/BackgroundTasksChangedData",
          "description": "Schema for the `BackgroundTasksChangedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.background_tasks_changed\".",
      "title": "BackgroundTasksChangedEvent"
    },
    "CanvasClosedData": {
      "type": "object",
      "properties": {
        "instanceId": {
          "type": "string",
          "minLength": 1,
          "description": "Stable caller-supplied identifier of the canvas instance that was closed"
        },
        "extensionId": {
          "type": "string",
          "description": "Owning provider identifier"
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier"
        }
      },
      "required": [
        "instanceId",
        "extensionId",
        "canvasId"
      ],
      "additionalProperties": false,
      "title": "CanvasClosedData",
      "description": "Schema for the `CanvasClosedData` type."
    },
    "CanvasClosedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.canvas.closed",
          "description": "Type discriminator. Always \"session.canvas.closed\"."
        },
        "data": {
          "$ref": "#/definitions/CanvasClosedData",
          "description": "Schema for the `CanvasClosedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.canvas.closed\".",
      "title": "CanvasClosedEvent"
    },
    "CanvasOpenedAvailability": {
      "type": "string",
      "enum": [
        "ready",
        "stale"
      ],
      "description": "Runtime-controlled routing state for the instance. \"ready\" when the provider connection is live; \"stale\" when the provider has gone away and the instance is awaiting rebinding.",
      "title": "CanvasOpenedAvailability",
      "x-enumDescriptions": {
        "ready": "Provider connection is live; actions can be invoked.",
        "stale": "Provider has gone away; the instance is awaiting rebinding."
      }
    },
    "CanvasOpenedData": {
      "type": "object",
      "properties": {
        "instanceId": {
          "type": "string",
          "description": "Stable caller-supplied canvas instance identifier"
        },
        "extensionId": {
          "type": "string",
          "description": "Owning provider identifier"
        },
        "extensionName": {
          "type": "string",
          "description": "Owning extension display name, when available"
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier"
        },
        "title": {
          "type": "string",
          "description": "Rendered title"
        },
        "status": {
          "type": "string",
          "description": "Provider-supplied status text"
        },
        "url": {
          "type": "string",
          "description": "URL for web-rendered canvases"
        },
        "input": {
          "description": "Input supplied when the instance was opened",
          "x-opaque-json": true
        },
        "reopen": {
          "type": "boolean",
          "description": "Whether this notification represents an idempotent reopen"
        },
        "availability": {
          "$ref": "#/definitions/CanvasOpenedAvailability",
          "description": "Runtime-controlled routing state for the instance. \"ready\" when the provider connection is live; \"stale\" when the provider has gone away and the instance is awaiting rebinding."
        }
      },
      "required": [
        "instanceId",
        "extensionId",
        "canvasId",
        "reopen",
        "availability"
      ],
      "additionalProperties": false,
      "title": "CanvasOpenedData",
      "description": "Schema for the `CanvasOpenedData` type."
    },
    "CanvasOpenedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.canvas.opened",
          "description": "Type discriminator. Always \"session.canvas.opened\"."
        },
        "data": {
          "$ref": "#/definitions/CanvasOpenedData",
          "description": "Schema for the `CanvasOpenedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.canvas.opened\".",
      "title": "CanvasOpenedEvent"
    },
    "CanvasRegistryChangedCanvas": {
      "type": "object",
      "properties": {
        "extensionId": {
          "type": "string",
          "description": "Owning provider identifier"
        },
        "extensionName": {
          "type": "string",
          "description": "Owning extension display name, when available"
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier"
        },
        "displayName": {
          "type": "string",
          "description": "Human-readable canvas name"
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "description": "Short, single-sentence description shown to the agent in canvas catalogs."
        },
        "inputSchema": {
          "type": "object",
          "additionalProperties": {},
          "description": "JSON Schema for canvas open input",
          "x-opaque-json": true
        },
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CanvasRegistryChangedCanvasAction"
          },
          "description": "Actions the agent or host may invoke"
        }
      },
      "required": [
        "extensionId",
        "canvasId",
        "displayName",
        "description"
      ],
      "additionalProperties": false,
      "title": "CanvasRegistryChangedCanvas",
      "description": "Schema for the `CanvasRegistryChangedCanvas` type."
    },
    "CanvasRegistryChangedCanvasAction": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Action name"
        },
        "description": {
          "type": "string",
          "description": "Action description"
        },
        "inputSchema": {
          "type": "object",
          "additionalProperties": {},
          "description": "JSON Schema for action input",
          "x-opaque-json": true
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "title": "CanvasRegistryChangedCanvasAction",
      "description": "Schema for the `CanvasRegistryChangedCanvasAction` type."
    },
    "CanvasRegistryChangedData": {
      "type": "object",
      "properties": {
        "canvases": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CanvasRegistryChangedCanvas"
          },
          "description": "Canvas declarations currently available"
        }
      },
      "required": [
        "canvases"
      ],
      "additionalProperties": false,
      "title": "CanvasRegistryChangedData",
      "description": "Schema for the `CanvasRegistryChangedData` type."
    },
    "CanvasRegistryChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.canvas.registry_changed",
          "description": "Type discriminator. Always \"session.canvas.registry_changed\"."
        },
        "data": {
          "$ref": "#/definitions/CanvasRegistryChangedData",
          "description": "Schema for the `CanvasRegistryChangedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.canvas.registry_changed\".",
      "title": "CanvasRegistryChangedEvent"
    },
    "CapabilitiesChangedData": {
      "type": "object",
      "properties": {
        "ui": {
          "$ref": "#/definitions/CapabilitiesChangedUI",
          "description": "UI capability changes"
        }
      },
      "additionalProperties": false,
      "description": "Session capability change notification",
      "title": "CapabilitiesChangedData"
    },
    "CapabilitiesChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "capabilities.changed",
          "description": "Type discriminator. Always \"capabilities.changed\"."
        },
        "data": {
          "$ref": "#/definitions/CapabilitiesChangedData",
          "description": "Session capability change notification"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"capabilities.changed\". Session capability change notification",
      "title": "CapabilitiesChangedEvent"
    },
    "CapabilitiesChangedUI": {
      "type": "object",
      "properties": {
        "elicitation": {
          "type": "boolean",
          "description": "Whether elicitation is now supported"
        },
        "mcpApps": {
          "type": "boolean",
          "description": "Whether MCP Apps (SEP-1865) UI passthrough is now supported"
        },
        "canvases": {
          "type": "boolean",
          "description": "Whether canvas rendering is now supported"
        }
      },
      "additionalProperties": false,
      "description": "UI capability changes",
      "title": "CapabilitiesChangedUI"
    },
    "CommandCompletedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the resolved command request; clients should dismiss any UI for this request"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "Queued command completion notification signaling UI dismissal",
      "title": "CommandCompletedData"
    },
    "CommandCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "command.completed",
          "description": "Type discriminator. Always \"command.completed\"."
        },
        "data": {
          "$ref": "#/definitions/CommandCompletedData",
          "description": "Queued command completion notification signaling UI dismissal"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"command.completed\". Queued command completion notification signaling UI dismissal",
      "title": "CommandCompletedEvent"
    },
    "CommandExecuteData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier; used to respond via session.commands.handlePendingCommand()"
        },
        "command": {
          "type": "string",
          "description": "The full command text (e.g., /deploy production)"
        },
        "commandName": {
          "type": "string",
          "description": "Command name without leading /"
        },
        "args": {
          "type": "string",
          "description": "Raw argument string after the command name"
        }
      },
      "required": [
        "requestId",
        "command",
        "commandName",
        "args"
      ],
      "additionalProperties": false,
      "description": "Registered command dispatch request routed to the owning client",
      "title": "CommandExecuteData"
    },
    "CommandExecuteEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "command.execute",
          "description": "Type discriminator. Always \"command.execute\"."
        },
        "data": {
          "$ref": "#/definitions/CommandExecuteData",
          "description": "Registered command dispatch request routed to the owning client"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"command.execute\". Registered command dispatch request routed to the owning client",
      "title": "CommandExecuteEvent"
    },
    "CommandQueuedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for this request; used to respond via session.respondToQueuedCommand()"
        },
        "command": {
          "type": "string",
          "description": "The slash command text to be executed (e.g., /help, /clear)"
        }
      },
      "required": [
        "requestId",
        "command"
      ],
      "additionalProperties": false,
      "description": "Queued slash command dispatch request for client execution",
      "title": "CommandQueuedData"
    },
    "CommandQueuedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "command.queued",
          "description": "Type discriminator. Always \"command.queued\"."
        },
        "data": {
          "$ref": "#/definitions/CommandQueuedData",
          "description": "Queued slash command dispatch request for client execution"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"command.queued\". Queued slash command dispatch request for client execution",
      "title": "CommandQueuedEvent"
    },
    "CommandsChangedCommand": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Slash command name without the leading slash."
        },
        "description": {
          "type": "string",
          "description": "Optional human-readable command description."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "title": "CommandsChangedCommand",
      "description": "Schema for the `CommandsChangedCommand` type."
    },
    "CommandsChangedData": {
      "type": "object",
      "properties": {
        "commands": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CommandsChangedCommand"
          },
          "description": "Current list of registered SDK commands"
        }
      },
      "required": [
        "commands"
      ],
      "additionalProperties": false,
      "description": "SDK command registration change notification",
      "title": "CommandsChangedData"
    },
    "CommandsChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "commands.changed",
          "description": "Type discriminator. Always \"commands.changed\"."
        },
        "data": {
          "$ref": "#/definitions/CommandsChangedData",
          "description": "SDK command registration change notification"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"commands.changed\". SDK command registration change notification",
      "title": "CommandsChangedEvent"
    },
    "CompactionCompleteCompactionTokensUsed": {
      "type": "object",
      "properties": {
        "inputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Input tokens consumed by the compaction LLM call"
        },
        "outputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Output tokens produced by the compaction LLM call"
        },
        "cacheReadTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Cached input tokens reused in the compaction LLM call"
        },
        "cacheWriteTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Tokens written to prompt cache in the compaction LLM call"
        },
        "copilotUsage": {
          "$ref": "#/definitions/CompactionCompleteCompactionTokensUsedCopilotUsage",
          "description": "Per-request cost and usage data from the CAPI copilot_usage response field",
          "visibility": "internal"
        },
        "duration": {
          "type": "integer",
          "minimum": 0,
          "description": "Duration of the compaction LLM call in milliseconds",
          "format": "duration"
        },
        "model": {
          "type": "string",
          "description": "Model identifier used for the compaction LLM call"
        }
      },
      "additionalProperties": false,
      "description": "Token usage breakdown for the compaction LLM call (aligned with assistant.usage format)",
      "title": "CompactionCompleteCompactionTokensUsed"
    },
    "CompactionCompleteCompactionTokensUsedCopilotUsage": {
      "type": "object",
      "properties": {
        "tokenDetails": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail",
            "description": "Token usage detail for a single billing category"
          },
          "description": "Itemized token usage breakdown"
        },
        "totalNanoAiu": {
          "type": "number",
          "minimum": 0,
          "description": "Total cost in nano-AI units for this request"
        }
      },
      "required": [
        "tokenDetails",
        "totalNanoAiu"
      ],
      "additionalProperties": false,
      "description": "Per-request cost and usage data from the CAPI copilot_usage response field",
      "title": "CompactionCompleteCompactionTokensUsedCopilotUsage",
      "visibility": "internal"
    },
    "CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail": {
      "type": "object",
      "properties": {
        "batchSize": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of tokens in this billing batch"
        },
        "costPerBatch": {
          "type": "integer",
          "minimum": 0,
          "description": "Cost per batch of tokens"
        },
        "tokenCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total token count for this entry"
        },
        "tokenType": {
          "type": "string",
          "description": "Token category (e.g., \"input\", \"output\")"
        }
      },
      "required": [
        "batchSize",
        "costPerBatch",
        "tokenCount",
        "tokenType"
      ],
      "additionalProperties": false,
      "description": "Token usage detail for a single billing category",
      "title": "CompactionCompleteCompactionTokensUsedCopilotUsageTokenDetail"
    },
    "CompactionCompleteData": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether compaction completed successfully"
        },
        "error": {
          "type": "string",
          "description": "Error message if compaction failed"
        },
        "preCompactionTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens in conversation before compaction"
        },
        "postCompactionTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens in conversation after compaction"
        },
        "preCompactionMessagesLength": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of messages before compaction"
        },
        "messagesRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of messages removed during compaction"
        },
        "tokensRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of tokens removed during compaction"
        },
        "customInstructions": {
          "type": "string",
          "description": "User-supplied focus instructions provided to a manual `/compact` invocation. Omitted for automatic compaction and for manual compaction with no focus text."
        },
        "summaryContent": {
          "type": "string",
          "description": "LLM-generated summary of the compacted conversation history"
        },
        "checkpointNumber": {
          "type": "integer",
          "minimum": 0,
          "description": "Checkpoint snapshot number created for recovery"
        },
        "checkpointPath": {
          "type": "string",
          "description": "File path where the checkpoint was stored"
        },
        "compactionTokensUsed": {
          "$ref": "#/definitions/CompactionCompleteCompactionTokensUsed",
          "description": "Token usage breakdown for the compaction LLM call (aligned with assistant.usage format)"
        },
        "requestId": {
          "type": "string",
          "description": "GitHub request tracing ID (x-github-request-id header) for the compaction LLM call"
        },
        "serviceRequestId": {
          "type": "string",
          "description": "Copilot service request ID (x-copilot-service-request-id header) for the compaction LLM call"
        },
        "systemTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from system message(s) after compaction"
        },
        "conversationTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from non-system messages (user, assistant, tool) after compaction"
        },
        "toolDefinitionsTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from tool definitions after compaction"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Conversation compaction results including success status, metrics, and optional error details",
      "title": "CompactionCompleteData"
    },
    "CompactionCompleteEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.compaction_complete",
          "description": "Type discriminator. Always \"session.compaction_complete\"."
        },
        "data": {
          "$ref": "#/definitions/CompactionCompleteData",
          "description": "Conversation compaction results including success status, metrics, and optional error details"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.compaction_complete\". Conversation compaction results including success status, metrics, and optional error details",
      "title": "CompactionCompleteEvent"
    },
    "CompactionStartData": {
      "type": "object",
      "properties": {
        "systemTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from system message(s) at compaction start"
        },
        "conversationTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from non-system messages (user, assistant, tool) at compaction start"
        },
        "toolDefinitionsTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from tool definitions at compaction start"
        }
      },
      "additionalProperties": false,
      "description": "Context window breakdown at the start of LLM-powered conversation compaction",
      "title": "CompactionStartData"
    },
    "CompactionStartEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.compaction_start",
          "description": "Type discriminator. Always \"session.compaction_start\"."
        },
        "data": {
          "$ref": "#/definitions/CompactionStartData",
          "description": "Context window breakdown at the start of LLM-powered conversation compaction"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.compaction_start\". Context window breakdown at the start of LLM-powered conversation compaction",
      "title": "CompactionStartEvent"
    },
    "ContextChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.context_changed",
          "description": "Type discriminator. Always \"session.context_changed\"."
        },
        "data": {
          "$ref": "#/definitions/WorkingDirectoryContext",
          "description": "Updated working directory and git context after the change"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.context_changed\". Updated working directory and git context after the change",
      "title": "ContextChangedEvent"
    },
    "ContextTier": {
      "type": "string",
      "enum": [
        "default",
        "long_context"
      ],
      "title": "ContextTier",
      "x-enumDescriptions": {
        "default": "Default context tier with standard context window size.",
        "long_context": "Extended context tier with a larger context window."
      },
      "description": "Allowed values for the `ContextTier` enumeration."
    },
    "CustomAgentsUpdatedAgent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the agent"
        },
        "name": {
          "type": "string",
          "description": "Internal name of the agent"
        },
        "displayName": {
          "type": "string",
          "description": "Human-readable display name"
        },
        "description": {
          "type": "string",
          "description": "Description of what the agent does"
        },
        "source": {
          "type": "string",
          "description": "Source location: user, project, inherited, remote, or plugin"
        },
        "tools": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "List of tool names available to this agent, or null when all tools are available"
        },
        "userInvocable": {
          "type": "boolean",
          "description": "Whether the agent can be selected by the user"
        },
        "model": {
          "type": "string",
          "description": "Model override for this agent, if set"
        }
      },
      "required": [
        "id",
        "name",
        "displayName",
        "description",
        "source",
        "tools",
        "userInvocable"
      ],
      "additionalProperties": false,
      "title": "CustomAgentsUpdatedAgent",
      "description": "Schema for the `CustomAgentsUpdatedAgent` type."
    },
    "CustomAgentsUpdatedData": {
      "type": "object",
      "properties": {
        "agents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CustomAgentsUpdatedAgent"
          },
          "description": "Array of loaded custom agent metadata"
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Non-fatal warnings from agent loading"
        },
        "errors": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Fatal errors from agent loading"
        }
      },
      "required": [
        "agents",
        "warnings",
        "errors"
      ],
      "additionalProperties": false,
      "title": "CustomAgentsUpdatedData",
      "description": "Schema for the `CustomAgentsUpdatedData` type."
    },
    "CustomAgentsUpdatedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.custom_agents_updated",
          "description": "Type discriminator. Always \"session.custom_agents_updated\"."
        },
        "data": {
          "$ref": "#/definitions/CustomAgentsUpdatedData",
          "description": "Schema for the `CustomAgentsUpdatedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.custom_agents_updated\".",
      "title": "CustomAgentsUpdatedEvent"
    },
    "CustomNotificationData": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "minLength": 1,
          "description": "Namespace for the custom notification producer"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "Source-defined custom notification name"
        },
        "version": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Optional source-defined payload schema version"
        },
        "subject": {
          "$ref": "#/definitions/CustomNotificationSubject",
          "description": "Optional source-defined string identifiers describing the payload subject"
        },
        "payload": {
          "$ref": "#/definitions/CustomNotificationPayload",
          "description": "Source-defined JSON payload for the custom notification"
        }
      },
      "required": [
        "source",
        "name",
        "payload"
      ],
      "additionalProperties": false,
      "description": "Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.",
      "title": "CustomNotificationData"
    },
    "CustomNotificationEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.custom_notification",
          "description": "Type discriminator. Always \"session.custom_notification\"."
        },
        "data": {
          "$ref": "#/definitions/CustomNotificationData",
          "description": "Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.custom_notification\". Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined.",
      "title": "CustomNotificationEvent"
    },
    "CustomNotificationPayload": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {}
        },
        {
          "type": "object",
          "additionalProperties": {}
        }
      ],
      "description": "Source-defined JSON payload for the custom notification",
      "title": "CustomNotificationPayload",
      "x-opaque-json": true
    },
    "CustomNotificationSubject": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Optional source-defined string identifiers describing the payload subject",
      "title": "CustomNotificationSubject"
    },
    "ElicitationCompletedAction": {
      "type": "string",
      "enum": [
        "accept",
        "decline",
        "cancel"
      ],
      "description": "The user action: \"accept\" (submitted form), \"decline\" (explicitly refused), or \"cancel\" (dismissed)",
      "title": "ElicitationCompletedAction",
      "x-enumDescriptions": {
        "accept": "The user submitted the requested form.",
        "decline": "The user explicitly declined the request.",
        "cancel": "The user dismissed the request."
      }
    },
    "ElicitationCompletedContent": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "title": "ElicitationCompletedContent",
      "x-opaque-json": true,
      "description": "Schema for the `ElicitationCompletedContent` type."
    },
    "ElicitationCompletedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the resolved elicitation request; clients should dismiss any UI for this request"
        },
        "action": {
          "$ref": "#/definitions/ElicitationCompletedAction",
          "description": "The user action: \"accept\" (submitted form), \"decline\" (explicitly refused), or \"cancel\" (dismissed)"
        },
        "content": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/ElicitationCompletedContent"
          },
          "description": "The submitted form data when action is 'accept'; keys match the requested schema fields"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "Elicitation request completion with the user's response",
      "title": "ElicitationCompletedData"
    },
    "ElicitationCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "elicitation.completed",
          "description": "Type discriminator. Always \"elicitation.completed\"."
        },
        "data": {
          "$ref": "#/definitions/ElicitationCompletedData",
          "description": "Elicitation request completion with the user's response"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"elicitation.completed\". Elicitation request completion with the user's response",
      "title": "ElicitationCompletedEvent"
    },
    "ElicitationRequestedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for this elicitation request; used to respond via session.respondToElicitation()"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID from the LLM completion; used to correlate with CompletionChunk.toolCall.id for remote UIs"
        },
        "elicitationSource": {
          "type": "string",
          "description": "The source that initiated the request (MCP server name, or absent for agent-initiated)"
        },
        "message": {
          "type": "string",
          "description": "Message describing what information is needed from the user"
        },
        "mode": {
          "$ref": "#/definitions/ElicitationRequestedMode",
          "description": "Elicitation mode; \"form\" for structured input, \"url\" for browser-based. Defaults to \"form\" when absent."
        },
        "requestedSchema": {
          "$ref": "#/definitions/ElicitationRequestedSchema",
          "description": "JSON Schema describing the form fields to present to the user (form mode only)"
        },
        "url": {
          "type": "string",
          "description": "URL to open in the user's browser (url mode only)"
        }
      },
      "required": [
        "requestId",
        "message"
      ],
      "additionalProperties": true,
      "description": "Elicitation request; may be form-based (structured input) or URL-based (browser redirect)",
      "title": "ElicitationRequestedData"
    },
    "ElicitationRequestedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "elicitation.requested",
          "description": "Type discriminator. Always \"elicitation.requested\"."
        },
        "data": {
          "$ref": "#/definitions/ElicitationRequestedData",
          "description": "Elicitation request; may be form-based (structured input) or URL-based (browser redirect)"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"elicitation.requested\". Elicitation request; may be form-based (structured input) or URL-based (browser redirect)",
      "title": "ElicitationRequestedEvent"
    },
    "ElicitationRequestedMode": {
      "type": "string",
      "enum": [
        "form",
        "url"
      ],
      "description": "Elicitation mode; \"form\" for structured input, \"url\" for browser-based. Defaults to \"form\" when absent.",
      "title": "ElicitationRequestedMode",
      "x-enumDescriptions": {
        "form": "Structured form-based elicitation.",
        "url": "Browser URL-based elicitation."
      }
    },
    "ElicitationRequestedSchema": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "object",
          "description": "Schema type indicator (always 'object')"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Form field definitions, keyed by field name"
        },
        "required": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of required field names"
        }
      },
      "required": [
        "type",
        "properties"
      ],
      "additionalProperties": false,
      "description": "JSON Schema describing the form fields to present to the user (form mode only)",
      "title": "ElicitationRequestedSchema"
    },
    "EmbeddedBlobResourceContents": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "URI identifying the resource"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the blob content"
        },
        "blob": {
          "type": "string",
          "description": "Base64-encoded binary content of the resource",
          "contentEncoding": "base64"
        }
      },
      "required": [
        "uri",
        "blob"
      ],
      "additionalProperties": false,
      "title": "EmbeddedBlobResourceContents",
      "description": "Schema for the `EmbeddedBlobResourceContents` type."
    },
    "EmbeddedTextResourceContents": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "URI identifying the resource"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the text content"
        },
        "text": {
          "type": "string",
          "description": "Text content of the resource"
        }
      },
      "required": [
        "uri",
        "text"
      ],
      "additionalProperties": false,
      "title": "EmbeddedTextResourceContents",
      "description": "Schema for the `EmbeddedTextResourceContents` type."
    },
    "ErrorData": {
      "type": "object",
      "properties": {
        "errorType": {
          "type": "string",
          "description": "Category of error (e.g., \"authentication\", \"authorization\", \"quota\", \"rate_limit\", \"context_limit\", \"query\")"
        },
        "errorCode": {
          "type": "string",
          "description": "Fine-grained error code from the upstream provider, when available. For `errorType: \"rate_limit\"`, this is one of the `RateLimitErrorCode` values (e.g., `\"user_weekly_rate_limited\"`, `\"user_global_rate_limited\"`, `\"rate_limited\"`, `\"user_model_rate_limited\"`, `\"integration_rate_limited\"`). For `errorType: \"quota\"`, this is the CAPI quota error code (e.g., `\"quota_exceeded\"`, `\"session_quota_exceeded\"`, `\"billing_not_configured\"`)."
        },
        "eligibleForAutoSwitch": {
          "type": "boolean",
          "description": "Only set on `errorType: \"rate_limit\"`. When `true`, the runtime will follow this error with an `auto_mode_switch.requested` event (or silently switch if `continueOnAutoMode` is enabled). UI clients can use this flag to suppress duplicate rendering of the rate-limit error when they show their own auto-mode-switch prompt."
        },
        "message": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "stack": {
          "type": "string",
          "description": "Error stack trace, when available"
        },
        "statusCode": {
          "type": "integer",
          "minimum": 0,
          "maximum": 999,
          "description": "HTTP status code from the upstream request, if applicable"
        },
        "providerCallId": {
          "type": "string",
          "description": "GitHub request tracing ID (x-github-request-id header) for correlating with server-side logs"
        },
        "serviceRequestId": {
          "type": "string",
          "description": "Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation"
        },
        "url": {
          "type": "string",
          "description": "Optional URL associated with this error that the user can open in a browser"
        }
      },
      "required": [
        "errorType",
        "message"
      ],
      "additionalProperties": false,
      "description": "Error details for timeline display including message and optional diagnostic information",
      "title": "ErrorData"
    },
    "ErrorEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.error",
          "description": "Type discriminator. Always \"session.error\"."
        },
        "data": {
          "$ref": "#/definitions/ErrorData",
          "description": "Error details for timeline display including message and optional diagnostic information"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.error\". Error details for timeline display including message and optional diagnostic information",
      "title": "ErrorEvent"
    },
    "ExitPlanModeAction": {
      "type": "string",
      "enum": [
        "exit_only",
        "interactive",
        "autopilot",
        "autopilot_fleet"
      ],
      "description": "Exit plan mode action",
      "title": "ExitPlanModeAction",
      "x-enumDescriptions": {
        "exit_only": "Exit plan mode without starting implementation.",
        "interactive": "Exit plan mode and continue in interactive mode.",
        "autopilot": "Exit plan mode and continue autonomously.",
        "autopilot_fleet": "Exit plan mode and continue with parallel autonomous workers."
      }
    },
    "ExitPlanModeCompletedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the resolved exit plan mode request; clients should dismiss any UI for this request"
        },
        "approved": {
          "type": "boolean",
          "description": "Whether the plan was approved by the user"
        },
        "selectedAction": {
          "$ref": "#/definitions/ExitPlanModeAction",
          "description": "Action selected by the user"
        },
        "autoApproveEdits": {
          "type": "boolean",
          "description": "Whether edits should be auto-approved without confirmation"
        },
        "feedback": {
          "type": "string",
          "description": "Free-form feedback from the user if they requested changes to the plan"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "Plan mode exit completion with the user's approval decision and optional feedback",
      "title": "ExitPlanModeCompletedData"
    },
    "ExitPlanModeCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "exit_plan_mode.completed",
          "description": "Type discriminator. Always \"exit_plan_mode.completed\"."
        },
        "data": {
          "$ref": "#/definitions/ExitPlanModeCompletedData",
          "description": "Plan mode exit completion with the user's approval decision and optional feedback"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"exit_plan_mode.completed\". Plan mode exit completion with the user's approval decision and optional feedback",
      "title": "ExitPlanModeCompletedEvent"
    },
    "ExitPlanModeRequestedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for this request; used to respond via session.respondToExitPlanMode()"
        },
        "summary": {
          "type": "string",
          "description": "Summary of the plan that was created"
        },
        "planContent": {
          "type": "string",
          "description": "Full content of the plan file"
        },
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExitPlanModeAction",
            "description": "Exit plan mode action"
          },
          "description": "Available actions the user can take"
        },
        "recommendedAction": {
          "$ref": "#/definitions/ExitPlanModeAction",
          "description": "Recommended action to preselect for the user"
        }
      },
      "required": [
        "requestId",
        "summary",
        "planContent",
        "actions",
        "recommendedAction"
      ],
      "additionalProperties": false,
      "description": "Plan approval request with plan content and available user actions",
      "title": "ExitPlanModeRequestedData"
    },
    "ExitPlanModeRequestedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "exit_plan_mode.requested",
          "description": "Type discriminator. Always \"exit_plan_mode.requested\"."
        },
        "data": {
          "$ref": "#/definitions/ExitPlanModeRequestedData",
          "description": "Plan approval request with plan content and available user actions"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"exit_plan_mode.requested\". Plan approval request with plan content and available user actions",
      "title": "ExitPlanModeRequestedEvent"
    },
    "ExtensionsAttachmentsPushedData": {
      "type": "object",
      "properties": {
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Attachment",
            "description": "A user message attachment — a file, directory, code selection, blob, GitHub reference, or extension-supplied context payload"
          },
          "description": "Attachments contributed by an extension; the host should surface these as composer pills and forward them via the next session.send call."
        }
      },
      "required": [
        "attachments"
      ],
      "additionalProperties": false,
      "title": "ExtensionsAttachmentsPushedData",
      "description": "Schema for the `ExtensionsAttachmentsPushedData` type."
    },
    "ExtensionsAttachmentsPushedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.extensions.attachments_pushed",
          "description": "Type discriminator. Always \"session.extensions.attachments_pushed\"."
        },
        "data": {
          "$ref": "#/definitions/ExtensionsAttachmentsPushedData",
          "description": "Schema for the `ExtensionsAttachmentsPushedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.extensions.attachments_pushed\".",
      "title": "ExtensionsAttachmentsPushedEvent"
    },
    "ExtensionsLoadedData": {
      "type": "object",
      "properties": {
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExtensionsLoadedExtension"
          },
          "description": "Array of discovered extensions and their status"
        }
      },
      "required": [
        "extensions"
      ],
      "additionalProperties": false,
      "title": "ExtensionsLoadedData",
      "description": "Schema for the `ExtensionsLoadedData` type."
    },
    "ExtensionsLoadedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.extensions_loaded",
          "description": "Type discriminator. Always \"session.extensions_loaded\"."
        },
        "data": {
          "$ref": "#/definitions/ExtensionsLoadedData",
          "description": "Schema for the `ExtensionsLoadedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.extensions_loaded\".",
      "title": "ExtensionsLoadedEvent"
    },
    "ExtensionsLoadedExtension": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext')"
        },
        "name": {
          "type": "string",
          "description": "Extension name (directory name)"
        },
        "source": {
          "$ref": "#/definitions/ExtensionsLoadedExtensionSource",
          "description": "Discovery source"
        },
        "status": {
          "$ref": "#/definitions/ExtensionsLoadedExtensionStatus",
          "description": "Current status: running, disabled, failed, or starting"
        }
      },
      "required": [
        "id",
        "name",
        "source",
        "status"
      ],
      "additionalProperties": false,
      "title": "ExtensionsLoadedExtension",
      "description": "Schema for the `ExtensionsLoadedExtension` type."
    },
    "ExtensionsLoadedExtensionSource": {
      "type": "string",
      "enum": [
        "project",
        "user",
        "plugin",
        "session"
      ],
      "description": "Discovery source",
      "title": "ExtensionsLoadedExtensionSource",
      "x-enumDescriptions": {
        "project": "Extension discovered from the current project.",
        "user": "Extension discovered from the user's extension directory.",
        "plugin": "Extension contributed by an installed plugin.",
        "session": "Extension discovered from the current session's state directory."
      }
    },
    "ExtensionsLoadedExtensionStatus": {
      "type": "string",
      "enum": [
        "running",
        "disabled",
        "failed",
        "starting"
      ],
      "description": "Current status: running, disabled, failed, or starting",
      "title": "ExtensionsLoadedExtensionStatus",
      "x-enumDescriptions": {
        "running": "The extension process is running.",
        "disabled": "The extension is installed but disabled.",
        "failed": "The extension failed to start or crashed.",
        "starting": "The extension process is starting."
      }
    },
    "ExternalToolCompletedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the resolved external tool request; clients should dismiss any UI for this request"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "External tool completion notification signaling UI dismissal",
      "title": "ExternalToolCompletedData"
    },
    "ExternalToolCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "external_tool.completed",
          "description": "Type discriminator. Always \"external_tool.completed\"."
        },
        "data": {
          "$ref": "#/definitions/ExternalToolCompletedData",
          "description": "External tool completion notification signaling UI dismissal"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"external_tool.completed\". External tool completion notification signaling UI dismissal",
      "title": "ExternalToolCompletedEvent"
    },
    "ExternalToolRequestedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for this request; used to respond via session.respondToExternalTool()"
        },
        "sessionId": {
          "type": "string",
          "description": "Session ID that this external tool request belongs to"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID assigned to this external tool invocation"
        },
        "toolName": {
          "type": "string",
          "description": "Name of the external tool to invoke"
        },
        "arguments": {
          "description": "Arguments to pass to the external tool",
          "x-opaque-json": true
        },
        "workingDirectory": {
          "type": "string",
          "description": "Active session working directory, when known."
        },
        "traceparent": {
          "type": "string",
          "description": "W3C Trace Context traceparent header for the execute_tool span"
        },
        "tracestate": {
          "type": "string",
          "description": "W3C Trace Context tracestate header for the execute_tool span"
        }
      },
      "required": [
        "requestId",
        "sessionId",
        "toolCallId",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "External tool invocation request for client-side tool execution",
      "title": "ExternalToolRequestedData"
    },
    "ExternalToolRequestedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "external_tool.requested",
          "description": "Type discriminator. Always \"external_tool.requested\"."
        },
        "data": {
          "$ref": "#/definitions/ExternalToolRequestedData",
          "description": "External tool invocation request for client-side tool execution"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"external_tool.requested\". External tool invocation request for client-side tool execution",
      "title": "ExternalToolRequestedEvent"
    },
    "HandoffData": {
      "type": "object",
      "properties": {
        "handoffTime": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the handoff occurred"
        },
        "sourceType": {
          "$ref": "#/definitions/HandoffSourceType",
          "description": "Origin type of the session being handed off"
        },
        "repository": {
          "$ref": "#/definitions/HandoffRepository",
          "description": "Repository context for the handed-off session"
        },
        "context": {
          "type": "string",
          "description": "Additional context information for the handoff"
        },
        "summary": {
          "type": "string",
          "description": "Summary of the work done in the source session"
        },
        "remoteSessionId": {
          "type": "string",
          "description": "Session ID of the remote session being handed off"
        },
        "host": {
          "type": "string",
          "description": "GitHub host URL for the source session (e.g., https://github.com or https://tenant.ghe.com)"
        }
      },
      "required": [
        "handoffTime",
        "sourceType"
      ],
      "additionalProperties": false,
      "description": "Session handoff metadata including source, context, and repository information",
      "title": "HandoffData"
    },
    "HandoffEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.handoff",
          "description": "Type discriminator. Always \"session.handoff\"."
        },
        "data": {
          "$ref": "#/definitions/HandoffData",
          "description": "Session handoff metadata including source, context, and repository information"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.handoff\". Session handoff metadata including source, context, and repository information",
      "title": "HandoffEvent"
    },
    "HandoffRepository": {
      "type": "object",
      "properties": {
        "owner": {
          "type": "string",
          "description": "Repository owner (user or organization)"
        },
        "name": {
          "type": "string",
          "description": "Repository name"
        },
        "branch": {
          "type": "string",
          "description": "Git branch name, if applicable"
        }
      },
      "required": [
        "owner",
        "name"
      ],
      "additionalProperties": false,
      "description": "Repository context for the handed-off session",
      "title": "HandoffRepository"
    },
    "HandoffSourceType": {
      "type": "string",
      "enum": [
        "remote",
        "local"
      ],
      "description": "Origin type of the session being handed off",
      "title": "HandoffSourceType",
      "x-enumDescriptions": {
        "remote": "The handoff originated from a remote session.",
        "local": "The handoff originated from a local session."
      }
    },
    "HookEndData": {
      "type": "object",
      "properties": {
        "hookInvocationId": {
          "type": "string",
          "description": "Identifier matching the corresponding hook.start event"
        },
        "hookType": {
          "type": "string",
          "description": "Type of hook that was invoked (e.g., \"preToolUse\", \"postToolUse\", \"sessionStart\")"
        },
        "output": {
          "description": "Output data produced by the hook",
          "x-opaque-json": true
        },
        "success": {
          "type": "boolean",
          "description": "Whether the hook completed successfully"
        },
        "error": {
          "$ref": "#/definitions/HookEndError",
          "description": "Error details when the hook failed"
        }
      },
      "required": [
        "hookInvocationId",
        "hookType",
        "success"
      ],
      "additionalProperties": false,
      "description": "Hook invocation completion details including output, success status, and error information",
      "title": "HookEndData"
    },
    "HookEndError": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "stack": {
          "type": "string",
          "description": "Error stack trace, when available"
        },
        "source": {
          "type": "string",
          "description": "Source label of the hook that errored (e.g. the plugin it was loaded from), when known"
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "description": "Error details when the hook failed",
      "title": "HookEndError"
    },
    "HookEndEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "hook.end",
          "description": "Type discriminator. Always \"hook.end\"."
        },
        "data": {
          "$ref": "#/definitions/HookEndData",
          "description": "Hook invocation completion details including output, success status, and error information"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"hook.end\". Hook invocation completion details including output, success status, and error information",
      "title": "HookEndEvent"
    },
    "HookProgressData": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Human-readable progress message from the hook process"
        },
        "temporary": {
          "type": "boolean",
          "description": "When true, this status message replaces the previous temporary one instead of accumulating"
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "description": "Ephemeral progress update from a running hook process",
      "title": "HookProgressData"
    },
    "HookProgressEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "hook.progress",
          "description": "Type discriminator. Always \"hook.progress\"."
        },
        "data": {
          "$ref": "#/definitions/HookProgressData",
          "description": "Ephemeral progress update from a running hook process"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"hook.progress\". Ephemeral progress update from a running hook process",
      "title": "HookProgressEvent"
    },
    "HookStartData": {
      "type": "object",
      "properties": {
        "hookInvocationId": {
          "type": "string",
          "description": "Unique identifier for this hook invocation"
        },
        "hookType": {
          "type": "string",
          "description": "Type of hook being invoked (e.g., \"preToolUse\", \"postToolUse\", \"sessionStart\")"
        },
        "input": {
          "description": "Input data passed to the hook",
          "x-opaque-json": true
        }
      },
      "required": [
        "hookInvocationId",
        "hookType"
      ],
      "additionalProperties": false,
      "description": "Hook invocation start details including type and input data",
      "title": "HookStartData"
    },
    "HookStartEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "hook.start",
          "description": "Type discriminator. Always \"hook.start\"."
        },
        "data": {
          "$ref": "#/definitions/HookStartData",
          "description": "Hook invocation start details including type and input data"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"hook.start\". Hook invocation start details including type and input data",
      "title": "HookStartEvent"
    },
    "IdleData": {
      "type": "object",
      "properties": {
        "aborted": {
          "type": "boolean",
          "description": "True when the preceding agentic loop was cancelled via abort signal"
        }
      },
      "additionalProperties": false,
      "description": "Payload indicating the session is idle with no background agents or attached shell commands in flight",
      "title": "IdleData"
    },
    "IdleEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.idle",
          "description": "Type discriminator. Always \"session.idle\"."
        },
        "data": {
          "$ref": "#/definitions/IdleData",
          "description": "Payload indicating the session is idle with no background agents or attached shell commands in flight"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.idle\". Payload indicating the session is idle with no background agents or attached shell commands in flight",
      "title": "IdleEvent"
    },
    "InfoData": {
      "type": "object",
      "properties": {
        "infoType": {
          "type": "string",
          "description": "Category of informational message (e.g., \"notification\", \"timing\", \"context_window\", \"mcp\", \"snapshot\", \"configuration\", \"authentication\", \"model\")"
        },
        "message": {
          "type": "string",
          "description": "Human-readable informational message for display in the timeline"
        },
        "url": {
          "type": "string",
          "description": "Optional URL associated with this message that the user can open in a browser"
        },
        "tip": {
          "type": "string",
          "description": "Optional actionable tip displayed with this message"
        }
      },
      "required": [
        "infoType",
        "message"
      ],
      "additionalProperties": false,
      "description": "Informational message for timeline display with categorization",
      "title": "InfoData"
    },
    "InfoEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.info",
          "description": "Type discriminator. Always \"session.info\"."
        },
        "data": {
          "$ref": "#/definitions/InfoData",
          "description": "Informational message for timeline display with categorization"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.info\". Informational message for timeline display with categorization",
      "title": "InfoEvent"
    },
    "McpAppToolCallCompleteData": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server hosting the tool"
        },
        "toolName": {
          "type": "string",
          "description": "MCP tool name that was invoked"
        },
        "arguments": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Arguments passed to the tool by the app view, if any"
        },
        "success": {
          "type": "boolean",
          "description": "True when the call completed without throwing AND the MCP CallToolResult did not set isError"
        },
        "durationMs": {
          "type": "number",
          "description": "Wall-clock duration of the underlying tools/call in milliseconds"
        },
        "result": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Standard MCP CallToolResult returned by the server. Present whether or not the call set isError."
        },
        "error": {
          "$ref": "#/definitions/McpAppToolCallCompleteError",
          "description": "Set when the underlying tools/call threw an error before returning a CallToolResult"
        },
        "toolMeta": {
          "$ref": "#/definitions/McpAppToolCallCompleteToolMeta",
          "description": "The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools."
        }
      },
      "required": [
        "serverName",
        "toolName",
        "success",
        "durationMs"
      ],
      "additionalProperties": false,
      "description": "MCP App view called a tool on a connected MCP server (SEP-1865)",
      "title": "McpAppToolCallCompleteData"
    },
    "McpAppToolCallCompleteError": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Human-readable error message"
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "description": "Set when the underlying tools/call threw an error before returning a CallToolResult",
      "title": "McpAppToolCallCompleteError"
    },
    "McpAppToolCallCompleteEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "mcp_app.tool_call_complete",
          "description": "Type discriminator. Always \"mcp_app.tool_call_complete\"."
        },
        "data": {
          "$ref": "#/definitions/McpAppToolCallCompleteData",
          "description": "MCP App view called a tool on a connected MCP server (SEP-1865)"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"mcp_app.tool_call_complete\". MCP App view called a tool on a connected MCP server (SEP-1865)",
      "title": "McpAppToolCallCompleteEvent"
    },
    "McpAppToolCallCompleteToolMeta": {
      "type": "object",
      "properties": {
        "ui": {
          "$ref": "#/definitions/McpAppToolCallCompleteToolMetaUI",
          "description": "Schema for the `McpAppToolCallCompleteToolMetaUI` type."
        }
      },
      "additionalProperties": true,
      "description": "The tool's `_meta.ui` block at the time of the call, so consumers can decide whether to forward the result to the model without re-listing tools.",
      "title": "McpAppToolCallCompleteToolMeta"
    },
    "McpAppToolCallCompleteToolMetaUI": {
      "type": "object",
      "properties": {
        "resourceUri": {
          "type": "string",
          "description": "`ui://` URI declared by the tool's `_meta.ui.resourceUri`"
        },
        "visibility": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tool visibility per SEP-1865 (typically a subset of `[\"model\",\"app\"]`)"
        }
      },
      "additionalProperties": true,
      "title": "McpAppToolCallCompleteToolMetaUI",
      "description": "Schema for the `McpAppToolCallCompleteToolMetaUI` type."
    },
    "McpOauthCompletedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the resolved OAuth request"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "MCP OAuth request completion notification",
      "title": "McpOauthCompletedData"
    },
    "McpOauthCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "mcp.oauth_completed",
          "description": "Type discriminator. Always \"mcp.oauth_completed\"."
        },
        "data": {
          "$ref": "#/definitions/McpOauthCompletedData",
          "description": "MCP OAuth request completion notification"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"mcp.oauth_completed\". MCP OAuth request completion notification",
      "title": "McpOauthCompletedEvent"
    },
    "McpOauthRequiredData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for this OAuth request; used to respond via session.respondToMcpOAuth()"
        },
        "serverName": {
          "type": "string",
          "description": "Display name of the MCP server that requires OAuth"
        },
        "serverUrl": {
          "type": "string",
          "description": "URL of the MCP server that requires OAuth"
        },
        "staticClientConfig": {
          "$ref": "#/definitions/McpOauthRequiredStaticClientConfig",
          "description": "Static OAuth client configuration, if the server specifies one"
        }
      },
      "required": [
        "requestId",
        "serverName",
        "serverUrl"
      ],
      "additionalProperties": false,
      "description": "OAuth authentication request for an MCP server",
      "title": "McpOauthRequiredData"
    },
    "McpOauthRequiredEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "mcp.oauth_required",
          "description": "Type discriminator. Always \"mcp.oauth_required\"."
        },
        "data": {
          "$ref": "#/definitions/McpOauthRequiredData",
          "description": "OAuth authentication request for an MCP server"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"mcp.oauth_required\". OAuth authentication request for an MCP server",
      "title": "McpOauthRequiredEvent"
    },
    "McpOauthRequiredStaticClientConfig": {
      "type": "object",
      "properties": {
        "clientId": {
          "type": "string",
          "description": "OAuth client ID for the server"
        },
        "publicClient": {
          "type": "boolean",
          "description": "Whether this is a public OAuth client"
        },
        "grantType": {
          "type": "string",
          "const": "client_credentials",
          "description": "Optional non-default OAuth grant type. When set to 'client_credentials', the OAuth flow runs headlessly using the client_id + keychain-stored secret (no browser, no callback server)."
        }
      },
      "required": [
        "clientId"
      ],
      "additionalProperties": false,
      "description": "Static OAuth client configuration, if the server specifies one",
      "title": "McpOauthRequiredStaticClientConfig"
    },
    "McpServersLoadedData": {
      "type": "object",
      "properties": {
        "servers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpServersLoadedServer"
          },
          "description": "Array of MCP server status summaries"
        }
      },
      "required": [
        "servers"
      ],
      "additionalProperties": false,
      "title": "McpServersLoadedData",
      "description": "Schema for the `McpServersLoadedData` type."
    },
    "McpServersLoadedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.mcp_servers_loaded",
          "description": "Type discriminator. Always \"session.mcp_servers_loaded\"."
        },
        "data": {
          "$ref": "#/definitions/McpServersLoadedData",
          "description": "Schema for the `McpServersLoadedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.mcp_servers_loaded\".",
      "title": "McpServersLoadedEvent"
    },
    "McpServersLoadedServer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Server name (config key)"
        },
        "status": {
          "$ref": "#/definitions/McpServerStatus",
          "description": "Connection status: connected, failed, needs-auth, pending, disabled, or not_configured"
        },
        "source": {
          "$ref": "#/definitions/McpServerSource",
          "description": "Configuration source: user, workspace, plugin, or builtin"
        },
        "error": {
          "type": "string",
          "description": "Error message if the server failed to connect"
        },
        "transport": {
          "$ref": "#/definitions/McpServerTransport",
          "description": "Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)"
        },
        "pluginName": {
          "type": "string",
          "description": "Name of the plugin that supplied the effective MCP server config, only when source is plugin"
        },
        "pluginVersion": {
          "type": "string",
          "description": "Version of the plugin that supplied the effective MCP server config, only when source is plugin"
        }
      },
      "required": [
        "name",
        "status"
      ],
      "additionalProperties": false,
      "title": "McpServersLoadedServer",
      "description": "Schema for the `McpServersLoadedServer` type."
    },
    "McpServerSource": {
      "type": "string",
      "enum": [
        "user",
        "workspace",
        "plugin",
        "builtin"
      ],
      "description": "Configuration source: user, workspace, plugin, or builtin",
      "title": "McpServerSource",
      "x-enumDescriptions": {
        "user": "Server configured in the user's global MCP configuration.",
        "workspace": "Server configured by the current workspace.",
        "plugin": "Server contributed by an installed plugin.",
        "builtin": "Server bundled with the runtime."
      }
    },
    "McpServerStatus": {
      "type": "string",
      "enum": [
        "connected",
        "failed",
        "needs-auth",
        "pending",
        "disabled",
        "not_configured"
      ],
      "description": "Connection status: connected, failed, needs-auth, pending, disabled, or not_configured",
      "title": "McpServerStatus",
      "x-enumDescriptions": {
        "connected": "The server is connected and available.",
        "failed": "The server failed to connect or initialize.",
        "needs-auth": "The server requires authentication before it can connect.",
        "pending": "The server connection is still being established.",
        "disabled": "The server is configured but disabled.",
        "not_configured": "The server is not configured for this session."
      }
    },
    "McpServerStatusChangedData": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server whose status changed"
        },
        "status": {
          "$ref": "#/definitions/McpServerStatus",
          "description": "Connection status: connected, failed, needs-auth, pending, disabled, or not_configured"
        },
        "error": {
          "type": "string",
          "description": "Error message if the server entered a failed state"
        }
      },
      "required": [
        "serverName",
        "status"
      ],
      "additionalProperties": false,
      "title": "McpServerStatusChangedData",
      "description": "Schema for the `McpServerStatusChangedData` type."
    },
    "McpServerStatusChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.mcp_server_status_changed",
          "description": "Type discriminator. Always \"session.mcp_server_status_changed\"."
        },
        "data": {
          "$ref": "#/definitions/McpServerStatusChangedData",
          "description": "Schema for the `McpServerStatusChangedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.mcp_server_status_changed\".",
      "title": "McpServerStatusChangedEvent"
    },
    "McpServerTransport": {
      "type": "string",
      "enum": [
        "stdio",
        "http",
        "sse",
        "memory"
      ],
      "description": "Transport mechanism: stdio, http, sse (deprecated), or memory (in-process MCP server)",
      "title": "McpServerTransport",
      "x-enumDescriptions": {
        "stdio": "Server communicates over stdio with a local child process.",
        "http": "Server communicates over streamable HTTP.",
        "sse": "Server communicates over Server-Sent Events (deprecated).",
        "memory": "Server is backed by an in-memory runtime implementation."
      }
    },
    "ModeChangedData": {
      "type": "object",
      "properties": {
        "previousMode": {
          "$ref": "#/definitions/SessionMode",
          "description": "The session mode the agent is operating in"
        },
        "newMode": {
          "$ref": "#/definitions/SessionMode",
          "description": "The session mode the agent is operating in"
        }
      },
      "required": [
        "previousMode",
        "newMode"
      ],
      "additionalProperties": false,
      "description": "Agent mode change details including previous and new modes",
      "title": "ModeChangedData"
    },
    "ModeChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.mode_changed",
          "description": "Type discriminator. Always \"session.mode_changed\"."
        },
        "data": {
          "$ref": "#/definitions/ModeChangedData",
          "description": "Agent mode change details including previous and new modes"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.mode_changed\". Agent mode change details including previous and new modes",
      "title": "ModeChangedEvent"
    },
    "ModelCallFailureData": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "description": "Model identifier used for the failed API call"
        },
        "initiator": {
          "type": "string",
          "description": "What initiated this API call (e.g., \"sub-agent\", \"mcp-sampling\"); absent for user-initiated calls"
        },
        "apiCallId": {
          "type": "string",
          "description": "Completion ID from the model provider (e.g., chatcmpl-abc123)"
        },
        "providerCallId": {
          "type": "string",
          "description": "GitHub request tracing ID (x-github-request-id header) for server-side log correlation"
        },
        "serviceRequestId": {
          "type": "string",
          "description": "Copilot service request ID (x-copilot-service-request-id header) for CAPI log correlation"
        },
        "statusCode": {
          "type": "integer",
          "minimum": 0,
          "maximum": 999,
          "description": "HTTP status code from the failed request"
        },
        "durationMs": {
          "type": "integer",
          "minimum": 0,
          "description": "Duration of the failed API call in milliseconds",
          "format": "duration"
        },
        "source": {
          "$ref": "#/definitions/ModelCallFailureSource",
          "description": "Where the failed model call originated"
        },
        "errorMessage": {
          "type": "string",
          "description": "Raw provider/runtime error message for restricted telemetry"
        }
      },
      "required": [
        "source"
      ],
      "additionalProperties": false,
      "description": "Failed LLM API call metadata for telemetry",
      "title": "ModelCallFailureData"
    },
    "ModelCallFailureEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "model.call_failure",
          "description": "Type discriminator. Always \"model.call_failure\"."
        },
        "data": {
          "$ref": "#/definitions/ModelCallFailureData",
          "description": "Failed LLM API call metadata for telemetry"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"model.call_failure\". Failed LLM API call metadata for telemetry",
      "title": "ModelCallFailureEvent"
    },
    "ModelCallFailureSource": {
      "type": "string",
      "enum": [
        "top_level",
        "subagent",
        "mcp_sampling"
      ],
      "description": "Where the failed model call originated",
      "title": "ModelCallFailureSource",
      "x-enumDescriptions": {
        "top_level": "Model call from the top-level agent.",
        "subagent": "Model call from a sub-agent.",
        "mcp_sampling": "Model call from MCP sampling."
      }
    },
    "ModelChangeData": {
      "type": "object",
      "properties": {
        "previousModel": {
          "type": "string",
          "description": "Model that was previously selected, if any"
        },
        "newModel": {
          "type": "string",
          "description": "Newly selected model identifier"
        },
        "previousReasoningEffort": {
          "type": "string",
          "description": "Reasoning effort level before the model change, if applicable"
        },
        "reasoningEffort": {
          "type": [
            "string",
            "null"
          ],
          "description": "Reasoning effort level after the model change, if applicable"
        },
        "previousReasoningSummary": {
          "$ref": "#/definitions/ReasoningSummary",
          "description": "Reasoning summary mode before the model change, if applicable"
        },
        "reasoningSummary": {
          "$ref": "#/definitions/ReasoningSummary",
          "description": "Reasoning summary mode after the model change, if applicable"
        },
        "contextTier": {
          "anyOf": [
            {
              "$ref": "#/definitions/ContextTier"
            },
            {
              "type": "null"
            }
          ],
          "description": "Context tier after the model change; null explicitly clears a previously selected tier"
        },
        "cause": {
          "type": "string",
          "description": "Reason the change happened, when not user-initiated. Currently `\"rate_limit_auto_switch\"` for changes triggered by the auto-mode-switch rate-limit recovery path. UI clients can use this to render contextual copy."
        }
      },
      "required": [
        "newModel"
      ],
      "additionalProperties": false,
      "description": "Model change details including previous and new model identifiers",
      "title": "ModelChangeData"
    },
    "ModelChangeEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.model_change",
          "description": "Type discriminator. Always \"session.model_change\"."
        },
        "data": {
          "$ref": "#/definitions/ModelChangeData",
          "description": "Model change details including previous and new model identifiers"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.model_change\". Model change details including previous and new model identifiers",
      "title": "ModelChangeEvent"
    },
    "PendingMessagesModifiedData": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Empty payload; the event signals that the pending message queue has changed",
      "title": "PendingMessagesModifiedData"
    },
    "PendingMessagesModifiedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "pending_messages.modified",
          "description": "Type discriminator. Always \"pending_messages.modified\"."
        },
        "data": {
          "$ref": "#/definitions/PendingMessagesModifiedData",
          "description": "Empty payload; the event signals that the pending message queue has changed"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"pending_messages.modified\". Empty payload; the event signals that the pending message queue has changed",
      "title": "PendingMessagesModifiedEvent"
    },
    "PermissionApproved": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approved",
          "description": "The permission request was approved"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "title": "PermissionApproved",
      "description": "Schema for the `PermissionApproved` type."
    },
    "PermissionApprovedForLocation": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approved-for-location",
          "description": "Approved and persisted for this project location"
        },
        "approval": {
          "$ref": "#/definitions/UserToolSessionApproval",
          "description": "The approval to persist for this location"
        },
        "locationKey": {
          "type": "string",
          "description": "The location key (git root or cwd) to persist the approval to"
        }
      },
      "required": [
        "kind",
        "approval",
        "locationKey"
      ],
      "additionalProperties": false,
      "title": "PermissionApprovedForLocation",
      "description": "Schema for the `PermissionApprovedForLocation` type."
    },
    "PermissionApprovedForSession": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approved-for-session",
          "description": "Approved and remembered for the rest of the session"
        },
        "approval": {
          "$ref": "#/definitions/UserToolSessionApproval",
          "description": "The approval to add as a session-scoped rule"
        }
      },
      "required": [
        "kind",
        "approval"
      ],
      "additionalProperties": false,
      "title": "PermissionApprovedForSession",
      "description": "Schema for the `PermissionApprovedForSession` type."
    },
    "PermissionCancelled": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "cancelled",
          "description": "The permission request was cancelled before a response was used"
        },
        "reason": {
          "type": "string",
          "description": "Optional explanation of why the request was cancelled"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "title": "PermissionCancelled",
      "description": "Schema for the `PermissionCancelled` type."
    },
    "PermissionCompletedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the resolved permission request; clients should dismiss any UI for this request"
        },
        "toolCallId": {
          "type": "string",
          "description": "Optional tool call ID associated with this permission prompt; clients may use it to correlate UI created from tool-scoped prompts"
        },
        "result": {
          "$ref": "#/definitions/PermissionResult",
          "description": "The result of the permission request"
        }
      },
      "required": [
        "requestId",
        "result"
      ],
      "additionalProperties": false,
      "description": "Permission request completion notification signaling UI dismissal",
      "title": "PermissionCompletedData"
    },
    "PermissionCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "permission.completed",
          "description": "Type discriminator. Always \"permission.completed\"."
        },
        "data": {
          "$ref": "#/definitions/PermissionCompletedData",
          "description": "Permission request completion notification signaling UI dismissal"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"permission.completed\". Permission request completion notification signaling UI dismissal",
      "title": "PermissionCompletedEvent"
    },
    "PermissionDeniedByContentExclusionPolicy": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-by-content-exclusion-policy",
          "description": "Denied by the organization's content exclusion policy"
        },
        "path": {
          "type": "string",
          "description": "File path that triggered the exclusion"
        },
        "message": {
          "type": "string",
          "description": "Human-readable explanation of why the path was excluded"
        }
      },
      "required": [
        "kind",
        "path",
        "message"
      ],
      "additionalProperties": false,
      "title": "PermissionDeniedByContentExclusionPolicy",
      "description": "Schema for the `PermissionDeniedByContentExclusionPolicy` type."
    },
    "PermissionDeniedByPermissionRequestHook": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-by-permission-request-hook",
          "description": "Denied by a permission request hook registered by an extension or plugin"
        },
        "message": {
          "type": "string",
          "description": "Optional message from the hook explaining the denial"
        },
        "interrupt": {
          "type": "boolean",
          "description": "Whether to interrupt the current agent turn"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "title": "PermissionDeniedByPermissionRequestHook",
      "description": "Schema for the `PermissionDeniedByPermissionRequestHook` type."
    },
    "PermissionDeniedByRules": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-by-rules",
          "description": "Denied because approval rules explicitly blocked it"
        },
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionRule"
          },
          "description": "Rules that denied the request"
        }
      },
      "required": [
        "kind",
        "rules"
      ],
      "additionalProperties": false,
      "title": "PermissionDeniedByRules",
      "description": "Schema for the `PermissionDeniedByRules` type."
    },
    "PermissionDeniedInteractivelyByUser": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-interactively-by-user",
          "description": "Denied by the user during an interactive prompt"
        },
        "feedback": {
          "type": "string",
          "description": "Optional feedback from the user explaining the denial"
        },
        "forceReject": {
          "type": "boolean",
          "description": "Whether to force-reject the current agent turn"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "title": "PermissionDeniedInteractivelyByUser",
      "description": "Schema for the `PermissionDeniedInteractivelyByUser` type."
    },
    "PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-no-approval-rule-and-could-not-request-from-user",
          "description": "Denied because no approval rule matched and user confirmation was unavailable"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "title": "PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser",
      "description": "Schema for the `PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser` type."
    },
    "PermissionPromptRequest": {
      "anyOf": [
        {
          "$ref": "#/definitions/PermissionPromptRequestCommands",
          "description": "Shell command permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestWrite",
          "description": "File write permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestRead",
          "description": "File read permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestMcp",
          "description": "MCP tool invocation permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestUrl",
          "description": "URL access permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestMemory",
          "description": "Memory operation permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestCustomTool",
          "description": "Custom tool invocation permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestPath",
          "description": "Path access permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestHook",
          "description": "Hook confirmation permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestExtensionManagement",
          "description": "Extension management permission prompt"
        },
        {
          "$ref": "#/definitions/PermissionPromptRequestExtensionPermissionAccess",
          "description": "Extension permission access prompt"
        }
      ],
      "description": "Derived user-facing permission prompt details for UI consumers",
      "title": "PermissionPromptRequest"
    },
    "PermissionPromptRequestCommands": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "commands",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "fullCommandText": {
          "type": "string",
          "description": "The complete shell command text to be executed"
        },
        "intention": {
          "type": "string",
          "description": "Human-readable description of what the command intends to do"
        },
        "commandIdentifiers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Command identifiers covered by this approval prompt"
        },
        "canOfferSessionApproval": {
          "type": "boolean",
          "description": "Whether the UI can offer session-wide approval for this command pattern"
        },
        "warning": {
          "type": "string",
          "description": "Optional warning message about risks of running this command"
        }
      },
      "required": [
        "kind",
        "fullCommandText",
        "intention",
        "commandIdentifiers",
        "canOfferSessionApproval"
      ],
      "additionalProperties": false,
      "description": "Shell command permission prompt",
      "title": "PermissionPromptRequestCommands"
    },
    "PermissionPromptRequestCustomTool": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "custom-tool",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "toolName": {
          "type": "string",
          "description": "Name of the custom tool"
        },
        "toolDescription": {
          "type": "string",
          "description": "Description of what the custom tool does"
        },
        "args": {
          "description": "Arguments to pass to the custom tool",
          "x-opaque-json": true
        }
      },
      "required": [
        "kind",
        "toolName",
        "toolDescription"
      ],
      "additionalProperties": false,
      "description": "Custom tool invocation permission prompt",
      "title": "PermissionPromptRequestCustomTool"
    },
    "PermissionPromptRequestExtensionManagement": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-management",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "operation": {
          "type": "string",
          "description": "The extension management operation (scaffold, reload)"
        },
        "extensionName": {
          "type": "string",
          "description": "Name of the extension being managed"
        }
      },
      "required": [
        "kind",
        "operation"
      ],
      "additionalProperties": false,
      "description": "Extension management permission prompt",
      "title": "PermissionPromptRequestExtensionManagement"
    },
    "PermissionPromptRequestExtensionPermissionAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-permission-access",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "extensionName": {
          "type": "string",
          "description": "Name of the extension requesting permission access"
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Capabilities the extension is requesting"
        }
      },
      "required": [
        "kind",
        "extensionName",
        "capabilities"
      ],
      "additionalProperties": false,
      "description": "Extension permission access prompt",
      "title": "PermissionPromptRequestExtensionPermissionAccess"
    },
    "PermissionPromptRequestHook": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "hook",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "toolName": {
          "type": "string",
          "description": "Name of the tool the hook is gating"
        },
        "toolArgs": {
          "description": "Arguments of the tool call being gated",
          "x-opaque-json": true
        },
        "hookMessage": {
          "type": "string",
          "description": "Optional message from the hook explaining why confirmation is needed"
        }
      },
      "required": [
        "kind",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Hook confirmation permission prompt",
      "title": "PermissionPromptRequestHook"
    },
    "PermissionPromptRequestMcp": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server providing the tool"
        },
        "toolName": {
          "type": "string",
          "description": "Internal name of the MCP tool"
        },
        "toolTitle": {
          "type": "string",
          "description": "Human-readable title of the MCP tool"
        },
        "args": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "description": "Arguments to pass to the MCP tool",
          "x-opaque-json": true
        }
      },
      "required": [
        "kind",
        "serverName",
        "toolName",
        "toolTitle"
      ],
      "additionalProperties": false,
      "description": "MCP tool invocation permission prompt",
      "title": "PermissionPromptRequestMcp"
    },
    "PermissionPromptRequestMemory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "memory",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "action": {
          "$ref": "#/definitions/PermissionRequestMemoryAction",
          "description": "Whether this is a store or vote memory operation"
        },
        "subject": {
          "type": "string",
          "description": "Topic or subject of the memory (store only)"
        },
        "fact": {
          "type": "string",
          "description": "The fact being stored or voted on"
        },
        "citations": {
          "type": "string",
          "description": "Source references for the stored fact (store only)"
        },
        "direction": {
          "$ref": "#/definitions/PermissionRequestMemoryDirection",
          "description": "Vote direction (vote only)"
        },
        "reason": {
          "type": "string",
          "description": "Reason for the vote (vote only)"
        }
      },
      "required": [
        "kind",
        "fact"
      ],
      "additionalProperties": false,
      "description": "Memory operation permission prompt",
      "title": "PermissionPromptRequestMemory"
    },
    "PermissionPromptRequestPath": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "path",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "accessKind": {
          "$ref": "#/definitions/PermissionPromptRequestPathAccessKind",
          "description": "Underlying permission kind that needs path approval"
        },
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "File paths that require explicit approval"
        }
      },
      "required": [
        "kind",
        "accessKind",
        "paths"
      ],
      "additionalProperties": false,
      "description": "Path access permission prompt",
      "title": "PermissionPromptRequestPath"
    },
    "PermissionPromptRequestPathAccessKind": {
      "type": "string",
      "enum": [
        "read",
        "shell",
        "write"
      ],
      "description": "Underlying permission kind that needs path approval",
      "title": "PermissionPromptRequestPathAccessKind",
      "x-enumDescriptions": {
        "read": "Read access to a filesystem path.",
        "shell": "Shell command access involving a filesystem path.",
        "write": "Write access to a filesystem path."
      }
    },
    "PermissionPromptRequestRead": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "read",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "intention": {
          "type": "string",
          "description": "Human-readable description of why the file is being read"
        },
        "path": {
          "type": "string",
          "description": "Path of the file or directory being read"
        }
      },
      "required": [
        "kind",
        "intention",
        "path"
      ],
      "additionalProperties": false,
      "description": "File read permission prompt",
      "title": "PermissionPromptRequestRead"
    },
    "PermissionPromptRequestUrl": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "url",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "intention": {
          "type": "string",
          "description": "Human-readable description of why the URL is being accessed"
        },
        "url": {
          "type": "string",
          "description": "URL to be fetched"
        }
      },
      "required": [
        "kind",
        "intention",
        "url"
      ],
      "additionalProperties": false,
      "description": "URL access permission prompt",
      "title": "PermissionPromptRequestUrl"
    },
    "PermissionPromptRequestWrite": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "write",
          "description": "Prompt kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "intention": {
          "type": "string",
          "description": "Human-readable description of the intended file change"
        },
        "fileName": {
          "type": "string",
          "description": "Path of the file being written to"
        },
        "diff": {
          "type": "string",
          "description": "Unified diff showing the proposed changes"
        },
        "newFileContents": {
          "type": "string",
          "description": "Complete new file contents for newly created files"
        },
        "canOfferSessionApproval": {
          "type": "boolean",
          "description": "Whether the UI can offer session-wide approval for file write operations"
        }
      },
      "required": [
        "kind",
        "intention",
        "fileName",
        "diff",
        "canOfferSessionApproval"
      ],
      "additionalProperties": false,
      "description": "File write permission prompt",
      "title": "PermissionPromptRequestWrite"
    },
    "PermissionRequest": {
      "anyOf": [
        {
          "$ref": "#/definitions/PermissionRequestShell",
          "description": "Shell command permission request"
        },
        {
          "$ref": "#/definitions/PermissionRequestWrite",
          "description": "File write permission request"
        },
        {
          "$ref": "#/definitions/PermissionRequestRead",
          "description": "File or directory read permission request"
        },
        {
          "$ref": "#/definitions/PermissionRequestMcp",
          "description": "MCP tool invocation permission request"
        },
        {
          "$ref": "#/definitions/PermissionRequestUrl",
          "description": "URL access permission request"
        },
        {
          "$ref": "#/definitions/PermissionRequestMemory",
          "description": "Memory operation permission request"
        },
        {
          "$ref": "#/definitions/PermissionRequestCustomTool",
          "description": "Custom tool invocation permission request"
        },
        {
          "$ref": "#/definitions/PermissionRequestHook",
          "description": "Hook confirmation permission request"
        },
        {
          "$ref": "#/definitions/PermissionRequestExtensionManagement",
          "description": "Extension management permission request"
        },
        {
          "$ref": "#/definitions/PermissionRequestExtensionPermissionAccess",
          "description": "Extension permission access request"
        }
      ],
      "description": "Details of the permission being requested",
      "title": "PermissionRequest"
    },
    "PermissionRequestCustomTool": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "custom-tool",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "toolName": {
          "type": "string",
          "description": "Name of the custom tool"
        },
        "toolDescription": {
          "type": "string",
          "description": "Description of what the custom tool does"
        },
        "args": {
          "description": "Arguments to pass to the custom tool",
          "x-opaque-json": true
        }
      },
      "required": [
        "kind",
        "toolName",
        "toolDescription"
      ],
      "additionalProperties": false,
      "description": "Custom tool invocation permission request",
      "title": "PermissionRequestCustomTool"
    },
    "PermissionRequestedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for this permission request; used to respond via session.respondToPermission()"
        },
        "permissionRequest": {
          "$ref": "#/definitions/PermissionRequest",
          "description": "Details of the permission being requested"
        },
        "promptRequest": {
          "$ref": "#/definitions/PermissionPromptRequest",
          "description": "Derived user-facing permission prompt details for UI consumers"
        },
        "resolvedByHook": {
          "type": "boolean",
          "description": "When true, this permission was already resolved by a permissionRequest hook and requires no client action"
        }
      },
      "required": [
        "requestId",
        "permissionRequest"
      ],
      "additionalProperties": false,
      "description": "Permission request notification requiring client approval with request details",
      "title": "PermissionRequestedData"
    },
    "PermissionRequestedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "permission.requested",
          "description": "Type discriminator. Always \"permission.requested\"."
        },
        "data": {
          "$ref": "#/definitions/PermissionRequestedData",
          "description": "Permission request notification requiring client approval with request details"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"permission.requested\". Permission request notification requiring client approval with request details",
      "title": "PermissionRequestedEvent"
    },
    "PermissionRequestExtensionManagement": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-management",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "operation": {
          "type": "string",
          "description": "The extension management operation (scaffold, reload)"
        },
        "extensionName": {
          "type": "string",
          "description": "Name of the extension being managed"
        }
      },
      "required": [
        "kind",
        "operation"
      ],
      "additionalProperties": false,
      "description": "Extension management permission request",
      "title": "PermissionRequestExtensionManagement"
    },
    "PermissionRequestExtensionPermissionAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-permission-access",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "extensionName": {
          "type": "string",
          "description": "Name of the extension requesting permission access"
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Capabilities the extension is requesting"
        }
      },
      "required": [
        "kind",
        "extensionName",
        "capabilities"
      ],
      "additionalProperties": false,
      "description": "Extension permission access request",
      "title": "PermissionRequestExtensionPermissionAccess"
    },
    "PermissionRequestHook": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "hook",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "toolName": {
          "type": "string",
          "description": "Name of the tool the hook is gating"
        },
        "toolArgs": {
          "description": "Arguments of the tool call being gated",
          "x-opaque-json": true
        },
        "hookMessage": {
          "type": "string",
          "description": "Optional message from the hook explaining why confirmation is needed"
        }
      },
      "required": [
        "kind",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Hook confirmation permission request",
      "title": "PermissionRequestHook"
    },
    "PermissionRequestMcp": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server providing the tool"
        },
        "toolName": {
          "type": "string",
          "description": "Internal name of the MCP tool"
        },
        "toolTitle": {
          "type": "string",
          "description": "Human-readable title of the MCP tool"
        },
        "args": {
          "description": "Arguments to pass to the MCP tool",
          "x-opaque-json": true
        },
        "readOnly": {
          "type": "boolean",
          "description": "Whether this MCP tool is read-only (no side effects)"
        }
      },
      "required": [
        "kind",
        "serverName",
        "toolName",
        "toolTitle",
        "readOnly"
      ],
      "additionalProperties": false,
      "description": "MCP tool invocation permission request",
      "title": "PermissionRequestMcp"
    },
    "PermissionRequestMemory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "memory",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "action": {
          "$ref": "#/definitions/PermissionRequestMemoryAction",
          "description": "Whether this is a store or vote memory operation"
        },
        "subject": {
          "type": "string",
          "description": "Topic or subject of the memory (store only)"
        },
        "fact": {
          "type": "string",
          "description": "The fact being stored or voted on"
        },
        "citations": {
          "type": "string",
          "description": "Source references for the stored fact (store only)"
        },
        "direction": {
          "$ref": "#/definitions/PermissionRequestMemoryDirection",
          "description": "Vote direction (vote only)"
        },
        "reason": {
          "type": "string",
          "description": "Reason for the vote (vote only)"
        }
      },
      "required": [
        "kind",
        "fact"
      ],
      "additionalProperties": false,
      "description": "Memory operation permission request",
      "title": "PermissionRequestMemory"
    },
    "PermissionRequestMemoryAction": {
      "type": "string",
      "enum": [
        "store",
        "vote"
      ],
      "description": "Whether this is a store or vote memory operation",
      "default": "store",
      "title": "PermissionRequestMemoryAction",
      "x-enumDescriptions": {
        "store": "Store a new memory.",
        "vote": "Vote on an existing memory."
      }
    },
    "PermissionRequestMemoryDirection": {
      "type": "string",
      "enum": [
        "upvote",
        "downvote"
      ],
      "description": "Vote direction (vote only)",
      "title": "PermissionRequestMemoryDirection",
      "x-enumDescriptions": {
        "upvote": "Vote that the memory is useful or accurate.",
        "downvote": "Vote that the memory is incorrect or outdated."
      }
    },
    "PermissionRequestRead": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "read",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "intention": {
          "type": "string",
          "description": "Human-readable description of why the file is being read"
        },
        "path": {
          "type": "string",
          "description": "Path of the file or directory being read"
        }
      },
      "required": [
        "kind",
        "intention",
        "path"
      ],
      "additionalProperties": false,
      "description": "File or directory read permission request",
      "title": "PermissionRequestRead"
    },
    "PermissionRequestShell": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "shell",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "fullCommandText": {
          "type": "string",
          "description": "The complete shell command text to be executed"
        },
        "intention": {
          "type": "string",
          "description": "Human-readable description of what the command intends to do"
        },
        "commands": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionRequestShellCommand"
          },
          "description": "Parsed command identifiers found in the command text"
        },
        "possiblePaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "File paths that may be read or written by the command"
        },
        "possibleUrls": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionRequestShellPossibleUrl"
          },
          "description": "URLs that may be accessed by the command"
        },
        "hasWriteFileRedirection": {
          "type": "boolean",
          "description": "Whether the command includes a file write redirection (e.g., > or >>)"
        },
        "canOfferSessionApproval": {
          "type": "boolean",
          "description": "Whether the UI can offer session-wide approval for this command pattern"
        },
        "warning": {
          "type": "string",
          "description": "Optional warning message about risks of running this command"
        }
      },
      "required": [
        "kind",
        "fullCommandText",
        "intention",
        "commands",
        "possiblePaths",
        "possibleUrls",
        "hasWriteFileRedirection",
        "canOfferSessionApproval"
      ],
      "additionalProperties": false,
      "description": "Shell command permission request",
      "title": "PermissionRequestShell"
    },
    "PermissionRequestShellCommand": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "Command identifier (e.g., executable name)"
        },
        "readOnly": {
          "type": "boolean",
          "description": "Whether this command is read-only (no side effects)"
        }
      },
      "required": [
        "identifier",
        "readOnly"
      ],
      "additionalProperties": false,
      "title": "PermissionRequestShellCommand",
      "description": "Schema for the `PermissionRequestShellCommand` type."
    },
    "PermissionRequestShellPossibleUrl": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "URL that may be accessed by the command"
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false,
      "title": "PermissionRequestShellPossibleUrl",
      "description": "Schema for the `PermissionRequestShellPossibleUrl` type."
    },
    "PermissionRequestUrl": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "url",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "intention": {
          "type": "string",
          "description": "Human-readable description of why the URL is being accessed"
        },
        "url": {
          "type": "string",
          "description": "URL to be fetched"
        }
      },
      "required": [
        "kind",
        "intention",
        "url"
      ],
      "additionalProperties": false,
      "description": "URL access permission request",
      "title": "PermissionRequestUrl"
    },
    "PermissionRequestWrite": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "write",
          "description": "Permission kind discriminator"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID that triggered this permission request"
        },
        "intention": {
          "type": "string",
          "description": "Human-readable description of the intended file change"
        },
        "fileName": {
          "type": "string",
          "description": "Path of the file being written to"
        },
        "diff": {
          "type": "string",
          "description": "Unified diff showing the proposed changes"
        },
        "newFileContents": {
          "type": "string",
          "description": "Complete new file contents for newly created files"
        },
        "canOfferSessionApproval": {
          "type": "boolean",
          "description": "Whether the UI can offer session-wide approval for file write operations"
        }
      },
      "required": [
        "kind",
        "intention",
        "fileName",
        "diff",
        "canOfferSessionApproval"
      ],
      "additionalProperties": false,
      "description": "File write permission request",
      "title": "PermissionRequestWrite"
    },
    "PermissionResult": {
      "anyOf": [
        {
          "$ref": "#/definitions/PermissionApproved"
        },
        {
          "$ref": "#/definitions/PermissionApprovedForSession"
        },
        {
          "$ref": "#/definitions/PermissionApprovedForLocation"
        },
        {
          "$ref": "#/definitions/PermissionCancelled"
        },
        {
          "$ref": "#/definitions/PermissionDeniedByRules"
        },
        {
          "$ref": "#/definitions/PermissionDeniedNoApprovalRuleAndCouldNotRequestFromUser"
        },
        {
          "$ref": "#/definitions/PermissionDeniedInteractivelyByUser"
        },
        {
          "$ref": "#/definitions/PermissionDeniedByContentExclusionPolicy"
        },
        {
          "$ref": "#/definitions/PermissionDeniedByPermissionRequestHook"
        }
      ],
      "description": "The result of the permission request",
      "title": "PermissionResult"
    },
    "PermissionRule": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "description": "The rule kind, such as Shell or GitHubMCP"
        },
        "argument": {
          "type": [
            "string",
            "null"
          ],
          "description": "Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory')."
        }
      },
      "required": [
        "kind",
        "argument"
      ],
      "additionalProperties": false,
      "title": "PermissionRule",
      "description": "Schema for the `PermissionRule` type."
    },
    "PermissionsChangedData": {
      "type": "object",
      "properties": {
        "previousAllowAllPermissions": {
          "type": "boolean",
          "description": "Aggregate allow-all flag before the change"
        },
        "allowAllPermissions": {
          "type": "boolean",
          "description": "Aggregate allow-all flag after the change"
        }
      },
      "required": [
        "previousAllowAllPermissions",
        "allowAllPermissions"
      ],
      "additionalProperties": false,
      "description": "Permissions change details carrying the aggregate allow-all boolean transition.",
      "title": "PermissionsChangedData"
    },
    "PermissionsChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.permissions_changed",
          "description": "Type discriminator. Always \"session.permissions_changed\"."
        },
        "data": {
          "$ref": "#/definitions/PermissionsChangedData",
          "description": "Permissions change details carrying the aggregate allow-all boolean transition."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.permissions_changed\". Permissions change details carrying the aggregate allow-all boolean transition.",
      "title": "PermissionsChangedEvent"
    },
    "PlanChangedData": {
      "type": "object",
      "properties": {
        "operation": {
          "$ref": "#/definitions/PlanChangedOperation",
          "description": "The type of operation performed on the plan file"
        }
      },
      "required": [
        "operation"
      ],
      "additionalProperties": false,
      "description": "Plan file operation details indicating what changed",
      "title": "PlanChangedData"
    },
    "PlanChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.plan_changed",
          "description": "Type discriminator. Always \"session.plan_changed\"."
        },
        "data": {
          "$ref": "#/definitions/PlanChangedData",
          "description": "Plan file operation details indicating what changed"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.plan_changed\". Plan file operation details indicating what changed",
      "title": "PlanChangedEvent"
    },
    "PlanChangedOperation": {
      "type": "string",
      "enum": [
        "create",
        "update",
        "delete"
      ],
      "description": "The type of operation performed on the plan file",
      "title": "PlanChangedOperation",
      "x-enumDescriptions": {
        "create": "The plan file was created.",
        "update": "The plan file was updated.",
        "delete": "The plan file was deleted."
      }
    },
    "ReasoningSummary": {
      "type": "string",
      "enum": [
        "none",
        "concise",
        "detailed"
      ],
      "description": "Reasoning summary mode used for model calls, if applicable (e.g. \"none\", \"concise\", \"detailed\")",
      "title": "ReasoningSummary",
      "x-enumDescriptions": {
        "none": "Do not request reasoning summaries from the model.",
        "concise": "Request a concise summary of the model's reasoning.",
        "detailed": "Request a detailed summary of the model's reasoning."
      }
    },
    "RemoteSteerableChangedData": {
      "type": "object",
      "properties": {
        "remoteSteerable": {
          "type": "boolean",
          "description": "Whether this session now supports remote steering via GitHub"
        }
      },
      "required": [
        "remoteSteerable"
      ],
      "additionalProperties": false,
      "description": "Notifies that the session's remote steering capability has changed",
      "title": "RemoteSteerableChangedData"
    },
    "RemoteSteerableChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.remote_steerable_changed",
          "description": "Type discriminator. Always \"session.remote_steerable_changed\"."
        },
        "data": {
          "$ref": "#/definitions/RemoteSteerableChangedData",
          "description": "Notifies that the session's remote steering capability has changed"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.remote_steerable_changed\". Notifies that the session's remote steering capability has changed",
      "title": "RemoteSteerableChangedEvent"
    },
    "ResumeData": {
      "type": "object",
      "properties": {
        "resumeTime": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the session was resumed"
        },
        "eventCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of persisted events in the session at the time of resume"
        },
        "eventsFileSizeBytes": {
          "type": "integer",
          "minimum": 0,
          "description": "On-disk byte size of the session's persisted events.jsonl file at resume time; omitted when the file does not exist or cannot be stat'd"
        },
        "selectedModel": {
          "type": "string",
          "description": "Model currently selected at resume time"
        },
        "reasoningEffort": {
          "type": "string",
          "description": "Reasoning effort level used for model calls, if applicable (e.g. \"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\")"
        },
        "reasoningSummary": {
          "$ref": "#/definitions/ReasoningSummary",
          "description": "Reasoning summary mode used for model calls, if applicable (e.g. \"none\", \"concise\", \"detailed\")"
        },
        "contextTier": {
          "anyOf": [
            {
              "$ref": "#/definitions/ContextTier"
            },
            {
              "type": "null"
            }
          ],
          "description": "Context tier currently selected at resume time; null when no tier is active"
        },
        "context": {
          "$ref": "#/definitions/WorkingDirectoryContext",
          "description": "Updated working directory and git context at resume time"
        },
        "alreadyInUse": {
          "type": "boolean",
          "description": "Whether the session was already in use by another client at resume time"
        },
        "sessionWasActive": {
          "type": "boolean",
          "description": "True when this resume attached to a session that the runtime already had running in-memory (for example, an extension joining a session another client was actively driving). False (or omitted) for cold resumes — the runtime had to reconstitute the session from its persisted event log."
        },
        "remoteSteerable": {
          "type": "boolean",
          "description": "Whether this session supports remote steering via GitHub"
        },
        "continuePendingWork": {
          "type": "boolean",
          "description": "When true, tool calls and permission requests left in flight by the previous session lifetime remain pending after resume and the agentic loop awaits their results. User sends are queued behind the pending work until all such requests reach a terminal state. When false (the default), any such tool calls and permission requests are immediately marked as interrupted on resume."
        }
      },
      "required": [
        "resumeTime",
        "eventCount"
      ],
      "additionalProperties": false,
      "description": "Session resume metadata including current context and event count",
      "title": "ResumeData"
    },
    "ResumeEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.resume",
          "description": "Type discriminator. Always \"session.resume\"."
        },
        "data": {
          "$ref": "#/definitions/ResumeData",
          "description": "Session resume metadata including current context and event count"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.resume\". Session resume metadata including current context and event count",
      "title": "ResumeEvent"
    },
    "SamplingCompletedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the resolved sampling request; clients should dismiss any UI for this request"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "Sampling request completion notification signaling UI dismissal",
      "title": "SamplingCompletedData"
    },
    "SamplingCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "sampling.completed",
          "description": "Type discriminator. Always \"sampling.completed\"."
        },
        "data": {
          "$ref": "#/definitions/SamplingCompletedData",
          "description": "Sampling request completion notification signaling UI dismissal"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"sampling.completed\". Sampling request completion notification signaling UI dismissal",
      "title": "SamplingCompletedEvent"
    },
    "SamplingRequestedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for this sampling request; used to respond via session.respondToSampling()"
        },
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server that initiated the sampling request"
        },
        "mcpRequestId": {
          "type": [
            "string",
            "number"
          ],
          "description": "The JSON-RPC request ID from the MCP protocol",
          "x-opaque-json": true
        }
      },
      "required": [
        "requestId",
        "serverName",
        "mcpRequestId"
      ],
      "additionalProperties": true,
      "description": "Sampling request from an MCP server; contains the server name and a requestId for correlation",
      "title": "SamplingRequestedData"
    },
    "SamplingRequestedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "sampling.requested",
          "description": "Type discriminator. Always \"sampling.requested\"."
        },
        "data": {
          "$ref": "#/definitions/SamplingRequestedData",
          "description": "Sampling request from an MCP server; contains the server name and a requestId for correlation"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"sampling.requested\". Sampling request from an MCP server; contains the server name and a requestId for correlation",
      "title": "SamplingRequestedEvent"
    },
    "ScheduleCancelledData": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Id of the scheduled prompt that was cancelled"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Scheduled prompt cancelled from the schedule manager dialog",
      "title": "ScheduleCancelledData"
    },
    "ScheduleCancelledEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.schedule_cancelled",
          "description": "Type discriminator. Always \"session.schedule_cancelled\"."
        },
        "data": {
          "$ref": "#/definitions/ScheduleCancelledData",
          "description": "Scheduled prompt cancelled from the schedule manager dialog"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.schedule_cancelled\". Scheduled prompt cancelled from the schedule manager dialog",
      "title": "ScheduleCancelledEvent"
    },
    "ScheduleCreatedData": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Sequential id assigned to the scheduled prompt within the session"
        },
        "intervalMs": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Interval between ticks in milliseconds (relative-interval schedules)",
          "format": "duration"
        },
        "cron": {
          "type": "string",
          "description": "5-field cron expression for a recurring calendar schedule, evaluated in `tz`"
        },
        "tz": {
          "type": "string",
          "description": "IANA timezone the `cron` expression is evaluated in"
        },
        "at": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Absolute fire time (epoch milliseconds) for a one-shot calendar schedule"
        },
        "prompt": {
          "type": "string",
          "description": "Prompt text that gets enqueued on every tick"
        },
        "recurring": {
          "type": "boolean",
          "description": "Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)"
        },
        "displayPrompt": {
          "type": "string",
          "description": "Optional user-facing label shown in the timeline instead of the actual prompt (e.g. `/skill-name args` when the prompt is a skill invocation expansion)"
        }
      },
      "required": [
        "id",
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Scheduled prompt registered via /every or /after",
      "title": "ScheduleCreatedData"
    },
    "ScheduleCreatedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.schedule_created",
          "description": "Type discriminator. Always \"session.schedule_created\"."
        },
        "data": {
          "$ref": "#/definitions/ScheduleCreatedData",
          "description": "Scheduled prompt registered via /every or /after"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.schedule_created\". Scheduled prompt registered via /every or /after",
      "title": "ScheduleCreatedEvent"
    },
    "SessionEvent": {
      "anyOf": [
        {
          "$ref": "#/definitions/StartEvent",
          "description": "Session event \"session.start\". Session initialization metadata including context and configuration"
        },
        {
          "$ref": "#/definitions/ResumeEvent",
          "description": "Session event \"session.resume\". Session resume metadata including current context and event count"
        },
        {
          "$ref": "#/definitions/RemoteSteerableChangedEvent",
          "description": "Session event \"session.remote_steerable_changed\". Notifies that the session's remote steering capability has changed"
        },
        {
          "$ref": "#/definitions/ErrorEvent",
          "description": "Session event \"session.error\". Error details for timeline display including message and optional diagnostic information"
        },
        {
          "$ref": "#/definitions/IdleEvent",
          "description": "Session event \"session.idle\". Payload indicating the session is idle with no background agents or attached shell commands in flight"
        },
        {
          "$ref": "#/definitions/TitleChangedEvent",
          "description": "Session event \"session.title_changed\". Session title change payload containing the new display title"
        },
        {
          "$ref": "#/definitions/ScheduleCreatedEvent",
          "description": "Session event \"session.schedule_created\". Scheduled prompt registered via /every or /after"
        },
        {
          "$ref": "#/definitions/ScheduleCancelledEvent",
          "description": "Session event \"session.schedule_cancelled\". Scheduled prompt cancelled from the schedule manager dialog"
        },
        {
          "$ref": "#/definitions/AutopilotObjectiveChangedEvent",
          "description": "Session event \"session.autopilot_objective_changed\". Autopilot objective state file operation details indicating what changed"
        },
        {
          "$ref": "#/definitions/InfoEvent",
          "description": "Session event \"session.info\". Informational message for timeline display with categorization"
        },
        {
          "$ref": "#/definitions/WarningEvent",
          "description": "Session event \"session.warning\". Warning message for timeline display with categorization"
        },
        {
          "$ref": "#/definitions/ModelChangeEvent",
          "description": "Session event \"session.model_change\". Model change details including previous and new model identifiers"
        },
        {
          "$ref": "#/definitions/ModeChangedEvent",
          "description": "Session event \"session.mode_changed\". Agent mode change details including previous and new modes"
        },
        {
          "$ref": "#/definitions/PermissionsChangedEvent",
          "description": "Session event \"session.permissions_changed\". Permissions change details carrying the aggregate allow-all boolean transition."
        },
        {
          "$ref": "#/definitions/PlanChangedEvent",
          "description": "Session event \"session.plan_changed\". Plan file operation details indicating what changed"
        },
        {
          "$ref": "#/definitions/TodosChangedEvent",
          "description": "Session event \"session.todos_changed\". Signal-only event: the agent's todos or todo_deps table was written to. No payload — clients should call session.plan.readSqlTodosWithDependencies() to fetch the current state. Events arrive in order; clients can debounce on arrival if needed."
        },
        {
          "$ref": "#/definitions/WorkspaceFileChangedEvent",
          "description": "Session event \"session.workspace_file_changed\". Workspace file change details including path and operation type"
        },
        {
          "$ref": "#/definitions/HandoffEvent",
          "description": "Session event \"session.handoff\". Session handoff metadata including source, context, and repository information"
        },
        {
          "$ref": "#/definitions/TruncationEvent",
          "description": "Session event \"session.truncation\". Conversation truncation statistics including token counts and removed content metrics"
        },
        {
          "$ref": "#/definitions/SnapshotRewindEvent",
          "description": "Session event \"session.snapshot_rewind\". Session rewind details including target event and count of removed events"
        },
        {
          "$ref": "#/definitions/ShutdownEvent",
          "description": "Session event \"session.shutdown\". Session termination metrics including usage statistics, code changes, and shutdown reason"
        },
        {
          "$ref": "#/definitions/ContextChangedEvent",
          "description": "Session event \"session.context_changed\". Updated working directory and git context after the change"
        },
        {
          "$ref": "#/definitions/UsageInfoEvent",
          "description": "Session event \"session.usage_info\". Current context window usage statistics including token and message counts"
        },
        {
          "$ref": "#/definitions/CompactionStartEvent",
          "description": "Session event \"session.compaction_start\". Context window breakdown at the start of LLM-powered conversation compaction"
        },
        {
          "$ref": "#/definitions/CompactionCompleteEvent",
          "description": "Session event \"session.compaction_complete\". Conversation compaction results including success status, metrics, and optional error details"
        },
        {
          "$ref": "#/definitions/TaskCompleteEvent",
          "description": "Session event \"session.task_complete\". Task completion notification with summary from the agent"
        },
        {
          "$ref": "#/definitions/UserMessageEvent",
          "description": "Session event \"user.message\"."
        },
        {
          "$ref": "#/definitions/PendingMessagesModifiedEvent",
          "description": "Session event \"pending_messages.modified\". Empty payload; the event signals that the pending message queue has changed"
        },
        {
          "$ref": "#/definitions/AssistantTurnStartEvent",
          "description": "Session event \"assistant.turn_start\". Turn initialization metadata including identifier and interaction tracking"
        },
        {
          "$ref": "#/definitions/AssistantIntentEvent",
          "description": "Session event \"assistant.intent\". Agent intent description for current activity or plan"
        },
        {
          "$ref": "#/definitions/AssistantReasoningEvent",
          "description": "Session event \"assistant.reasoning\". Assistant reasoning content for timeline display with complete thinking text"
        },
        {
          "$ref": "#/definitions/AssistantReasoningDeltaEvent",
          "description": "Session event \"assistant.reasoning_delta\". Streaming reasoning delta for incremental extended thinking updates"
        },
        {
          "$ref": "#/definitions/AssistantStreamingDeltaEvent",
          "description": "Session event \"assistant.streaming_delta\". Streaming response progress with cumulative byte count"
        },
        {
          "$ref": "#/definitions/AssistantMessageEvent",
          "description": "Session event \"assistant.message\". Assistant response containing text content, optional tool requests, and interaction metadata"
        },
        {
          "$ref": "#/definitions/AssistantMessageStartEvent",
          "description": "Session event \"assistant.message_start\". Streaming assistant message start metadata"
        },
        {
          "$ref": "#/definitions/AssistantMessageDeltaEvent",
          "description": "Session event \"assistant.message_delta\". Streaming assistant message delta for incremental response updates"
        },
        {
          "$ref": "#/definitions/AssistantTurnEndEvent",
          "description": "Session event \"assistant.turn_end\". Turn completion metadata including the turn identifier"
        },
        {
          "$ref": "#/definitions/AssistantUsageEvent",
          "description": "Session event \"assistant.usage\". LLM API call usage metrics including tokens, costs, quotas, and billing information"
        },
        {
          "$ref": "#/definitions/ModelCallFailureEvent",
          "description": "Session event \"model.call_failure\". Failed LLM API call metadata for telemetry"
        },
        {
          "$ref": "#/definitions/AbortEvent",
          "description": "Session event \"abort\". Turn abort information including the reason for termination"
        },
        {
          "$ref": "#/definitions/ToolUserRequestedEvent",
          "description": "Session event \"tool.user_requested\". User-initiated tool invocation request with tool name and arguments"
        },
        {
          "$ref": "#/definitions/ToolExecutionStartEvent",
          "description": "Session event \"tool.execution_start\". Tool execution startup details including MCP server information when applicable"
        },
        {
          "$ref": "#/definitions/ToolExecutionPartialResultEvent",
          "description": "Session event \"tool.execution_partial_result\". Streaming tool execution output for incremental result display"
        },
        {
          "$ref": "#/definitions/ToolExecutionProgressEvent",
          "description": "Session event \"tool.execution_progress\". Tool execution progress notification with status message"
        },
        {
          "$ref": "#/definitions/ToolExecutionCompleteEvent",
          "description": "Session event \"tool.execution_complete\". Tool execution completion results including success status, detailed output, and error information"
        },
        {
          "$ref": "#/definitions/SkillInvokedEvent",
          "description": "Session event \"skill.invoked\". Skill invocation details including content, allowed tools, and plugin metadata"
        },
        {
          "$ref": "#/definitions/SubagentStartedEvent",
          "description": "Session event \"subagent.started\". Sub-agent startup details including parent tool call and agent information"
        },
        {
          "$ref": "#/definitions/SubagentCompletedEvent",
          "description": "Session event \"subagent.completed\". Sub-agent completion details for successful execution"
        },
        {
          "$ref": "#/definitions/SubagentFailedEvent",
          "description": "Session event \"subagent.failed\". Sub-agent failure details including error message and agent information"
        },
        {
          "$ref": "#/definitions/SubagentSelectedEvent",
          "description": "Session event \"subagent.selected\". Custom agent selection details including name and available tools"
        },
        {
          "$ref": "#/definitions/SubagentDeselectedEvent",
          "description": "Session event \"subagent.deselected\". Empty payload; the event signals that the custom agent was deselected, returning to the default agent"
        },
        {
          "$ref": "#/definitions/HookStartEvent",
          "description": "Session event \"hook.start\". Hook invocation start details including type and input data"
        },
        {
          "$ref": "#/definitions/HookEndEvent",
          "description": "Session event \"hook.end\". Hook invocation completion details including output, success status, and error information"
        },
        {
          "$ref": "#/definitions/HookProgressEvent",
          "description": "Session event \"hook.progress\". Ephemeral progress update from a running hook process"
        },
        {
          "$ref": "#/definitions/SystemMessageEvent",
          "description": "Session event \"system.message\". System/developer instruction content with role and optional template metadata"
        },
        {
          "$ref": "#/definitions/SystemNotificationEvent",
          "description": "Session event \"system.notification\". System-generated notification for runtime events like background task completion"
        },
        {
          "$ref": "#/definitions/PermissionRequestedEvent",
          "description": "Session event \"permission.requested\". Permission request notification requiring client approval with request details"
        },
        {
          "$ref": "#/definitions/PermissionCompletedEvent",
          "description": "Session event \"permission.completed\". Permission request completion notification signaling UI dismissal"
        },
        {
          "$ref": "#/definitions/UserInputRequestedEvent",
          "description": "Session event \"user_input.requested\". User input request notification with question and optional predefined choices"
        },
        {
          "$ref": "#/definitions/UserInputCompletedEvent",
          "description": "Session event \"user_input.completed\". User input request completion with the user's response"
        },
        {
          "$ref": "#/definitions/ElicitationRequestedEvent",
          "description": "Session event \"elicitation.requested\". Elicitation request; may be form-based (structured input) or URL-based (browser redirect)"
        },
        {
          "$ref": "#/definitions/ElicitationCompletedEvent",
          "description": "Session event \"elicitation.completed\". Elicitation request completion with the user's response"
        },
        {
          "$ref": "#/definitions/SamplingRequestedEvent",
          "description": "Session event \"sampling.requested\". Sampling request from an MCP server; contains the server name and a requestId for correlation"
        },
        {
          "$ref": "#/definitions/SamplingCompletedEvent",
          "description": "Session event \"sampling.completed\". Sampling request completion notification signaling UI dismissal"
        },
        {
          "$ref": "#/definitions/McpOauthRequiredEvent",
          "description": "Session event \"mcp.oauth_required\". OAuth authentication request for an MCP server"
        },
        {
          "$ref": "#/definitions/McpOauthCompletedEvent",
          "description": "Session event \"mcp.oauth_completed\". MCP OAuth request completion notification"
        },
        {
          "$ref": "#/definitions/CustomNotificationEvent",
          "description": "Session event \"session.custom_notification\". Opaque custom notification data. Consumers may branch on source and name, but payload semantics are source-defined."
        },
        {
          "$ref": "#/definitions/ExternalToolRequestedEvent",
          "description": "Session event \"external_tool.requested\". External tool invocation request for client-side tool execution"
        },
        {
          "$ref": "#/definitions/ExternalToolCompletedEvent",
          "description": "Session event \"external_tool.completed\". External tool completion notification signaling UI dismissal"
        },
        {
          "$ref": "#/definitions/CommandQueuedEvent",
          "description": "Session event \"command.queued\". Queued slash command dispatch request for client execution"
        },
        {
          "$ref": "#/definitions/CommandExecuteEvent",
          "description": "Session event \"command.execute\". Registered command dispatch request routed to the owning client"
        },
        {
          "$ref": "#/definitions/CommandCompletedEvent",
          "description": "Session event \"command.completed\". Queued command completion notification signaling UI dismissal"
        },
        {
          "$ref": "#/definitions/AutoModeSwitchRequestedEvent",
          "description": "Session event \"auto_mode_switch.requested\". Auto mode switch request notification requiring user approval"
        },
        {
          "$ref": "#/definitions/AutoModeSwitchCompletedEvent",
          "description": "Session event \"auto_mode_switch.completed\". Auto mode switch completion notification"
        },
        {
          "$ref": "#/definitions/CommandsChangedEvent",
          "description": "Session event \"commands.changed\". SDK command registration change notification"
        },
        {
          "$ref": "#/definitions/CapabilitiesChangedEvent",
          "description": "Session event \"capabilities.changed\". Session capability change notification"
        },
        {
          "$ref": "#/definitions/ExitPlanModeRequestedEvent",
          "description": "Session event \"exit_plan_mode.requested\". Plan approval request with plan content and available user actions"
        },
        {
          "$ref": "#/definitions/ExitPlanModeCompletedEvent",
          "description": "Session event \"exit_plan_mode.completed\". Plan mode exit completion with the user's approval decision and optional feedback"
        },
        {
          "$ref": "#/definitions/ToolsUpdatedEvent",
          "description": "Session event \"session.tools_updated\"."
        },
        {
          "$ref": "#/definitions/BackgroundTasksChangedEvent",
          "description": "Session event \"session.background_tasks_changed\"."
        },
        {
          "$ref": "#/definitions/SkillsLoadedEvent",
          "description": "Session event \"session.skills_loaded\"."
        },
        {
          "$ref": "#/definitions/CustomAgentsUpdatedEvent",
          "description": "Session event \"session.custom_agents_updated\"."
        },
        {
          "$ref": "#/definitions/McpServersLoadedEvent",
          "description": "Session event \"session.mcp_servers_loaded\"."
        },
        {
          "$ref": "#/definitions/McpServerStatusChangedEvent",
          "description": "Session event \"session.mcp_server_status_changed\"."
        },
        {
          "$ref": "#/definitions/ExtensionsLoadedEvent",
          "description": "Session event \"session.extensions_loaded\"."
        },
        {
          "$ref": "#/definitions/CanvasOpenedEvent",
          "description": "Session event \"session.canvas.opened\"."
        },
        {
          "$ref": "#/definitions/CanvasRegistryChangedEvent",
          "description": "Session event \"session.canvas.registry_changed\"."
        },
        {
          "$ref": "#/definitions/CanvasClosedEvent",
          "description": "Session event \"session.canvas.closed\"."
        },
        {
          "$ref": "#/definitions/ExtensionsAttachmentsPushedEvent",
          "description": "Session event \"session.extensions.attachments_pushed\"."
        },
        {
          "$ref": "#/definitions/McpAppToolCallCompleteEvent",
          "description": "Session event \"mcp_app.tool_call_complete\". MCP App view called a tool on a connected MCP server (SEP-1865)"
        }
      ],
      "description": "Union of all session event variants emitted by the Copilot CLI runtime."
    },
    "SessionMode": {
      "type": "string",
      "enum": [
        "interactive",
        "plan",
        "autopilot"
      ],
      "description": "The session mode the agent is operating in",
      "title": "SessionMode",
      "x-enumDescriptions": {
        "interactive": "The agent is responding interactively to the user.",
        "plan": "The agent is preparing a plan before making changes.",
        "autopilot": "The agent is working autonomously toward task completion."
      }
    },
    "ShutdownCodeChanges": {
      "type": "object",
      "properties": {
        "linesAdded": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of lines added during the session"
        },
        "linesRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of lines removed during the session"
        },
        "filesModified": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of file paths that were modified during the session"
        }
      },
      "required": [
        "linesAdded",
        "linesRemoved",
        "filesModified"
      ],
      "additionalProperties": false,
      "description": "Aggregate code change metrics for the session",
      "title": "ShutdownCodeChanges"
    },
    "ShutdownData": {
      "type": "object",
      "properties": {
        "shutdownType": {
          "$ref": "#/definitions/ShutdownType",
          "description": "Whether the session ended normally (\"routine\") or due to a crash/fatal error (\"error\")"
        },
        "errorReason": {
          "type": "string",
          "description": "Error description when shutdownType is \"error\""
        },
        "totalPremiumRequests": {
          "type": "number",
          "minimum": 0,
          "description": "Total number of premium API requests used during the session",
          "visibility": "internal"
        },
        "totalNanoAiu": {
          "type": "number",
          "minimum": 0,
          "description": "Session-wide accumulated nano-AI units cost",
          "stability": "experimental"
        },
        "tokenDetails": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/ShutdownTokenDetail"
          },
          "description": "Session-wide per-token-type accumulated token counts"
        },
        "totalApiDurationMs": {
          "type": "integer",
          "minimum": 0,
          "description": "Cumulative time spent in API calls during the session, in milliseconds",
          "format": "duration"
        },
        "sessionStartTime": {
          "type": "integer",
          "minimum": 0,
          "description": "Unix timestamp (milliseconds) when the session started"
        },
        "eventsFileSizeBytes": {
          "type": "integer",
          "minimum": 0,
          "description": "On-disk byte size of the session's persisted events.jsonl file at shutdown time; omitted when the file does not exist or cannot be stat'd"
        },
        "codeChanges": {
          "$ref": "#/definitions/ShutdownCodeChanges",
          "description": "Aggregate code change metrics for the session"
        },
        "modelMetrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/ShutdownModelMetric"
          },
          "description": "Per-model usage breakdown, keyed by model identifier"
        },
        "currentModel": {
          "type": "string",
          "description": "Model that was selected at the time of shutdown"
        },
        "currentTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens in context window at shutdown"
        },
        "systemTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "System message token count at shutdown"
        },
        "conversationTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Non-system message token count at shutdown"
        },
        "toolDefinitionsTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Tool definitions token count at shutdown"
        }
      },
      "required": [
        "shutdownType",
        "totalApiDurationMs",
        "sessionStartTime",
        "codeChanges",
        "modelMetrics"
      ],
      "additionalProperties": false,
      "description": "Session termination metrics including usage statistics, code changes, and shutdown reason",
      "title": "ShutdownData"
    },
    "ShutdownEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.shutdown",
          "description": "Type discriminator. Always \"session.shutdown\"."
        },
        "data": {
          "$ref": "#/definitions/ShutdownData",
          "description": "Session termination metrics including usage statistics, code changes, and shutdown reason"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.shutdown\". Session termination metrics including usage statistics, code changes, and shutdown reason",
      "title": "ShutdownEvent"
    },
    "ShutdownModelMetric": {
      "type": "object",
      "properties": {
        "requests": {
          "$ref": "#/definitions/ShutdownModelMetricRequests",
          "description": "Request count and cost metrics"
        },
        "usage": {
          "$ref": "#/definitions/ShutdownModelMetricUsage",
          "description": "Token usage breakdown"
        },
        "totalNanoAiu": {
          "type": "number",
          "minimum": 0,
          "description": "Accumulated nano-AI units cost for this model",
          "stability": "experimental"
        },
        "tokenDetails": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/ShutdownModelMetricTokenDetail"
          },
          "description": "Token count details per type"
        }
      },
      "required": [
        "requests",
        "usage"
      ],
      "additionalProperties": false,
      "title": "ShutdownModelMetric",
      "description": "Schema for the `ShutdownModelMetric` type."
    },
    "ShutdownModelMetricRequests": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of API requests made to this model",
          "stability": "experimental"
        },
        "cost": {
          "type": "number",
          "description": "Cumulative cost multiplier for requests to this model",
          "stability": "experimental"
        }
      },
      "additionalProperties": false,
      "description": "Request count and cost metrics",
      "title": "ShutdownModelMetricRequests"
    },
    "ShutdownModelMetricTokenDetail": {
      "type": "object",
      "properties": {
        "tokenCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Accumulated token count for this token type"
        }
      },
      "required": [
        "tokenCount"
      ],
      "additionalProperties": false,
      "title": "ShutdownModelMetricTokenDetail",
      "description": "Schema for the `ShutdownModelMetricTokenDetail` type."
    },
    "ShutdownModelMetricUsage": {
      "type": "object",
      "properties": {
        "inputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total input tokens consumed across all requests to this model"
        },
        "outputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total output tokens produced across all requests to this model"
        },
        "cacheReadTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens read from prompt cache across all requests"
        },
        "cacheWriteTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens written to prompt cache across all requests"
        },
        "reasoningTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total reasoning tokens produced across all requests to this model"
        }
      },
      "required": [
        "inputTokens",
        "outputTokens",
        "cacheReadTokens",
        "cacheWriteTokens"
      ],
      "additionalProperties": false,
      "description": "Token usage breakdown",
      "title": "ShutdownModelMetricUsage"
    },
    "ShutdownTokenDetail": {
      "type": "object",
      "properties": {
        "tokenCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Accumulated token count for this token type"
        }
      },
      "required": [
        "tokenCount"
      ],
      "additionalProperties": false,
      "title": "ShutdownTokenDetail",
      "description": "Schema for the `ShutdownTokenDetail` type."
    },
    "ShutdownType": {
      "type": "string",
      "enum": [
        "routine",
        "error"
      ],
      "description": "Whether the session ended normally (\"routine\") or due to a crash/fatal error (\"error\")",
      "title": "ShutdownType",
      "x-enumDescriptions": {
        "routine": "The session ended normally.",
        "error": "The session ended because of a crash or fatal error."
      }
    },
    "SkillInvokedData": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the invoked skill"
        },
        "path": {
          "type": "string",
          "description": "File path to the SKILL.md definition"
        },
        "content": {
          "type": "string",
          "description": "Full content of the skill file, injected into the conversation for the model"
        },
        "allowedTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tool names that should be auto-approved when this skill is active"
        },
        "source": {
          "type": "string",
          "description": "Source identifier for where the skill was discovered. Known values include: project (workspace skill), inherited (parent-directory skill), personal-copilot (~/.copilot/skills), personal-agents (~/.agents/skills), custom (configured directory), plugin (installed plugin), builtin (bundled runtime skill), and remote (org/enterprise skill)"
        },
        "pluginName": {
          "type": "string",
          "description": "Name of the plugin this skill originated from, when applicable"
        },
        "pluginVersion": {
          "type": "string",
          "description": "Version of the plugin this skill originated from, when applicable"
        },
        "description": {
          "type": "string",
          "description": "Description of the skill from its SKILL.md frontmatter"
        },
        "trigger": {
          "$ref": "#/definitions/SkillInvokedTrigger",
          "description": "What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent)"
        }
      },
      "required": [
        "name",
        "path",
        "content"
      ],
      "additionalProperties": false,
      "description": "Skill invocation details including content, allowed tools, and plugin metadata",
      "title": "SkillInvokedData"
    },
    "SkillInvokedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "skill.invoked",
          "description": "Type discriminator. Always \"skill.invoked\"."
        },
        "data": {
          "$ref": "#/definitions/SkillInvokedData",
          "description": "Skill invocation details including content, allowed tools, and plugin metadata"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"skill.invoked\". Skill invocation details including content, allowed tools, and plugin metadata",
      "title": "SkillInvokedEvent"
    },
    "SkillInvokedTrigger": {
      "type": "string",
      "enum": [
        "user-invoked",
        "agent-invoked",
        "context-load"
      ],
      "description": "What triggered the skill invocation: `user-invoked` (explicit user action, such as via a slash command or UI affordance), `agent-invoked` (agent requested the skill), or `context-load` (loaded as part of another context, such as preloading skills configured on a custom agent or subagent)",
      "title": "SkillInvokedTrigger",
      "x-enumDescriptions": {
        "user-invoked": "Skill invocation requested explicitly by the user, such as via a slash command or UI affordance.",
        "agent-invoked": "Skill invocation requested by the agent.",
        "context-load": "Skill content loaded as part of another context, such as a configured custom agent or subagent."
      }
    },
    "SkillsLoadedData": {
      "type": "object",
      "properties": {
        "skills": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SkillsLoadedSkill"
          },
          "description": "Array of resolved skill metadata"
        }
      },
      "required": [
        "skills"
      ],
      "additionalProperties": false,
      "title": "SkillsLoadedData",
      "description": "Schema for the `SkillsLoadedData` type."
    },
    "SkillsLoadedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.skills_loaded",
          "description": "Type discriminator. Always \"session.skills_loaded\"."
        },
        "data": {
          "$ref": "#/definitions/SkillsLoadedData",
          "description": "Schema for the `SkillsLoadedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.skills_loaded\".",
      "title": "SkillsLoadedEvent"
    },
    "SkillsLoadedSkill": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique identifier for the skill"
        },
        "description": {
          "type": "string",
          "description": "Description of what the skill does"
        },
        "source": {
          "$ref": "#/definitions/SkillSource",
          "description": "Source location type (e.g., project, personal-copilot, plugin, builtin)"
        },
        "userInvocable": {
          "type": "boolean",
          "description": "Whether the skill can be invoked by the user as a slash command"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the skill is currently enabled"
        },
        "path": {
          "type": "string",
          "description": "Absolute path to the skill file, if available"
        }
      },
      "required": [
        "name",
        "description",
        "source",
        "userInvocable",
        "enabled"
      ],
      "additionalProperties": false,
      "title": "SkillsLoadedSkill",
      "description": "Schema for the `SkillsLoadedSkill` type."
    },
    "SkillSource": {
      "type": "string",
      "enum": [
        "project",
        "inherited",
        "personal-copilot",
        "personal-agents",
        "plugin",
        "custom",
        "builtin"
      ],
      "description": "Source location type (e.g., project, personal-copilot, plugin, builtin)",
      "title": "SkillSource",
      "x-enumDescriptions": {
        "project": "Skill defined in the current project's skill directories.",
        "inherited": "Skill discovered from a parent directory in the current workspace tree.",
        "personal-copilot": "Skill defined in the user's Copilot skill directory.",
        "personal-agents": "Skill defined in the user's personal agents skill directory.",
        "plugin": "Skill provided by an installed plugin.",
        "custom": "Skill loaded from a configured custom skill directory.",
        "builtin": "Skill bundled with the runtime."
      }
    },
    "SnapshotRewindData": {
      "type": "object",
      "properties": {
        "upToEventId": {
          "type": "string",
          "description": "Event ID that was rewound to; this event and all after it were removed"
        },
        "eventsRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of events that were removed by the rewind"
        }
      },
      "required": [
        "upToEventId",
        "eventsRemoved"
      ],
      "additionalProperties": false,
      "description": "Session rewind details including target event and count of removed events",
      "title": "SnapshotRewindData"
    },
    "SnapshotRewindEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.snapshot_rewind",
          "description": "Type discriminator. Always \"session.snapshot_rewind\"."
        },
        "data": {
          "$ref": "#/definitions/SnapshotRewindData",
          "description": "Session rewind details including target event and count of removed events"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.snapshot_rewind\". Session rewind details including target event and count of removed events",
      "title": "SnapshotRewindEvent"
    },
    "StartData": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Unique identifier for the session"
        },
        "version": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Schema version number for the session event format"
        },
        "producer": {
          "type": "string",
          "description": "Identifier of the software producing the events (e.g., \"copilot-agent\")"
        },
        "copilotVersion": {
          "type": "string",
          "description": "Version string of the Copilot application"
        },
        "startTime": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the session was created"
        },
        "selectedModel": {
          "type": "string",
          "description": "Model selected at session creation time, if any"
        },
        "reasoningEffort": {
          "type": "string",
          "description": "Reasoning effort level used for model calls, if applicable (e.g. \"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\")"
        },
        "reasoningSummary": {
          "$ref": "#/definitions/ReasoningSummary",
          "description": "Reasoning summary mode used for model calls, if applicable (e.g. \"none\", \"concise\", \"detailed\")"
        },
        "contextTier": {
          "anyOf": [
            {
              "$ref": "#/definitions/ContextTier"
            },
            {
              "type": "null"
            }
          ],
          "description": "Context tier selected at session creation time for models with tiered context pricing; null when no tier is selected (e.g., non-tiered model)"
        },
        "context": {
          "$ref": "#/definitions/WorkingDirectoryContext",
          "description": "Working directory and git context at session start"
        },
        "alreadyInUse": {
          "type": "boolean",
          "description": "Whether the session was already in use by another client at start time"
        },
        "remoteSteerable": {
          "type": "boolean",
          "description": "Whether this session supports remote steering via GitHub"
        },
        "detachedFromSpawningParentSessionId": {
          "type": "string",
          "description": "When set, identifies a parent session whose context this session continues — e.g., a detached headless rem-agent run launched on the parent's interactive shutdown. Telemetry from this session is reported under the parent's session_id."
        }
      },
      "required": [
        "sessionId",
        "version",
        "producer",
        "copilotVersion",
        "startTime"
      ],
      "additionalProperties": false,
      "description": "Session initialization metadata including context and configuration",
      "title": "StartData"
    },
    "StartEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.start",
          "description": "Type discriminator. Always \"session.start\"."
        },
        "data": {
          "$ref": "#/definitions/StartData",
          "description": "Session initialization metadata including context and configuration"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.start\". Session initialization metadata including context and configuration",
      "title": "StartEvent"
    },
    "SubagentCompletedData": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID of the parent tool invocation that spawned this sub-agent"
        },
        "agentName": {
          "type": "string",
          "description": "Internal name of the sub-agent"
        },
        "agentDisplayName": {
          "type": "string",
          "description": "Human-readable display name of the sub-agent"
        },
        "model": {
          "type": "string",
          "description": "Model used by the sub-agent"
        },
        "totalToolCalls": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of tool calls made by the sub-agent"
        },
        "totalTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens (input + output) consumed by the sub-agent"
        },
        "durationMs": {
          "type": "integer",
          "minimum": 0,
          "description": "Wall-clock duration of the sub-agent execution in milliseconds",
          "format": "duration"
        }
      },
      "required": [
        "toolCallId",
        "agentName",
        "agentDisplayName"
      ],
      "additionalProperties": false,
      "description": "Sub-agent completion details for successful execution",
      "title": "SubagentCompletedData"
    },
    "SubagentCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "subagent.completed",
          "description": "Type discriminator. Always \"subagent.completed\"."
        },
        "data": {
          "$ref": "#/definitions/SubagentCompletedData",
          "description": "Sub-agent completion details for successful execution"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"subagent.completed\". Sub-agent completion details for successful execution",
      "title": "SubagentCompletedEvent"
    },
    "SubagentDeselectedData": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Empty payload; the event signals that the custom agent was deselected, returning to the default agent",
      "title": "SubagentDeselectedData"
    },
    "SubagentDeselectedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "subagent.deselected",
          "description": "Type discriminator. Always \"subagent.deselected\"."
        },
        "data": {
          "$ref": "#/definitions/SubagentDeselectedData",
          "description": "Empty payload; the event signals that the custom agent was deselected, returning to the default agent"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"subagent.deselected\". Empty payload; the event signals that the custom agent was deselected, returning to the default agent",
      "title": "SubagentDeselectedEvent"
    },
    "SubagentFailedData": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID of the parent tool invocation that spawned this sub-agent"
        },
        "agentName": {
          "type": "string",
          "description": "Internal name of the sub-agent"
        },
        "agentDisplayName": {
          "type": "string",
          "description": "Human-readable display name of the sub-agent"
        },
        "error": {
          "type": "string",
          "description": "Error message describing why the sub-agent failed"
        },
        "model": {
          "type": "string",
          "description": "Model selected for the sub-agent, when known"
        },
        "totalToolCalls": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of tool calls made before the sub-agent failed"
        },
        "totalTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens (input + output) consumed before the sub-agent failed"
        },
        "durationMs": {
          "type": "integer",
          "minimum": 0,
          "description": "Wall-clock duration of the sub-agent execution in milliseconds",
          "format": "duration"
        }
      },
      "required": [
        "toolCallId",
        "agentName",
        "agentDisplayName",
        "error"
      ],
      "additionalProperties": false,
      "description": "Sub-agent failure details including error message and agent information",
      "title": "SubagentFailedData"
    },
    "SubagentFailedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "subagent.failed",
          "description": "Type discriminator. Always \"subagent.failed\"."
        },
        "data": {
          "$ref": "#/definitions/SubagentFailedData",
          "description": "Sub-agent failure details including error message and agent information"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"subagent.failed\". Sub-agent failure details including error message and agent information",
      "title": "SubagentFailedEvent"
    },
    "SubagentSelectedData": {
      "type": "object",
      "properties": {
        "agentName": {
          "type": "string",
          "description": "Internal name of the selected custom agent"
        },
        "agentDisplayName": {
          "type": "string",
          "description": "Human-readable display name of the selected custom agent"
        },
        "tools": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "List of tool names available to this agent, or null for all tools"
        }
      },
      "required": [
        "agentName",
        "agentDisplayName",
        "tools"
      ],
      "additionalProperties": false,
      "description": "Custom agent selection details including name and available tools",
      "title": "SubagentSelectedData"
    },
    "SubagentSelectedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "subagent.selected",
          "description": "Type discriminator. Always \"subagent.selected\"."
        },
        "data": {
          "$ref": "#/definitions/SubagentSelectedData",
          "description": "Custom agent selection details including name and available tools"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"subagent.selected\". Custom agent selection details including name and available tools",
      "title": "SubagentSelectedEvent"
    },
    "SubagentStartedData": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID of the parent tool invocation that spawned this sub-agent"
        },
        "agentName": {
          "type": "string",
          "description": "Internal name of the sub-agent"
        },
        "agentDisplayName": {
          "type": "string",
          "description": "Human-readable display name of the sub-agent"
        },
        "agentDescription": {
          "type": "string",
          "description": "Description of what the sub-agent does"
        },
        "model": {
          "type": "string",
          "description": "Model the sub-agent will run with, when known at start."
        }
      },
      "required": [
        "toolCallId",
        "agentName",
        "agentDisplayName",
        "agentDescription"
      ],
      "additionalProperties": false,
      "description": "Sub-agent startup details including parent tool call and agent information",
      "title": "SubagentStartedData"
    },
    "SubagentStartedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "subagent.started",
          "description": "Type discriminator. Always \"subagent.started\"."
        },
        "data": {
          "$ref": "#/definitions/SubagentStartedData",
          "description": "Sub-agent startup details including parent tool call and agent information"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"subagent.started\". Sub-agent startup details including parent tool call and agent information",
      "title": "SubagentStartedEvent"
    },
    "SystemMessageData": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "The system or developer prompt text sent as model input"
        },
        "role": {
          "$ref": "#/definitions/SystemMessageRole",
          "description": "Message role: \"system\" for system prompts, \"developer\" for developer-injected instructions"
        },
        "name": {
          "type": "string",
          "description": "Optional name identifier for the message source"
        },
        "metadata": {
          "$ref": "#/definitions/SystemMessageMetadata",
          "description": "Metadata about the prompt template and its construction"
        }
      },
      "required": [
        "content",
        "role"
      ],
      "additionalProperties": false,
      "description": "System/developer instruction content with role and optional template metadata",
      "title": "SystemMessageData"
    },
    "SystemMessageEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "system.message",
          "description": "Type discriminator. Always \"system.message\"."
        },
        "data": {
          "$ref": "#/definitions/SystemMessageData",
          "description": "System/developer instruction content with role and optional template metadata"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"system.message\". System/developer instruction content with role and optional template metadata",
      "title": "SystemMessageEvent"
    },
    "SystemMessageMetadata": {
      "type": "object",
      "properties": {
        "promptVersion": {
          "type": "string",
          "description": "Version identifier of the prompt template used"
        },
        "variables": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Template variables used when constructing the prompt"
        }
      },
      "additionalProperties": false,
      "description": "Metadata about the prompt template and its construction",
      "title": "SystemMessageMetadata"
    },
    "SystemMessageRole": {
      "type": "string",
      "enum": [
        "system",
        "developer"
      ],
      "description": "Message role: \"system\" for system prompts, \"developer\" for developer-injected instructions",
      "title": "SystemMessageRole",
      "x-enumDescriptions": {
        "system": "System prompt message.",
        "developer": "Developer instruction message."
      }
    },
    "SystemNotification": {
      "anyOf": [
        {
          "$ref": "#/definitions/SystemNotificationAgentCompleted"
        },
        {
          "$ref": "#/definitions/SystemNotificationAgentIdle"
        },
        {
          "$ref": "#/definitions/SystemNotificationNewInboxMessage"
        },
        {
          "$ref": "#/definitions/SystemNotificationShellCompleted"
        },
        {
          "$ref": "#/definitions/SystemNotificationShellDetachedCompleted"
        },
        {
          "$ref": "#/definitions/SystemNotificationInstructionDiscovered"
        }
      ],
      "description": "Structured metadata identifying what triggered this notification",
      "title": "SystemNotification"
    },
    "SystemNotificationAgentCompleted": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "agent_completed",
          "description": "Type discriminator. Always \"agent_completed\"."
        },
        "agentId": {
          "type": "string",
          "description": "Unique identifier of the background agent"
        },
        "agentType": {
          "type": "string",
          "description": "Type of the agent (e.g., explore, task, general-purpose)"
        },
        "status": {
          "$ref": "#/definitions/SystemNotificationAgentCompletedStatus",
          "description": "Whether the agent completed successfully or failed"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description of the agent task"
        },
        "prompt": {
          "type": "string",
          "description": "The full prompt given to the background agent"
        }
      },
      "required": [
        "type",
        "agentId",
        "agentType",
        "status"
      ],
      "additionalProperties": false,
      "title": "SystemNotificationAgentCompleted",
      "description": "Schema for the `SystemNotificationAgentCompleted` type."
    },
    "SystemNotificationAgentCompletedStatus": {
      "type": "string",
      "enum": [
        "completed",
        "failed"
      ],
      "description": "Whether the agent completed successfully or failed",
      "title": "SystemNotificationAgentCompletedStatus",
      "x-enumDescriptions": {
        "completed": "The agent completed successfully.",
        "failed": "The agent failed."
      }
    },
    "SystemNotificationAgentIdle": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "agent_idle",
          "description": "Type discriminator. Always \"agent_idle\"."
        },
        "agentId": {
          "type": "string",
          "description": "Unique identifier of the background agent"
        },
        "agentType": {
          "type": "string",
          "description": "Type of the agent (e.g., explore, task, general-purpose)"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description of the agent task"
        }
      },
      "required": [
        "type",
        "agentId",
        "agentType"
      ],
      "additionalProperties": false,
      "title": "SystemNotificationAgentIdle",
      "description": "Schema for the `SystemNotificationAgentIdle` type."
    },
    "SystemNotificationData": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "The notification text, typically wrapped in <system_notification> XML tags"
        },
        "kind": {
          "$ref": "#/definitions/SystemNotification",
          "description": "Structured metadata identifying what triggered this notification"
        }
      },
      "required": [
        "content",
        "kind"
      ],
      "additionalProperties": false,
      "description": "System-generated notification for runtime events like background task completion",
      "title": "SystemNotificationData"
    },
    "SystemNotificationEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "system.notification",
          "description": "Type discriminator. Always \"system.notification\"."
        },
        "data": {
          "$ref": "#/definitions/SystemNotificationData",
          "description": "System-generated notification for runtime events like background task completion"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"system.notification\". System-generated notification for runtime events like background task completion",
      "title": "SystemNotificationEvent"
    },
    "SystemNotificationInstructionDiscovered": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "instruction_discovered",
          "description": "Type discriminator. Always \"instruction_discovered\"."
        },
        "sourcePath": {
          "type": "string",
          "description": "Relative path to the discovered instruction file"
        },
        "triggerFile": {
          "type": "string",
          "description": "Path of the file access that triggered discovery"
        },
        "triggerTool": {
          "type": "string",
          "description": "Tool command that triggered discovery (currently always 'view')"
        },
        "description": {
          "type": "string",
          "description": "Human-readable label for the timeline (e.g., 'AGENTS.md from packages/billing/')"
        }
      },
      "required": [
        "type",
        "sourcePath",
        "triggerFile",
        "triggerTool"
      ],
      "additionalProperties": false,
      "title": "SystemNotificationInstructionDiscovered",
      "description": "Schema for the `SystemNotificationInstructionDiscovered` type."
    },
    "SystemNotificationNewInboxMessage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "new_inbox_message",
          "description": "Type discriminator. Always \"new_inbox_message\"."
        },
        "entryId": {
          "type": "string",
          "description": "Unique identifier of the inbox entry"
        },
        "senderName": {
          "type": "string",
          "description": "Human-readable name of the sender"
        },
        "senderType": {
          "type": "string",
          "description": "Category of the sender (e.g., sidekick-agent, plugin, hook)"
        },
        "summary": {
          "type": "string",
          "description": "Short summary shown before the agent decides whether to read the inbox"
        }
      },
      "required": [
        "type",
        "entryId",
        "senderName",
        "senderType",
        "summary"
      ],
      "additionalProperties": false,
      "title": "SystemNotificationNewInboxMessage",
      "description": "Schema for the `SystemNotificationNewInboxMessage` type."
    },
    "SystemNotificationShellCompleted": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "shell_completed",
          "description": "Type discriminator. Always \"shell_completed\"."
        },
        "shellId": {
          "type": "string",
          "description": "Unique identifier of the shell session"
        },
        "exitCode": {
          "type": "integer",
          "description": "Exit code of the shell command, if available"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description of the command"
        }
      },
      "required": [
        "type",
        "shellId"
      ],
      "additionalProperties": false,
      "title": "SystemNotificationShellCompleted",
      "description": "Schema for the `SystemNotificationShellCompleted` type."
    },
    "SystemNotificationShellDetachedCompleted": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "shell_detached_completed",
          "description": "Type discriminator. Always \"shell_detached_completed\"."
        },
        "shellId": {
          "type": "string",
          "description": "Unique identifier of the detached shell session"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description of the command"
        }
      },
      "required": [
        "type",
        "shellId"
      ],
      "additionalProperties": false,
      "title": "SystemNotificationShellDetachedCompleted",
      "description": "Schema for the `SystemNotificationShellDetachedCompleted` type."
    },
    "TaskCompleteData": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string",
          "default": "",
          "description": "Summary of the completed task, provided by the agent"
        },
        "success": {
          "type": "boolean",
          "description": "Whether the tool call succeeded. False when validation failed (e.g., invalid arguments)"
        }
      },
      "additionalProperties": false,
      "description": "Task completion notification with summary from the agent",
      "title": "TaskCompleteData"
    },
    "TaskCompleteEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.task_complete",
          "description": "Type discriminator. Always \"session.task_complete\"."
        },
        "data": {
          "$ref": "#/definitions/TaskCompleteData",
          "description": "Task completion notification with summary from the agent"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.task_complete\". Task completion notification with summary from the agent",
      "title": "TaskCompleteEvent"
    },
    "TitleChangedData": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "The new display title for the session"
        }
      },
      "required": [
        "title"
      ],
      "additionalProperties": false,
      "description": "Session title change payload containing the new display title",
      "title": "TitleChangedData"
    },
    "TitleChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.title_changed",
          "description": "Type discriminator. Always \"session.title_changed\"."
        },
        "data": {
          "$ref": "#/definitions/TitleChangedData",
          "description": "Session title change payload containing the new display title"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.title_changed\". Session title change payload containing the new display title",
      "title": "TitleChangedEvent"
    },
    "TodosChangedData": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Signal-only event: the agent's todos or todo_deps table was written to. No payload — clients should call session.plan.readSqlTodosWithDependencies() to fetch the current state. Events arrive in order; clients can debounce on arrival if needed.",
      "title": "TodosChangedData"
    },
    "TodosChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.todos_changed",
          "description": "Type discriminator. Always \"session.todos_changed\"."
        },
        "data": {
          "$ref": "#/definitions/TodosChangedData",
          "description": "Signal-only event: the agent's todos or todo_deps table was written to. No payload — clients should call session.plan.readSqlTodosWithDependencies() to fetch the current state. Events arrive in order; clients can debounce on arrival if needed."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.todos_changed\". Signal-only event: the agent's todos or todo_deps table was written to. No payload — clients should call session.plan.readSqlTodosWithDependencies() to fetch the current state. Events arrive in order; clients can debounce on arrival if needed.",
      "title": "TodosChangedEvent"
    },
    "ToolExecutionCompleteContent": {
      "anyOf": [
        {
          "$ref": "#/definitions/ToolExecutionCompleteContentText",
          "description": "Plain text content block"
        },
        {
          "$ref": "#/definitions/ToolExecutionCompleteContentTerminal",
          "description": "Terminal/shell output content block with optional exit code and working directory"
        },
        {
          "$ref": "#/definitions/ToolExecutionCompleteContentImage",
          "description": "Image content block with base64-encoded data"
        },
        {
          "$ref": "#/definitions/ToolExecutionCompleteContentAudio",
          "description": "Audio content block with base64-encoded data"
        },
        {
          "$ref": "#/definitions/ToolExecutionCompleteContentResourceLink",
          "description": "Resource link content block referencing an external resource"
        },
        {
          "$ref": "#/definitions/ToolExecutionCompleteContentResource",
          "description": "Embedded resource content block with inline text or binary data"
        }
      ],
      "description": "A content block within a tool result, which may be text, terminal output, image, audio, or a resource",
      "title": "ToolExecutionCompleteContent"
    },
    "ToolExecutionCompleteContentAudio": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "audio",
          "description": "Content block type discriminator"
        },
        "data": {
          "type": "string",
          "description": "Base64-encoded audio data",
          "contentEncoding": "base64"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the audio (e.g., audio/wav, audio/mpeg)"
        }
      },
      "required": [
        "type",
        "data",
        "mimeType"
      ],
      "additionalProperties": false,
      "description": "Audio content block with base64-encoded data",
      "title": "ToolExecutionCompleteContentAudio"
    },
    "ToolExecutionCompleteContentImage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "image",
          "description": "Content block type discriminator"
        },
        "data": {
          "type": "string",
          "description": "Base64-encoded image data",
          "contentEncoding": "base64"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the image (e.g., image/png, image/jpeg)"
        }
      },
      "required": [
        "type",
        "data",
        "mimeType"
      ],
      "additionalProperties": false,
      "description": "Image content block with base64-encoded data",
      "title": "ToolExecutionCompleteContentImage"
    },
    "ToolExecutionCompleteContentResource": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "resource",
          "description": "Content block type discriminator"
        },
        "resource": {
          "$ref": "#/definitions/ToolExecutionCompleteContentResourceDetails",
          "description": "The embedded resource contents, either text or base64-encoded binary"
        }
      },
      "required": [
        "type",
        "resource"
      ],
      "additionalProperties": false,
      "description": "Embedded resource content block with inline text or binary data",
      "title": "ToolExecutionCompleteContentResource"
    },
    "ToolExecutionCompleteContentResourceDetails": {
      "anyOf": [
        {
          "$ref": "#/definitions/EmbeddedTextResourceContents"
        },
        {
          "$ref": "#/definitions/EmbeddedBlobResourceContents"
        }
      ],
      "description": "The embedded resource contents, either text or base64-encoded binary",
      "title": "ToolExecutionCompleteContentResourceDetails"
    },
    "ToolExecutionCompleteContentResourceLink": {
      "type": "object",
      "properties": {
        "icons": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ToolExecutionCompleteContentResourceLinkIcon",
            "description": "Icon image for a resource"
          },
          "description": "Icons associated with this resource"
        },
        "name": {
          "type": "string",
          "description": "Resource name identifier"
        },
        "title": {
          "type": "string",
          "description": "Human-readable display title for the resource"
        },
        "uri": {
          "type": "string",
          "description": "URI identifying the resource"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description of the resource"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the resource content"
        },
        "size": {
          "type": "integer",
          "minimum": 0,
          "description": "Size of the resource in bytes"
        },
        "type": {
          "type": "string",
          "const": "resource_link",
          "description": "Content block type discriminator"
        }
      },
      "required": [
        "name",
        "uri",
        "type"
      ],
      "additionalProperties": false,
      "description": "Resource link content block referencing an external resource",
      "title": "ToolExecutionCompleteContentResourceLink"
    },
    "ToolExecutionCompleteContentResourceLinkIcon": {
      "type": "object",
      "properties": {
        "src": {
          "type": "string",
          "description": "URL or path to the icon image"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the icon image"
        },
        "sizes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Available icon sizes (e.g., ['16x16', '32x32'])"
        },
        "theme": {
          "$ref": "#/definitions/ToolExecutionCompleteContentResourceLinkIconTheme",
          "description": "Theme variant this icon is intended for"
        }
      },
      "required": [
        "src"
      ],
      "additionalProperties": false,
      "description": "Icon image for a resource",
      "title": "ToolExecutionCompleteContentResourceLinkIcon"
    },
    "ToolExecutionCompleteContentResourceLinkIconTheme": {
      "type": "string",
      "enum": [
        "light",
        "dark"
      ],
      "description": "Theme variant this icon is intended for",
      "title": "ToolExecutionCompleteContentResourceLinkIconTheme",
      "x-enumDescriptions": {
        "light": "Icon intended for light themes.",
        "dark": "Icon intended for dark themes."
      }
    },
    "ToolExecutionCompleteContentTerminal": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "terminal",
          "description": "Content block type discriminator"
        },
        "text": {
          "type": "string",
          "description": "Terminal/shell output text"
        },
        "exitCode": {
          "type": "integer",
          "description": "Process exit code, if the command has completed"
        },
        "cwd": {
          "type": "string",
          "description": "Working directory where the command was executed"
        }
      },
      "required": [
        "type",
        "text"
      ],
      "additionalProperties": false,
      "description": "Terminal/shell output content block with optional exit code and working directory",
      "title": "ToolExecutionCompleteContentTerminal"
    },
    "ToolExecutionCompleteContentText": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "text",
          "description": "Content block type discriminator"
        },
        "text": {
          "type": "string",
          "description": "The text content"
        }
      },
      "required": [
        "type",
        "text"
      ],
      "additionalProperties": false,
      "description": "Plain text content block",
      "title": "ToolExecutionCompleteContentText"
    },
    "ToolExecutionCompleteData": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Unique identifier for the completed tool call"
        },
        "success": {
          "type": "boolean",
          "description": "Whether the tool execution completed successfully"
        },
        "model": {
          "type": "string",
          "description": "Model identifier that generated this tool call"
        },
        "interactionId": {
          "type": "string",
          "description": "CAPI interaction ID for correlating this tool execution with upstream telemetry"
        },
        "isUserRequested": {
          "type": "boolean",
          "description": "Whether this tool call was explicitly requested by the user rather than the assistant"
        },
        "result": {
          "$ref": "#/definitions/ToolExecutionCompleteResult",
          "description": "Tool execution result on success"
        },
        "error": {
          "$ref": "#/definitions/ToolExecutionCompleteError",
          "description": "Error details when the tool execution failed"
        },
        "toolTelemetry": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts)"
        },
        "turnId": {
          "type": "string",
          "description": "Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event"
        },
        "toolDescription": {
          "$ref": "#/definitions/ToolExecutionCompleteToolDescription",
          "description": "Tool definition metadata, present for MCP tools with MCP Apps support"
        },
        "sandboxed": {
          "type": "boolean",
          "description": "Whether this tool execution ran inside a sandbox container"
        },
        "parentToolCallId": {
          "type": "string",
          "description": "Tool call ID of the parent tool invocation when this event originates from a sub-agent",
          "deprecated": true
        }
      },
      "required": [
        "toolCallId",
        "success"
      ],
      "additionalProperties": false,
      "description": "Tool execution completion results including success status, detailed output, and error information",
      "title": "ToolExecutionCompleteData"
    },
    "ToolExecutionCompleteError": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "code": {
          "type": "string",
          "description": "Machine-readable error code"
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "description": "Error details when the tool execution failed",
      "title": "ToolExecutionCompleteError"
    },
    "ToolExecutionCompleteEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "tool.execution_complete",
          "description": "Type discriminator. Always \"tool.execution_complete\"."
        },
        "data": {
          "$ref": "#/definitions/ToolExecutionCompleteData",
          "description": "Tool execution completion results including success status, detailed output, and error information"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"tool.execution_complete\". Tool execution completion results including success status, detailed output, and error information",
      "title": "ToolExecutionCompleteEvent"
    },
    "ToolExecutionCompleteResult": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "Concise tool result text sent to the LLM for chat completion, potentially truncated for token efficiency"
        },
        "detailedContent": {
          "type": "string",
          "description": "Full detailed tool result for UI/timeline display, preserving complete content such as diffs. Falls back to content when absent."
        },
        "contents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ToolExecutionCompleteContent",
            "description": "A content block within a tool result, which may be text, terminal output, image, audio, or a resource"
          },
          "description": "Structured content blocks (text, images, audio, resources) returned by the tool in their native format"
        },
        "uiResource": {
          "$ref": "#/definitions/ToolExecutionCompleteUIResource",
          "description": "MCP Apps UI resource content for rendering in a sandboxed iframe"
        }
      },
      "required": [
        "content"
      ],
      "additionalProperties": false,
      "description": "Tool execution result on success",
      "title": "ToolExecutionCompleteResult"
    },
    "ToolExecutionCompleteToolDescription": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Tool name"
        },
        "description": {
          "type": "string",
          "description": "Tool description"
        },
        "_meta": {
          "$ref": "#/definitions/ToolExecutionCompleteToolDescriptionMeta",
          "description": "MCP Apps metadata for UI resource association"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Tool definition metadata, present for MCP tools with MCP Apps support",
      "title": "ToolExecutionCompleteToolDescription"
    },
    "ToolExecutionCompleteToolDescriptionMeta": {
      "type": "object",
      "properties": {
        "ui": {
          "$ref": "#/definitions/ToolExecutionCompleteToolDescriptionMetaUI",
          "description": "Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type."
        }
      },
      "additionalProperties": false,
      "description": "MCP Apps metadata for UI resource association",
      "title": "ToolExecutionCompleteToolDescriptionMeta"
    },
    "ToolExecutionCompleteToolDescriptionMetaUI": {
      "type": "object",
      "properties": {
        "resourceUri": {
          "type": "string",
          "description": "URI of the UI resource"
        },
        "visibility": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ToolExecutionCompleteToolDescriptionMetaUIVisibility"
          },
          "description": "Who can access this tool"
        }
      },
      "additionalProperties": false,
      "title": "ToolExecutionCompleteToolDescriptionMetaUI",
      "description": "Schema for the `ToolExecutionCompleteToolDescriptionMetaUI` type."
    },
    "ToolExecutionCompleteToolDescriptionMetaUIVisibility": {
      "type": "string",
      "enum": [
        "model",
        "app"
      ],
      "title": "ToolExecutionCompleteToolDescriptionMetaUIVisibility",
      "x-enumDescriptions": {
        "model": "Tool is callable by the model (LLM tool surface)",
        "app": "Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool"
      },
      "description": "Allowed values for the `ToolExecutionCompleteToolDescriptionMetaUIVisibility` enumeration."
    },
    "ToolExecutionCompleteUIResource": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "The ui:// URI of the resource"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the content"
        },
        "text": {
          "type": "string",
          "description": "HTML content as a string"
        },
        "blob": {
          "type": "string",
          "description": "Base64-encoded HTML content"
        },
        "_meta": {
          "$ref": "#/definitions/ToolExecutionCompleteUIResourceMeta",
          "description": "Resource-level UI metadata (CSP, permissions, visual preferences)"
        }
      },
      "required": [
        "uri",
        "mimeType"
      ],
      "additionalProperties": false,
      "description": "MCP Apps UI resource content for rendering in a sandboxed iframe",
      "title": "ToolExecutionCompleteUIResource"
    },
    "ToolExecutionCompleteUIResourceMeta": {
      "type": "object",
      "properties": {
        "ui": {
          "$ref": "#/definitions/ToolExecutionCompleteUIResourceMetaUI",
          "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUI` type."
        }
      },
      "additionalProperties": false,
      "description": "Resource-level UI metadata (CSP, permissions, visual preferences)",
      "title": "ToolExecutionCompleteUIResourceMeta"
    },
    "ToolExecutionCompleteUIResourceMetaUI": {
      "type": "object",
      "properties": {
        "csp": {
          "$ref": "#/definitions/ToolExecutionCompleteUIResourceMetaUICsp",
          "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type."
        },
        "permissions": {
          "$ref": "#/definitions/ToolExecutionCompleteUIResourceMetaUIPermissions",
          "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type."
        },
        "domain": {
          "type": "string"
        },
        "prefersBorder": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "title": "ToolExecutionCompleteUIResourceMetaUI",
      "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUI` type."
    },
    "ToolExecutionCompleteUIResourceMetaUICsp": {
      "type": "object",
      "properties": {
        "connectDomains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "resourceDomains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "frameDomains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "baseUriDomains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false,
      "title": "ToolExecutionCompleteUIResourceMetaUICsp",
      "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUICsp` type."
    },
    "ToolExecutionCompleteUIResourceMetaUIPermissions": {
      "type": "object",
      "properties": {
        "camera": {
          "$ref": "#/definitions/ToolExecutionCompleteUIResourceMetaUIPermissionsCamera",
          "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type."
        },
        "microphone": {
          "$ref": "#/definitions/ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone",
          "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type."
        },
        "geolocation": {
          "$ref": "#/definitions/ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation",
          "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type."
        },
        "clipboardWrite": {
          "$ref": "#/definitions/ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite",
          "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type."
        }
      },
      "additionalProperties": false,
      "title": "ToolExecutionCompleteUIResourceMetaUIPermissions",
      "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissions` type."
    },
    "ToolExecutionCompleteUIResourceMetaUIPermissionsCamera": {
      "type": "object",
      "properties": {},
      "additionalProperties": true,
      "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsCamera",
      "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsCamera` type."
    },
    "ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite": {
      "type": "object",
      "properties": {},
      "additionalProperties": true,
      "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite",
      "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsClipboardWrite` type."
    },
    "ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation": {
      "type": "object",
      "properties": {},
      "additionalProperties": true,
      "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation",
      "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsGeolocation` type."
    },
    "ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone": {
      "type": "object",
      "properties": {},
      "additionalProperties": true,
      "title": "ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone",
      "description": "Schema for the `ToolExecutionCompleteUIResourceMetaUIPermissionsMicrophone` type."
    },
    "ToolExecutionPartialData": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID this partial result belongs to"
        },
        "partialOutput": {
          "type": "string",
          "description": "Incremental output chunk from the running tool"
        }
      },
      "required": [
        "toolCallId",
        "partialOutput"
      ],
      "additionalProperties": false,
      "description": "Streaming tool execution output for incremental result display",
      "title": "ToolExecutionPartialData"
    },
    "ToolExecutionPartialResultEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "tool.execution_partial_result",
          "description": "Type discriminator. Always \"tool.execution_partial_result\"."
        },
        "data": {
          "$ref": "#/definitions/ToolExecutionPartialData",
          "description": "Streaming tool execution output for incremental result display"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"tool.execution_partial_result\". Streaming tool execution output for incremental result display",
      "title": "ToolExecutionPartialResultEvent"
    },
    "ToolExecutionProgressData": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID this progress notification belongs to"
        },
        "progressMessage": {
          "type": "string",
          "description": "Human-readable progress status message (e.g., from an MCP server)"
        }
      },
      "required": [
        "toolCallId",
        "progressMessage"
      ],
      "additionalProperties": false,
      "description": "Tool execution progress notification with status message",
      "title": "ToolExecutionProgressData"
    },
    "ToolExecutionProgressEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "tool.execution_progress",
          "description": "Type discriminator. Always \"tool.execution_progress\"."
        },
        "data": {
          "$ref": "#/definitions/ToolExecutionProgressData",
          "description": "Tool execution progress notification with status message"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"tool.execution_progress\". Tool execution progress notification with status message",
      "title": "ToolExecutionProgressEvent"
    },
    "ToolExecutionStartData": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Unique identifier for this tool call"
        },
        "toolName": {
          "type": "string",
          "description": "Name of the tool being executed"
        },
        "arguments": {
          "description": "Arguments passed to the tool",
          "x-opaque-json": true
        },
        "model": {
          "type": "string",
          "description": "Model identifier that generated this tool call"
        },
        "mcpServerName": {
          "type": "string",
          "description": "Name of the MCP server hosting this tool, when the tool is an MCP tool"
        },
        "mcpToolName": {
          "type": "string",
          "description": "Original tool name on the MCP server, when the tool is an MCP tool"
        },
        "turnId": {
          "type": "string",
          "description": "Identifier for the agent loop turn this tool was invoked in, matching the corresponding assistant.turn_start event"
        },
        "displayVerbatim": {
          "type": "boolean",
          "description": "When true, the tool output should be displayed expanded (verbatim) in the CLI timeline"
        },
        "toolDescription": {
          "$ref": "#/definitions/ToolExecutionStartToolDescription",
          "description": "Tool definition metadata, present for MCP tools with MCP Apps support"
        },
        "parentToolCallId": {
          "type": "string",
          "description": "Tool call ID of the parent tool invocation when this event originates from a sub-agent",
          "deprecated": true
        }
      },
      "required": [
        "toolCallId",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Tool execution startup details including MCP server information when applicable",
      "title": "ToolExecutionStartData"
    },
    "ToolExecutionStartEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "tool.execution_start",
          "description": "Type discriminator. Always \"tool.execution_start\"."
        },
        "data": {
          "$ref": "#/definitions/ToolExecutionStartData",
          "description": "Tool execution startup details including MCP server information when applicable"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"tool.execution_start\". Tool execution startup details including MCP server information when applicable",
      "title": "ToolExecutionStartEvent"
    },
    "ToolExecutionStartToolDescription": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Tool name"
        },
        "description": {
          "type": "string",
          "description": "Tool description"
        },
        "_meta": {
          "$ref": "#/definitions/ToolExecutionStartToolDescriptionMeta",
          "description": "MCP Apps metadata for UI resource association"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Tool definition metadata, present for MCP tools with MCP Apps support",
      "title": "ToolExecutionStartToolDescription"
    },
    "ToolExecutionStartToolDescriptionMeta": {
      "type": "object",
      "properties": {
        "ui": {
          "$ref": "#/definitions/ToolExecutionStartToolDescriptionMetaUI",
          "description": "Schema for the `ToolExecutionStartToolDescriptionMetaUI` type."
        }
      },
      "additionalProperties": false,
      "description": "MCP Apps metadata for UI resource association",
      "title": "ToolExecutionStartToolDescriptionMeta"
    },
    "ToolExecutionStartToolDescriptionMetaUI": {
      "type": "object",
      "properties": {
        "resourceUri": {
          "type": "string",
          "description": "URI of the UI resource"
        },
        "visibility": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ToolExecutionStartToolDescriptionMetaUIVisibility"
          },
          "description": "Who can access this tool"
        }
      },
      "additionalProperties": false,
      "title": "ToolExecutionStartToolDescriptionMetaUI",
      "description": "Schema for the `ToolExecutionStartToolDescriptionMetaUI` type."
    },
    "ToolExecutionStartToolDescriptionMetaUIVisibility": {
      "type": "string",
      "enum": [
        "model",
        "app"
      ],
      "title": "ToolExecutionStartToolDescriptionMetaUIVisibility",
      "x-enumDescriptions": {
        "model": "Tool is callable by the model (LLM tool surface)",
        "app": "Tool is callable by the MCP App view (iframe) via session.mcp.apps.callTool"
      },
      "description": "Allowed values for the `ToolExecutionStartToolDescriptionMetaUIVisibility` enumeration."
    },
    "ToolsUpdatedData": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "description": "Identifier of the model the resolved tools apply to."
        }
      },
      "required": [
        "model"
      ],
      "additionalProperties": false,
      "title": "ToolsUpdatedData",
      "description": "Schema for the `ToolsUpdatedData` type."
    },
    "ToolsUpdatedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.tools_updated",
          "description": "Type discriminator. Always \"session.tools_updated\"."
        },
        "data": {
          "$ref": "#/definitions/ToolsUpdatedData",
          "description": "Schema for the `ToolsUpdatedData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.tools_updated\".",
      "title": "ToolsUpdatedEvent"
    },
    "ToolUserRequestedData": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Unique identifier for this tool call"
        },
        "toolName": {
          "type": "string",
          "description": "Name of the tool the user wants to invoke"
        },
        "arguments": {
          "description": "Arguments for the tool invocation",
          "x-opaque-json": true
        }
      },
      "required": [
        "toolCallId",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "User-initiated tool invocation request with tool name and arguments",
      "title": "ToolUserRequestedData"
    },
    "ToolUserRequestedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "tool.user_requested",
          "description": "Type discriminator. Always \"tool.user_requested\"."
        },
        "data": {
          "$ref": "#/definitions/ToolUserRequestedData",
          "description": "User-initiated tool invocation request with tool name and arguments"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"tool.user_requested\". User-initiated tool invocation request with tool name and arguments",
      "title": "ToolUserRequestedEvent"
    },
    "TruncationData": {
      "type": "object",
      "properties": {
        "tokenLimit": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum token count for the model's context window"
        },
        "preTruncationTokensInMessages": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens in conversation messages before truncation"
        },
        "preTruncationMessagesLength": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of conversation messages before truncation"
        },
        "postTruncationTokensInMessages": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens in conversation messages after truncation"
        },
        "postTruncationMessagesLength": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of conversation messages after truncation"
        },
        "tokensRemovedDuringTruncation": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of tokens removed by truncation"
        },
        "messagesRemovedDuringTruncation": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of messages removed by truncation"
        },
        "performedBy": {
          "type": "string",
          "description": "Identifier of the component that performed truncation (e.g., \"BasicTruncator\")"
        }
      },
      "required": [
        "tokenLimit",
        "preTruncationTokensInMessages",
        "preTruncationMessagesLength",
        "postTruncationTokensInMessages",
        "postTruncationMessagesLength",
        "tokensRemovedDuringTruncation",
        "messagesRemovedDuringTruncation",
        "performedBy"
      ],
      "additionalProperties": false,
      "description": "Conversation truncation statistics including token counts and removed content metrics",
      "title": "TruncationData"
    },
    "TruncationEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.truncation",
          "description": "Type discriminator. Always \"session.truncation\"."
        },
        "data": {
          "$ref": "#/definitions/TruncationData",
          "description": "Conversation truncation statistics including token counts and removed content metrics"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.truncation\". Conversation truncation statistics including token counts and removed content metrics",
      "title": "TruncationEvent"
    },
    "UsageInfoData": {
      "type": "object",
      "properties": {
        "tokenLimit": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum token count for the model's context window"
        },
        "currentTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Current number of tokens in the context window"
        },
        "messagesLength": {
          "type": "integer",
          "minimum": 0,
          "description": "Current number of messages in the conversation"
        },
        "systemTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from system message(s)"
        },
        "conversationTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from non-system messages (user, assistant, tool)"
        },
        "toolDefinitionsTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from tool definitions"
        },
        "isInitial": {
          "type": "boolean",
          "description": "Whether this is the first usage_info event emitted in this session"
        }
      },
      "required": [
        "tokenLimit",
        "currentTokens",
        "messagesLength"
      ],
      "additionalProperties": false,
      "description": "Current context window usage statistics including token and message counts",
      "title": "UsageInfoData"
    },
    "UsageInfoEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.usage_info",
          "description": "Type discriminator. Always \"session.usage_info\"."
        },
        "data": {
          "$ref": "#/definitions/UsageInfoData",
          "description": "Current context window usage statistics including token and message counts"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.usage_info\". Current context window usage statistics including token and message counts",
      "title": "UsageInfoEvent"
    },
    "UserInputCompletedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the resolved user input request; clients should dismiss any UI for this request"
        },
        "answer": {
          "type": "string",
          "description": "The user's answer to the input request"
        },
        "wasFreeform": {
          "type": "boolean",
          "description": "Whether the answer was typed as free-form text rather than selected from choices"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "User input request completion with the user's response",
      "title": "UserInputCompletedData"
    },
    "UserInputCompletedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "user_input.completed",
          "description": "Type discriminator. Always \"user_input.completed\"."
        },
        "data": {
          "$ref": "#/definitions/UserInputCompletedData",
          "description": "User input request completion with the user's response"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"user_input.completed\". User input request completion with the user's response",
      "title": "UserInputCompletedEvent"
    },
    "UserInputRequestedData": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for this input request; used to respond via session.respondToUserInput()"
        },
        "question": {
          "type": "string",
          "description": "The question or prompt to present to the user"
        },
        "choices": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Predefined choices for the user to select from, if applicable"
        },
        "allowFreeform": {
          "type": "boolean",
          "description": "Whether the user can provide a free-form text response in addition to predefined choices"
        },
        "toolCallId": {
          "type": "string",
          "description": "The LLM-assigned tool call ID that triggered this request; used by remote UIs to correlate responses"
        }
      },
      "required": [
        "requestId",
        "question"
      ],
      "additionalProperties": false,
      "description": "User input request notification with question and optional predefined choices",
      "title": "UserInputRequestedData"
    },
    "UserInputRequestedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "const": true,
          "description": "Always true for events that are transient and not persisted to the session event log on disk."
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "user_input.requested",
          "description": "Type discriminator. Always \"user_input.requested\"."
        },
        "data": {
          "$ref": "#/definitions/UserInputRequestedData",
          "description": "User input request notification with question and optional predefined choices"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "ephemeral",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"user_input.requested\". User input request notification with question and optional predefined choices",
      "title": "UserInputRequestedEvent"
    },
    "UserMessageAgentMode": {
      "type": "string",
      "enum": [
        "interactive",
        "plan",
        "autopilot",
        "shell"
      ],
      "description": "The agent mode that was active when this message was sent",
      "title": "UserMessageAgentMode",
      "x-enumDescriptions": {
        "interactive": "The agent is responding interactively to the user.",
        "plan": "The agent is preparing a plan before making changes.",
        "autopilot": "The agent is working autonomously toward task completion.",
        "shell": "The agent is in shell-focused UI mode."
      }
    },
    "UserMessageData": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "The user's message text as displayed in the timeline"
        },
        "transformedContent": {
          "type": "string",
          "description": "Transformed version of the message sent to the model, with XML wrapping, timestamps, and other augmentations for prompt caching"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Attachment",
            "description": "A user message attachment — a file, directory, code selection, blob, GitHub reference, or extension-supplied context payload"
          },
          "description": "Files, selections, or GitHub references attached to the message"
        },
        "supportedNativeDocumentMimeTypes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Normalized document MIME types that were sent natively instead of through tagged_files XML"
        },
        "nativeDocumentPathFallbackPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Path-backed native document attachments that stayed on the tagged_files path flow because native upload could not read them or would exceed the request size limit"
        },
        "source": {
          "type": "string",
          "description": "Origin of this message, used for timeline filtering (e.g., \"skill-pdf\" for skill-injected messages that should be hidden from the user)"
        },
        "agentMode": {
          "$ref": "#/definitions/UserMessageAgentMode",
          "description": "The agent mode that was active when this message was sent"
        },
        "isAutopilotContinuation": {
          "type": "boolean",
          "description": "True when this user message was auto-injected by autopilot's continuation loop rather than typed by the user; used to distinguish autopilot-driven turns in telemetry."
        },
        "interactionId": {
          "type": "string",
          "description": "CAPI interaction ID for correlating this user message with its turn"
        },
        "parentAgentTaskId": {
          "type": "string",
          "description": "Parent agent task ID for background telemetry correlated to this user turn"
        }
      },
      "required": [
        "content"
      ],
      "additionalProperties": false,
      "title": "UserMessageData",
      "description": "Schema for the `UserMessageData` type."
    },
    "UserMessageEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "user.message",
          "description": "Type discriminator. Always \"user.message\"."
        },
        "data": {
          "$ref": "#/definitions/UserMessageData",
          "description": "Schema for the `UserMessageData` type."
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"user.message\".",
      "title": "UserMessageEvent"
    },
    "UserToolSessionApproval": {
      "anyOf": [
        {
          "$ref": "#/definitions/UserToolSessionApprovalCommands"
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalRead"
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalWrite"
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalMcp"
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalMemory"
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalCustomTool"
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalExtensionManagement"
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalExtensionPermissionAccess"
        }
      ],
      "description": "The approval to add as a session-scoped rule",
      "title": "UserToolSessionApproval"
    },
    "UserToolSessionApprovalCommands": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "commands",
          "description": "Command approval kind"
        },
        "commandIdentifiers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Command identifiers approved by the user"
        }
      },
      "required": [
        "kind",
        "commandIdentifiers"
      ],
      "additionalProperties": false,
      "title": "UserToolSessionApprovalCommands",
      "description": "Schema for the `UserToolSessionApprovalCommands` type."
    },
    "UserToolSessionApprovalCustomTool": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "custom-tool",
          "description": "Custom tool approval kind"
        },
        "toolName": {
          "type": "string",
          "description": "Custom tool name"
        }
      },
      "required": [
        "kind",
        "toolName"
      ],
      "additionalProperties": false,
      "title": "UserToolSessionApprovalCustomTool",
      "description": "Schema for the `UserToolSessionApprovalCustomTool` type."
    },
    "UserToolSessionApprovalExtensionManagement": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-management",
          "description": "Extension management approval kind"
        },
        "operation": {
          "type": "string",
          "description": "Optional operation identifier"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "title": "UserToolSessionApprovalExtensionManagement",
      "description": "Schema for the `UserToolSessionApprovalExtensionManagement` type."
    },
    "UserToolSessionApprovalExtensionPermissionAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-permission-access",
          "description": "Extension permission access approval kind"
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name"
        }
      },
      "required": [
        "kind",
        "extensionName"
      ],
      "additionalProperties": false,
      "title": "UserToolSessionApprovalExtensionPermissionAccess",
      "description": "Schema for the `UserToolSessionApprovalExtensionPermissionAccess` type."
    },
    "UserToolSessionApprovalMcp": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp",
          "description": "MCP tool approval kind"
        },
        "serverName": {
          "type": "string",
          "description": "MCP server name"
        },
        "toolName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional MCP tool name, or null for all tools on the server"
        }
      },
      "required": [
        "kind",
        "serverName",
        "toolName"
      ],
      "additionalProperties": false,
      "title": "UserToolSessionApprovalMcp",
      "description": "Schema for the `UserToolSessionApprovalMcp` type."
    },
    "UserToolSessionApprovalMemory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "memory",
          "description": "Memory approval kind"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "title": "UserToolSessionApprovalMemory",
      "description": "Schema for the `UserToolSessionApprovalMemory` type."
    },
    "UserToolSessionApprovalRead": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "read",
          "description": "Read approval kind"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "title": "UserToolSessionApprovalRead",
      "description": "Schema for the `UserToolSessionApprovalRead` type."
    },
    "UserToolSessionApprovalWrite": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "write",
          "description": "Write approval kind"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "title": "UserToolSessionApprovalWrite",
      "description": "Schema for the `UserToolSessionApprovalWrite` type."
    },
    "WarningData": {
      "type": "object",
      "properties": {
        "warningType": {
          "type": "string",
          "description": "Category of warning (e.g., \"subscription\", \"policy\", \"mcp\")"
        },
        "message": {
          "type": "string",
          "description": "Human-readable warning message for display in the timeline"
        },
        "url": {
          "type": "string",
          "description": "Optional URL associated with this warning that the user can open in a browser"
        }
      },
      "required": [
        "warningType",
        "message"
      ],
      "additionalProperties": false,
      "description": "Warning message for timeline display with categorization",
      "title": "WarningData"
    },
    "WarningEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.warning",
          "description": "Type discriminator. Always \"session.warning\"."
        },
        "data": {
          "$ref": "#/definitions/WarningData",
          "description": "Warning message for timeline display with categorization"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.warning\". Warning message for timeline display with categorization",
      "title": "WarningEvent"
    },
    "WorkingDirectoryContext": {
      "type": "object",
      "properties": {
        "cwd": {
          "type": "string",
          "description": "Current working directory path"
        },
        "gitRoot": {
          "type": "string",
          "description": "Root directory of the git repository, resolved via git rev-parse"
        },
        "repository": {
          "type": "string",
          "description": "Repository identifier derived from the git remote URL (\"owner/name\" for GitHub, \"org/project/repo\" for Azure DevOps)"
        },
        "hostType": {
          "$ref": "#/definitions/WorkingDirectoryContextHostType",
          "description": "Hosting platform type of the repository (github or ado)"
        },
        "repositoryHost": {
          "type": "string",
          "description": "Raw host string from the git remote URL (e.g. \"github.com\", \"mycompany.ghe.com\", \"dev.azure.com\")"
        },
        "branch": {
          "type": "string",
          "description": "Current git branch name"
        },
        "headCommit": {
          "type": "string",
          "description": "Head commit of current git branch at session start time"
        },
        "baseCommit": {
          "type": "string",
          "description": "Base commit of current git branch at session start time"
        }
      },
      "required": [
        "cwd"
      ],
      "additionalProperties": false,
      "description": "Working directory and git context at session start",
      "title": "WorkingDirectoryContext"
    },
    "WorkingDirectoryContextHostType": {
      "type": "string",
      "enum": [
        "github",
        "ado"
      ],
      "description": "Hosting platform type of the repository (github or ado)",
      "title": "WorkingDirectoryContextHostType",
      "x-enumDescriptions": {
        "github": "Repository is hosted on GitHub.",
        "ado": "Repository is hosted on Azure DevOps."
      }
    },
    "WorkspaceFileChangedData": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Relative path within the session workspace files directory"
        },
        "operation": {
          "$ref": "#/definitions/WorkspaceFileChangedOperation",
          "description": "Whether the file was newly created or updated"
        }
      },
      "required": [
        "path",
        "operation"
      ],
      "additionalProperties": false,
      "description": "Workspace file change details including path and operation type",
      "title": "WorkspaceFileChangedData"
    },
    "WorkspaceFileChangedEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique event identifier (UUID v4), generated when the event is emitted"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the event was created"
        },
        "parentId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "description": "ID of the chronologically preceding event in the session, forming a linked chain. Null for the first event."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the event is transient and not persisted to the session event log on disk"
        },
        "agentId": {
          "type": "string",
          "description": "Sub-agent instance identifier. Absent for events from the root/main agent and session-level events."
        },
        "type": {
          "type": "string",
          "const": "session.workspace_file_changed",
          "description": "Type discriminator. Always \"session.workspace_file_changed\"."
        },
        "data": {
          "$ref": "#/definitions/WorkspaceFileChangedData",
          "description": "Workspace file change details including path and operation type"
        }
      },
      "required": [
        "id",
        "timestamp",
        "parentId",
        "type",
        "data"
      ],
      "additionalProperties": false,
      "description": "Session event \"session.workspace_file_changed\". Workspace file change details including path and operation type",
      "title": "WorkspaceFileChangedEvent"
    },
    "WorkspaceFileChangedOperation": {
      "type": "string",
      "enum": [
        "create",
        "update"
      ],
      "description": "Whether the file was newly created or updated",
      "title": "WorkspaceFileChangedOperation",
      "x-enumDescriptions": {
        "create": "The workspace file was created.",
        "update": "The workspace file was updated."
      }
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "JSON Schema for session events emitted by the Copilot CLI runtime."
}
