{
  "$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)"
                    },
                    "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"
                },
                "alreadyInUse": {
                  "type": "boolean",
                  "description": "Whether the session was already in use by another client at start time"
                }
              },
              "required": [
                "sessionId",
                "version",
                "producer",
                "copilotVersion",
                "startTime"
              ],
              "additionalProperties": false,
              "description": "Session initialization metadata including context and configuration"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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)"
                    },
                    "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"
                },
                "alreadyInUse": {
                  "type": "boolean",
                  "description": "Whether the session was already in use by another client at resume time"
                }
              },
              "required": [
                "resumeTime",
                "eventCount"
              ],
              "additionalProperties": false,
              "description": "Session resume metadata including current context and event count"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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\", \"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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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": {
                "backgroundTasks": {
                  "type": "object",
                  "properties": {
                    "agents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "agentId": {
                            "type": "string",
                            "description": "Unique identifier of the background agent"
                          },
                          "agentType": {
                            "type": "string",
                            "description": "Type of the background agent"
                          },
                          "description": {
                            "type": "string",
                            "description": "Human-readable description of the agent task"
                          }
                        },
                        "required": [
                          "agentId",
                          "agentType"
                        ],
                        "additionalProperties": false,
                        "description": "A background agent task"
                      },
                      "description": "Currently running background agents"
                    },
                    "shells": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "shellId": {
                            "type": "string",
                            "description": "Unique identifier of the background shell"
                          },
                          "description": {
                            "type": "string",
                            "description": "Human-readable description of the shell command"
                          }
                        },
                        "required": [
                          "shellId"
                        ],
                        "additionalProperties": false,
                        "description": "A background shell command"
                      },
                      "description": "Currently running background shell commands"
                    }
                  },
                  "required": [
                    "agents",
                    "shells"
                  ],
                  "additionalProperties": false,
                  "description": "Background tasks still running when the agent became idle"
                }
              },
              "additionalProperties": false,
              "description": "Payload indicating the agent is idle; includes any background tasks still in flight"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                }
              },
              "required": [
                "operation"
              ],
              "additionalProperties": false,
              "description": "Plan file operation details indicating what changed"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                }
              },
              "required": [
                "path",
                "operation"
              ],
              "additionalProperties": false,
              "description": "Workspace file change details including path and operation type"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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.import_legacy"
            },
            "data": {
              "type": "object",
              "properties": {
                "legacySession": {
                  "type": "object",
                  "properties": {
                    "sessionId": {
                      "type": "string"
                    },
                    "startTime": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "chatMessages": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "content": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "text"
                                        },
                                        "text": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "text"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                ]
                              },
                              "role": {
                                "type": "string",
                                "const": "developer"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "content",
                              "role"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "content": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "text"
                                        },
                                        "text": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "text"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                ]
                              },
                              "role": {
                                "type": "string",
                                "const": "system"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "content",
                              "role"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "content": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "text"
                                            },
                                            "text": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "text"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "image_url"
                                            },
                                            "image_url": {
                                              "type": "object",
                                              "properties": {
                                                "url": {
                                                  "type": "string"
                                                },
                                                "detail": {
                                                  "type": "string",
                                                  "enum": [
                                                    "auto",
                                                    "low",
                                                    "high"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "url"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "image_url"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "input_audio"
                                            },
                                            "input_audio": {
                                              "type": "object",
                                              "properties": {
                                                "data": {
                                                  "type": "string"
                                                },
                                                "format": {
                                                  "type": "string",
                                                  "enum": [
                                                    "wav",
                                                    "mp3"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "data",
                                                "format"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "input_audio"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "type": {
                                              "type": "string",
                                              "const": "file"
                                            },
                                            "file": {
                                              "type": "object",
                                              "properties": {
                                                "file_date": {
                                                  "type": "string"
                                                },
                                                "file_id": {
                                                  "type": "string"
                                                },
                                                "filename": {
                                                  "type": "string"
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "required": [
                                            "type",
                                            "file"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  }
                                ]
                              },
                              "role": {
                                "type": "string",
                                "const": "user"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "content",
                              "role"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "content": {
                                "anyOf": [
                                  {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "text"
                                                },
                                                "text": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "text"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "refusal"
                                                },
                                                "refusal": {
                                                  "type": "string"
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "refusal"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      }
                                    ]
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "role": {
                                "type": "string",
                                "const": "assistant"
                              },
                              "name": {
                                "type": "string"
                              },
                              "refusal": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "audio": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "function_call": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string"
                                      },
                                      "arguments": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "arguments"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "tool_calls": {
                                "type": "array",
                                "items": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string",
                                          "const": "function"
                                        },
                                        "function": {
                                          "type": "object",
                                          "properties": {
                                            "name": {
                                              "type": "string"
                                            },
                                            "arguments": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "name",
                                            "arguments"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "type",
                                        "function"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "type": {
                                          "type": "string",
                                          "const": "custom"
                                        },
                                        "custom": {
                                          "type": "object",
                                          "properties": {
                                            "name": {
                                              "type": "string"
                                            },
                                            "input": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "name",
                                            "input"
                                          ],
                                          "additionalProperties": false
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "type",
                                        "custom"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              }
                            },
                            "required": [
                              "role"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "content": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "text"
                                        },
                                        "text": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "text"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                ]
                              },
                              "role": {
                                "type": "string",
                                "const": "tool"
                              },
                              "tool_call_id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "content",
                              "role",
                              "tool_call_id"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "content": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "role": {
                                "type": "string",
                                "const": "function"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "content",
                              "role",
                              "name"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "timeline": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "copilot"
                                  },
                                  "text": {
                                    "type": "string"
                                  },
                                  "isStreaming": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "type",
                                  "text"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "error"
                                  },
                                  "text": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "text"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "info"
                                  },
                                  "text": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "text"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "warning"
                                  },
                                  "text": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "text"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "user"
                                  },
                                  "text": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "text"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "tool_call_requested"
                                  },
                                  "callId": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "toolTitle": {
                                    "type": "string"
                                  },
                                  "intentionSummary": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "arguments": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string"
                                              },
                                              "description": {
                                                "type": "string"
                                              },
                                              "timeout": {
                                                "type": "number"
                                              },
                                              "shellId": {
                                                "type": "string"
                                              },
                                              "async": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "description"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "shellId": {
                                                "type": "string"
                                              },
                                              "input": {
                                                "type": "string"
                                              },
                                              "delay": {
                                                "type": "number"
                                              }
                                            },
                                            "required": [
                                              "shellId",
                                              "input"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "shellId": {
                                                "type": "string"
                                              },
                                              "delay": {
                                                "type": "number"
                                              }
                                            },
                                            "required": [
                                              "shellId",
                                              "delay"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "shellId": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "shellId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string",
                                                "const": "view"
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "view_range": {
                                                "type": "array",
                                                "minItems": 2,
                                                "maxItems": 2,
                                                "items": [
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "number"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "path"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string",
                                                "const": "create"
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "file_text": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "path",
                                              "file_text"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string",
                                                "const": "str_replace"
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "new_str": {
                                                "type": "string"
                                              },
                                              "old_str": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "path",
                                              "old_str"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string",
                                                "const": "insert"
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "insert_line": {
                                                "type": "number"
                                              },
                                              "new_str": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "path",
                                              "insert_line",
                                              "new_str"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      {}
                                    ]
                                  },
                                  "partialOutput": {
                                    "type": "string"
                                  },
                                  "isHidden": {
                                    "type": "boolean"
                                  },
                                  "isAlwaysExpanded": {
                                    "type": "boolean"
                                  },
                                  "showNoContent": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "type",
                                  "callId",
                                  "name",
                                  "intentionSummary"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "tool_call_completed"
                                  },
                                  "callId": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "toolTitle": {
                                    "type": "string"
                                  },
                                  "intentionSummary": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "result": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "success"
                                          },
                                          "log": {
                                            "type": "string"
                                          },
                                          "detailedLog": {
                                            "type": "string"
                                          },
                                          "markdown": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "log"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "failure"
                                          },
                                          "log": {
                                            "type": "string"
                                          },
                                          "markdown": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "log"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "rejected"
                                          },
                                          "markdown": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "properties": {
                                          "type": {
                                            "type": "string",
                                            "const": "denied"
                                          },
                                          "log": {
                                            "type": "string"
                                          },
                                          "markdown": {
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "type",
                                          "log"
                                        ],
                                        "additionalProperties": false
                                      }
                                    ]
                                  },
                                  "arguments": {
                                    "anyOf": [
                                      {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string"
                                              },
                                              "description": {
                                                "type": "string"
                                              },
                                              "timeout": {
                                                "type": "number"
                                              },
                                              "shellId": {
                                                "type": "string"
                                              },
                                              "async": {
                                                "type": "boolean"
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "description"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "shellId": {
                                                "type": "string"
                                              },
                                              "input": {
                                                "type": "string"
                                              },
                                              "delay": {
                                                "type": "number"
                                              }
                                            },
                                            "required": [
                                              "shellId",
                                              "input"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "shellId": {
                                                "type": "string"
                                              },
                                              "delay": {
                                                "type": "number"
                                              }
                                            },
                                            "required": [
                                              "shellId",
                                              "delay"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "shellId": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "shellId"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string",
                                                "const": "view"
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "view_range": {
                                                "type": "array",
                                                "minItems": 2,
                                                "maxItems": 2,
                                                "items": [
                                                  {
                                                    "type": "number"
                                                  },
                                                  {
                                                    "type": "number"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "path"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string",
                                                "const": "create"
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "file_text": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "path",
                                              "file_text"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string",
                                                "const": "str_replace"
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "new_str": {
                                                "type": "string"
                                              },
                                              "old_str": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "path",
                                              "old_str"
                                            ],
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "object",
                                            "properties": {
                                              "command": {
                                                "type": "string",
                                                "const": "insert"
                                              },
                                              "path": {
                                                "type": "string"
                                              },
                                              "insert_line": {
                                                "type": "number"
                                              },
                                              "new_str": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "command",
                                              "path",
                                              "insert_line",
                                              "new_str"
                                            ],
                                            "additionalProperties": false
                                          }
                                        ]
                                      },
                                      {}
                                    ]
                                  },
                                  "isHidden": {
                                    "type": "boolean"
                                  },
                                  "isAlwaysExpanded": {
                                    "type": "boolean"
                                  },
                                  "showNoContent": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "type",
                                  "callId",
                                  "name",
                                  "intentionSummary",
                                  "result"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "timestamp": {
                                "type": "string",
                                "format": "date-time"
                              }
                            },
                            "required": [
                              "id",
                              "timestamp"
                            ]
                          }
                        ]
                      }
                    },
                    "selectedModel": {
                      "type": "string",
                      "enum": [
                        "claude-sonnet-4.6",
                        "claude-sonnet-4.5",
                        "claude-haiku-4.5",
                        "claude-opus-4.6",
                        "claude-opus-4.6-fast",
                        "claude-opus-4.6-1m",
                        "claude-opus-4.5",
                        "claude-sonnet-4",
                        "gemini-3-pro-preview",
                        "gpt-5.4",
                        "gpt-5.3-codex",
                        "gpt-5.2-codex",
                        "gpt-5.2",
                        "gpt-5.1-codex-max",
                        "gpt-5.1-codex",
                        "gpt-5.1",
                        "gpt-5.4-mini",
                        "gpt-5.1-codex-mini",
                        "gpt-5-mini",
                        "gpt-4.1"
                      ]
                    }
                  },
                  "required": [
                    "sessionId",
                    "startTime",
                    "chatMessages",
                    "timeline"
                  ],
                  "additionalProperties": false
                },
                "importTime": {
                  "type": "string",
                  "format": "date-time",
                  "description": "ISO 8601 timestamp when the import was performed"
                },
                "sourceFile": {
                  "type": "string",
                  "description": "File path of the legacy session file that was imported"
                }
              },
              "required": [
                "legacySession",
                "importTime",
                "sourceFile"
              ],
              "additionalProperties": false,
              "description": "Legacy session import data including the complete session JSON, import timestamp, and source file path"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                },
                "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"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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; all events after this one 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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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\")"
                },
                "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"
                },
                "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"
                      },
                      "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"
                          }
                        },
                        "required": [
                          "inputTokens",
                          "outputTokens",
                          "cacheReadTokens",
                          "cacheWriteTokens"
                        ],
                        "additionalProperties": false,
                        "description": "Token usage breakdown"
                      }
                    },
                    "required": [
                      "requests",
                      "usage"
                    ],
                    "additionalProperties": false
                  },
                  "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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)"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                          }
                        },
                        "required": [
                          "type",
                          "path",
                          "displayName"
                        ],
                        "additionalProperties": false,
                        "description": "File attachment"
                      },
                      {
                        "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"
                      },
                      {
                        "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"
                              },
                              "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"
                              }
                            },
                            "required": [
                              "start",
                              "end"
                            ],
                            "additionalProperties": false,
                            "description": "Position range of the selection within the file"
                          }
                        },
                        "required": [
                          "type",
                          "filePath",
                          "displayName",
                          "text",
                          "selection"
                        ],
                        "additionalProperties": false,
                        "description": "Code selection attachment from an editor"
                      },
                      {
                        "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"
                          },
                          "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"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "blob",
                            "description": "Attachment type discriminator"
                          },
                          "data": {
                            "type": "string",
                            "description": "Base64-encoded content"
                          },
                          "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"
                      }
                    ],
                    "description": "A user message attachment — a file, directory, code selection, blob, or GitHub reference"
                  },
                  "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"
                },
                "interactionId": {
                  "type": "string",
                  "description": "CAPI interaction ID for correlating this user message with its turn"
                }
              },
              "required": [
                "content"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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."
                      },
                      "toolTitle": {
                        "type": "string",
                        "description": "Human-readable display title for the 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"
                  },
                  "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"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                },
                "cost": {
                  "type": "number",
                  "description": "Model multiplier cost for billing purposes"
                },
                "duration": {
                  "type": "number",
                  "description": "Duration of the API call in milliseconds"
                },
                "initiator": {
                  "type": "string",
                  "description": "What initiated this API call (e.g., \"sub-agent\"); 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
                  },
                  "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"
                      },
                      "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"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                          },
                          {
                            "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"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "image",
                                "description": "Content block type discriminator"
                              },
                              "data": {
                                "type": "string",
                                "description": "Base64-encoded image data"
                              },
                              "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"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "audio",
                                "description": "Content block type discriminator"
                              },
                              "data": {
                                "type": "string",
                                "description": "Base64-encoded audio data"
                              },
                              "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"
                          },
                          {
                            "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"
                                    }
                                  },
                                  "required": [
                                    "src"
                                  ],
                                  "additionalProperties": false,
                                  "description": "Icon image for a resource"
                                },
                                "description": "Icons associated with this resource"
                              },
                              "name": {
                                "type": "string",
                                "description": "Resource name identifier"
                              },
                              "title": {
                                "type": "string",
                                "description": "Human-readable display title for the resource"
                              },
                              "uri": {
                                "type": "string",
                                "description": "URI identifying the resource"
                              },
                              "description": {
                                "type": "string",
                                "description": "Human-readable description of the resource"
                              },
                              "mimeType": {
                                "type": "string",
                                "description": "MIME type of the resource content"
                              },
                              "size": {
                                "type": "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"
                          },
                          {
                            "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
                                  },
                                  {
                                    "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"
                                      }
                                    },
                                    "required": [
                                      "uri",
                                      "blob"
                                    ],
                                    "additionalProperties": false
                                  }
                                ],
                                "description": "The embedded resource contents, either text or base64-encoded binary"
                              }
                            },
                            "required": [
                              "type",
                              "resource"
                            ],
                            "additionalProperties": false,
                            "description": "Embedded resource content block with inline text or binary data"
                          }
                        ],
                        "description": "A content block within a tool result, which may be text, terminal output, image, audio, or a resource"
                      },
                      "description": "Structured content blocks (text, images, audio, resources) returned by the tool in their native format"
                    }
                  },
                  "required": [
                    "content"
                  ],
                  "additionalProperties": false,
                  "description": "Tool execution result on success"
                },
                "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"
                },
                "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                }
              },
              "required": [
                "hookInvocationId",
                "hookType",
                "success"
              ],
              "additionalProperties": false,
              "description": "Hook invocation completion details including output, success status, and error information"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                },
                "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"
                }
              },
              "required": [
                "content",
                "role"
              ],
              "additionalProperties": false,
              "description": "System or developer message content with role and optional template metadata"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                        },
                        "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
                    },
                    {
                      "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
                    },
                    {
                      "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
                    },
                    {
                      "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
                    }
                  ],
                  "description": "Structured metadata identifying what triggered this notification"
                }
              },
              "required": [
                "content",
                "kind"
              ],
              "additionalProperties": false,
              "description": "System-generated notification for runtime events like background task completion"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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
                          },
                          "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
                          },
                          "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"
                    },
                    {
                      "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"
                    },
                    {
                      "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"
                    },
                    {
                      "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"
                    },
                    {
                      "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"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "memory",
                          "description": "Permission kind discriminator"
                        },
                        "toolCallId": {
                          "type": "string",
                          "description": "Tool call ID that triggered this permission request"
                        },
                        "subject": {
                          "type": "string",
                          "description": "Topic or subject of the memory being stored"
                        },
                        "fact": {
                          "type": "string",
                          "description": "The fact or convention being stored"
                        },
                        "citations": {
                          "type": "string",
                          "description": "Source references for the stored fact"
                        }
                      },
                      "required": [
                        "kind",
                        "subject",
                        "fact",
                        "citations"
                      ],
                      "additionalProperties": false,
                      "description": "Memory storage permission request"
                    },
                    {
                      "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"
                    },
                    {
                      "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"
                    }
                  ],
                  "description": "Details of the permission being requested"
                }
              },
              "required": [
                "requestId",
                "permissionRequest"
              ],
              "additionalProperties": false,
              "description": "Permission request notification requiring client approval with request details"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                      ],
                      "description": "The outcome of the permission request"
                    }
                  },
                  "required": [
                    "kind"
                  ],
                  "additionalProperties": false,
                  "description": "The result of the permission request"
                }
              },
              "required": [
                "requestId",
                "result"
              ],
              "additionalProperties": false,
              "description": "Permission request completion notification signaling UI dismissal"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                }
              },
              "required": [
                "requestId"
              ],
              "additionalProperties": false,
              "description": "User input request completion notification signaling UI dismissal"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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."
                },
                "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)"
                },
                "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)"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                }
              },
              "required": [
                "requestId"
              ],
              "additionalProperties": false,
              "description": "Elicitation request completion notification signaling UI dismissal"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                }
              },
              "required": [
                "requestId",
                "serverName",
                "serverUrl"
              ],
              "additionalProperties": false,
              "description": "OAuth authentication request for an MCP server"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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
                  },
                  "description": "Current list of registered SDK commands"
                }
              },
              "required": [
                "commands"
              ],
              "additionalProperties": false,
              "description": "SDK command registration change notification"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                }
              },
              "required": [
                "requestId"
              ],
              "additionalProperties": false,
              "description": "Plan mode exit completion notification signaling UI dismissal"
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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
                  },
                  "description": "Array of resolved skill metadata"
                }
              },
              "required": [
                "skills"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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
                  },
                  "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
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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",
                          "pending",
                          "disabled",
                          "not_configured"
                        ],
                        "description": "Connection status: connected, failed, pending, disabled, or not_configured"
                      },
                      "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
                  },
                  "description": "Array of MCP server status summaries"
                }
              },
              "required": [
                "servers"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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",
                    "pending",
                    "disabled",
                    "not_configured"
                  ],
                  "description": "New connection status: connected, failed, pending, disabled, or not_configured"
                }
              },
              "required": [
                "serverName",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        },
        {
          "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"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "running",
                          "disabled",
                          "failed",
                          "starting"
                        ],
                        "description": "Current status: running, disabled, failed, or starting"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "source",
                      "status"
                    ],
                    "additionalProperties": false
                  },
                  "description": "Array of discovered extensions and their status"
                }
              },
              "required": [
                "extensions"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "timestamp",
            "parentId",
            "ephemeral",
            "type",
            "data"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}