{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://limecloud.github.io/agentartifact/schemas/agentartifact-handoff.schema.json",
  "title": "Agent Artifact Handoff Package",
  "type": "object",
  "required": [
    "schema_version",
    "handoff_id",
    "created_at",
    "created_by",
    "receiver",
    "artifacts"
  ],
  "properties": {
    "schema_version": {
      "type": "string"
    },
    "handoff_id": {
      "type": "string"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_by": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "receiver": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "artifacts": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "versions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "byte_refs": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "byte_ref_id",
          "uri",
          "media_type"
        ],
        "properties": {
          "byte_ref_id": {
            "type": "string"
          },
          "uri": {
            "type": "string"
          },
          "media_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "digest": {
            "type": "string"
          },
          "digest_algorithm": {
            "type": "string"
          },
          "storage_owner": {
            "type": "string"
          },
          "access": {
            "type": "object",
            "additionalProperties": true
          },
          "redaction_state": {
            "type": "string",
            "enum": [
              "none",
              "redacted",
              "withheld",
              "tokenized",
              "unknown"
            ]
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": true
      }
    },
    "source_links": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "export_refs": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "policy_refs": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "evidence_refs": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "constraints": {
      "type": "object",
      "additionalProperties": true
    },
    "omitted_payloads": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    }
  },
  "additionalProperties": true
}
