{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://lumi.local/protocol/v1/hello.schema.json",
  "allOf": [
    { "$ref": "envelope.schema.json" },
    {
      "properties": {
        "type": { "const": "hello" },
        "payload": {
          "type": "object",
          "required": ["companion_version", "plugin_version", "capabilities", "audio"],
          "properties": {
            "companion_version": { "type": "string", "maxLength": 32 },
            "plugin_version": { "type": "string", "maxLength": 32 },
            "obs_version": { "type": ["string", "null"], "maxLength": 32 },
            "resume_session_id": { "type": ["string", "null"], "format": "uuid" },
            "capabilities": { "type": "array", "maxItems": 32, "items": { "type": "string", "maxLength": 64 } },
            "audio": {
              "type": "object",
              "required": ["codec", "sample_rate", "channels", "bits"],
              "properties": {
                "codec": { "enum": ["pcm_s16le"] },
                "sample_rate": { "const": 16000 },
                "channels": { "const": 1 },
                "bits": { "const": 16 }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      }
    }
  ]
}
