{
  "openapi": "3.1.0",
  "info": {
    "title": "ЧПУ-мастерская A1 — AI Supplier Profile",
    "version": "2.0.0",
    "description": "Публичный машиночитаемый профиль мастерской и обезличенная предварительная проверка заказа. API не подтверждает цену, срок или изготовление."
  },
  "servers": [{"url": "/", "description": "Текущий публичный адрес сайта"}],
  "paths": {
    "/api/supplier-profile": {
      "get": {
        "operationId": "getSupplierProfile",
        "summary": "Получить полный профиль мастерской для AI-агента",
        "responses": {"200": {"description": "Оборудование, ограничения, контакты, интерфейсы и правила handoff"}}
      }
    },
    "/api/capabilities": {
      "get": {
        "operationId": "getCapabilities",
        "summary": "Совместимый адрес паспорта возможностей",
        "responses": {"200": {"description": "AI Supplier Profile 2.0"}}
      }
    },
    "/api/agent-preflight": {
      "post": {
        "operationId": "analyzeAnonymousManufacturingRequest",
        "summary": "Проверить обезличенную техническую спецификацию",
        "description": "Не передавайте имя, телефон, email, Telegram, адрес или файлы. После результата агент обязан запросить подтверждение человека перед переходом к форме заявки.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {"$ref": "#/components/schemas/PreflightRequest"},
              "examples": {
                "milling": {"value": {"operation": "фрезеровка панели", "material": "инженерный пластик", "dimensions": {"x": 300, "y": 200, "z": 12}, "quantity": 2, "fileType": "STEP"}},
                "turning": {"value": {"operation": "токарная обработка вала", "material": "сталь, марка уточняется", "dimensions": {"diameter": 80, "length": 450}, "quantity": 1, "fileType": "PDF"}},
                "grinding": {"value": {"operation": "круглое шлифование", "material": "сталь", "dimensions": {"diameter": 120, "length": 400}, "quantity": 4}}
              }
            }
          }
        },
        "responses": {
          "200": {"description": "Предварительный статус, недостающие параметры и human-confirmed handoff"},
          "400": {"description": "Некорректный JSON"},
          "413": {"description": "Слишком большой запрос"}
        }
      }
    },
    "/api/capability-check": {
      "post": {
        "operationId": "legacyCapabilityCheck",
        "summary": "Совместимый адрес предварительной проверки",
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PreflightRequest"}}}},
        "responses": {"200": {"description": "Предварительный результат"}}
      }
    }
  },
  "components": {
    "schemas": {
      "PreflightRequest": {
        "type": "object",
        "required": ["operation", "material", "dimensions"],
        "properties": {
          "operation": {"type": "string", "maxLength": 500},
          "material": {"type": "string", "maxLength": 500},
          "dimensions": {
            "type": "object",
            "properties": {
              "x": {"type": "number", "description": "мм"},
              "y": {"type": "number", "description": "мм"},
              "z": {"type": "number", "description": "мм"},
              "diameter": {"type": "number", "description": "мм"},
              "length": {"type": "number", "description": "мм"}
            }
          },
          "quantity": {"type": "integer", "minimum": 1},
          "fileType": {"type": "string"},
          "requirements": {"type": "string", "maxLength": 5000}
        },
        "additionalProperties": false
      }
    }
  }
}
