{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agentpaywire.com/schemas/library.schema.json",
  "title": "Agent Paywire knowledge library",
  "description": "links + original short summaries; content belongs to publishers",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "generated_at",
    "license",
    "count",
    "categories",
    "entries"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "schema_version": {
      "const": "1"
    },
    "generated_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T00:00:00Z$"
    },
    "license": {
      "const": "links + original short summaries; content belongs to publishers"
    },
    "category": {
      "enum": [
        "bitcoin-lightning",
        "payments",
        "agent-protocols",
        "robotics-autonomy",
        "iot",
        "datasets-benchmarks",
        "safety-security",
        "regulation"
      ]
    },
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "featured",
          "count",
          "json_url",
          "markdown_url",
          "html_url"
        ],
        "properties": {
          "id": {
            "enum": [
              "bitcoin-lightning",
              "payments",
              "agent-protocols",
              "robotics-autonomy",
              "iot",
              "datasets-benchmarks",
              "safety-security",
              "regulation"
            ]
          },
          "label": {
            "type": "string"
          },
          "featured": {
            "type": "boolean"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "json_url": {
            "type": "string",
            "format": "uri"
          },
          "markdown_url": {
            "type": "string",
            "format": "uri"
          },
          "html_url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "publisher",
          "authors",
          "date_published",
          "url",
          "type",
          "summary",
          "tags",
          "verified_at",
          "category"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "publisher": {
            "type": "string",
            "minLength": 1
          },
          "authors": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "date_published": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "type": {
            "enum": [
              "announcement",
              "directory",
              "docs",
              "regulatory",
              "repo",
              "report",
              "research-paper",
              "spec"
            ]
          },
          "summary": {
            "type": "string",
            "minLength": 1
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "verified_at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "category": {
            "enum": [
              "bitcoin-lightning",
              "payments",
              "agent-protocols",
              "robotics-autonomy",
              "iot",
              "datasets-benchmarks",
              "safety-security",
              "regulation"
            ]
          },
          "featured": {
            "type": "boolean"
          },
          "last_checked": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 100,
                "maximum": 599
              },
              {
                "type": "null"
              }
            ]
          },
          "archive_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    }
  }
}
