{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "HookEventName": {
      "enum": [
        "sessionStart",
        "userPromptSubmit",
        "stop"
      ],
      "type": "string"
    },
    "HookExecutionMode": {
      "enum": [
        "sync",
        "async"
      ],
      "type": "string"
    },
    "HookHandlerType": {
      "enum": [
        "command",
        "prompt",
        "agent"
      ],
      "type": "string"
    },
    "HookOutputEntry": {
      "properties": {
        "kind": {
          "$ref": "#/definitions/HookOutputEntryKind"
        },
        "text": {
          "type": "string"
        }
      },
      "required": [
        "kind",
        "text"
      ],
      "type": "object"
    },
    "HookOutputEntryKind": {
      "enum": [
        "warning",
        "stop",
        "feedback",
        "context",
        "error"
      ],
      "type": "string"
    },
    "HookRunStatus": {
      "enum": [
        "running",
        "completed",
        "failed",
        "blocked",
        "stopped"
      ],
      "type": "string"
    },
    "HookRunSummary": {
      "properties": {
        "completedAt": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "displayOrder": {
          "format": "int64",
          "type": "integer"
        },
        "durationMs": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "entries": {
          "items": {
            "$ref": "#/definitions/HookOutputEntry"
          },
          "type": "array"
        },
        "eventName": {
          "$ref": "#/definitions/HookEventName"
        },
        "executionMode": {
          "$ref": "#/definitions/HookExecutionMode"
        },
        "handlerType": {
          "$ref": "#/definitions/HookHandlerType"
        },
        "id": {
          "type": "string"
        },
        "scope": {
          "$ref": "#/definitions/HookScope"
        },
        "sourcePath": {
          "type": "string"
        },
        "startedAt": {
          "format": "int64",
          "type": "integer"
        },
        "status": {
          "$ref": "#/definitions/HookRunStatus"
        },
        "statusMessage": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "displayOrder",
        "entries",
        "eventName",
        "executionMode",
        "handlerType",
        "id",
        "scope",
        "sourcePath",
        "startedAt",
        "status"
      ],
      "type": "object"
    },
    "HookScope": {
      "enum": [
        "thread",
        "turn"
      ],
      "type": "string"
    }
  },
  "properties": {
    "run": {
      "$ref": "#/definitions/HookRunSummary"
    },
    "threadId": {
      "type": "string"
    },
    "turnId": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "run",
    "threadId"
  ],
  "title": "HookStartedNotification",
  "type": "object"
}