{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://static-agent-marketplace.org/schemas/draft/catalog.schema.json",
  "title": "Static Agent Marketplace catalog",
  "description": "The normalized catalog published at <base>/catalog.json. Every other output is derived from it; see section 7.2 of the specification.",
  "type": "object",
  "required": ["$schema", "specVersion", "marketplace", "entryPoints", "plugins", "skills", "external"],
  "properties": {
    "$schema": {"const": "https://static-agent-marketplace.org/schemas/draft/catalog.schema.json"},
    "specVersion": {"type": "string", "pattern": "^0\\.1\\.0(-draft)?$"},
    "generator": {
      "description": "The implementation that produced the catalog. Omitted in conformance runs.",
      "type": "object",
      "required": ["name", "version"],
      "properties": {
        "name": {"type": "string", "minLength": 1},
        "version": {"type": "string", "minLength": 1},
        "url": {"type": "string", "format": "uri"}
      },
      "additionalProperties": false
    },
    "marketplace": {
      "type": "object",
      "required": ["name", "owner", "url"],
      "properties": {
        "name": {"$ref": "entry.schema.json#/$defs/name"},
        "owner": {"$ref": "entry.schema.json#/$defs/author"},
        "description": {"type": "string", "minLength": 1, "maxLength": 1024},
        "url": {
          "description": "The site root, ending in a slash.",
          "allOf": [{"$ref": "entry.schema.json#/$defs/httpsUrl"}],
          "pattern": "^https://[^/]+/$"
        }
      },
      "additionalProperties": false
    },
    "entryPoints": {
      "type": "object",
      "required": ["aiCatalog", "claudeMarketplace", "llmsTxt", "catalog", "sha256sums"],
      "properties": {
        "aiCatalog": {"$ref": "entry.schema.json#/$defs/httpsUrl"},
        "agentSkillsIndex": {"$ref": "entry.schema.json#/$defs/httpsUrl"},
        "claudeMarketplace": {"$ref": "entry.schema.json#/$defs/httpsUrl"},
        "llmsTxt": {"$ref": "entry.schema.json#/$defs/httpsUrl"},
        "catalog": {"$ref": "entry.schema.json#/$defs/httpsUrl"},
        "sha256sums": {"$ref": "entry.schema.json#/$defs/httpsUrl"}
      },
      "additionalProperties": false
    },
    "plugins": {
      "description": "Plugins sorted by name.",
      "type": "array",
      "items": {
        "allOf": [{"$ref": "entry.schema.json#/$defs/plugin"}],
        "unevaluatedProperties": false
      }
    },
    "skills": {
      "description": "Skills of every plugin, sorted by name. Names are unique across the catalog.",
      "type": "array",
      "items": {
        "allOf": [{"$ref": "entry.schema.json#/$defs/skill"}],
        "unevaluatedProperties": false
      }
    },
    "external": {
      "description": "Input B entries with a remote source. Listed only; nothing is fetched or packaged (section 7.7).",
      "type": "array",
      "items": {
        "type": "object",
        "required": ["name", "source"],
        "properties": {
          "name": {"$ref": "entry.schema.json#/$defs/name"},
          "description": {"$ref": "entry.schema.json#/$defs/description"},
          "version": {"type": "string"},
          "source": {
            "type": "object",
            "required": ["source"],
            "properties": {
              "source": {"enum": ["github", "url", "git-subdir", "npm"]}
            }
          }
        },
        "additionalProperties": false
      }
    },
    "bundle": {
      "description": "The host-tree bundle of Annex A, present only when it was produced.",
      "$ref": "entry.schema.json#/$defs/package"
    }
  },
  "additionalProperties": false
}
