{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Baton adapter event",
  "description": "Event JSON accepted by `baton detect --event`, the MCP handoff_detect tool, and the Hermes context-engine bridge. Generated from AdapterEventSchema in packages/core/src/detect/index.ts.",
  "type": "object",
  "properties": {
    "harness": {
      "type": "string",
      "minLength": 1
    },
    "session_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "signals": {
      "type": "object",
      "properties": {
        "contextPressure": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "turnPressure": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "elapsedPressure": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "workBoundary": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "handoffRequest": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "changePressure": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "stuckSignal": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "resumeReadiness": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "semanticPhaseChange": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "unresolvedQuestions": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "sessionAgePressure": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "material_event": {
      "type": [
        "string",
        "null"
      ]
    },
    "at": {
      "type": "string"
    }
  },
  "required": [
    "harness"
  ],
  "additionalProperties": true
}
