{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://engenty.ai/schema/v1/wizard-package.json",
  "$comment": "MIT License. Copyright (c) 2026 Matthias Platzer.",
  "title": "engenty.wizards package manifest (wizard.json)",
  "description": "wizard.json in a .wizard package — a zip with this file and the wizard's workspace under files/.",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string"
    },
    "format": {
      "type": "string",
      "const": "engenty-wizard"
    },
    "version": {
      "type": "number",
      "const": 1
    },
    "exportedAt": {
      "type": "string"
    },
    "definition": {
      "$ref": "#/$defs/definition"
    },
    "connectors": {
      "default": [],
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 60
          },
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "domain": {
            "type": "string",
            "maxLength": 253
          },
          "sourceKind": {
            "type": "string",
            "enum": [
              "openapi",
              "mcp"
            ]
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "mcpServers": {
      "default": [],
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 31
          },
          "name": {
            "type": "string",
            "maxLength": 60
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "themes": {
      "default": [],
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(@[a-z0-9-]{1,39}\\/)?[a-z0-9][a-z0-9-]{0,47}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "version": {
            "default": "1.0.0",
            "type": "string",
            "pattern": "^\\d+\\.\\d+\\.\\d+$"
          },
          "base": {
            "default": "brand",
            "type": "string",
            "enum": [
              "brand",
              "host",
              "default"
            ]
          },
          "colors": {
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "accent": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                "background": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                "text": {
                  "type": "string",
                  "pattern": "^#[0-9a-fA-F]{6}$"
                },
                "scheme": {
                  "type": "string",
                  "enum": [
                    "light",
                    "dark"
                  ]
                }
              },
              "required": [
                "scheme"
              ],
              "additionalProperties": false
            }
          },
          "fonts": {
            "type": "object",
            "properties": {
              "heading": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60,
                "pattern": "^[A-Za-z0-9 -]+$"
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60,
                "pattern": "^[A-Za-z0-9 -]+$"
              }
            },
            "additionalProperties": false
          },
          "shape": {
            "type": "object",
            "properties": {
              "radius": {
                "type": "string",
                "enum": [
                  "sharp",
                  "soft",
                  "round"
                ]
              },
              "cards": {
                "type": "string",
                "enum": [
                  "solid",
                  "outline",
                  "glass"
                ]
              },
              "headings": {
                "type": "string",
                "enum": [
                  "normal",
                  "uppercase"
                ]
              }
            },
            "additionalProperties": false
          },
          "effects": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            }
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "knowledge": {
      "type": "object",
      "properties": {
        "pages": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "truncated": {
          "type": "boolean"
        }
      },
      "required": [
        "pages",
        "truncated"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "format",
    "version",
    "definition"
  ],
  "additionalProperties": false,
  "$defs": {
    "definition": {
      "type": "object",
      "properties": {
        "$schema": {
          "type": "string",
          "description": "The JSON Schema an editor checks this file against; the app does not read it."
        },
        "version": {
          "default": 1,
          "type": "number",
          "const": 1
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "default": "",
          "type": "string"
        },
        "avatar": {
          "default": "round",
          "type": "string",
          "enum": [
            "round",
            "drop",
            "dome",
            "flame",
            "oval",
            "bean",
            "pebble",
            "sprout",
            "tower",
            "wedge"
          ]
        },
        "costume": {
          "type": "string",
          "enum": [
            "witch",
            "devil",
            "bat",
            "pumpkin"
          ]
        },
        "intro": {
          "type": "string"
        },
        "lang": {
          "type": "string",
          "pattern": "^[a-z]{2}$"
        },
        "lists": {
          "maxItems": 12,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              },
              "columns": {
                "minItems": 1,
                "maxItems": 64,
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "edit": {
                          "type": "string",
                          "enum": [
                            "inline",
                            "popout"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "format": {
                          "type": "object",
                          "properties": {
                            "style": {
                              "default": "single",
                              "type": "string",
                              "enum": [
                                "single",
                                "multiline",
                                "markdown"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "type": {
                          "type": "string",
                          "const": "text"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "type"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "edit": {
                          "type": "string",
                          "enum": [
                            "inline",
                            "popout"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "format": {
                          "type": "object",
                          "properties": {
                            "currency": {
                              "type": "string",
                              "pattern": "^[A-Z]{3}$"
                            },
                            "fractionDigits": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 8
                            },
                            "grouping": {
                              "type": "boolean"
                            },
                            "style": {
                              "type": "string",
                              "enum": [
                                "integer",
                                "decimal",
                                "percent",
                                "currency"
                              ]
                            }
                          },
                          "required": [
                            "style"
                          ],
                          "additionalProperties": false
                        },
                        "type": {
                          "type": "string",
                          "const": "number"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "format",
                        "type"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "edit": {
                          "type": "string",
                          "enum": [
                            "inline",
                            "popout"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "format": {
                          "type": "object",
                          "properties": {
                            "dateStyle": {
                              "type": "string",
                              "enum": [
                                "short",
                                "medium",
                                "long",
                                "iso"
                              ]
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "date",
                                "datetime",
                                "time"
                              ]
                            },
                            "timePrecision": {
                              "type": "string",
                              "enum": [
                                "hours",
                                "minutes",
                                "seconds"
                              ]
                            }
                          },
                          "required": [
                            "kind"
                          ],
                          "additionalProperties": false
                        },
                        "type": {
                          "type": "string",
                          "const": "date"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "format",
                        "type"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "edit": {
                          "type": "string",
                          "enum": [
                            "inline",
                            "popout"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "format": {
                          "type": "object",
                          "properties": {
                            "display": {
                              "type": "string",
                              "enum": [
                                "hms",
                                "hours",
                                "minutes",
                                "decimal-hours",
                                "iso"
                              ]
                            },
                            "inputUnit": {
                              "type": "string",
                              "enum": [
                                "milliseconds",
                                "seconds",
                                "minutes",
                                "hours",
                                "days"
                              ]
                            }
                          },
                          "required": [
                            "display",
                            "inputUnit"
                          ],
                          "additionalProperties": false
                        },
                        "type": {
                          "type": "string",
                          "const": "duration"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "format",
                        "type"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "edit": {
                          "type": "string",
                          "enum": [
                            "inline",
                            "popout"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "format": {
                          "type": "object",
                          "properties": {
                            "allowCustom": {
                              "type": "boolean"
                            },
                            "multiple": {
                              "type": "boolean"
                            },
                            "options": {
                              "maxItems": 200,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 64
                                  },
                                  "label": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "required": [
                                  "id",
                                  "label"
                                ],
                                "additionalProperties": false
                              }
                            }
                          },
                          "required": [
                            "allowCustom",
                            "options"
                          ],
                          "additionalProperties": false
                        },
                        "type": {
                          "type": "string",
                          "const": "select"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "format",
                        "type"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string",
                          "maxLength": 1024
                        },
                        "edit": {
                          "type": "string",
                          "enum": [
                            "inline",
                            "popout"
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "type": {
                          "type": "string",
                          "const": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "type"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "key": {
                "type": "string"
              },
              "check": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "shared": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "title",
              "columns"
            ],
            "additionalProperties": false
          }
        },
        "connections": {
          "maxItems": 12,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "mail"
                ]
              },
              "connector": {
                "type": "string"
              },
              "actions": {
                "maxItems": 200,
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "policy": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string",
                  "enum": [
                    "allow",
                    "ask"
                  ]
                }
              },
              "title": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "id"
            ],
            "additionalProperties": false
          }
        },
        "themes": {
          "maxItems": 8,
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^(@[a-z0-9-]{1,39}\\/)?[a-z0-9][a-z0-9-]{0,47}$"
          }
        },
        "steps": {
          "minItems": 1,
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "next": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "when": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "notEquals",
                                    "in",
                                    "notEmpty",
                                    "empty",
                                    "gt",
                                    "lt",
                                    "contains"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "equals",
                                      "notEquals",
                                      "in",
                                      "notEmpty",
                                      "empty",
                                      "gt",
                                      "lt",
                                      "contains"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ],
                                "additionalProperties": false
                              }
                            }
                          ]
                        },
                        "ask": {
                          "type": "string",
                          "minLength": 1
                        },
                        "goto": {
                          "type": "string"
                        },
                        "max": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        }
                      },
                      "required": [
                        "goto"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "type": {
                    "type": "string",
                    "const": "page"
                  },
                  "fields": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "text",
                            "textarea",
                            "number",
                            "select",
                            "multiselect",
                            "date",
                            "email",
                            "url",
                            "toggle",
                            "color",
                            "image",
                            "file",
                            "items",
                            "connection",
                            "list",
                            "location",
                            "audio",
                            "signature",
                            "slot"
                          ]
                        },
                        "required": {
                          "type": "boolean"
                        },
                        "placeholder": {
                          "type": "string"
                        },
                        "help": {
                          "type": "string"
                        },
                        "options": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "default": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "columns": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                              },
                              "label": {
                                "type": "string",
                                "minLength": 1
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "number",
                                  "money"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "label",
                              "kind"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "vat": {
                          "type": "object",
                          "properties": {
                            "rate": {
                              "type": "number"
                            },
                            "field": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        "currency": {
                          "type": "string"
                        },
                        "multiple": {
                          "type": "boolean"
                        },
                        "min": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 30
                        },
                        "max": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 30
                        },
                        "camera": {
                          "type": "boolean"
                        },
                        "video": {
                          "type": "boolean"
                        },
                        "listen": {
                          "type": "boolean"
                        },
                        "scan": {
                          "type": "boolean"
                        },
                        "connection": {
                          "type": "string"
                        },
                        "list": {
                          "type": "string"
                        },
                        "prefill": {
                          "type": "string"
                        },
                        "when": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "notEquals",
                                    "in",
                                    "notEmpty",
                                    "empty",
                                    "gt",
                                    "lt",
                                    "contains"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "equals",
                                      "notEquals",
                                      "in",
                                      "notEmpty",
                                      "empty",
                                      "gt",
                                      "lt",
                                      "contains"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ],
                                "additionalProperties": false
                              }
                            }
                          ]
                        },
                        "optionsFrom": {
                          "type": "string"
                        },
                        "cards": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string",
                              "minLength": 1
                            },
                            "value": {
                              "type": "string"
                            },
                            "image": {
                              "type": "string"
                            },
                            "subtitle": {
                              "type": "string"
                            },
                            "meta": {
                              "type": "string"
                            },
                            "link": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "label"
                          ],
                          "additionalProperties": false
                        },
                        "ask": {
                          "type": "string",
                          "minLength": 1
                        },
                        "group": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "label",
                        "kind"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "groups": {
                    "maxItems": 6,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                        },
                        "instructions": {
                          "type": "string",
                          "minLength": 1
                        },
                        "optional": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "instructions"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cta": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "title",
                  "type",
                  "fields"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "next": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "when": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "notEquals",
                                    "in",
                                    "notEmpty",
                                    "empty",
                                    "gt",
                                    "lt",
                                    "contains"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "equals",
                                      "notEquals",
                                      "in",
                                      "notEmpty",
                                      "empty",
                                      "gt",
                                      "lt",
                                      "contains"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ],
                                "additionalProperties": false
                              }
                            }
                          ]
                        },
                        "ask": {
                          "type": "string",
                          "minLength": 1
                        },
                        "goto": {
                          "type": "string"
                        },
                        "max": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        }
                      },
                      "required": [
                        "goto"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "type": {
                    "type": "string",
                    "const": "agent"
                  },
                  "instructions": {
                    "default": "",
                    "type": "string"
                  },
                  "call": {
                    "type": "object",
                    "properties": {
                      "tool": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9-]{0,39}\\.[a-z][a-z0-9_]{0,39}$"
                      },
                      "input": {
                        "default": {},
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      }
                    },
                    "required": [
                      "tool"
                    ],
                    "additionalProperties": false
                  },
                  "tools": {
                    "default": [],
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "web_search",
                            "web_fetch",
                            "browser",
                            "sandbox",
                            "image",
                            "http",
                            "pages",
                            "code"
                          ]
                        },
                        {
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9-]{0,39}\\.[a-z][a-z0-9_]{0,39}$"
                        }
                      ]
                    }
                  },
                  "mcp": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "connections": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "output": {
                    "default": {
                      "format": "markdown"
                    },
                    "type": "object",
                    "properties": {
                      "format": {
                        "type": "string",
                        "enum": [
                          "text",
                          "markdown",
                          "json"
                        ]
                      },
                      "fields": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "text",
                                "number",
                                "list",
                                "table",
                                "yesno",
                                "choice",
                                "score"
                              ]
                            },
                            "description": {
                              "type": "string"
                            },
                            "columns": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "options": {
                              "minItems": 2,
                              "maxItems": 40,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1
                              }
                            }
                          },
                          "required": [
                            "id",
                            "kind"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "schema": {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "object"
                          },
                          "label": {
                            "type": "string",
                            "minLength": 1
                          },
                          "description": {
                            "type": "string"
                          },
                          "fields": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string",
                              "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                            },
                            "additionalProperties": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "text"
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "long": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "number"
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "unit": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "yesno"
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "yes": {
                                      "type": "string"
                                    },
                                    "no": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "kind"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "choice"
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "options": {
                                      "minItems": 2,
                                      "maxItems": 40,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "options"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "ref"
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "to": {
                                      "type": "string",
                                      "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "to"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "list"
                                    },
                                    "label": {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    "description": {
                                      "type": "string"
                                    },
                                    "of": {
                                      "oneOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "text"
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            },
                                            "long": {
                                              "type": "boolean"
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "number"
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            },
                                            "unit": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "yesno"
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            },
                                            "yes": {
                                              "type": "string"
                                            },
                                            "no": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "kind"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "choice"
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            },
                                            "options": {
                                              "minItems": 2,
                                              "maxItems": 40,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1
                                              }
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "options"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "ref"
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            },
                                            "to": {
                                              "type": "string",
                                              "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "to"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "object",
                                          "properties": {
                                            "kind": {
                                              "type": "string",
                                              "const": "object"
                                            },
                                            "label": {
                                              "type": "string",
                                              "minLength": 1
                                            },
                                            "description": {
                                              "type": "string"
                                            },
                                            "fields": {
                                              "type": "object",
                                              "propertyNames": {
                                                "type": "string",
                                                "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                              },
                                              "additionalProperties": {
                                                "oneOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "kind": {
                                                        "type": "string",
                                                        "const": "text"
                                                      },
                                                      "label": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "description": {
                                                        "type": "string"
                                                      },
                                                      "long": {
                                                        "type": "boolean"
                                                      }
                                                    },
                                                    "required": [
                                                      "kind"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "kind": {
                                                        "type": "string",
                                                        "const": "number"
                                                      },
                                                      "label": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "description": {
                                                        "type": "string"
                                                      },
                                                      "unit": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "required": [
                                                      "kind"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "kind": {
                                                        "type": "string",
                                                        "const": "yesno"
                                                      },
                                                      "label": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "description": {
                                                        "type": "string"
                                                      },
                                                      "yes": {
                                                        "type": "string"
                                                      },
                                                      "no": {
                                                        "type": "string"
                                                      }
                                                    },
                                                    "required": [
                                                      "kind"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "kind": {
                                                        "type": "string",
                                                        "const": "choice"
                                                      },
                                                      "label": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "description": {
                                                        "type": "string"
                                                      },
                                                      "options": {
                                                        "minItems": 2,
                                                        "maxItems": 40,
                                                        "type": "array",
                                                        "items": {
                                                          "type": "string",
                                                          "minLength": 1
                                                        }
                                                      }
                                                    },
                                                    "required": [
                                                      "kind",
                                                      "options"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "kind": {
                                                        "type": "string",
                                                        "const": "ref"
                                                      },
                                                      "label": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "description": {
                                                        "type": "string"
                                                      },
                                                      "to": {
                                                        "type": "string",
                                                        "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                                      }
                                                    },
                                                    "required": [
                                                      "kind",
                                                      "to"
                                                    ],
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "kind": {
                                                        "type": "string",
                                                        "const": "list"
                                                      },
                                                      "label": {
                                                        "type": "string",
                                                        "minLength": 1
                                                      },
                                                      "description": {
                                                        "type": "string"
                                                      },
                                                      "of": {
                                                        "oneOf": [
                                                          {
                                                            "type": "object",
                                                            "properties": {
                                                              "kind": {
                                                                "type": "string",
                                                                "const": "text"
                                                              },
                                                              "label": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "description": {
                                                                "type": "string"
                                                              },
                                                              "long": {
                                                                "type": "boolean"
                                                              }
                                                            },
                                                            "required": [
                                                              "kind"
                                                            ],
                                                            "additionalProperties": false
                                                          },
                                                          {
                                                            "type": "object",
                                                            "properties": {
                                                              "kind": {
                                                                "type": "string",
                                                                "const": "number"
                                                              },
                                                              "label": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "description": {
                                                                "type": "string"
                                                              },
                                                              "unit": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "kind"
                                                            ],
                                                            "additionalProperties": false
                                                          },
                                                          {
                                                            "type": "object",
                                                            "properties": {
                                                              "kind": {
                                                                "type": "string",
                                                                "const": "yesno"
                                                              },
                                                              "label": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "description": {
                                                                "type": "string"
                                                              },
                                                              "yes": {
                                                                "type": "string"
                                                              },
                                                              "no": {
                                                                "type": "string"
                                                              }
                                                            },
                                                            "required": [
                                                              "kind"
                                                            ],
                                                            "additionalProperties": false
                                                          },
                                                          {
                                                            "type": "object",
                                                            "properties": {
                                                              "kind": {
                                                                "type": "string",
                                                                "const": "choice"
                                                              },
                                                              "label": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "description": {
                                                                "type": "string"
                                                              },
                                                              "options": {
                                                                "minItems": 2,
                                                                "maxItems": 40,
                                                                "type": "array",
                                                                "items": {
                                                                  "type": "string",
                                                                  "minLength": 1
                                                                }
                                                              }
                                                            },
                                                            "required": [
                                                              "kind",
                                                              "options"
                                                            ],
                                                            "additionalProperties": false
                                                          },
                                                          {
                                                            "type": "object",
                                                            "properties": {
                                                              "kind": {
                                                                "type": "string",
                                                                "const": "ref"
                                                              },
                                                              "label": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "description": {
                                                                "type": "string"
                                                              },
                                                              "to": {
                                                                "type": "string",
                                                                "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                                              }
                                                            },
                                                            "required": [
                                                              "kind",
                                                              "to"
                                                            ],
                                                            "additionalProperties": false
                                                          },
                                                          {
                                                            "type": "object",
                                                            "properties": {
                                                              "kind": {
                                                                "type": "string",
                                                                "const": "object"
                                                              },
                                                              "label": {
                                                                "type": "string",
                                                                "minLength": 1
                                                              },
                                                              "description": {
                                                                "type": "string"
                                                              },
                                                              "fields": {
                                                                "type": "object",
                                                                "propertyNames": {
                                                                  "type": "string",
                                                                  "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                                                },
                                                                "additionalProperties": {
                                                                  "oneOf": [
                                                                    {
                                                                      "type": "object",
                                                                      "properties": {
                                                                        "kind": {
                                                                          "type": "string",
                                                                          "const": "text"
                                                                        },
                                                                        "label": {
                                                                          "type": "string",
                                                                          "minLength": 1
                                                                        },
                                                                        "description": {
                                                                          "type": "string"
                                                                        },
                                                                        "long": {
                                                                          "type": "boolean"
                                                                        }
                                                                      },
                                                                      "required": [
                                                                        "kind"
                                                                      ],
                                                                      "additionalProperties": false
                                                                    },
                                                                    {
                                                                      "type": "object",
                                                                      "properties": {
                                                                        "kind": {
                                                                          "type": "string",
                                                                          "const": "number"
                                                                        },
                                                                        "label": {
                                                                          "type": "string",
                                                                          "minLength": 1
                                                                        },
                                                                        "description": {
                                                                          "type": "string"
                                                                        },
                                                                        "unit": {
                                                                          "type": "string"
                                                                        }
                                                                      },
                                                                      "required": [
                                                                        "kind"
                                                                      ],
                                                                      "additionalProperties": false
                                                                    },
                                                                    {
                                                                      "type": "object",
                                                                      "properties": {
                                                                        "kind": {
                                                                          "type": "string",
                                                                          "const": "yesno"
                                                                        },
                                                                        "label": {
                                                                          "type": "string",
                                                                          "minLength": 1
                                                                        },
                                                                        "description": {
                                                                          "type": "string"
                                                                        },
                                                                        "yes": {
                                                                          "type": "string"
                                                                        },
                                                                        "no": {
                                                                          "type": "string"
                                                                        }
                                                                      },
                                                                      "required": [
                                                                        "kind"
                                                                      ],
                                                                      "additionalProperties": false
                                                                    },
                                                                    {
                                                                      "type": "object",
                                                                      "properties": {
                                                                        "kind": {
                                                                          "type": "string",
                                                                          "const": "choice"
                                                                        },
                                                                        "label": {
                                                                          "type": "string",
                                                                          "minLength": 1
                                                                        },
                                                                        "description": {
                                                                          "type": "string"
                                                                        },
                                                                        "options": {
                                                                          "minItems": 2,
                                                                          "maxItems": 40,
                                                                          "type": "array",
                                                                          "items": {
                                                                            "type": "string",
                                                                            "minLength": 1
                                                                          }
                                                                        }
                                                                      },
                                                                      "required": [
                                                                        "kind",
                                                                        "options"
                                                                      ],
                                                                      "additionalProperties": false
                                                                    },
                                                                    {
                                                                      "type": "object",
                                                                      "properties": {
                                                                        "kind": {
                                                                          "type": "string",
                                                                          "const": "ref"
                                                                        },
                                                                        "label": {
                                                                          "type": "string",
                                                                          "minLength": 1
                                                                        },
                                                                        "description": {
                                                                          "type": "string"
                                                                        },
                                                                        "to": {
                                                                          "type": "string",
                                                                          "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                                                        }
                                                                      },
                                                                      "required": [
                                                                        "kind",
                                                                        "to"
                                                                      ],
                                                                      "additionalProperties": false
                                                                    },
                                                                    {
                                                                      "type": "object",
                                                                      "properties": {
                                                                        "kind": {
                                                                          "type": "string",
                                                                          "const": "list"
                                                                        },
                                                                        "label": {
                                                                          "type": "string",
                                                                          "minLength": 1
                                                                        },
                                                                        "description": {
                                                                          "type": "string"
                                                                        },
                                                                        "of": {
                                                                          "oneOf": [
                                                                            {
                                                                              "type": "object",
                                                                              "properties": {
                                                                                "kind": {
                                                                                  "type": "string",
                                                                                  "const": "text"
                                                                                },
                                                                                "label": {
                                                                                  "type": "string",
                                                                                  "minLength": 1
                                                                                },
                                                                                "description": {
                                                                                  "type": "string"
                                                                                },
                                                                                "long": {
                                                                                  "type": "boolean"
                                                                                }
                                                                              },
                                                                              "required": [
                                                                                "kind"
                                                                              ],
                                                                              "additionalProperties": false
                                                                            },
                                                                            {
                                                                              "type": "object",
                                                                              "properties": {
                                                                                "kind": {
                                                                                  "type": "string",
                                                                                  "const": "number"
                                                                                },
                                                                                "label": {
                                                                                  "type": "string",
                                                                                  "minLength": 1
                                                                                },
                                                                                "description": {
                                                                                  "type": "string"
                                                                                },
                                                                                "unit": {
                                                                                  "type": "string"
                                                                                }
                                                                              },
                                                                              "required": [
                                                                                "kind"
                                                                              ],
                                                                              "additionalProperties": false
                                                                            },
                                                                            {
                                                                              "type": "object",
                                                                              "properties": {
                                                                                "kind": {
                                                                                  "type": "string",
                                                                                  "const": "yesno"
                                                                                },
                                                                                "label": {
                                                                                  "type": "string",
                                                                                  "minLength": 1
                                                                                },
                                                                                "description": {
                                                                                  "type": "string"
                                                                                },
                                                                                "yes": {
                                                                                  "type": "string"
                                                                                },
                                                                                "no": {
                                                                                  "type": "string"
                                                                                }
                                                                              },
                                                                              "required": [
                                                                                "kind"
                                                                              ],
                                                                              "additionalProperties": false
                                                                            },
                                                                            {
                                                                              "type": "object",
                                                                              "properties": {
                                                                                "kind": {
                                                                                  "type": "string",
                                                                                  "const": "choice"
                                                                                },
                                                                                "label": {
                                                                                  "type": "string",
                                                                                  "minLength": 1
                                                                                },
                                                                                "description": {
                                                                                  "type": "string"
                                                                                },
                                                                                "options": {
                                                                                  "minItems": 2,
                                                                                  "maxItems": 40,
                                                                                  "type": "array",
                                                                                  "items": {
                                                                                    "type": "string",
                                                                                    "minLength": 1
                                                                                  }
                                                                                }
                                                                              },
                                                                              "required": [
                                                                                "kind",
                                                                                "options"
                                                                              ],
                                                                              "additionalProperties": false
                                                                            },
                                                                            {
                                                                              "type": "object",
                                                                              "properties": {
                                                                                "kind": {
                                                                                  "type": "string",
                                                                                  "const": "ref"
                                                                                },
                                                                                "label": {
                                                                                  "type": "string",
                                                                                  "minLength": 1
                                                                                },
                                                                                "description": {
                                                                                  "type": "string"
                                                                                },
                                                                                "to": {
                                                                                  "type": "string",
                                                                                  "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                                                                }
                                                                              },
                                                                              "required": [
                                                                                "kind",
                                                                                "to"
                                                                              ],
                                                                              "additionalProperties": false
                                                                            },
                                                                            {
                                                                              "type": "object",
                                                                              "properties": {
                                                                                "kind": {
                                                                                  "type": "string",
                                                                                  "const": "object"
                                                                                },
                                                                                "label": {
                                                                                  "type": "string",
                                                                                  "minLength": 1
                                                                                },
                                                                                "description": {
                                                                                  "type": "string"
                                                                                },
                                                                                "fields": {
                                                                                  "type": "object",
                                                                                  "propertyNames": {
                                                                                    "type": "string",
                                                                                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                                                                  },
                                                                                  "additionalProperties": {
                                                                                    "oneOf": [
                                                                                      {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                          "kind": {
                                                                                            "type": "string",
                                                                                            "const": "text"
                                                                                          },
                                                                                          "label": {
                                                                                            "type": "string",
                                                                                            "minLength": 1
                                                                                          },
                                                                                          "description": {
                                                                                            "type": "string"
                                                                                          },
                                                                                          "long": {
                                                                                            "type": "boolean"
                                                                                          }
                                                                                        },
                                                                                        "required": [
                                                                                          "kind"
                                                                                        ],
                                                                                        "additionalProperties": false
                                                                                      },
                                                                                      {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                          "kind": {
                                                                                            "type": "string",
                                                                                            "const": "number"
                                                                                          },
                                                                                          "label": {
                                                                                            "type": "string",
                                                                                            "minLength": 1
                                                                                          },
                                                                                          "description": {
                                                                                            "type": "string"
                                                                                          },
                                                                                          "unit": {
                                                                                            "type": "string"
                                                                                          }
                                                                                        },
                                                                                        "required": [
                                                                                          "kind"
                                                                                        ],
                                                                                        "additionalProperties": false
                                                                                      },
                                                                                      {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                          "kind": {
                                                                                            "type": "string",
                                                                                            "const": "yesno"
                                                                                          },
                                                                                          "label": {
                                                                                            "type": "string",
                                                                                            "minLength": 1
                                                                                          },
                                                                                          "description": {
                                                                                            "type": "string"
                                                                                          },
                                                                                          "yes": {
                                                                                            "type": "string"
                                                                                          },
                                                                                          "no": {
                                                                                            "type": "string"
                                                                                          }
                                                                                        },
                                                                                        "required": [
                                                                                          "kind"
                                                                                        ],
                                                                                        "additionalProperties": false
                                                                                      },
                                                                                      {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                          "kind": {
                                                                                            "type": "string",
                                                                                            "const": "choice"
                                                                                          },
                                                                                          "label": {
                                                                                            "type": "string",
                                                                                            "minLength": 1
                                                                                          },
                                                                                          "description": {
                                                                                            "type": "string"
                                                                                          },
                                                                                          "options": {
                                                                                            "minItems": 2,
                                                                                            "maxItems": 40,
                                                                                            "type": "array",
                                                                                            "items": {
                                                                                              "type": "string",
                                                                                              "minLength": 1
                                                                                            }
                                                                                          }
                                                                                        },
                                                                                        "required": [
                                                                                          "kind",
                                                                                          "options"
                                                                                        ],
                                                                                        "additionalProperties": false
                                                                                      },
                                                                                      {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                          "kind": {
                                                                                            "type": "string",
                                                                                            "const": "ref"
                                                                                          },
                                                                                          "label": {
                                                                                            "type": "string",
                                                                                            "minLength": 1
                                                                                          },
                                                                                          "description": {
                                                                                            "type": "string"
                                                                                          },
                                                                                          "to": {
                                                                                            "type": "string",
                                                                                            "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                                                                          }
                                                                                        },
                                                                                        "required": [
                                                                                          "kind",
                                                                                          "to"
                                                                                        ],
                                                                                        "additionalProperties": false
                                                                                      },
                                                                                      {
                                                                                        "type": "object",
                                                                                        "properties": {
                                                                                          "kind": {
                                                                                            "type": "string",
                                                                                            "const": "list"
                                                                                          },
                                                                                          "label": {
                                                                                            "type": "string",
                                                                                            "minLength": 1
                                                                                          },
                                                                                          "description": {
                                                                                            "type": "string"
                                                                                          },
                                                                                          "of": {
                                                                                            "oneOf": [
                                                                                              {
                                                                                                "type": "object",
                                                                                                "properties": {
                                                                                                  "kind": {
                                                                                                    "type": "string",
                                                                                                    "const": "text"
                                                                                                  },
                                                                                                  "label": {
                                                                                                    "type": "string",
                                                                                                    "minLength": 1
                                                                                                  },
                                                                                                  "description": {
                                                                                                    "type": "string"
                                                                                                  },
                                                                                                  "long": {
                                                                                                    "type": "boolean"
                                                                                                  }
                                                                                                },
                                                                                                "required": [
                                                                                                  "kind"
                                                                                                ],
                                                                                                "additionalProperties": false
                                                                                              },
                                                                                              {
                                                                                                "type": "object",
                                                                                                "properties": {
                                                                                                  "kind": {
                                                                                                    "type": "string",
                                                                                                    "const": "number"
                                                                                                  },
                                                                                                  "label": {
                                                                                                    "type": "string",
                                                                                                    "minLength": 1
                                                                                                  },
                                                                                                  "description": {
                                                                                                    "type": "string"
                                                                                                  },
                                                                                                  "unit": {
                                                                                                    "type": "string"
                                                                                                  }
                                                                                                },
                                                                                                "required": [
                                                                                                  "kind"
                                                                                                ],
                                                                                                "additionalProperties": false
                                                                                              },
                                                                                              {
                                                                                                "type": "object",
                                                                                                "properties": {
                                                                                                  "kind": {
                                                                                                    "type": "string",
                                                                                                    "const": "yesno"
                                                                                                  },
                                                                                                  "label": {
                                                                                                    "type": "string",
                                                                                                    "minLength": 1
                                                                                                  },
                                                                                                  "description": {
                                                                                                    "type": "string"
                                                                                                  },
                                                                                                  "yes": {
                                                                                                    "type": "string"
                                                                                                  },
                                                                                                  "no": {
                                                                                                    "type": "string"
                                                                                                  }
                                                                                                },
                                                                                                "required": [
                                                                                                  "kind"
                                                                                                ],
                                                                                                "additionalProperties": false
                                                                                              },
                                                                                              {
                                                                                                "type": "object",
                                                                                                "properties": {
                                                                                                  "kind": {
                                                                                                    "type": "string",
                                                                                                    "const": "choice"
                                                                                                  },
                                                                                                  "label": {
                                                                                                    "type": "string",
                                                                                                    "minLength": 1
                                                                                                  },
                                                                                                  "description": {
                                                                                                    "type": "string"
                                                                                                  },
                                                                                                  "options": {
                                                                                                    "minItems": 2,
                                                                                                    "maxItems": 40,
                                                                                                    "type": "array",
                                                                                                    "items": {
                                                                                                      "type": "string",
                                                                                                      "minLength": 1
                                                                                                    }
                                                                                                  }
                                                                                                },
                                                                                                "required": [
                                                                                                  "kind",
                                                                                                  "options"
                                                                                                ],
                                                                                                "additionalProperties": false
                                                                                              },
                                                                                              {
                                                                                                "type": "object",
                                                                                                "properties": {
                                                                                                  "kind": {
                                                                                                    "type": "string",
                                                                                                    "const": "ref"
                                                                                                  },
                                                                                                  "label": {
                                                                                                    "type": "string",
                                                                                                    "minLength": 1
                                                                                                  },
                                                                                                  "description": {
                                                                                                    "type": "string"
                                                                                                  },
                                                                                                  "to": {
                                                                                                    "type": "string",
                                                                                                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                                                                                                  }
                                                                                                },
                                                                                                "required": [
                                                                                                  "kind",
                                                                                                  "to"
                                                                                                ],
                                                                                                "additionalProperties": false
                                                                                              }
                                                                                            ]
                                                                                          }
                                                                                        },
                                                                                        "required": [
                                                                                          "kind",
                                                                                          "of"
                                                                                        ],
                                                                                        "additionalProperties": false
                                                                                      }
                                                                                    ]
                                                                                  }
                                                                                }
                                                                              },
                                                                              "required": [
                                                                                "kind",
                                                                                "fields"
                                                                              ],
                                                                              "additionalProperties": false
                                                                            }
                                                                          ]
                                                                        }
                                                                      },
                                                                      "required": [
                                                                        "kind",
                                                                        "of"
                                                                      ],
                                                                      "additionalProperties": false
                                                                    }
                                                                  ]
                                                                }
                                                              }
                                                            },
                                                            "required": [
                                                              "kind",
                                                              "fields"
                                                            ],
                                                            "additionalProperties": false
                                                          }
                                                        ]
                                                      }
                                                    },
                                                    "required": [
                                                      "kind",
                                                      "of"
                                                    ],
                                                    "additionalProperties": false
                                                  }
                                                ]
                                              }
                                            }
                                          },
                                          "required": [
                                            "kind",
                                            "fields"
                                          ],
                                          "additionalProperties": false
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "kind",
                                    "of"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            }
                          }
                        },
                        "required": [
                          "kind",
                          "fields"
                        ],
                        "additionalProperties": false
                      },
                      "surface": {
                        "anyOf": [
                          {
                            "type": "boolean"
                          },
                          {
                            "minItems": 1,
                            "maxItems": 200,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,40}$"
                                },
                                "component": {
                                  "type": "string",
                                  "enum": [
                                    "Column",
                                    "Text",
                                    "List",
                                    "Row",
                                    "DetailGrid",
                                    "Badge",
                                    "Grid",
                                    "Metric",
                                    "Table",
                                    "Image",
                                    "BarChart",
                                    "LineChart",
                                    "DonutChart",
                                    "Actions",
                                    "Button",
                                    "Tabs",
                                    "Card",
                                    "Fold",
                                    "Group",
                                    "Chips",
                                    "Checklist",
                                    "Steps",
                                    "Link",
                                    "Callout"
                                  ]
                                },
                                "children": {
                                  "anyOf": [
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "path": {
                                          "type": "string"
                                        },
                                        "componentId": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "path",
                                        "componentId"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "component"
                              ],
                              "additionalProperties": {}
                            }
                          }
                        ]
                      }
                    },
                    "required": [
                      "format"
                    ],
                    "additionalProperties": false
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "classifier",
                      "standard",
                      "high",
                      "highest"
                    ]
                  },
                  "effort": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "each": {
                    "type": "string"
                  },
                  "working": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "title",
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "next": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "when": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "notEquals",
                                    "in",
                                    "notEmpty",
                                    "empty",
                                    "gt",
                                    "lt",
                                    "contains"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "equals",
                                      "notEquals",
                                      "in",
                                      "notEmpty",
                                      "empty",
                                      "gt",
                                      "lt",
                                      "contains"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ],
                                "additionalProperties": false
                              }
                            }
                          ]
                        },
                        "ask": {
                          "type": "string",
                          "minLength": 1
                        },
                        "goto": {
                          "type": "string"
                        },
                        "max": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        }
                      },
                      "required": [
                        "goto"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "type": {
                    "type": "string",
                    "const": "generate"
                  },
                  "asset": {
                    "type": "string",
                    "enum": [
                      "image",
                      "video",
                      "voice",
                      "document",
                      "dashboard"
                    ]
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 1
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "aspectRatio": {
                        "type": "string",
                        "enum": [
                          "1:1",
                          "16:9",
                          "9:16",
                          "4:5",
                          "3:2",
                          "2:3"
                        ]
                      },
                      "duration": {
                        "type": "number"
                      },
                      "resolution": {
                        "type": "string",
                        "enum": [
                          "720p",
                          "480p"
                        ]
                      },
                      "style": {
                        "type": "string"
                      },
                      "template": {
                        "type": "string",
                        "enum": [
                          "invoice",
                          "offer",
                          "briefing",
                          "letter",
                          "report",
                          "free"
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "referenceImage": {
                    "type": "string"
                  },
                  "each": {
                    "type": "string"
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "classifier",
                      "standard",
                      "high",
                      "highest"
                    ]
                  },
                  "effort": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "working": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "title",
                  "type",
                  "asset",
                  "prompt"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "next": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "when": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "notEquals",
                                    "in",
                                    "notEmpty",
                                    "empty",
                                    "gt",
                                    "lt",
                                    "contains"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "equals",
                                      "notEquals",
                                      "in",
                                      "notEmpty",
                                      "empty",
                                      "gt",
                                      "lt",
                                      "contains"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ],
                                "additionalProperties": false
                              }
                            }
                          ]
                        },
                        "ask": {
                          "type": "string",
                          "minLength": 1
                        },
                        "goto": {
                          "type": "string"
                        },
                        "max": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        }
                      },
                      "required": [
                        "goto"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "type": {
                    "type": "string",
                    "const": "widget"
                  },
                  "entry": {
                    "type": "string",
                    "minLength": 1
                  },
                  "data": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "sample": {
                    "type": "string"
                  },
                  "layout": {
                    "type": "string",
                    "enum": [
                      "fixed",
                      "page"
                    ]
                  },
                  "size": {
                    "type": "object",
                    "properties": {
                      "width": {
                        "type": "integer",
                        "minimum": 200,
                        "maximum": 3840
                      },
                      "height": {
                        "type": "integer",
                        "minimum": 200,
                        "maximum": 3840
                      }
                    },
                    "required": [
                      "width",
                      "height"
                    ],
                    "additionalProperties": false
                  },
                  "video": {
                    "type": "boolean"
                  },
                  "working": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "title",
                  "type",
                  "entry"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "next": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "when": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "notEquals",
                                    "in",
                                    "notEmpty",
                                    "empty",
                                    "gt",
                                    "lt",
                                    "contains"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "equals",
                                      "notEquals",
                                      "in",
                                      "notEmpty",
                                      "empty",
                                      "gt",
                                      "lt",
                                      "contains"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ],
                                "additionalProperties": false
                              }
                            }
                          ]
                        },
                        "ask": {
                          "type": "string",
                          "minLength": 1
                        },
                        "goto": {
                          "type": "string"
                        },
                        "max": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        }
                      },
                      "required": [
                        "goto"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "type": {
                    "type": "string",
                    "const": "surface"
                  },
                  "components": {
                    "minItems": 1,
                    "maxItems": 200,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,40}$"
                        },
                        "component": {
                          "type": "string",
                          "enum": [
                            "Column",
                            "Text",
                            "List",
                            "Row",
                            "DetailGrid",
                            "Badge",
                            "Grid",
                            "Metric",
                            "Table",
                            "Image",
                            "BarChart",
                            "LineChart",
                            "DonutChart",
                            "Actions",
                            "Button",
                            "Tabs",
                            "Card",
                            "Fold",
                            "Group",
                            "Chips",
                            "Checklist",
                            "Steps",
                            "Link",
                            "Callout"
                          ]
                        },
                        "children": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "object",
                              "properties": {
                                "path": {
                                  "type": "string"
                                },
                                "componentId": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "path",
                                "componentId"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "component"
                      ],
                      "additionalProperties": {}
                    }
                  },
                  "candidates": {
                    "maxItems": 16,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1
                        },
                        "components": {
                          "minItems": 1,
                          "maxItems": 200,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,40}$"
                              },
                              "component": {
                                "type": "string",
                                "enum": [
                                  "Column",
                                  "Text",
                                  "List",
                                  "Row",
                                  "DetailGrid",
                                  "Badge",
                                  "Grid",
                                  "Metric",
                                  "Table",
                                  "Image",
                                  "BarChart",
                                  "LineChart",
                                  "DonutChart",
                                  "Actions",
                                  "Button",
                                  "Tabs",
                                  "Card",
                                  "Fold",
                                  "Group",
                                  "Chips",
                                  "Checklist",
                                  "Steps",
                                  "Link",
                                  "Callout"
                                ]
                              },
                              "children": {
                                "anyOf": [
                                  {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "path": {
                                        "type": "string"
                                      },
                                      "componentId": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "path",
                                      "componentId"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "component"
                            ],
                            "additionalProperties": {}
                          }
                        },
                        "group": {
                          "type": "string"
                        },
                        "required": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "description",
                        "components"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "groups": {
                    "maxItems": 6,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                        },
                        "instructions": {
                          "type": "string",
                          "minLength": 1
                        },
                        "optional": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "instructions"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "data": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "working": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "title",
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "next": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "when": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "notEquals",
                                    "in",
                                    "notEmpty",
                                    "empty",
                                    "gt",
                                    "lt",
                                    "contains"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "equals",
                                      "notEquals",
                                      "in",
                                      "notEmpty",
                                      "empty",
                                      "gt",
                                      "lt",
                                      "contains"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ],
                                "additionalProperties": false
                              }
                            }
                          ]
                        },
                        "ask": {
                          "type": "string",
                          "minLength": 1
                        },
                        "goto": {
                          "type": "string"
                        },
                        "max": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        }
                      },
                      "required": [
                        "goto"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "type": {
                    "type": "string",
                    "const": "film"
                  },
                  "brief": {
                    "type": "string",
                    "minLength": 1
                  },
                  "skills": {
                    "default": [
                      "hyperframes"
                    ],
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "kit": {
                    "type": "string"
                  },
                  "inputs": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "format": {
                    "default": "16:9",
                    "type": "string",
                    "enum": [
                      "16:9",
                      "9:16",
                      "1:1"
                    ]
                  },
                  "from": {
                    "type": "string"
                  },
                  "seconds": {
                    "type": "integer",
                    "minimum": 3,
                    "maximum": 600
                  },
                  "model": {
                    "type": "string",
                    "enum": [
                      "classifier",
                      "standard",
                      "high",
                      "highest"
                    ]
                  },
                  "effort": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "working": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "title",
                  "type",
                  "brief"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "next": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "when": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "notEquals",
                                    "in",
                                    "notEmpty",
                                    "empty",
                                    "gt",
                                    "lt",
                                    "contains"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "equals",
                                      "notEquals",
                                      "in",
                                      "notEmpty",
                                      "empty",
                                      "gt",
                                      "lt",
                                      "contains"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ],
                                "additionalProperties": false
                              }
                            }
                          ]
                        },
                        "ask": {
                          "type": "string",
                          "minLength": 1
                        },
                        "goto": {
                          "type": "string"
                        },
                        "max": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        }
                      },
                      "required": [
                        "goto"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "type": {
                    "type": "string",
                    "const": "review"
                  },
                  "show": {
                    "minItems": 1,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "edit": {
                    "type": "boolean"
                  },
                  "regenerate": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "id",
                  "title",
                  "type",
                  "show"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "next": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "when": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "op": {
                                  "type": "string",
                                  "enum": [
                                    "equals",
                                    "notEquals",
                                    "in",
                                    "notEmpty",
                                    "empty",
                                    "gt",
                                    "lt",
                                    "contains"
                                  ]
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "op"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      "equals",
                                      "notEquals",
                                      "in",
                                      "notEmpty",
                                      "empty",
                                      "gt",
                                      "lt",
                                      "contains"
                                    ]
                                  },
                                  "value": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "field",
                                  "op"
                                ],
                                "additionalProperties": false
                              }
                            }
                          ]
                        },
                        "ask": {
                          "type": "string",
                          "minLength": 1
                        },
                        "goto": {
                          "type": "string"
                        },
                        "max": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        }
                      },
                      "required": [
                        "goto"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "type": {
                    "type": "string",
                    "const": "result"
                  },
                  "message": {
                    "type": "string"
                  },
                  "deliverables": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "formats": {
                          "minItems": 1,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "png",
                              "mp4",
                              "mp3",
                              "pdf",
                              "docx",
                              "html",
                              "md",
                              "txt",
                              "csv",
                              "xlsx",
                              "json",
                              "zip"
                            ]
                          }
                        }
                      },
                      "required": [
                        "from",
                        "formats"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "share": {
                    "maxItems": 12,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "target": {
                          "type": "string",
                          "minLength": 1
                        },
                        "label": {
                          "type": "string"
                        },
                        "values": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "target"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "id",
                  "title",
                  "type",
                  "deliverables"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "required": [
        "title",
        "steps"
      ],
      "additionalProperties": false
    }
  }
}
