{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://dee-wan.dev/schemas/plugins/manifest-v1.schema.json",
  "title": "Dee Wan plugin manifest v1",
  "description": "The document a plugin serves at its manifest URL. Generated from the Zod object backend/src/lib/plugins/manifest.ts validates every fetched manifest with.",
  "type": "object",
  "properties": {
    "manifest_version": {
      "type": "number",
      "const": 1
    },
    "id": {
      "type": "string",
      "maxLength": 128,
      "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*){2,}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "pattern": "^[^\\p{Cc}<>]+$"
    },
    "version": {
      "type": "string",
      "maxLength": 64,
      "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$"
    },
    "protocol_versions": {
      "minItems": 1,
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "integer",
        "exclusiveMinimum": 0,
        "maximum": 9007199254740991
      }
    },
    "base_url": {
      "type": "string",
      "maxLength": 2048
    },
    "activation_url": {
      "type": "string",
      "maxLength": 2048
    },
    "management_url": {
      "type": "string",
      "maxLength": 2048
    },
    "requested_capabilities": {
      "minItems": 1,
      "maxItems": 4,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "content:read",
          "workflow:read",
          "workflow:publish",
          "workflow:unpublish"
        ]
      }
    },
    "content_actions": {
      "maxItems": 4,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,31}$"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 24,
            "pattern": "^[^\\p{Cc}<>]+$"
          }
        },
        "required": [
          "id",
          "label"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "manifest_version",
    "id",
    "name",
    "version",
    "protocol_versions",
    "base_url",
    "activation_url",
    "management_url",
    "requested_capabilities"
  ],
  "additionalProperties": false
}
