{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/tembo/main/json-schema/tembo-session-event-data-schema.json",
  "title": "SessionEventData",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tembo-openapi.yml#/components/schemas/SessionEventData",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "maxLength": 100
    },
    "scope": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "foreground",
            "subagent",
            "background"
          ]
        },
        "parentToolUseId": {
          "type": "string",
          "maxLength": 1000
        },
        "taskId": {
          "type": "string",
          "maxLength": 1000
        }
      },
      "required": [
        "kind"
      ]
    },
    "source": {
      "type": "string",
      "maxLength": 500
    },
    "providerEvent": {
      "type": "boolean"
    },
    "delivery": {
      "type": "string",
      "enum": [
        "realtime",
        "persist"
      ]
    },
    "event": {
      "type": "object",
      "properties": {
        "event": {
          "type": "string",
          "maxLength": 500
        },
        "message": {
          "type": "string",
          "maxLength": 1000000
        },
        "provider": {
          "type": "string",
          "maxLength": 100
        },
        "messageId": {
          "type": "string",
          "maxLength": 1000
        }
      },
      "required": [
        "event",
        "message"
      ]
    },
    "index": {
      "type": "integer"
    },
    "itemId": {
      "type": "string",
      "maxLength": 1000
    },
    "sequenceNumber": {
      "type": "integer"
    },
    "accumulatedText": {
      "type": "string",
      "maxLength": 1000000
    },
    "deltaType": {
      "type": "string",
      "enum": [
        "text_delta",
        "input_json_delta"
      ]
    },
    "responsePhase": {
      "type": "string",
      "enum": [
        "commentary",
        "final_answer"
      ]
    },
    "toolName": {
      "type": "string",
      "maxLength": 1000
    },
    "toolResult": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "running",
            "completed",
            "error"
          ]
        },
        "output": {
          "type": "string"
        },
        "exitCode": {
          "type": "number"
        },
        "error": {
          "type": "string"
        }
      },
      "required": [
        "status"
      ]
    },
    "snapshotId": {
      "type": "string"
    },
    "snapshotCreatedAt": {
      "type": "string"
    }
  },
  "required": [
    "type"
  ]
}