{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://sdk.remeet.video/schema/v0/remeet.json",
    "title": "ReMeet app manifest (SDK v0)",
    "type": "object",
    "required": ["key", "version", "name", "description", "developer", "surfaces"],
    "properties": {
        "key": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{2,39}$", "description": "Unique app id: 3–40 lowercase letters, digits and dashes." },
        "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
        "name": { "$ref": "#/$defs/texts", "description": "Shown in the marketplace. «en» is required, «ru» and «ar» are optional. Up to 60 characters." },
        "description": { "$ref": "#/$defs/texts", "description": "Up to 300 characters." },
        "art": { "type": "string", "format": "uri", "pattern": "^https://", "description": "Picture for the marketplace card (square, transparent background works best)." },
        "developer": {
            "type": "object",
            "required": ["name"],
            "properties": {
                "name": { "type": "string", "maxLength": 80 },
                "email": { "type": "string", "format": "email" },
                "url": { "type": "string", "format": "uri", "pattern": "^https://" }
            }
        },
        "surfaces": {
            "type": "object",
            "minProperties": 1,
            "additionalProperties": false,
            "properties": {
                "panel": { "$ref": "#/$defs/surface", "description": "Side panel in the meeting, next to the chat." },
                "stage": { "$ref": "#/$defs/surface", "description": "Shared stage over the video grid." }
            }
        },
        "permissions": {
            "type": "array",
            "uniqueItems": true,
            "items": { "enum": ["participants.read", "app.broadcast", "chat.read", "chat.send", "captions.read", "badges.write", "stage.start", "storage"] }
        },
        "media": {
            "type": "array",
            "uniqueItems": true,
            "items": { "enum": ["camera", "microphone"] }
        }
    },
    "$defs": {
        "texts": {
            "type": "object",
            "required": ["en"],
            "properties": { "en": { "type": "string" }, "ru": { "type": "string" }, "ar": { "type": "string" } }
        },
        "surface": {
            "type": "object",
            "required": ["url"],
            "properties": { "url": { "type": "string", "format": "uri", "pattern": "^https://" } }
        }
    }
}
