{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "minItems": 1,
  "maxItems": 50,
  "type": "array",
  "items": {
    "anyOf": [
      {
        "type": "object",
        "properties": {
          "setup": {
            "default": {
              "mode": "none"
            },
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "const": "none"
                  }
                },
                "required": [
                  "mode"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "const": "script"
                  },
                  "shell": {
                    "type": "string",
                    "enum": [
                      "sh",
                      "bash"
                    ]
                  },
                  "script": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 65536
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 3600000
                  }
                },
                "required": [
                  "mode",
                  "shell",
                  "script",
                  "timeoutMs"
                ],
                "additionalProperties": false
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "provider": {
            "default": "vercel",
            "type": "string",
            "const": "vercel"
          },
          "auth": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "const": "byok"
                  },
                  "teamId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "tokenSecretName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[A-Za-z0-9_-]+$"
                  }
                },
                "required": [
                  "mode",
                  "teamId",
                  "projectId",
                  "tokenSecretName"
                ],
                "additionalProperties": false
              }
            ]
          },
          "imageProfileId": {
            "default": "vercel-universal",
            "type": "string",
            "enum": [
              "vercel-universal",
              "vercel-node22",
              "vercel-node24",
              "vercel-node26",
              "vercel-python",
              "vercel-ubuntu",
              "vercel-arch"
            ]
          },
          "resources": {
            "default": {},
            "type": "object",
            "properties": {
              "vcpus": {
                "anyOf": [
                  {
                    "type": "number",
                    "const": 1
                  },
                  {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 32
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "timeoutMs": {
            "default": 600000,
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 86400000
          },
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_-]{0,63}$"
          }
        },
        "required": [
          "name",
          "auth",
          "key"
        ],
        "additionalProperties": false
      }
    ]
  }
}
