{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "text"
        },
        "payload": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string",
              "maxLength": 16000
            },
            "attachments": {
              "maxItems": 8,
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              }
            }
          },
          "required": [
            "text"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "attention": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "question",
                "information",
                "response"
              ]
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "revision": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "corrected",
                "retracted"
              ]
            },
            "count": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "at": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          "required": [
            "state",
            "count",
            "at"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "task"
        },
        "payload": {
          "type": "object",
          "properties": {
            "taskId": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "summary": {
              "type": "string",
              "maxLength": 1000
            }
          },
          "required": [
            "taskId",
            "summary"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "result"
        },
        "payload": {
          "type": "object",
          "properties": {
            "taskId": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "text": {
              "type": "string",
              "maxLength": 16000
            }
          },
          "required": [
            "taskId",
            "text"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "artifact"
        },
        "payload": {
          "type": "object",
          "properties": {
            "fileId": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "caption": {
              "type": "string",
              "maxLength": 1000
            }
          },
          "required": [
            "fileId",
            "caption"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "status"
        },
        "payload": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "online",
                "idle",
                "working",
                "waiting",
                "offline"
              ]
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "approval_request"
        },
        "payload": {
          "type": "object",
          "properties": {
            "approvalId": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          },
          "required": [
            "approvalId"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "approval_decision"
        },
        "payload": {
          "type": "object",
          "properties": {
            "approvalId": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            }
          },
          "required": [
            "approvalId"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "data"
        },
        "payload": {
          "type": "object",
          "properties": {
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/@+-]{0,127}$"
            },
            "data": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "$ref": "#/$defs/__schema0"
              }
            },
            "text": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "required": [
            "schema",
            "data"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "attention": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "question",
                "information",
                "response"
              ]
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "revision": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "corrected",
                "retracted"
              ]
            },
            "count": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "at": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          "required": [
            "state",
            "count",
            "at"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "revision"
        },
        "payload": {
          "type": "object",
          "properties": {
            "messageId": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "sequence": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "action": {
              "type": "string",
              "enum": [
                "correct",
                "retract"
              ]
            },
            "payload": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "maxLength": 16000
                    },
                    "attachments": {
                      "maxItems": 8,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                      }
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "schema": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/@+-]{0,127}$"
                    },
                    "data": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "$ref": "#/$defs/__schema0"
                      }
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 2000
                    }
                  },
                  "required": [
                    "schema",
                    "data"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "messageId",
            "sequence",
            "action"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "sealed"
        },
        "payload": {
          "type": "object",
          "properties": {
            "alg": {
              "type": "string",
              "const": "relayger-e2ee-v1"
            },
            "ephemeralKey": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "nonce": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "ciphertext": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "recipients": {
              "minItems": 1,
              "maxItems": 32,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  },
                  "keyId": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  },
                  "nonce": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]+$"
                  },
                  "wrappedKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]+$"
                  }
                },
                "required": [
                  "id",
                  "keyId",
                  "nonce",
                  "wrappedKey"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "alg",
            "ephemeralKey",
            "nonce",
            "ciphertext",
            "recipients"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "attention": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "question",
                "information",
                "response"
              ]
            },
            "expiresAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "progress"
        },
        "payload": {
          "type": "object",
          "properties": {
            "taskId": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "percent": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            },
            "note": {
              "type": "string"
            }
          },
          "required": [
            "taskId"
          ],
          "additionalProperties": false
        },
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "clientMessageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "replyTo": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "mentions": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        },
        "rootTaskId": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "messageId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "conversationId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        },
        "sequence": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "sender": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
            },
            "handle": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "human",
                "agent",
                "service"
              ]
            },
            "number": {
              "type": "string",
              "pattern": "^[1-9][0-9]{9}$"
            }
          },
          "required": [
            "id",
            "handle",
            "kind"
          ],
          "additionalProperties": false
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
        },
        "traceId": {
          "type": "string",
          "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
        }
      },
      "required": [
        "type",
        "payload",
        "schemaVersion",
        "clientMessageId",
        "replyTo",
        "mentions",
        "rootTaskId",
        "messageId",
        "conversationId",
        "sequence",
        "sender",
        "createdAt",
        "traceId"
      ],
      "additionalProperties": false
    }
  ],
  "$defs": {
    "__schema0": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        },
        {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema0"
          }
        }
      ]
    }
  }
}
