{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://aigeoradar.com/schemas/acr/1.0/crawler-registry.schema.json",
    "title": "AI Crawler Registry (ACR)",
    "description": "Machine-readable registry of web crawlers and bots for robots.txt policy analysis. Part of the AI Discovery Framework (ADF). ACR v1.0.0. Maintained by AigeoRadar.",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "$schema",
        "specification",
        "maintainer",
        "license",
        "generatedAt",
        "crawlerCount",
        "categories",
        "crawlers"
    ],
    "properties": {
        "$schema": {
            "type": "string",
            "format": "uri",
            "const": "https://aigeoradar.com/schemas/acr/1.0/crawler-registry.schema.json"
        },
        "specification": {
            "type": "object",
            "additionalProperties": false,
            "required": ["name", "shortName", "version", "rfc"],
            "properties": {
                "name": { "type": "string", "const": "AI Crawler Registry" },
                "shortName": { "type": "string", "const": "ACR" },
                "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
                "rfc": { "type": "string", "pattern": "^ACR-\\d{3}$" }
            }
        },
        "maintainer": {
            "type": "object",
            "additionalProperties": false,
            "required": ["name", "url", "specification"],
            "properties": {
                "name": { "type": "string" },
                "url": { "type": "string", "format": "uri" },
                "specification": { "type": "string", "format": "uri" },
                "github": { "type": "string", "format": "uri" }
            }
        },
        "license": { "type": "string", "const": "CC-BY-4.0" },
        "generatedAt": { "type": "string", "format": "date-time" },
        "crawlerCount": { "type": "integer", "minimum": 0 },
        "categories": {
            "type": "array",
            "items": { "$ref": "#/$defs/category" }
        },
        "crawlers": {
            "type": "array",
            "items": { "$ref": "#/$defs/crawler" }
        }
    },
    "$defs": {
        "category": {
            "type": "object",
            "additionalProperties": false,
            "required": ["key", "label"],
            "properties": {
                "key": { "type": "string" },
                "label": { "type": "string" }
            }
        },
        "crawler": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "id",
                "name",
                "robotsAgent",
                "userAgent",
                "category",
                "categoryLabel",
                "purpose",
                "verified",
                "official",
                "capabilities"
            ],
            "properties": {
                "id": { "type": "string", "pattern": "^[a-z0-9-]+$" },
                "name": { "type": "string", "minLength": 1 },
                "robotsAgent": { "type": "string", "minLength": 1 },
                "userAgent": { "type": "string", "minLength": 1 },
                "company": { "type": ["string", "null"] },
                "category": { "type": "string" },
                "categoryLabel": { "type": "string" },
                "purpose": { "type": "string" },
                "description": { "type": ["string", "null"] },
                "documentationUrl": { "type": ["string", "null"], "format": "uri" },
                "verified": { "type": "boolean" },
                "official": { "type": "boolean" },
                "capabilities": { "$ref": "#/$defs/capabilities" }
            }
        },
        "capabilities": {
            "type": "object",
            "additionalProperties": false,
            "required": ["ai", "training", "search", "preview", "ads", "monitoring", "rss", "security", "seo"],
            "properties": {
                "ai": { "type": "boolean" },
                "training": { "type": "boolean" },
                "search": { "type": "boolean" },
                "preview": { "type": "boolean" },
                "ads": { "type": "boolean" },
                "monitoring": { "type": "boolean" },
                "rss": { "type": "boolean" },
                "security": { "type": "boolean" },
                "seo": { "type": "boolean" }
            }
        }
    }
}
