{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commentary-dev/json-schema/commentary-dev-project-agentcancel-package-upload-output-schema.json",
  "title": "ProjectAgentcancelPackageUploadOutput",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commentary-dev-package-uploads-api-openapi.yml#/components/schemas/ProjectAgentcancelPackageUploadOutput",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "$ref": "#/$defs/ProjectAgentUpload"
    },
    "idempotencyReplayed": {
      "type": "boolean"
    }
  },
  "required": [
    "data"
  ],
  "$defs": {
    "ProjectAgentUpload": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "workspaceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 262144000
        },
        "receivedBytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 262144000
        },
        "maxChunkBytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4194304
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "state": {
          "type": "string",
          "enum": [
            "uploading",
            "validating",
            "complete",
            "expired",
            "failed",
            "canceled"
          ]
        },
        "expiresAt": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$"
        },
        "manifestSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "receivedChunks": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "offset": {
                "type": "integer",
                "minimum": 0,
                "maximum": 262144000
              },
              "bytes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 4194304
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "offset",
              "bytes",
              "sha256"
            ]
          },
          "maxItems": 63,
          "minItems": 0
        },
        "bundle": {
          "anyOf": [
            {
              "$ref": "#/$defs/ProjectAgentUploadBundle"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "workspaceId",
        "bytes",
        "receivedBytes",
        "maxChunkBytes",
        "sha256",
        "state",
        "expiresAt",
        "manifestSha256",
        "receivedChunks",
        "bundle"
      ]
    },
    "ProjectAgentUploadBundle": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "workspaceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "manifestSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 262144000
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024,
                "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "etag": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "sizeBytes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 26214400
              },
              "contentType": {
                "const": "application/octet-stream"
              },
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024,
                "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
              },
              "detectedMime": {
                "type": "string",
                "maxLength": 200
              }
            },
            "required": [
              "key",
              "sha256",
              "etag",
              "sizeBytes",
              "contentType",
              "path",
              "detectedMime"
            ]
          },
          "maxItems": 10000,
          "minItems": 1
        }
      },
      "required": [
        "id",
        "workspaceId",
        "manifestSha256",
        "sha256",
        "bytes",
        "files"
      ]
    }
  }
}