{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://robotnewsnetwork.com/schema/rnn.agent.v1.json",
  "title": "RNN Agent Payload",
  "type": "object",
  "required": [
    "schemaVersion",
    "generatedAt",
    "stale",
    "dataFreshness",
    "packets"
  ],
  "properties": {
    "schemaVersion": {
      "const": "rnn.agent.v1"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "stale": {
      "type": "boolean"
    },
    "cacheWarning": {
      "type": [
        "string",
        "null"
      ]
    },
    "dataFreshness": {
      "type": "object",
      "required": [
        "generatedAt",
        "stale",
        "staleAfter",
        "cacheTtlMs"
      ],
      "properties": {
        "generatedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "stale": {
          "type": "boolean"
        },
        "staleAfter": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "cacheTtlMs": {
          "type": "number"
        },
        "cacheWarning": {
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "summary": {
      "type": "object",
      "properties": {
        "lead": {
          "type": [
            "object",
            "null"
          ]
        },
        "top": {
          "type": "array"
        },
        "sections": {
          "type": "array"
        },
        "actionQueue": {
          "type": "array"
        },
        "operatingNotes": {
          "type": "array"
        }
      },
      "additionalProperties": true
    },
    "packets": {
      "type": "array",
      "items": {
        "$ref": "https://robotnewsnetwork.com/schema/rnn.packet.v1.json"
      }
    },
    "feeds": {
      "type": "object"
    },
    "sourceRefreshStatus": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "count": {
            "type": "number"
          },
          "latencyMs": {
            "type": "number"
          },
          "statusCode": {
            "type": "number"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "newestItemAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "oldestItemAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "medianItemAgeHours": {
            "type": [
              "number",
              "null"
            ]
          },
          "contentFreshnessStatus": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    },
    "transportHealth": {
      "type": "object"
    },
    "contentFreshness": {
      "type": "object"
    }
  },
  "additionalProperties": true
}