{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/geronimo-iia/agent-foundation/schemas/docs-index.json",
  "title": "Docs Hub Index",
  "description": "Schema for index.json generated by agent-hub-indexer for documentation hubs",
  "type": "object",
  "required": ["type", "version", "entries", "metadata"],
  "properties": {
    "type": {
      "type": "string",
      "const": "docs"
    },
    "version": {
      "type": "string"
    },
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["title", "summary", "path", "commit_hash", "last_updated", "status", "read_when"],
        "properties": {
          "title": { "type": "string" },
          "summary": { "type": "string" },
          "path": { "type": "string" },
          "commit_hash": { "type": "string" },
          "last_updated": { "type": "string" },
          "status": {
            "type": "string",
            "enum": ["active", "draft", "deprecated"]
          },
          "read_when": {
            "type": "array",
            "items": { "type": "string" },
            "minItems": 1
          }
        },
        "additionalProperties": false
      }
    },
    "metadata": {
      "type": "object",
      "required": ["generated_at", "commit_hash", "total_entries"],
      "properties": {
        "generated_at": { "type": "string", "format": "date-time" },
        "commit_hash": { "type": "string" },
        "total_entries": { "type": "integer", "minimum": 0 }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
