{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://a2aprotocol.ru/ext/ru-profile/v0.1/schema.json",
  "title": "Профиль A2A-RU 0.1 — поле params расширения https://a2aprotocol.ru/ext/ru-profile/v0.1",
  "description": "Черновик для обсуждения до 15.12.2026. Инициатива ООО «САРМАТЕХ», не часть официальной спецификации A2A. CC BY 4.0.",
  "type": "object",
  "required": [
    "operator",
    "principal",
    "passport",
    "authority",
    "data",
    "disclosure"
  ],
  "properties": {
    "operator": {
      "type": "object",
      "required": [
        "name",
        "inn",
        "ogrn",
        "contact"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 2,
          "description": "Полное наименование юрлица или ФИО ИП"
        },
        "inn": {
          "type": "string",
          "pattern": "^(\\d{10}|\\d{12})$"
        },
        "ogrn": {
          "type": "string",
          "pattern": "^(\\d{13}|\\d{15})$",
          "description": "ОГРН или ОГРНИП"
        },
        "contact": {
          "type": "string",
          "format": "email",
          "description": "Почта, на которую отвечает человек"
        }
      },
      "additionalProperties": false
    },
    "principal": {
      "enum": [
        "organization",
        "person"
      ],
      "description": "organization — агент работает на компанию, person — персональный агент человека"
    },
    "passport": {
      "type": "object",
      "required": [
        "id",
        "url"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^AP-\\d{4}-\\d{6}$"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "additionalProperties": false
    },
    "authority": {
      "type": "object",
      "required": [
        "maxLevel"
      ],
      "properties": {
        "maxLevel": {
          "type": "integer",
          "minimum": 0,
          "maximum": 3,
          "description": "0 — читает, 1 — готовит, 2 — действует обратимо, 3 — действует необратимо (только с подтверждением человека)"
        },
        "limits": {
          "type": "object",
          "properties": {
            "perOperationRub": {
              "type": "number",
              "minimum": 0
            },
            "perDayRub": {
              "type": "number",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "data": {
      "type": "object",
      "required": [
        "residency",
        "personalData"
      ],
      "properties": {
        "residency": {
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "description": "Страна хранения данных, ISO 3166-1 alpha-2"
        },
        "personalData": {
          "type": "boolean"
        },
        "retentionDays": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "disclosure": {
      "type": "object",
      "required": [
        "identifiesAsAI"
      ],
      "properties": {
        "identifiesAsAI": {
          "const": true
        }
      },
      "additionalProperties": false
    },
    "rules": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "registry": {
      "type": "string",
      "format": "uri"
    }
  },
  "additionalProperties": false
}