{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://loop.firmiana.si/news/v1/sources.schema.json",
  "title": "Sources read for status, new-model signals and posts, and how often (sources.json)",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "version", "generated_at", "license", "user_agent", "providers", "signals", "status"],
  "properties": {
    "schema": { "type": "string", "format": "uri" },
    "version": { "const": 1 },
    "generated_at": { "type": "string", "format": "date-time" },
    "license": { "const": "CC-BY-4.0" },
    "user_agent": { "type": "string" },
    "providers": {
      "type": "object",
      "description": "Per provider: regular expressions for model ids (ids) and for model names in running text (names)",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name"],
        "properties": { "name": { "type": "string" }, "ids": { "type": "string" }, "names": { "type": "string" } }
      }
    },
    "signals": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "kind", "class", "url", "every", "note"],
        "properties": {
          "id": { "type": "string", "pattern": "^[a-z0-9-]+$" },
          "kind": { "enum": ["page", "feed", "openrouter", "modelsdev", "hf", "hn"] },
          "class": { "enum": ["official", "aggregator", "forum"] },
          "provider": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "page": { "type": "string", "format": "uri" },
          "every": { "type": "integer", "minimum": 60, "description": "Seconds between reads" },
          "posts": { "type": "boolean" },
          "server": { "type": "boolean", "description": "false: read only by the GitHub workflow, not on the web server" },
          "note": { "type": "string" },
          "map": { "type": "object", "additionalProperties": { "type": "string" } },
          "orgs": { "type": "object", "additionalProperties": { "type": "string" } },
          "min_points": { "type": "integer" }
        }
      }
    },
    "status": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "name", "status_page", "adapter", "every"],
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "status_page": { "type": "string", "format": "uri" },
          "adapter": { "type": "string" },
          "host": { "type": ["string", "null"] },
          "api": { "type": ["string", "null"] },
          "keep": { "type": ["string", "null"] },
          "feeds": { "type": ["array", "null"], "items": { "type": "string", "format": "uri" } },
          "every": { "type": "integer", "minimum": 30 }
        }
      }
    }
  }
}
