{
  "$ref": "#/definitions/SessionEvent",
  "definitions": {
    "SessionEvent": {
      "anyOf": [
        {
          "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"
            },
            "type": {
              "type": "string",
              "const": "session.start"
            },
            "data": {
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "description": "Unique identifier for the session"
                },
                "version": {
                  "type": "number",
                  "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. \"low\", \"medium\", \"high\", \"xhigh\")"
                },
                "context": {
                  "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": {
                      "type": "string",
                      "enum": [
                        "github",
                        "ado"
                      ],
                      "description": "Hosting platform type of the repository (github or ado)",
                      "title": "StartContextHostType"
                    },
                    "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": "StartContext"
                },
                "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 Mission Control"
                }
              },
              "required": [
                "sessionId",
                "version",
                "producer",
                "copilotVersion",
                "startTime"
              ],
              "additionalProperties": false,
              "description": "Session initialization metadata including context and configuration",
              "title": "StartData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.resume"
            },
            "data": {
              "type": "object",
              "properties": {
                "resumeTime": {
                  "type": "string",
                  "format": "date-time",
                  "description": "ISO 8601 timestamp when the session was resumed"
                },
                "eventCount": {
                  "type": "number",
                  "description": "Total number of persisted events in the session at the time of resume"
                },
                "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. \"low\", \"medium\", \"high\", \"xhigh\")"
                },
                "context": {
                  "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": {
                      "type": "string",
                      "enum": [
                        "github",
                        "ado"
                      ],
                      "description": "Hosting platform type of the repository (github or ado)",
                      "title": "ResumeContextHostType"
                    },
                    "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": "Updated working directory and git context at resume time",
                  "title": "ResumeContext"
                },
                "alreadyInUse": {
                  "type": "boolean",
                  "description": "Whether the session was already in use by another client at resume time"
                },
                "remoteSteerable": {
                  "type": "boolean",
                  "description": "Whether this session supports remote steering via Mission Control"
                }
              },
              "required": [
                "resumeTime",
                "eventCount"
              ],
              "additionalProperties": false,
              "description": "Session resume metadata including current context and event count",
              "title": "ResumeData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.remote_steerable_changed"
            },
            "data": {
              "type": "object",
              "properties": {
                "remoteSteerable": {
                  "type": "boolean",
                  "description": "Whether this session now supports remote steering via Mission Control"
                }
              },
              "required": [
                "remoteSteerable"
              ],
              "additionalProperties": false,
              "description": "Notifies Mission Control that the session's remote steering capability has changed",
              "title": "RemoteSteerableChangedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.error"
            },
            "data": {
              "type": "object",
              "properties": {
                "errorType": {
                  "type": "string",
                  "description": "Category of error (e.g., \"authentication\", \"authorization\", \"quota\", \"rate_limit\", \"context_limit\", \"query\")"
                },
                "message": {
                  "type": "string",
                  "description": "Human-readable error message"
                },
                "stack": {
                  "type": "string",
                  "description": "Error stack trace, when available"
                },
                "statusCode": {
                  "type": "integer",
                  "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"
                },
                "url": {
                  "type": "string",
                  "format": "uri",
                  "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "session.idle"
            },
            "data": {
              "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 in flight",
              "title": "IdleData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "session.title_changed"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "description": "When true, the event is transient and not persisted to the session event log on disk"
            },
            "type": {
              "type": "string",
              "const": "session.info"
            },
            "data": {
              "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",
                  "format": "uri",
                  "description": "Optional URL associated with this message that the user can open in a browser"
                }
              },
              "required": [
                "infoType",
                "message"
              ],
              "additionalProperties": false,
              "description": "Informational message for timeline display with categorization",
              "title": "InfoData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.warning"
            },
            "data": {
              "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",
                  "format": "uri",
                  "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.model_change"
            },
            "data": {
              "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",
                  "description": "Reasoning effort level after the model change, if applicable"
                }
              },
              "required": [
                "newModel"
              ],
              "additionalProperties": false,
              "description": "Model change details including previous and new model identifiers",
              "title": "ModelChangeData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.mode_changed"
            },
            "data": {
              "type": "object",
              "properties": {
                "previousMode": {
                  "type": "string",
                  "description": "Agent mode before the change (e.g., \"interactive\", \"plan\", \"autopilot\")"
                },
                "newMode": {
                  "type": "string",
                  "description": "Agent mode after the change (e.g., \"interactive\", \"plan\", \"autopilot\")"
                }
              },
              "required": [
                "previousMode",
                "newMode"
              ],
              "additionalProperties": false,
              "description": "Agent mode change details including previous and new modes",
              "title": "ModeChangedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.plan_changed"
            },
            "data": {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "enum": [
                    "create",
                    "update",
                    "delete"
                  ],
                  "description": "The type of operation performed on the plan file",
                  "title": "PlanChangedOperation"
                }
              },
              "required": [
                "operation"
              ],
              "additionalProperties": false,
              "description": "Plan file operation details indicating what changed",
              "title": "PlanChangedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.workspace_file_changed"
            },
            "data": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "Relative path within the session workspace files directory"
                },
                "operation": {
                  "type": "string",
                  "enum": [
                    "create",
                    "update"
                  ],
                  "description": "Whether the file was newly created or updated",
                  "title": "WorkspaceFileChangedOperation"
                }
              },
              "required": [
                "path",
                "operation"
              ],
              "additionalProperties": false,
              "description": "Workspace file change details including path and operation type",
              "title": "WorkspaceFileChangedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.handoff"
            },
            "data": {
              "type": "object",
              "properties": {
                "handoffTime": {
                  "type": "string",
                  "format": "date-time",
                  "description": "ISO 8601 timestamp when the handoff occurred"
                },
                "sourceType": {
                  "type": "string",
                  "enum": [
                    "remote",
                    "local"
                  ],
                  "description": "Origin type of the session being handed off",
                  "title": "HandoffSourceType"
                },
                "repository": {
                  "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"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.truncation"
            },
            "data": {
              "type": "object",
              "properties": {
                "tokenLimit": {
                  "type": "number",
                  "description": "Maximum token count for the model's context window"
                },
                "preTruncationTokensInMessages": {
                  "type": "number",
                  "description": "Total tokens in conversation messages before truncation"
                },
                "preTruncationMessagesLength": {
                  "type": "number",
                  "description": "Number of conversation messages before truncation"
                },
                "postTruncationTokensInMessages": {
                  "type": "number",
                  "description": "Total tokens in conversation messages after truncation"
                },
                "postTruncationMessagesLength": {
                  "type": "number",
                  "description": "Number of conversation messages after truncation"
                },
                "tokensRemovedDuringTruncation": {
                  "type": "number",
                  "description": "Number of tokens removed by truncation"
                },
                "messagesRemovedDuringTruncation": {
                  "type": "number",
                  "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "session.snapshot_rewind"
            },
            "data": {
              "type": "object",
              "properties": {
                "upToEventId": {
                  "type": "string",
                  "description": "Event ID that was rewound to; this event and all after it were removed"
                },
                "eventsRemoved": {
                  "type": "number",
                  "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "description": "When true, the event is transient and not persisted to the session event log on disk"
            },
            "type": {
              "type": "string",
              "const": "session.shutdown"
            },
            "data": {
              "type": "object",
              "properties": {
                "shutdownType": {
                  "type": "string",
                  "enum": [
                    "routine",
                    "error"
                  ],
                  "description": "Whether the session ended normally (\"routine\") or due to a crash/fatal error (\"error\")",
                  "title": "ShutdownType"
                },
                "errorReason": {
                  "type": "string",
                  "description": "Error description when shutdownType is \"error\""
                },
                "totalPremiumRequests": {
                  "type": "number",
                  "description": "Total number of premium API requests used during the session"
                },
                "totalApiDurationMs": {
                  "type": "number",
                  "description": "Cumulative time spent in API calls during the session, in milliseconds"
                },
                "sessionStartTime": {
                  "type": "number",
                  "description": "Unix timestamp (milliseconds) when the session started"
                },
                "codeChanges": {
                  "type": "object",
                  "properties": {
                    "linesAdded": {
                      "type": "number",
                      "description": "Total number of lines added during the session"
                    },
                    "linesRemoved": {
                      "type": "number",
                      "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"
                },
                "modelMetrics": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "requests": {
                        "type": "object",
                        "properties": {
                          "count": {
                            "type": "number",
                            "description": "Total number of API requests made to this model"
                          },
                          "cost": {
                            "type": "number",
                            "description": "Cumulative cost multiplier for requests to this model"
                          }
                        },
                        "required": [
                          "count",
                          "cost"
                        ],
                        "additionalProperties": false,
                        "description": "Request count and cost metrics",
                        "title": "ShutdownModelMetricRequests"
                      },
                      "usage": {
                        "type": "object",
                        "properties": {
                          "inputTokens": {
                            "type": "number",
                            "description": "Total input tokens consumed across all requests to this model"
                          },
                          "outputTokens": {
                            "type": "number",
                            "description": "Total output tokens produced across all requests to this model"
                          },
                          "cacheReadTokens": {
                            "type": "number",
                            "description": "Total tokens read from prompt cache across all requests"
                          },
                          "cacheWriteTokens": {
                            "type": "number",
                            "description": "Total tokens written to prompt cache across all requests"
                          },
                          "reasoningTokens": {
                            "type": "number",
                            "description": "Total reasoning tokens produced across all requests to this model"
                          }
                        },
                        "required": [
                          "inputTokens",
                          "outputTokens",
                          "cacheReadTokens",
                          "cacheWriteTokens"
                        ],
                        "additionalProperties": false,
                        "description": "Token usage breakdown",
                        "title": "ShutdownModelMetricUsage"
                      }
                    },
                    "required": [
                      "requests",
                      "usage"
                    ],
                    "additionalProperties": false,
                    "title": "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": "number",
                  "description": "Total tokens in context window at shutdown"
                },
                "systemTokens": {
                  "type": "number",
                  "description": "System message token count at shutdown"
                },
                "conversationTokens": {
                  "type": "number",
                  "description": "Non-system message token count at shutdown"
                },
                "toolDefinitionsTokens": {
                  "type": "number",
                  "description": "Tool definitions token count at shutdown"
                }
              },
              "required": [
                "shutdownType",
                "totalPremiumRequests",
                "totalApiDurationMs",
                "sessionStartTime",
                "codeChanges",
                "modelMetrics"
              ],
              "additionalProperties": false,
              "description": "Session termination metrics including usage statistics, code changes, and shutdown reason",
              "title": "ShutdownData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.context_changed"
            },
            "data": {
              "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": {
                  "type": "string",
                  "enum": [
                    "github",
                    "ado"
                  ],
                  "description": "Hosting platform type of the repository (github or ado)",
                  "title": "ContextChangedHostType"
                },
                "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": "Updated working directory and git context after the change",
              "title": "ContextChangedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "session.usage_info"
            },
            "data": {
              "type": "object",
              "properties": {
                "tokenLimit": {
                  "type": "number",
                  "description": "Maximum token count for the model's context window"
                },
                "currentTokens": {
                  "type": "number",
                  "description": "Current number of tokens in the context window"
                },
                "messagesLength": {
                  "type": "number",
                  "description": "Current number of messages in the conversation"
                },
                "systemTokens": {
                  "type": "number",
                  "description": "Token count from system message(s)"
                },
                "conversationTokens": {
                  "type": "number",
                  "description": "Token count from non-system messages (user, assistant, tool)"
                },
                "toolDefinitionsTokens": {
                  "type": "number",
                  "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "description": "When true, the event is transient and not persisted to the session event log on disk"
            },
            "type": {
              "type": "string",
              "const": "session.compaction_start"
            },
            "data": {
              "type": "object",
              "properties": {
                "systemTokens": {
                  "type": "number",
                  "description": "Token count from system message(s) at compaction start"
                },
                "conversationTokens": {
                  "type": "number",
                  "description": "Token count from non-system messages (user, assistant, tool) at compaction start"
                },
                "toolDefinitionsTokens": {
                  "type": "number",
                  "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.compaction_complete"
            },
            "data": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "description": "Whether compaction completed successfully"
                },
                "error": {
                  "type": "string",
                  "description": "Error message if compaction failed"
                },
                "preCompactionTokens": {
                  "type": "number",
                  "description": "Total tokens in conversation before compaction"
                },
                "postCompactionTokens": {
                  "type": "number",
                  "description": "Total tokens in conversation after compaction"
                },
                "preCompactionMessagesLength": {
                  "type": "number",
                  "description": "Number of messages before compaction"
                },
                "messagesRemoved": {
                  "type": "number",
                  "description": "Number of messages removed during compaction"
                },
                "tokensRemoved": {
                  "type": "number",
                  "description": "Number of tokens removed during compaction"
                },
                "summaryContent": {
                  "type": "string",
                  "description": "LLM-generated summary of the compacted conversation history"
                },
                "checkpointNumber": {
                  "type": "number",
                  "description": "Checkpoint snapshot number created for recovery"
                },
                "checkpointPath": {
                  "type": "string",
                  "description": "File path where the checkpoint was stored"
                },
                "compactionTokensUsed": {
                  "type": "object",
                  "properties": {
                    "input": {
                      "type": "number",
                      "description": "Input tokens consumed by the compaction LLM call"
                    },
                    "output": {
                      "type": "number",
                      "description": "Output tokens produced by the compaction LLM call"
                    },
                    "cachedInput": {
                      "type": "number",
                      "description": "Cached input tokens reused in the compaction LLM call"
                    }
                  },
                  "required": [
                    "input",
                    "output",
                    "cachedInput"
                  ],
                  "additionalProperties": false,
                  "description": "Token usage breakdown for the compaction LLM call",
                  "title": "CompactionCompleteCompactionTokensUsed"
                },
                "requestId": {
                  "type": "string",
                  "description": "GitHub request tracing ID (x-github-request-id header) for the compaction LLM call"
                },
                "systemTokens": {
                  "type": "number",
                  "description": "Token count from system message(s) after compaction"
                },
                "conversationTokens": {
                  "type": "number",
                  "description": "Token count from non-system messages (user, assistant, tool) after compaction"
                },
                "toolDefinitionsTokens": {
                  "type": "number",
                  "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "session.task_complete"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "user.message"
            },
            "data": {
              "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": {
                    "anyOf": [
                      {
                        "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": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "type": "number",
                                "description": "Start line number (1-based)"
                              },
                              "end": {
                                "type": "number",
                                "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": "UserMessageAttachmentFileLineRange"
                          }
                        },
                        "required": [
                          "type",
                          "path",
                          "displayName"
                        ],
                        "additionalProperties": false,
                        "description": "File attachment",
                        "title": "UserMessageAttachmentFile"
                      },
                      {
                        "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": "UserMessageAttachmentDirectory"
                      },
                      {
                        "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": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "type": "object",
                                "properties": {
                                  "line": {
                                    "type": "number",
                                    "description": "Start line number (0-based)"
                                  },
                                  "character": {
                                    "type": "number",
                                    "description": "Start character offset within the line (0-based)"
                                  }
                                },
                                "required": [
                                  "line",
                                  "character"
                                ],
                                "additionalProperties": false,
                                "description": "Start position of the selection",
                                "title": "UserMessageAttachmentSelectionDetailsStart"
                              },
                              "end": {
                                "type": "object",
                                "properties": {
                                  "line": {
                                    "type": "number",
                                    "description": "End line number (0-based)"
                                  },
                                  "character": {
                                    "type": "number",
                                    "description": "End character offset within the line (0-based)"
                                  }
                                },
                                "required": [
                                  "line",
                                  "character"
                                ],
                                "additionalProperties": false,
                                "description": "End position of the selection",
                                "title": "UserMessageAttachmentSelectionDetailsEnd"
                              }
                            },
                            "required": [
                              "start",
                              "end"
                            ],
                            "additionalProperties": false,
                            "description": "Position range of the selection within the file",
                            "title": "UserMessageAttachmentSelectionDetails"
                          }
                        },
                        "required": [
                          "type",
                          "filePath",
                          "displayName",
                          "text",
                          "selection"
                        ],
                        "additionalProperties": false,
                        "description": "Code selection attachment from an editor",
                        "title": "UserMessageAttachmentSelection"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "github_reference",
                            "description": "Attachment type discriminator"
                          },
                          "number": {
                            "type": "number",
                            "description": "Issue, pull request, or discussion number"
                          },
                          "title": {
                            "type": "string",
                            "description": "Title of the referenced item"
                          },
                          "referenceType": {
                            "type": "string",
                            "enum": [
                              "issue",
                              "pr",
                              "discussion"
                            ],
                            "description": "Type of GitHub reference",
                            "title": "UserMessageAttachmentGithubReferenceType"
                          },
                          "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": "UserMessageAttachmentGithubReference"
                      },
                      {
                        "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": "UserMessageAttachmentBlob"
                      }
                    ],
                    "description": "A user message attachment — a file, directory, code selection, blob, or GitHub reference",
                    "title": "UserMessageAttachment"
                  },
                  "description": "Files, selections, or GitHub references attached to the message"
                },
                "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": {
                  "type": "string",
                  "enum": [
                    "interactive",
                    "plan",
                    "autopilot",
                    "shell"
                  ],
                  "description": "The agent mode that was active when this message was sent",
                  "title": "UserMessageAgentMode"
                },
                "interactionId": {
                  "type": "string",
                  "description": "CAPI interaction ID for correlating this user message with its turn"
                }
              },
              "required": [
                "content"
              ],
              "additionalProperties": false,
              "title": "UserMessageData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "pending_messages.modified"
            },
            "data": {
              "type": "object",
              "properties": {},
              "additionalProperties": false,
              "description": "Empty payload; the event signals that the pending message queue has changed",
              "title": "PendingMessagesModifiedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "description": "When true, the event is transient and not persisted to the session event log on disk"
            },
            "type": {
              "type": "string",
              "const": "assistant.turn_start"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "assistant.intent"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "description": "When true, the event is transient and not persisted to the session event log on disk"
            },
            "type": {
              "type": "string",
              "const": "assistant.reasoning"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "assistant.reasoning_delta"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "assistant.streaming_delta"
            },
            "data": {
              "type": "object",
              "properties": {
                "totalResponseSizeBytes": {
                  "type": "number",
                  "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "description": "When true, the event is transient and not persisted to the session event log on disk"
            },
            "type": {
              "type": "string",
              "const": "assistant.message"
            },
            "data": {
              "type": "object",
              "properties": {
                "messageId": {
                  "type": "string",
                  "description": "Unique identifier for this assistant message"
                },
                "content": {
                  "type": "string",
                  "description": "The assistant's text response content"
                },
                "toolRequests": {
                  "type": "array",
                  "items": {
                    "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"
                      },
                      "type": {
                        "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"
                      },
                      "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"
                      },
                      "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"
                  },
                  "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": "number",
                  "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"
                },
                "parentToolCallId": {
                  "type": "string",
                  "description": "Tool call ID of the parent tool invocation when this event originates from a sub-agent"
                }
              },
              "required": [
                "messageId",
                "content"
              ],
              "additionalProperties": false,
              "description": "Assistant response containing text content, optional tool requests, and interaction metadata",
              "title": "AssistantMessageData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "assistant.message_delta"
            },
            "data": {
              "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"
                }
              },
              "required": [
                "messageId",
                "deltaContent"
              ],
              "additionalProperties": false,
              "description": "Streaming assistant message delta for incremental response updates",
              "title": "AssistantMessageDeltaData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "description": "When true, the event is transient and not persisted to the session event log on disk"
            },
            "type": {
              "type": "string",
              "const": "assistant.turn_end"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "assistant.usage"
            },
            "data": {
              "type": "object",
              "properties": {
                "model": {
                  "type": "string",
                  "description": "Model identifier used for this API call"
                },
                "inputTokens": {
                  "type": "number",
                  "description": "Number of input tokens consumed"
                },
                "outputTokens": {
                  "type": "number",
                  "description": "Number of output tokens produced"
                },
                "cacheReadTokens": {
                  "type": "number",
                  "description": "Number of tokens read from prompt cache"
                },
                "cacheWriteTokens": {
                  "type": "number",
                  "description": "Number of tokens written to prompt cache"
                },
                "reasoningTokens": {
                  "type": "number",
                  "description": "Number of output tokens used for reasoning (e.g., chain-of-thought)"
                },
                "cost": {
                  "type": "number",
                  "description": "Model multiplier cost for billing purposes"
                },
                "duration": {
                  "type": "number",
                  "description": "Duration of the API call in milliseconds"
                },
                "ttftMs": {
                  "type": "number",
                  "description": "Time to first token in milliseconds. Only available for streaming requests"
                },
                "interTokenLatencyMs": {
                  "type": "number",
                  "description": "Average inter-token latency in milliseconds. Only available for streaming requests"
                },
                "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"
                },
                "parentToolCallId": {
                  "type": "string",
                  "description": "Parent tool call ID when this usage originates from a sub-agent"
                },
                "quotaSnapshots": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "isUnlimitedEntitlement": {
                        "type": "boolean",
                        "description": "Whether the user has an unlimited usage entitlement"
                      },
                      "entitlementRequests": {
                        "type": "number",
                        "description": "Total requests allowed by the entitlement"
                      },
                      "usedRequests": {
                        "type": "number",
                        "description": "Number of requests already consumed"
                      },
                      "usageAllowedWithExhaustedQuota": {
                        "type": "boolean",
                        "description": "Whether usage is still permitted after quota exhaustion"
                      },
                      "overage": {
                        "type": "number",
                        "description": "Number of requests over the entitlement limit"
                      },
                      "overageAllowedWithExhaustedQuota": {
                        "type": "boolean",
                        "description": "Whether overage is allowed when quota is exhausted"
                      },
                      "remainingPercentage": {
                        "type": "number",
                        "description": "Percentage of quota remaining (0.0 to 1.0)"
                      },
                      "resetDate": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Date when the quota resets"
                      }
                    },
                    "required": [
                      "isUnlimitedEntitlement",
                      "entitlementRequests",
                      "usedRequests",
                      "usageAllowedWithExhaustedQuota",
                      "overage",
                      "overageAllowedWithExhaustedQuota",
                      "remainingPercentage"
                    ],
                    "additionalProperties": false,
                    "title": "AssistantUsageQuotaSnapshot"
                  },
                  "description": "Per-quota resource usage snapshots, keyed by quota identifier"
                },
                "copilotUsage": {
                  "type": "object",
                  "properties": {
                    "tokenDetails": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "batchSize": {
                            "type": "number",
                            "description": "Number of tokens in this billing batch"
                          },
                          "costPerBatch": {
                            "type": "number",
                            "description": "Cost per batch of tokens"
                          },
                          "tokenCount": {
                            "type": "number",
                            "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"
                      },
                      "description": "Itemized token usage breakdown"
                    },
                    "totalNanoAiu": {
                      "type": "number",
                      "description": "Total cost in nano-AIU (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"
                },
                "reasoningEffort": {
                  "type": "string",
                  "description": "Reasoning effort level used for model calls, if applicable (e.g. \"low\", \"medium\", \"high\", \"xhigh\")"
                }
              },
              "required": [
                "model"
              ],
              "additionalProperties": false,
              "description": "LLM API call usage metrics including tokens, costs, quotas, and billing information",
              "title": "AssistantUsageData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "description": "When true, the event is transient and not persisted to the session event log on disk"
            },
            "type": {
              "type": "string",
              "const": "abort"
            },
            "data": {
              "type": "object",
              "properties": {
                "reason": {
                  "type": "string",
                  "description": "Reason the current turn was aborted (e.g., \"user initiated\")"
                }
              },
              "required": [
                "reason"
              ],
              "additionalProperties": false,
              "description": "Turn abort information including the reason for termination",
              "title": "AbortData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "tool.user_requested"
            },
            "data": {
              "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"
                }
              },
              "required": [
                "toolCallId",
                "toolName"
              ],
              "additionalProperties": false,
              "description": "User-initiated tool invocation request with tool name and arguments",
              "title": "ToolUserRequestedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "tool.execution_start"
            },
            "data": {
              "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"
                },
                "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"
                },
                "parentToolCallId": {
                  "type": "string",
                  "description": "Tool call ID of the parent tool invocation when this event originates from a sub-agent"
                }
              },
              "required": [
                "toolCallId",
                "toolName"
              ],
              "additionalProperties": false,
              "description": "Tool execution startup details including MCP server information when applicable",
              "title": "ToolExecutionStartData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "tool.execution_partial_result"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "tool.execution_progress"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "description": "When true, the event is transient and not persisted to the session event log on disk"
            },
            "type": {
              "type": "string",
              "const": "tool.execution_complete"
            },
            "data": {
              "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": {
                  "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": {
                        "anyOf": [
                          {
                            "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"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "terminal",
                                "description": "Content block type discriminator"
                              },
                              "text": {
                                "type": "string",
                                "description": "Terminal/shell output text"
                              },
                              "exitCode": {
                                "type": "number",
                                "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"
                          },
                          {
                            "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"
                          },
                          {
                            "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"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "icons": {
                                "type": "array",
                                "items": {
                                  "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": {
                                      "type": "string",
                                      "enum": [
                                        "light",
                                        "dark"
                                      ],
                                      "description": "Theme variant this icon is intended for",
                                      "title": "ToolExecutionCompleteContentResourceLinkIconTheme"
                                    }
                                  },
                                  "required": [
                                    "src"
                                  ],
                                  "additionalProperties": false,
                                  "description": "Icon image for a resource",
                                  "title": "ToolExecutionCompleteContentResourceLinkIcon"
                                },
                                "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": "number",
                                "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"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "resource",
                                "description": "Content block type discriminator"
                              },
                              "resource": {
                                "anyOf": [
                                  {
                                    "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",
                                    "titleSource": "annotation"
                                  },
                                  {
                                    "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",
                                    "titleSource": "annotation"
                                  }
                                ],
                                "description": "The embedded resource contents, either text or base64-encoded binary",
                                "title": "ToolExecutionCompleteContentResourceDetails"
                              }
                            },
                            "required": [
                              "type",
                              "resource"
                            ],
                            "additionalProperties": false,
                            "description": "Embedded resource content block with inline text or binary data",
                            "title": "ToolExecutionCompleteContentResource"
                          }
                        ],
                        "description": "A content block within a tool result, which may be text, terminal output, image, audio, or a resource",
                        "title": "ToolExecutionCompleteContent"
                      },
                      "description": "Structured content blocks (text, images, audio, resources) returned by the tool in their native format"
                    }
                  },
                  "required": [
                    "content"
                  ],
                  "additionalProperties": false,
                  "description": "Tool execution result on success",
                  "title": "ToolExecutionCompleteResult"
                },
                "error": {
                  "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"
                },
                "toolTelemetry": {
                  "type": "object",
                  "additionalProperties": {},
                  "description": "Tool-specific telemetry data (e.g., CodeQL check counts, grep match counts)"
                },
                "parentToolCallId": {
                  "type": "string",
                  "description": "Tool call ID of the parent tool invocation when this event originates from a sub-agent"
                }
              },
              "required": [
                "toolCallId",
                "success"
              ],
              "additionalProperties": false,
              "description": "Tool execution completion results including success status, detailed output, and error information",
              "title": "ToolExecutionCompleteData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "skill.invoked"
            },
            "data": {
              "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"
                },
                "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"
                }
              },
              "required": [
                "name",
                "path",
                "content"
              ],
              "additionalProperties": false,
              "description": "Skill invocation details including content, allowed tools, and plugin metadata",
              "title": "SkillInvokedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "subagent.started"
            },
            "data": {
              "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"
                }
              },
              "required": [
                "toolCallId",
                "agentName",
                "agentDisplayName",
                "agentDescription"
              ],
              "additionalProperties": false,
              "description": "Sub-agent startup details including parent tool call and agent information",
              "title": "SubagentStartedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "subagent.completed"
            },
            "data": {
              "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": "number",
                  "description": "Total number of tool calls made by the sub-agent"
                },
                "totalTokens": {
                  "type": "number",
                  "description": "Total tokens (input + output) consumed by the sub-agent"
                },
                "durationMs": {
                  "type": "number",
                  "description": "Wall-clock duration of the sub-agent execution in milliseconds"
                }
              },
              "required": [
                "toolCallId",
                "agentName",
                "agentDisplayName"
              ],
              "additionalProperties": false,
              "description": "Sub-agent completion details for successful execution",
              "title": "SubagentCompletedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "subagent.failed"
            },
            "data": {
              "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 used by the sub-agent (if any model calls succeeded before failure)"
                },
                "totalToolCalls": {
                  "type": "number",
                  "description": "Total number of tool calls made before the sub-agent failed"
                },
                "totalTokens": {
                  "type": "number",
                  "description": "Total tokens (input + output) consumed before the sub-agent failed"
                },
                "durationMs": {
                  "type": "number",
                  "description": "Wall-clock duration of the sub-agent execution in milliseconds"
                }
              },
              "required": [
                "toolCallId",
                "agentName",
                "agentDisplayName",
                "error"
              ],
              "additionalProperties": false,
              "description": "Sub-agent failure details including error message and agent information",
              "title": "SubagentFailedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "subagent.selected"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "subagent.deselected"
            },
            "data": {
              "type": "object",
              "properties": {},
              "additionalProperties": false,
              "description": "Empty payload; the event signals that the custom agent was deselected, returning to the default agent",
              "title": "SubagentDeselectedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "hook.start"
            },
            "data": {
              "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"
                }
              },
              "required": [
                "hookInvocationId",
                "hookType"
              ],
              "additionalProperties": false,
              "description": "Hook invocation start details including type and input data",
              "title": "HookStartData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "hook.end"
            },
            "data": {
              "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"
                },
                "success": {
                  "type": "boolean",
                  "description": "Whether the hook completed successfully"
                },
                "error": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Human-readable error message"
                    },
                    "stack": {
                      "type": "string",
                      "description": "Error stack trace, when available"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "additionalProperties": false,
                  "description": "Error details when the hook failed",
                  "title": "HookEndError"
                }
              },
              "required": [
                "hookInvocationId",
                "hookType",
                "success"
              ],
              "additionalProperties": false,
              "description": "Hook invocation completion details including output, success status, and error information",
              "title": "HookEndData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "system.message"
            },
            "data": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "string",
                  "description": "The system or developer prompt text"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "system",
                    "developer"
                  ],
                  "description": "Message role: \"system\" for system prompts, \"developer\" for developer-injected instructions",
                  "title": "SystemMessageRole"
                },
                "name": {
                  "type": "string",
                  "description": "Optional name identifier for the message source"
                },
                "metadata": {
                  "type": "object",
                  "properties": {
                    "promptVersion": {
                      "type": "string",
                      "description": "Version identifier of the prompt template used"
                    },
                    "variables": {
                      "type": "object",
                      "additionalProperties": {},
                      "description": "Template variables used when constructing the prompt"
                    }
                  },
                  "additionalProperties": false,
                  "description": "Metadata about the prompt template and its construction",
                  "title": "SystemMessageMetadata"
                }
              },
              "required": [
                "content",
                "role"
              ],
              "additionalProperties": false,
              "description": "System or developer message content with role and optional template metadata",
              "title": "SystemMessageData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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"
            },
            "type": {
              "type": "string",
              "const": "system.notification"
            },
            "data": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "string",
                  "description": "The notification text, typically wrapped in <system_notification> XML tags"
                },
                "kind": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "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": {
                          "type": "string",
                          "enum": [
                            "completed",
                            "failed"
                          ],
                          "description": "Whether the agent completed successfully or failed",
                          "title": "SystemNotificationAgentCompletedStatus"
                        },
                        "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"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "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"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "shell_completed"
                        },
                        "shellId": {
                          "type": "string",
                          "description": "Unique identifier of the shell session"
                        },
                        "exitCode": {
                          "type": "number",
                          "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"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "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": "Structured metadata identifying what triggered this notification",
                  "title": "SystemNotification"
                }
              },
              "required": [
                "content",
                "kind"
              ],
              "additionalProperties": false,
              "description": "System-generated notification for runtime events like background task completion",
              "title": "SystemNotificationData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "permission.requested"
            },
            "data": {
              "type": "object",
              "properties": {
                "requestId": {
                  "type": "string",
                  "description": "Unique identifier for this permission request; used to respond via session.respondToPermission()"
                },
                "permissionRequest": {
                  "anyOf": [
                    {
                      "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": {
                            "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": "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": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "description": "URL that may be accessed by the command"
                              }
                            },
                            "required": [
                              "url"
                            ],
                            "additionalProperties": false,
                            "title": "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"
                    },
                    {
                      "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"
                        }
                      },
                      "required": [
                        "kind",
                        "intention",
                        "fileName",
                        "diff"
                      ],
                      "additionalProperties": false,
                      "description": "File write permission request",
                      "title": "PermissionRequestWrite"
                    },
                    {
                      "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"
                    },
                    {
                      "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"
                        },
                        "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"
                    },
                    {
                      "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"
                    },
                    {
                      "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": {
                          "type": "string",
                          "enum": [
                            "store",
                            "vote"
                          ],
                          "default": "store",
                          "description": "Whether this is a store or vote memory operation",
                          "title": "PermissionRequestMemoryAction"
                        },
                        "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": {
                          "type": "string",
                          "enum": [
                            "upvote",
                            "downvote"
                          ],
                          "description": "Vote direction (vote only)",
                          "title": "PermissionRequestMemoryDirection"
                        },
                        "reason": {
                          "type": "string",
                          "description": "Reason for the vote (vote only)"
                        }
                      },
                      "required": [
                        "kind",
                        "fact"
                      ],
                      "additionalProperties": false,
                      "description": "Memory operation permission request",
                      "title": "PermissionRequestMemory"
                    },
                    {
                      "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"
                        }
                      },
                      "required": [
                        "kind",
                        "toolName",
                        "toolDescription"
                      ],
                      "additionalProperties": false,
                      "description": "Custom tool invocation permission request",
                      "title": "PermissionRequestCustomTool"
                    },
                    {
                      "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"
                        },
                        "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"
                    }
                  ],
                  "description": "Details of the permission being requested",
                  "title": "PermissionRequest"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "permission.completed"
            },
            "data": {
              "type": "object",
              "properties": {
                "requestId": {
                  "type": "string",
                  "description": "Request ID of the resolved permission request; clients should dismiss any UI for this request"
                },
                "result": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "approved",
                        "denied-by-rules",
                        "denied-no-approval-rule-and-could-not-request-from-user",
                        "denied-interactively-by-user",
                        "denied-by-content-exclusion-policy",
                        "denied-by-permission-request-hook"
                      ],
                      "description": "The outcome of the permission request",
                      "title": "PermissionCompletedKind"
                    }
                  },
                  "required": [
                    "kind"
                  ],
                  "additionalProperties": false,
                  "description": "The result of the permission request",
                  "title": "PermissionCompletedResult"
                }
              },
              "required": [
                "requestId",
                "result"
              ],
              "additionalProperties": false,
              "description": "Permission request completion notification signaling UI dismissal",
              "title": "PermissionCompletedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "user_input.requested"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "user_input.completed"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "elicitation.requested"
            },
            "data": {
              "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": {
                  "type": "string",
                  "enum": [
                    "form",
                    "url"
                  ],
                  "description": "Elicitation mode; \"form\" for structured input, \"url\" for browser-based. Defaults to \"form\" when absent.",
                  "title": "ElicitationRequestedMode"
                },
                "requestedSchema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "object",
                      "description": "Schema type indicator (always 'object')"
                    },
                    "properties": {
                      "type": "object",
                      "additionalProperties": {},
                      "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"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "elicitation.completed"
            },
            "data": {
              "type": "object",
              "properties": {
                "requestId": {
                  "type": "string",
                  "description": "Request ID of the resolved elicitation request; clients should dismiss any UI for this request"
                },
                "action": {
                  "type": "string",
                  "enum": [
                    "accept",
                    "decline",
                    "cancel"
                  ],
                  "description": "The user action: \"accept\" (submitted form), \"decline\" (explicitly refused), or \"cancel\" (dismissed)",
                  "title": "ElicitationCompletedAction"
                },
                "content": {
                  "type": "object",
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "title": "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "sampling.requested"
            },
            "data": {
              "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"
                }
              },
              "required": [
                "requestId",
                "serverName",
                "mcpRequestId"
              ],
              "additionalProperties": true,
              "description": "Sampling request from an MCP server; contains the server name and a requestId for correlation",
              "title": "SamplingRequestedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "sampling.completed"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "mcp.oauth_required"
            },
            "data": {
              "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": {
                  "type": "object",
                  "properties": {
                    "clientId": {
                      "type": "string",
                      "description": "OAuth client ID for the server"
                    },
                    "publicClient": {
                      "type": "boolean",
                      "description": "Whether this is a public OAuth client"
                    }
                  },
                  "required": [
                    "clientId"
                  ],
                  "additionalProperties": false,
                  "description": "Static OAuth client configuration, if the server specifies one",
                  "title": "McpOauthRequiredStaticClientConfig"
                }
              },
              "required": [
                "requestId",
                "serverName",
                "serverUrl"
              ],
              "additionalProperties": false,
              "description": "OAuth authentication request for an MCP server",
              "title": "McpOauthRequiredData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "mcp.oauth_completed"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "external_tool.requested"
            },
            "data": {
              "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"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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",
              "const": true
            },
            "type": {
              "type": "string",
              "const": "external_tool.completed"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "command.queued"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "command.execute"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "command.completed"
            },
            "data": {
              "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "commands.changed"
            },
            "data": {
              "type": "object",
              "properties": {
                "commands": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "additionalProperties": false,
                    "title": "CommandsChangedCommand"
                  },
                  "description": "Current list of registered SDK commands"
                }
              },
              "required": [
                "commands"
              ],
              "additionalProperties": false,
              "description": "SDK command registration change notification",
              "title": "CommandsChangedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "capabilities.changed"
            },
            "data": {
              "type": "object",
              "properties": {
                "ui": {
                  "type": "object",
                  "properties": {
                    "elicitation": {
                      "type": "boolean",
                      "description": "Whether elicitation is now supported"
                    }
                  },
                  "additionalProperties": false,
                  "description": "UI capability changes",
                  "title": "CapabilitiesChangedUI"
                }
              },
              "additionalProperties": false,
              "description": "Session capability change notification",
              "title": "CapabilitiesChangedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "exit_plan_mode.requested"
            },
            "data": {
              "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": {
                    "type": "string"
                  },
                  "description": "Available actions the user can take (e.g., approve, edit, reject)"
                },
                "recommendedAction": {
                  "type": "string",
                  "description": "The recommended action for the user to take"
                }
              },
              "required": [
                "requestId",
                "summary",
                "planContent",
                "actions",
                "recommendedAction"
              ],
              "additionalProperties": false,
              "description": "Plan approval request with plan content and available user actions",
              "title": "ExitPlanModeRequestedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "exit_plan_mode.completed"
            },
            "data": {
              "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": {
                  "type": "string",
                  "description": "Which action the user selected (e.g. 'autopilot', 'interactive', 'exit_only')"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "session.tools_updated"
            },
            "data": {
              "type": "object",
              "properties": {
                "model": {
                  "type": "string"
                }
              },
              "required": [
                "model"
              ],
              "additionalProperties": false,
              "title": "ToolsUpdatedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "session.background_tasks_changed"
            },
            "data": {
              "type": "object",
              "properties": {},
              "additionalProperties": false,
              "title": "BackgroundTasksChangedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "session.skills_loaded"
            },
            "data": {
              "type": "object",
              "properties": {
                "skills": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Unique identifier for the skill"
                      },
                      "description": {
                        "type": "string",
                        "description": "Description of what the skill does"
                      },
                      "source": {
                        "type": "string",
                        "description": "Source location type of the skill (e.g., project, personal, plugin)"
                      },
                      "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": "Array of resolved skill metadata"
                }
              },
              "required": [
                "skills"
              ],
              "additionalProperties": false,
              "title": "SkillsLoadedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "session.custom_agents_updated"
            },
            "data": {
              "type": "object",
              "properties": {
                "agents": {
                  "type": "array",
                  "items": {
                    "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": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "List of tool names available to this agent"
                      },
                      "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": "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "session.mcp_servers_loaded"
            },
            "data": {
              "type": "object",
              "properties": {
                "servers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Server name (config key)"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "connected",
                          "failed",
                          "needs-auth",
                          "pending",
                          "disabled",
                          "not_configured"
                        ],
                        "description": "Connection status: connected, failed, needs-auth, pending, disabled, or not_configured",
                        "title": "McpServersLoadedServerStatus"
                      },
                      "source": {
                        "type": "string",
                        "description": "Configuration source: user, workspace, plugin, or builtin"
                      },
                      "error": {
                        "type": "string",
                        "description": "Error message if the server failed to connect"
                      }
                    },
                    "required": [
                      "name",
                      "status"
                    ],
                    "additionalProperties": false,
                    "title": "McpServersLoadedServer"
                  },
                  "description": "Array of MCP server status summaries"
                }
              },
              "required": [
                "servers"
              ],
              "additionalProperties": false,
              "title": "McpServersLoadedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "session.mcp_server_status_changed"
            },
            "data": {
              "type": "object",
              "properties": {
                "serverName": {
                  "type": "string",
                  "description": "Name of the MCP server whose status changed"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "connected",
                    "failed",
                    "needs-auth",
                    "pending",
                    "disabled",
                    "not_configured"
                  ],
                  "description": "New connection status: connected, failed, needs-auth, pending, disabled, or not_configured",
                  "title": "McpServerStatusChangedStatus"
                }
              },
              "required": [
                "serverName",
                "status"
              ],
              "additionalProperties": false,
              "title": "McpServerStatusChangedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "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
            },
            "type": {
              "type": "string",
              "const": "session.extensions_loaded"
            },
            "data": {
              "type": "object",
              "properties": {
                "extensions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Source-qualified extension ID (e.g., 'project:my-ext', 'user:auth-helper')"
                      },
                      "name": {
                        "type": "string",
                        "description": "Extension name (directory name)"
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "project",
                          "user"
                        ],
                        "description": "Discovery source",
                        "title": "ExtensionsLoadedExtensionSource"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "running",
                          "disabled",
                          "failed",
                          "starting"
                        ],
                        "description": "Current status: running, disabled, failed, or starting",
                        "title": "ExtensionsLoadedExtensionStatus"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "source",
                      "status"
                    ],
                    "additionalProperties": false,
                    "title": "ExtensionsLoadedExtension"
                  },
                  "description": "Array of discovered extensions and their status"
                }
              },
              "required": [
                "extensions"
              ],
              "additionalProperties": false,
              "title": "ExtensionsLoadedData"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false,
          "title": "ExtensionsLoadedEvent"
        }
      ]
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
