{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agentpaywire.com/schemas/sdk-security.schema.json",
  "title": "SDK security registry",
  "description": "Minimum safe versions backed by a linked source. Null means that source did not state the field.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "generated_at",
    "disclaimer",
    "description",
    "count",
    "entries"
  ],
  "properties": {
    "schema_version": {
      "const": "1"
    },
    "generated_at": {
      "type": "string"
    },
    "disclaimer": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "text",
        "url"
      ],
      "properties": {
        "text": {
          "const": "Not investment advice."
        },
        "url": {
          "const": "https://agentpaywire.com/disclaimer.json"
        }
      }
    },
    "$schema": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "selection_rule": {
      "type": "string"
    },
    "count": {
      "type": "integer"
    },
    "markdown_url": {
      "type": "string"
    },
    "csv_url": {
      "type": "string"
    },
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "package",
          "ecosystem",
          "minimum_safe_version",
          "constraint",
          "per_payment_cap_usd",
          "per_payment_cap_scope",
          "default_recognized_stablecoins_only",
          "spend_controls_opt_out",
          "formal_advisory_published",
          "advisory_url",
          "reported_at",
          "fixed_at",
          "origin_header_rejected_since",
          "fixes",
          "notes",
          "source",
          "related_urls",
          "verified_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "package": {
            "type": "string"
          },
          "ecosystem": {
            "type": "string",
            "enum": [
              "npm",
              "github"
            ]
          },
          "minimum_safe_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "constraint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "per_payment_cap_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "per_payment_cap_scope": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_recognized_stablecoins_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "spend_controls_opt_out": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "formal_advisory_published": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "advisory_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "reported_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "fixed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "origin_header_rejected_since": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "fixes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "format": "uri"
          },
          "related_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "verified_at": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        }
      }
    }
  }
}
