{
  "$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"
                }
              },
              "required": [
                "errorType",
                "message"
              ],
              "additionalProperties": false,
              "description": "Error details for timeline display including message and optional diagnostic information"
            }
          },
          "required": [
    