{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/suedeai-ai/json-schema/suedeai-ai-curated-service-catalog-schema.json",
  "title": "CuratedServiceCatalog",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agents-openapi.json#/components/schemas/CuratedServiceCatalog",
  "type": "object",
  "properties": {
    "service": {
      "type": "string"
    },
    "operator": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "collection": {
      "type": "string",
      "const": "business-operations"
    },
    "site": {
      "type": "string",
      "format": "uri"
    },
    "readinessProjectionVersion": {
      "type": "integer",
      "const": 2
    },
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "historicallySettledServiceCount": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "description": "Services with recorded settled calls; null when any service's usage counts are unavailable."
    },
    "services": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "calls": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "settledCalls": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "readiness": {
            "$ref": "#/$defs/CuratedServiceReadiness"
          }
        },
        "required": [
          "calls",
          "settledCalls",
          "readiness"
        ],
        "additionalProperties": true
      }
    }
  },
  "required": [
    "service",
    "operator",
    "collection",
    "site",
    "readinessProjectionVersion",
    "count",
    "historicallySettledServiceCount",
    "services"
  ],
  "additionalProperties": false,
  "$defs": {
    "CuratedServiceReadiness": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "preview",
            "payment-enabled",
            "unavailable"
          ]
        },
        "publishedLive": {
          "type": "boolean"
        },
        "acceptsPayment": {
          "type": "boolean"
        },
        "previewAvailable": {
          "type": "boolean"
        },
        "hasSettledCalls": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Historical evidence only: true when this service has at least one recorded settled call; null when usage counts are unavailable. It does not assert current payment readiness."
        },
        "settledCalls": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "lastCallAt": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        }
      },
      "required": [
        "state",
        "publishedLive",
        "acceptsPayment",
        "previewAvailable",
        "hasSettledCalls",
        "settledCalls",
        "lastCallAt"
      ],
      "additionalProperties": false
    }
  }
}