{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://intelligentliving.art/schemas/capability-plan/v1.json",
  "title": "Living Art Capability Plan v1",
  "type": "object",
  "required": [
    "type",
    "version",
    "generatedAt",
    "reference",
    "environment",
    "recommended",
    "plans"
  ],
  "properties": {
    "type": {
      "const": "https://intelligentliving.art/protocols/capability-plan/v1.json"
    },
    "version": {
      "const": "1.0.0"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "reference": {
      "type": "string",
      "minLength": 1
    },
    "environment": {
      "type": "object",
      "required": [
        "deploymentMode",
        "localInference",
        "personalProvider",
        "localSpeech",
        "localTranscription",
        "localImages",
        "camera",
        "microphone"
      ],
      "properties": {
        "deploymentMode": {
          "type": "string"
        },
        "localInference": {
          "type": "boolean"
        },
        "personalProvider": {
          "type": "boolean"
        },
        "localSpeech": {
          "type": "boolean"
        },
        "localTranscription": {
          "type": "boolean"
        },
        "localImages": {
          "type": "boolean"
        },
        "camera": {
          "type": "string"
        },
        "microphone": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "recommended": {
      "type": [
        "string",
        "null"
      ]
    },
    "plans": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/plan"
      },
      "minItems": 1
    }
  },
  "$defs": {
    "component": {
      "type": "object",
      "required": [
        "role",
        "selection"
      ],
      "properties": {
        "role": {
          "type": "string"
        },
        "selection": {
          "type": "string"
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        },
        "setting": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "plan": {
      "type": "object",
      "required": [
        "id",
        "label",
        "status",
        "interpretation",
        "summary",
        "components",
        "missing",
        "warnings"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "ready",
            "setup",
            "unverified",
            "blocked"
          ]
        },
        "interpretation": {
          "enum": [
            "canonical",
            "compatible-independent",
            "presentation-only",
            "none"
          ]
        },
        "summary": {
          "type": "string"
        },
        "components": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/component"
          }
        },
        "missing": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "launch": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
