{
  "config": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "command": {
        "type": "string",
        "minLength": 1,
        "maxLength": 4096
      },
      "args": {
        "default": [],
        "maxItems": 32,
        "type": "array",
        "items": {
          "type": "string",
          "maxLength": 4096
        }
      },
      "cwd": {
        "type": "string",
        "minLength": 1,
        "maxLength": 4096
      },
      "env": {
        "default": [],
        "maxItems": 32,
        "type": "array",
        "items": {
          "type": "string",
          "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$"
        }
      }
    },
    "required": [
      "command",
      "args",
      "env"
    ],
    "additionalProperties": false
  },
  "request": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "schemaVersion": {
        "type": "number",
        "const": 1
      },
      "jobKey": {
        "type": "string",
        "maxLength": 73
      },
      "runtimeId": {
        "type": "string",
        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
      },
      "attempt": {
        "type": "integer",
        "minimum": 1,
        "maximum": 5
      },
      "untrustedExternalData": {
        "type": "boolean",
        "const": true
      },
      "message": {
        "oneOf": [
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "text"
              },
              "body": {
                "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
              },
              "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": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "task"
              },
              "body": {
                "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
              }
            },
            "required": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "result"
              },
              "body": {
                "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
              }
            },
            "required": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "artifact"
              },
              "body": {
                "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
              }
            },
            "required": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "status"
              },
              "body": {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "online",
                      "idle",
                      "working",
                      "waiting",
                      "offline"
                    ]
                  }
                },
                "required": [
                  "state"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "approval_request"
              },
              "body": {
                "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
              }
            },
            "required": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "approval_decision"
              },
              "body": {
                "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
              }
            },
            "required": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "data"
              },
              "body": {
                "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
              },
              "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": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "revision"
              },
              "body": {
                "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
              }
            },
            "required": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "sealed"
              },
              "body": {
                "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
              },
              "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": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          },
          {
            "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}$"
              },
              "room": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "seq": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "from": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{9}$"
                  },
                  {
                    "type": "string",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                ]
              },
              "reply": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "root": {
                "type": "string",
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
              },
              "mentions": {
                "maxItems": 32,
                "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}$"
                }
              },
              "type": {
                "type": "string",
                "const": "progress"
              },
              "body": {
                "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
              }
            },
            "required": [
              "id",
              "room",
              "seq",
              "from",
              "type",
              "body"
            ],
            "additionalProperties": false
          }
        ]
      },
      "opened": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "maxLength": 16000
              }
            },
            "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": [
      "schemaVersion",
      "jobKey",
      "runtimeId",
      "attempt",
      "untrustedExternalData",
      "message"
    ],
    "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"
            }
          }
        ]
      }
    }
  },
  "response": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "schemaVersion": {
        "type": "number",
        "const": 1
      },
      "jobKey": {
        "type": "string",
        "maxLength": 73
      },
      "result": {
        "type": "object",
        "properties": {
          "reply": {
            "type": "string",
            "maxLength": 16000
          },
          "skip": {
            "type": "boolean"
          },
          "note": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_-]{1,39}$"
              },
              "text": {
                "type": "string",
                "maxLength": 4000
              },
              "sourceMessageIds": {
                "default": [],
                "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}$"
                }
              },
              "version": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              }
            },
            "required": [
              "key",
              "text",
              "sourceMessageIds",
              "version"
            ],
            "additionalProperties": false
          },
          "usage": {
            "type": "object",
            "properties": {
              "modelCalls": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "inputTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000
              },
              "outputTokens": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000
              }
            },
            "required": [
              "modelCalls",
              "inputTokens",
              "outputTokens"
            ],
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      }
    },
    "required": [
      "schemaVersion",
      "jobKey",
      "result"
    ],
    "additionalProperties": false
  }
}
