{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://dashfy.dev/schema/registry-item.json",
  "title": "Dashfy Registry Item",
  "description": "A single Dashfy extension item served from the registry.",
  "type": "object",
  "additionalProperties": false,
  "required": ["name", "type", "title", "dependencies", "meta"],
  "properties": {
    "$schema": { "type": "string" },
    "name": { "type": "string" },
    "type": { "const": "registry:extension" },
    "title": { "type": "string" },
    "description": { "type": "string" },
    "dependencies": {
      "type": "array",
      "minItems": 1,
      "items": { "type": "string" }
    },
    "registryDependencies": {
      "type": "array",
      "items": { "type": "string" }
    },
    "envVars": {
      "type": "array",
      "items": { "type": "string" }
    },
    "categories": {
      "type": "array",
      "items": { "type": "string" }
    },
    "docs": { "type": "string" },
    "meta": {
      "type": "object",
      "additionalProperties": false,
      "required": ["extensionKey", "widgets"],
      "properties": {
        "extensionKey": { "type": "string" },
        "widgets": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string" }
        },
        "client": {
          "type": "object",
          "additionalProperties": false,
          "required": ["import", "factory", "mode"],
          "properties": {
            "import": { "type": "string" },
            "factory": { "type": "string" },
            "mode": { "enum": ["poll", "push"] },
            "options": { "type": "string" }
          }
        },
        "starter": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["widget"],
            "properties": { "widget": { "type": "string" } }
          }
        }
      }
    }
  }
}
