{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/relayger-com/json-schema/relayger-com-task-schema.json",
  "title": "Task",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/relayger-com-inbox-api-openapi.yml#/components/schemas/Task",
  "additionalProperties": false,
  "properties": {
    "artifactIds": {
      "items": {
        "format": "uuid",
        "type": "string"
      },
      "type": "array"
    },
    "assigneeId": {
      "format": "uuid",
      "type": "string"
    },
    "attempts": {
      "type": "integer"
    },
    "createdAt": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "creatorId": {
      "format": "uuid",
      "type": "string"
    },
    "depth": {
      "maximum": 4,
      "minimum": 0,
      "type": "integer"
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "format": "uuid",
      "type": "string"
    },
    "input": {
      "$defs": {
        "__schema0": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "boolean"
            },
            {
              "type": "null"
            },
            {
              "items": {
                "$ref": "#/$defs/__schema0"
              },
              "type": "array"
            },
            {
              "additionalProperties": {
                "$ref": "#/$defs/__schema0"
              },
              "propertyNames": {
                "type": "string"
              },
              "type": "object"
            }
          ]
        }
      },
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "operation": {
              "enum": [
                "echo",
                "uppercase",
                "sum",
                "coordinate"
              ],
              "type": "string"
            },
            "text": {
              "maxLength": 16000,
              "type": "string"
            },
            "values": {
              "items": {
                "type": "number"
              },
              "maxItems": 1000,
              "type": "array"
            }
          },
          "required": [
            "operation"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "properties": {
            "data": {
              "additionalProperties": {
                "$ref": "#/$defs/__schema0"
              },
              "propertyNames": {
                "type": "string"
              },
              "type": "object"
            },
            "deadline": {
              "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))$",
              "type": "string"
            },
            "kind": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/@+-]{0,127}$",
              "type": "string"
            },
            "operation": {
              "const": "custom",
              "type": "string"
            },
            "text": {
              "maxLength": 16000,
              "type": "string"
            },
            "title": {
              "maxLength": 200,
              "type": "string"
            }
          },
          "required": [
            "operation",
            "kind",
            "title"
          ],
          "type": "object"
        }
      ]
    },
    "leaseOwner": {
      "format": "uuid",
      "type": "string"
    },
    "leaseUntil": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "parentTaskId": {
      "format": "uuid",
      "type": [
        "string",
        "null"
      ]
    },
    "progress": {
      "anyOf": [
        {
          "additionalProperties": false,
          "properties": {
            "at": {
              "format": "date-time",
              "type": "string"
            },
            "note": {
              "type": [
                "string",
                "null"
              ]
            },
            "percent": {
              "maximum": 100,
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            }
          },
          "required": [
            "percent",
            "note",
            "at"
          ],
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "result": {
      "anyOf": [
        {
          "$defs": {
            "__schema0": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                },
                {
                  "items": {
                    "$ref": "#/$defs/__schema0"
                  },
                  "type": "array"
                },
                {
                  "additionalProperties": {
                    "$ref": "#/$defs/__schema0"
                  },
                  "propertyNames": {
                    "type": "string"
                  },
                  "type": "object"
                }
              ]
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "additionalProperties": false,
          "properties": {
            "data": {
              "additionalProperties": {
                "$ref": "#/$defs/__schema0"
              },
              "propertyNames": {
                "type": "string"
              },
              "type": "object"
            },
            "text": {
              "maxLength": 16000,
              "type": "string"
            },
            "total": {
              "type": "number"
            }
          },
          "required": [
            "text"
          ],
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "roomId": {
      "format": "uuid",
      "type": "string"
    },
    "rootTaskId": {
      "format": "uuid",
      "type": "string"
    },
    "state": {
      "enum": [
        "queued",
        "running",
        "waiting_approval",
        "completed",
        "failed",
        "cancelled"
      ]
    },
    "updatedAt": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "version": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    }
  },
  "required": [
    "id",
    "roomId",
    "creatorId",
    "assigneeId",
    "parentTaskId",
    "rootTaskId",
    "depth",
    "input",
    "state",
    "result",
    "error",
    "version",
    "leaseUntil",
    "attempts",
    "createdAt",
    "updatedAt"
  ],
  "type": "object",
  "$defs": {
    "__schema0": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    }
  }
}