{
  "$id": "https://www.ai-dc.ai/developer/schemas/aidc.app.schema.json",
  "title": "AIDC Nexus 应用清单（aidc.app.json）",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "maxLength": 200
    },
    "manifestVersion": {
      "type": "number",
      "const": 1
    },
    "slug": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]{1,47}$"
    },
    "version": {
      "type": "string",
      "pattern": "^(0|[1-9]\\d{0,5})\\.(0|[1-9]\\d{0,5})\\.(0|[1-9]\\d{0,5})(-[0-9A-Za-z.-]{1,32})?$"
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "summary": {
      "default": "",
      "type": "string",
      "maxLength": 240
    },
    "category": {
      "default": "general",
      "type": "string",
      "enum": [
        "vision",
        "voice",
        "video",
        "data",
        "agent",
        "general"
      ]
    },
    "namespace": {
      "type": "string",
      "pattern": "^(public|cell-[a-z0-9][a-z0-9-]{1,62})$"
    },
    "entry": {
      "default": "index.html",
      "type": "string",
      "maxLength": 120,
      "pattern": "^[a-z0-9][a-z0-9._/-]*\\.html$"
    },
    "sdk": {
      "default": [],
      "maxItems": 6,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "vision",
          "voice",
          "video",
          "model",
          "data",
          "connect"
        ]
      }
    },
    "permissions": {
      "default": {
        "camera": false,
        "microphone": false
      },
      "type": "object",
      "properties": {
        "camera": {
          "default": false,
          "type": "boolean"
        },
        "microphone": {
          "default": false,
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "models": {
      "default": [],
      "maxItems": 12,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64
      }
    },
    "datasets": {
      "default": [],
      "maxItems": 12,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64
      }
    },
    "streams": {
      "default": [],
      "maxItems": 12,
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9-]{1,47}$"
      }
    },
    "agents": {
      "default": false,
      "type": "boolean"
    },
    "storage": {
      "default": {
        "type": "none"
      },
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "none"
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    },
    "limits": {
      "default": {
        "dailyTokens": 1000000,
        "requestsPerMinute": 30,
        "realtimeSessionsPerDay": 100
      },
      "type": "object",
      "properties": {
        "dailyTokens": {
          "default": 1000000,
          "type": "integer",
          "minimum": 1000,
          "maximum": 50000000
        },
        "requestsPerMinute": {
          "default": 30,
          "type": "integer",
          "minimum": 1,
          "maximum": 600
        },
        "realtimeSessionsPerDay": {
          "default": 100,
          "type": "integer",
          "minimum": 0,
          "maximum": 5000
        }
      },
      "additionalProperties": false
    },
    "cdn": {
      "default": [],
      "maxItems": 2,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "cdn.jsdelivr.net",
          "cdnjs.cloudflare.com"
        ]
      }
    }
  },
  "required": [
    "manifestVersion",
    "slug",
    "version",
    "title"
  ],
  "additionalProperties": false
}
