{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://overseer.studio/schemas/prefab/manifest.json",
  "title": "Overseer Prefab Manifest",
  "description": "Schema for a prefab manifest.json inside an Overseer plugin package",
  "type": "object",
  "required": ["id", "label", "tiles"],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string",
      "description": "Reference to this schema"
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "description": "Unique prefab identifier within the plugin"
    },
    "label": {
      "type": "string",
      "minLength": 1,
      "description": "Human-readable prefab name shown in the prefab picker"
    },
    "tiles": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "object" },
      "description": "Configured tiles inserted when the prefab is used"
    },
    "folders": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["id", "name"],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Folder identifier tiles reference via folderId"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Folder name shown in the session sidebar"
          },
          "color": {
            "type": "string",
            "description": "Hex color applied to the folder's sidebar icon and label"
          },
          "collapsed": {
            "type": "boolean",
            "description": "Whether the folder starts collapsed in the sidebar"
          }
        }
      },
      "description": "Sidebar folders the prefab's tiles are organized into"
    }
  }
}
