{
  "$defs": {
    "ActionStepDocument": {
      "additionalProperties": false,
      "description": "An ordered-block step with ``action:``.",
      "properties": {
        "action": {
          "title": "Action",
          "type": "string"
        },
        "id": {
          "title": "Id",
          "type": "string"
        },
        "next": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/IfBranchDocument"
                  },
                  {
                    "$ref": "#/$defs/ElseBranchDocument"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Next"
        }
      },
      "required": [
        "id",
        "action"
      ],
      "title": "ActionStepDocument",
      "type": "object"
    },
    "AutonomousStepDocument": {
      "additionalProperties": false,
      "description": "An ordered-block step with ``instructions:``.",
      "properties": {
        "complete_when": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Complete When"
        },
        "id": {
          "title": "Id",
          "type": "string"
        },
        "instructions": {
          "title": "Instructions",
          "type": "string"
        },
        "next": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/IfBranchDocument"
                  },
                  {
                    "$ref": "#/$defs/ElseBranchDocument"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Next"
        },
        "optional": {
          "default": false,
          "title": "Optional",
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "instructions"
      ],
      "title": "AutonomousStepDocument",
      "type": "object"
    },
    "CallStepDocument": {
      "additionalProperties": false,
      "description": "An ordered-block step with ``call:``.",
      "properties": {
        "call": {
          "title": "Call",
          "type": "string"
        },
        "id": {
          "title": "Id",
          "type": "string"
        },
        "next": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/IfBranchDocument"
                  },
                  {
                    "$ref": "#/$defs/ElseBranchDocument"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Next"
        }
      },
      "required": [
        "id",
        "call"
      ],
      "title": "CallStepDocument",
      "type": "object"
    },
    "CollectStepDocument": {
      "additionalProperties": false,
      "description": "An ordered-block step with ``collect:``.",
      "properties": {
        "ask_before_filling": {
          "default": false,
          "title": "Ask Before Filling",
          "type": "boolean"
        },
        "collect": {
          "title": "Collect",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        },
        "id": {
          "title": "Id",
          "type": "string"
        },
        "next": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/IfBranchDocument"
                  },
                  {
                    "$ref": "#/$defs/ElseBranchDocument"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Next"
        },
        "utterance": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Utterance"
        }
      },
      "required": [
        "id",
        "collect"
      ],
      "title": "CollectStepDocument",
      "type": "object"
    },
    "ElseBranchDocument": {
      "additionalProperties": false,
      "description": "The fallback ``next`` branch (``else``).",
      "properties": {
        "else": {
          "title": "Else",
          "type": "string"
        }
      },
      "required": [
        "else"
      ],
      "title": "ElseBranchDocument",
      "type": "object"
    },
    "EndStepDocument": {
      "additionalProperties": false,
      "description": "The ``id: END`` sentinel step.",
      "properties": {
        "id": {
          "const": "END",
          "title": "Id",
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "title": "EndStepDocument",
      "type": "object"
    },
    "ExecuteStepDocument": {
      "additionalProperties": false,
      "description": "An ordered-block step with ``execute_tool:``.",
      "properties": {
        "execute_tool": {
          "title": "Execute Tool",
          "type": "string"
        },
        "id": {
          "title": "Id",
          "type": "string"
        },
        "next": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/IfBranchDocument"
                  },
                  {
                    "$ref": "#/$defs/ElseBranchDocument"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Next"
        },
        "parameters": {
          "additionalProperties": true,
          "title": "Parameters",
          "type": "object"
        }
      },
      "required": [
        "id",
        "execute_tool"
      ],
      "title": "ExecuteStepDocument",
      "type": "object"
    },
    "IfBranchDocument": {
      "additionalProperties": false,
      "description": "A conditional ``next`` branch (``if`` / ``then``).",
      "properties": {
        "if": {
          "title": "If",
          "type": "string"
        },
        "then": {
          "title": "Then",
          "type": "string"
        }
      },
      "required": [
        "if",
        "then"
      ],
      "title": "IfBranchDocument",
      "type": "object"
    },
    "LinkStepDocument": {
      "additionalProperties": false,
      "description": "An ordered-block step with ``link:``.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "link": {
          "title": "Link",
          "type": "string"
        }
      },
      "required": [
        "id",
        "link"
      ],
      "title": "LinkStepDocument",
      "type": "object"
    },
    "OrderedBlockToolDocument": {
      "additionalProperties": false,
      "description": "One ordered-block ``tools:`` entry that carries constraint options.",
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "on_failure": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "On Failure"
        },
        "on_success": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "On Success"
        },
        "requires": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Requires"
        },
        "requires_confirmation": {
          "anyOf": [
            {
              "$ref": "#/$defs/RequiresConfirmationDocument"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "name"
      ],
      "title": "OrderedBlockToolDocument",
      "type": "object"
    },
    "RequiresConfirmationDocument": {
      "additionalProperties": false,
      "description": "Confirmation gate under a tool constraint.\n\n``enabled`` turns the pause on. ``utter_for_confirmation`` and\n``utter_on_user_denial`` name responses in ``responses.yml``. Omit a name\nto leave that line to the model.",
      "properties": {
        "enabled": {
          "default": false,
          "title": "Enabled",
          "type": "boolean"
        },
        "utter_for_confirmation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Utter For Confirmation"
        },
        "utter_on_user_denial": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Utter On User Denial"
        }
      },
      "title": "RequiresConfirmationDocument",
      "type": "object"
    },
    "RouteStepDocument": {
      "additionalProperties": false,
      "description": "An ordered-block step with ``noop: true``.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "next": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/IfBranchDocument"
                  },
                  {
                    "$ref": "#/$defs/ElseBranchDocument"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Next"
        },
        "noop": {
          "const": true,
          "title": "Noop",
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "noop"
      ],
      "title": "RouteStepDocument",
      "type": "object"
    },
    "SetMemoryStepDocument": {
      "additionalProperties": false,
      "description": "An ordered-block step with ``set_memory:``.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "next": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/IfBranchDocument"
                  },
                  {
                    "$ref": "#/$defs/ElseBranchDocument"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Next"
        },
        "set_memory": {
          "additionalProperties": true,
          "title": "Set Memory",
          "type": "object"
        }
      },
      "required": [
        "id",
        "set_memory"
      ],
      "title": "SetMemoryStepDocument",
      "type": "object"
    },
    "UtterStepDocument": {
      "additionalProperties": false,
      "description": "An ordered-block step with the legacy ``utter:`` key.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string"
        },
        "next": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/IfBranchDocument"
                  },
                  {
                    "$ref": "#/$defs/ElseBranchDocument"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Next"
        },
        "utter": {
          "title": "Utter",
          "type": "string"
        }
      },
      "required": [
        "id",
        "utter"
      ],
      "title": "UtterStepDocument",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Authoring shape of one ``:::ordered_block`` body.\n\nSteps use the YAML keys authors write (``collect``, ``execute_tool``),\nnot the engine's internal ``kind``. ``routable`` is engine-owned and is\nnot part of this contract.",
  "properties": {
    "complete_when": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Complete When"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Description"
    },
    "steps": {
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/CollectStepDocument"
          },
          {
            "$ref": "#/$defs/ExecuteStepDocument"
          },
          {
            "$ref": "#/$defs/SetMemoryStepDocument"
          },
          {
            "$ref": "#/$defs/AutonomousStepDocument"
          },
          {
            "$ref": "#/$defs/ActionStepDocument"
          },
          {
            "$ref": "#/$defs/UtterStepDocument"
          },
          {
            "$ref": "#/$defs/RouteStepDocument"
          },
          {
            "$ref": "#/$defs/CallStepDocument"
          },
          {
            "$ref": "#/$defs/LinkStepDocument"
          },
          {
            "$ref": "#/$defs/EndStepDocument"
          }
        ]
      },
      "title": "Steps",
      "type": "array"
    },
    "tools": {
      "items": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "$ref": "#/$defs/OrderedBlockToolDocument"
          }
        ]
      },
      "title": "Tools",
      "type": "array"
    }
  },
  "title": "ordered block",
  "type": "object"
}
