{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "command": {
          "type": "string",
          "const": "preset.show"
        },
        "data": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "source": {
              "type": "string",
              "enum": [
                "local",
                "npm"
              ]
            },
            "filePath": {
              "type": "string"
            },
            "scaffold": {
              "type": "object",
              "properties": {
                "framework": {
                  "type": "string"
                },
                "category": {
                  "type": "string"
                },
                "flags": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  }
                }
              },
              "required": [
                "framework",
                "category",
                "flags"
              ],
              "additionalProperties": false
            },
            "enhancements": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "config": {
              "type": "object",
              "properties": {
                "packageManager": {
                  "type": "string",
                  "enum": [
                    "npm",
                    "pnpm",
                    "yarn",
                    "bun"
                  ]
                },
                "typescript": {
                  "type": "boolean"
                },
                "defaultCategory": {
                  "type": "string",
                  "enum": [
                    "web",
                    "backend",
                    "mobile"
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "required": [
            "name",
            "source",
            "scaffold",
            "enhancements",
            "config"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "schemaVersion",
        "command",
        "data"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "command": {
          "type": "string",
          "const": "preset.show"
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "schemaVersion",
        "command",
        "error"
      ],
      "additionalProperties": false
    }
  ]
}
