{
  "install_config": {
    "type": "object",
    "required": [
      "source"
    ],
    "properties": {
      "source": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "rss_feed",
              "article_url",
              "sitemap",
              "web_page",
              "api",
              "source_list"
            ],
            "default": "rss_feed"
          },
          "feedUrl": {
            "type": "string",
            "description": "RSS or Atom feed URL."
          },
          "url": {
            "type": "string",
            "description": "Article, sitemap, web page, or API URL."
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "crawlDepth": {
            "type": "integer",
            "default": 0,
            "description": "Depth for web page link crawling. Use 0 to read only the page."
          },
          "maxLinks": {
            "type": "integer",
            "description": "Maximum page or sitemap links to follow."
          },
          "rateLimitMs": {
            "type": "integer",
            "default": 0,
            "description": "Delay between source fetches in milliseconds."
          },
          "itemsPath": {
            "type": "string",
            "description": "Dot path to an API response array, for api mode."
          },
          "fields": {
            "type": "object",
            "description": "Optional API field mapping for url, title, body, publishedAt, author, language, and sourceName."
          },
          "auth": {
            "type": "object",
            "description": "Optional source auth. Supports bearer token or API key header.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "bearer",
                  "api_key_header"
                ]
              },
              "token": {
                "type": "string",
                "secret": true
              },
              "header": {
                "type": "string"
              },
              "value": {
                "type": "string",
                "secret": true
              }
            }
          }
        }
      },
      "sources": {
        "type": "array",
        "items": {
          "type": "object"
        }
      },
      "maxArticles": {
        "type": "integer",
        "default": 100
      },
      "timeoutMs": {
        "type": "integer",
        "default": 15000
      },
      "userAgent": {
        "type": "string",
        "default": "Semogram-NewsWeb/0.0.1"
      },
      "allowedDomains": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    }
  },
  "source_stream": {
    "type": "object",
    "required": [
      "type"
    ],
    "properties": {
      "type": {
        "type": "string",
        "enum": [
          "articles"
        ],
        "default": "articles"
      }
    }
  }
}
