{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://helloaigent.dev/schemas/discovery.schema.json",
  "title": "Hello Aigent Discovery",
  "type": "object",
  "required": ["hello_aigent_version", "publisher", "feeds"],
  "additionalProperties": true,
  "properties": {
    "hello_aigent_version": { "type": "string" },
    "publisher": {
      "type": "object",
      "required": ["name", "site"],
      "additionalProperties": true,
      "properties": {
        "name": { "type": "string", "minLength": 1 },
        "site": { "type": "string", "format": "uri" }
      }
    },
    "feeds": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["id", "title", "description", "topics", "signing_public_key", "endpoints", "subscribe_schema_url", "update_schema_version"],
        "additionalProperties": true,
        "properties": {
          "id": { "type": "string", "minLength": 1 },
          "title": { "type": "string", "minLength": 1 },
          "description": { "type": "string", "minLength": 1 },
          "topics": {
            "type": "array",
            "items": { "type": "string" }
          },
          "signing_public_key": {
            "type": "string",
            "pattern": "^ed25519:[A-Za-z0-9+/=]+$"
          },
          "endpoints": {
            "type": "object",
            "required": ["subscribe", "fetch", "unsubscribe"],
            "additionalProperties": true,
            "properties": {
              "subscribe": { "type": "string", "format": "uri" },
              "fetch": { "type": "string", "format": "uri" },
              "unsubscribe": { "type": "string", "format": "uri" }
            }
          },
          "subscribe_schema_url": { "type": "string", "format": "uri" },
          "update_schema_version": { "type": "string" }
        }
      }
    }
  }
}
