{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "/contract/mosaic-app.schema.json",
  "title": "Mosaic app manifest",
  "description": "Served by an external app at /.well-known/mosaic.json (with CORS) so the mosaic launcher can install it as a tile. v0.1.",
  "type": "object",
  "required": ["slug", "name", "url"],
  "additionalProperties": false,
  "properties": {
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{0,63}$",
      "description": "Stable identifier, lowercase kebab-case, unique within a user's registry."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Display name for the launcher tile."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Absolute URL the tile opens."
    },
    "icon": {
      "type": "string",
      "format": "uri",
      "description": "Absolute URL to a square icon image."
    },
    "emoji": {
      "type": "string",
      "maxLength": 8,
      "description": "Emoji rendered when there is no icon."
    },
    "description": {
      "type": "string",
      "description": "One-line description shown in the Add-app flow."
    },
    "widget": {
      "type": "object",
      "required": ["endpoint"],
      "additionalProperties": false,
      "properties": {
        "endpoint": {
          "type": "string",
          "format": "uri",
          "description": "CORS-enabled read-only JSON endpoint returning a WidgetGlance."
        }
      }
    }
  }
}
