{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pixelgameshub.com/schemas/ai-games-index-v1.json",
  "title": "AI Games Index v1",
  "description": "Open catalog of AI-powered browser games maintained by PixelGamesHub. Licensed CC-BY-4.0.",
  "type": "object",
  "required": ["version", "license", "creator", "entries"],
  "properties": {
    "$schema": { "type": "string", "format": "uri" },
    "version": { "type": "string", "description": "Index revision identifier (date-stamped)." },
    "license": { "type": "string", "const": "CC-BY-4.0" },
    "licenseUrl": { "type": "string", "format": "uri" },
    "creator": {
      "type": "object",
      "required": ["name", "url"],
      "properties": {
        "name": { "type": "string" },
        "url": { "type": "string", "format": "uri" }
      }
    },
    "lastUpdated": { "type": "string", "format": "date-time" },
    "documentation": { "type": "string", "format": "uri" },
    "entries": {
      "type": "array",
      "items": { "$ref": "#/$defs/AiGameIndexEntry" }
    }
  },
  "$defs": {
    "AiGameIndexEntry": {
      "type": "object",
      "required": [
        "slug", "name", "description", "modelProvider",
        "requiresAccount", "freeTier", "category", "aiTags",
        "primarySiteUrl", "evidenceUrl", "lastVerifiedAt", "source"
      ],
      "properties": {
        "slug": { "type": "string", "pattern": "^[a-z0-9-]+$" },
        "name": { "type": "string", "maxLength": 200 },
        "description": { "type": "string", "maxLength": 280 },
        "modelProvider": { "type": "string" },
        "modelName": { "type": "string" },
        "requiresAccount": { "type": "boolean" },
        "freeTier": { "type": "boolean" },
        "category": { "type": "string" },
        "aiTags": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "ai-text-adventure",
              "ai-chat",
              "ai-art",
              "ai-music",
              "ai-guessing",
              "ai-simulation"
            ]
          }
        },
        "primarySiteUrl": { "type": "string", "format": "uri" },
        "hostedByUsSlug": { "type": "string" },
        "evidenceUrl": { "type": "string", "format": "uri" },
        "lastVerifiedAt": { "type": "string", "format": "date" },
        "source": { "type": "string", "enum": ["internal", "external"] },
        "notes": { "type": "string", "maxLength": 280 }
      }
    }
  }
}
