{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "brand": {
      "type": "string",
      "format": "oods-brand",
      "default": "A",
      "description": "Target brand identifier. Must name a brand directory under packages/tokens/src/tokens/brands."
    },
    "delta": {
      "description": "Alias changes (object) or an array using the supported add/remove/replace subset of RFC 6902 when strategy=patch.",
      "oneOf": [
        {
          "type": "object"
        },
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "op": {
                "type": "string",
                "enum": [
                  "add",
                  "remove",
                  "replace"
                ]
              },
              "path": {
                "type": "string"
              },
              "value": {}
            },
            "required": [
              "op",
              "path"
            ],
            "additionalProperties": false
          }
        }
      ]
    },
    "strategy": {
      "type": "string",
      "enum": [
        "alias",
        "patch"
      ],
      "default": "alias",
      "description": "Alias strategy rewrites token values; patch applies the supported add/remove/replace subset of RFC 6902."
    },
    "preview": {
      "type": "object",
      "description": "Preview response controls (apply=false).",
      "properties": {
        "verbosity": {
          "type": "string",
          "enum": [
            "full",
            "compact"
          ],
          "default": "full",
          "description": "full includes structured before/after payloads; compact returns summary + hunks only."
        }
      },
      "additionalProperties": false
    },
    "apply": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "delta"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "strategy": {
            "type": "string",
            "const": "patch"
          }
        },
        "required": [
          "strategy"
        ]
      },
      "then": {
        "properties": {
          "delta": {
            "type": "array"
          }
        }
      },
      "else": {
        "properties": {
          "delta": {
            "type": "object"
          }
        }
      }
    }
  ],
  "additionalProperties": false
}
