{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://a2aprotocol.ru/ext/trusted-persons/v0.1/schema.json",
  "title": "Доверенные лица 0.1 — содержимое части data сообщений A2A",
  "description": "Расширение https://a2aprotocol.ru/ext/trusted-persons/v0.1. Черновик для обсуждения до 15.12.2026. Инициатива ООО «САРМАТЕХ», не часть официальной спецификации A2A. CC BY 4.0.",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "kind",
        "invite",
        "scopes"
      ],
      "properties": {
        "kind": {
          "const": "tp.link.request"
        },
        "invite": {
          "type": "string",
          "minLength": 8
        },
        "scopes": {
          "type": "array",
          "items": {
            "enum": [
              "availability",
              "meeting",
              "files",
              "arrival"
            ]
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "displayName": {
          "type": "string",
          "maxLength": 80
        },
        "purpose": {
          "type": "string",
          "maxLength": 300
        }
      }
    },
    {
      "type": "object",
      "required": [
        "kind",
        "linkId",
        "scopes",
        "expires"
      ],
      "properties": {
        "kind": {
          "const": "tp.link.accept"
        },
        "linkId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{4,64}$"
        },
        "scopes": {
          "type": "array",
          "items": {
            "enum": [
              "availability",
              "meeting",
              "files",
              "arrival"
            ]
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "expires": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "const": "tp.link.decline"
        },
        "reason": {
          "type": "string",
          "maxLength": 300
        }
      }
    },
    {
      "type": "object",
      "required": [
        "kind",
        "linkId"
      ],
      "properties": {
        "kind": {
          "const": "tp.link.revoke"
        },
        "linkId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{4,64}$"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "kind",
        "linkId",
        "from",
        "to"
      ],
      "properties": {
        "kind": {
          "const": "tp.availability.query"
        },
        "linkId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{4,64}$"
        },
        "from": {
          "type": "string",
          "format": "date-time"
        },
        "to": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "kind",
        "linkId",
        "busy"
      ],
      "properties": {
        "kind": {
          "const": "tp.availability.answer"
        },
        "linkId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{4,64}$"
        },
        "busy": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 2,
            "maxItems": 2
          }
        }
      }
    },
    {
      "type": "object",
      "required": [
        "kind",
        "linkId",
        "slot"
      ],
      "properties": {
        "kind": {
          "const": "tp.meeting.propose"
        },
        "linkId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{4,64}$"
        },
        "slot": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "date-time"
          },
          "minItems": 2,
          "maxItems": 2
        },
        "place": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    {
      "type": "object",
      "required": [
        "kind",
        "linkId",
        "slot",
        "status",
        "confirmedByHuman"
      ],
      "properties": {
        "kind": {
          "const": "tp.meeting.confirm"
        },
        "linkId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{4,64}$"
        },
        "slot": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "date-time"
          },
          "minItems": 2,
          "maxItems": 2
        },
        "status": {
          "enum": [
            "accepted",
            "declined"
          ]
        },
        "confirmedByHuman": {
          "type": "boolean"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "kind",
        "linkId",
        "name",
        "mediaType",
        "size",
        "sha256"
      ],
      "properties": {
        "kind": {
          "const": "tp.file.offer"
        },
        "linkId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{4,64}$"
        },
        "name": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "kind",
        "linkId",
        "placeRef",
        "at"
      ],
      "properties": {
        "kind": {
          "const": "tp.arrival.notice"
        },
        "linkId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{4,64}$"
        },
        "placeRef": {
          "type": "string",
          "maxLength": 120
        },
        "at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  ]
}