{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:vnle:story:1.1",
  "title": "VNLE executable story",
  "$ref": "#/$defs/ExecutableStory",
  "$defs": {
    "Capability": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9.-]*$",
      "title": "Capability"
    },
    "ContentAsset": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "mediaType": {
          "type": "string"
        },
        "relativePath": {
          "$ref": "#/$defs/RelativePath"
        },
        "contentHash": {
          "$ref": "#/$defs/Hash"
        },
        "displayName": {
          "type": "string"
        },
        "licenseNote": {
          "type": "string"
        },
        "width": {
          "type": "integer",
          "minimum": 0,
          "maximum": 2147483647
        },
        "height": {
          "type": "integer",
          "minimum": 0,
          "maximum": 2147483647
        },
        "byteSize": {
          "type": "integer",
          "minimum": 0,
          "maximum": 2147483647
        },
        "originalName": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "mediaType",
        "relativePath",
        "contentHash",
        "displayName"
      ],
      "additionalProperties": false,
      "title": "ContentAsset"
    },
    "ContentCharacter": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "key": {
          "$ref": "#/$defs/Key"
        },
        "nameTextRef": {
          "$ref": "#/$defs/Id"
        },
        "color": {
          "type": "string",
          "pattern": "^#[0-9a-fA-F]{6}$"
        },
        "defaultPortraitRef": {
          "$ref": "#/$defs/Id"
        },
        "emotions": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Emotion"
          }
        }
      },
      "required": [
        "id",
        "name",
        "key",
        "nameTextRef",
        "color",
        "emotions"
      ],
      "additionalProperties": false,
      "title": "ContentCharacter"
    },
    "ContentCommandDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "key": {
          "$ref": "#/$defs/Key"
        },
        "category": {
          "type": "string"
        },
        "inputs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ParameterDefinition"
          }
        },
        "outcomes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OutcomeDefinition"
          },
          "minItems": 1
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "key",
        "category",
        "inputs",
        "outcomes"
      ],
      "additionalProperties": false,
      "title": "ContentCommandDefinition"
    },
    "ContentItemDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "key": {
          "$ref": "#/$defs/Key"
        },
        "nameTextRef": {
          "$ref": "#/$defs/Id"
        },
        "descriptionTextRef": {
          "$ref": "#/$defs/Id"
        },
        "iconAssetRef": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "id",
        "name",
        "key",
        "nameTextRef"
      ],
      "additionalProperties": false,
      "title": "ContentItemDefinition"
    },
    "ContentLocationDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "key": {
          "$ref": "#/$defs/Key"
        },
        "nameTextRef": {
          "$ref": "#/$defs/Id"
        },
        "descriptionTextRef": {
          "$ref": "#/$defs/Id"
        },
        "previewAssetRef": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "id",
        "name",
        "key",
        "nameTextRef"
      ],
      "additionalProperties": false,
      "title": "ContentLocationDefinition"
    },
    "ContentMinigameDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "key": {
          "$ref": "#/$defs/Key"
        },
        "nameTextRef": {
          "$ref": "#/$defs/Id"
        },
        "commandRef": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "id",
        "name",
        "key",
        "commandRef"
      ],
      "additionalProperties": false,
      "title": "ContentMinigameDefinition"
    },
    "ContentQuestDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "key": {
          "$ref": "#/$defs/Key"
        },
        "titleTextRef": {
          "$ref": "#/$defs/Id"
        },
        "descriptionTextRef": {
          "$ref": "#/$defs/Id"
        },
        "objectiveDefinitions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/QuestObjective"
          }
        }
      },
      "required": [
        "id",
        "name",
        "key",
        "titleTextRef",
        "objectiveDefinitions"
      ],
      "additionalProperties": false,
      "title": "ContentQuestDefinition"
    },
    "ContentTextEntry": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "key": {
          "$ref": "#/$defs/Key"
        },
        "category": {
          "type": "string"
        },
        "sourceMessage": {
          "$ref": "#/$defs/Message"
        },
        "placeholders": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/PlaceholderDefinition"
          }
        },
        "externalUse": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "category",
        "sourceMessage",
        "placeholders",
        "externalUse"
      ],
      "additionalProperties": false,
      "title": "ContentTextEntry"
    },
    "ContentVariableDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "key": {
          "$ref": "#/$defs/Key"
        },
        "valueType": {
          "$ref": "#/$defs/ScalarType"
        },
        "defaultValue": {
          "$ref": "#/$defs/ScalarValue"
        },
        "description": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "key",
        "valueType",
        "defaultValue"
      ],
      "additionalProperties": false,
      "title": "ContentVariableDefinition"
    },
    "Emotion": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "portraitRef": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "additionalProperties": false,
      "title": "Emotion"
    },
    "EntityType": {
      "type": "string",
      "enum": [
        "item",
        "quest",
        "location",
        "minigame",
        "asset"
      ],
      "title": "EntityType"
    },
    "EntryRef": {
      "type": "object",
      "properties": {
        "flowRef": {
          "$ref": "#/$defs/Id"
        },
        "entryRef": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "flowRef",
        "entryRef"
      ],
      "additionalProperties": false,
      "title": "EntryRef"
    },
    "ExecutableChoiceOption": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "text": {
          "$ref": "#/$defs/ExecutableTextUse"
        },
        "condition": {
          "$ref": "#/$defs/ExecutableCondition"
        },
        "effects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ExecutableEffect"
          }
        },
        "continuation": {
          "$ref": "#/$defs/ExecutableContinuation"
        }
      },
      "required": [
        "id",
        "text",
        "effects",
        "continuation"
      ],
      "additionalProperties": false,
      "title": "ExecutableChoiceOption"
    },
    "ExecutableCondition": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "compare"
            },
            "left": {
              "$ref": "#/$defs/ExecutableOperand"
            },
            "operator": {
              "type": "string",
              "enum": [
                "eq",
                "ne",
                "lt",
                "lte",
                "gt",
                "gte"
              ]
            },
            "right": {
              "$ref": "#/$defs/ExecutableOperand"
            }
          },
          "required": [
            "kind",
            "left",
            "operator",
            "right"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "all"
            },
            "children": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ExecutableCondition"
              }
            }
          },
          "required": [
            "kind",
            "children"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "any"
            },
            "children": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ExecutableCondition"
              }
            }
          },
          "required": [
            "kind",
            "children"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "not"
            },
            "child": {
              "$ref": "#/$defs/ExecutableCondition"
            }
          },
          "required": [
            "kind",
            "child"
          ],
          "additionalProperties": false
        }
      ],
      "title": "ExecutableCondition"
    },
    "ExecutableContinuation": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "node"
            },
            "nodeRef": {
              "$ref": "#/$defs/Id"
            }
          },
          "required": [
            "kind",
            "nodeRef"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "end"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      ],
      "title": "ExecutableContinuation"
    },
    "ExecutableEffect": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "set"
            },
            "variableRef": {
              "$ref": "#/$defs/Id"
            },
            "value": {
              "$ref": "#/$defs/ExecutableOperand"
            }
          },
          "required": [
            "kind",
            "variableRef",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "add"
            },
            "variableRef": {
              "$ref": "#/$defs/Id"
            },
            "value": {
              "$ref": "#/$defs/ExecutableOperand"
            }
          },
          "required": [
            "kind",
            "variableRef",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "subtract"
            },
            "variableRef": {
              "$ref": "#/$defs/Id"
            },
            "value": {
              "$ref": "#/$defs/ExecutableOperand"
            }
          },
          "required": [
            "kind",
            "variableRef",
            "value"
          ],
          "additionalProperties": false
        }
      ],
      "title": "ExecutableEffect"
    },
    "ExecutableEmptyChoice": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "continue"
            },
            "continuation": {
              "$ref": "#/$defs/ExecutableContinuation"
            }
          },
          "required": [
            "kind",
            "continuation"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "fault"
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        }
      ],
      "title": "ExecutableEmptyChoice"
    },
    "ExecutableNode": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/Id"
            },
            "flowRef": {
              "$ref": "#/$defs/Id"
            },
            "kind": {
              "const": "dialogue"
            },
            "text": {
              "$ref": "#/$defs/ExecutableTextUse"
            },
            "speakerRef": {
              "$ref": "#/$defs/Id"
            },
            "emotionRef": {
              "$ref": "#/$defs/Id"
            },
            "continuation": {
              "$ref": "#/$defs/ExecutableContinuation"
            }
          },
          "required": [
            "id",
            "flowRef",
            "kind",
            "text",
            "continuation"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/Id"
            },
            "flowRef": {
              "$ref": "#/$defs/Id"
            },
            "kind": {
              "const": "choice"
            },
            "optionOrder": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Id"
              },
              "uniqueItems": true
            },
            "options": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ExecutableChoiceOption"
              }
            },
            "whenEmpty": {
              "$ref": "#/$defs/ExecutableEmptyChoice"
            }
          },
          "required": [
            "id",
            "flowRef",
            "kind",
            "optionOrder",
            "options",
            "whenEmpty"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/Id"
            },
            "flowRef": {
              "$ref": "#/$defs/Id"
            },
            "kind": {
              "const": "branch"
            },
            "condition": {
              "$ref": "#/$defs/ExecutableCondition"
            },
            "whenTrue": {
              "$ref": "#/$defs/ExecutableContinuation"
            },
            "whenFalse": {
              "$ref": "#/$defs/ExecutableContinuation"
            }
          },
          "required": [
            "id",
            "flowRef",
            "kind",
            "condition",
            "whenTrue",
            "whenFalse"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/Id"
            },
            "flowRef": {
              "$ref": "#/$defs/Id"
            },
            "kind": {
              "const": "action"
            },
            "effects": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ExecutableEffect"
              }
            },
            "continuation": {
              "$ref": "#/$defs/ExecutableContinuation"
            }
          },
          "required": [
            "id",
            "flowRef",
            "kind",
            "effects",
            "continuation"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/Id"
            },
            "flowRef": {
              "$ref": "#/$defs/Id"
            },
            "kind": {
              "const": "command"
            },
            "commandRef": {
              "$ref": "#/$defs/Id"
            },
            "arguments": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ExecutableOperand"
              }
            },
            "outcomes": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ExecutableOutcomeBinding"
              }
            }
          },
          "required": [
            "id",
            "flowRef",
            "kind",
            "commandRef",
            "arguments",
            "outcomes"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/Id"
            },
            "flowRef": {
              "$ref": "#/$defs/Id"
            },
            "kind": {
              "const": "jump"
            },
            "target": {
              "$ref": "#/$defs/EntryRef"
            }
          },
          "required": [
            "id",
            "flowRef",
            "kind",
            "target"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/Id"
            },
            "flowRef": {
              "$ref": "#/$defs/Id"
            },
            "kind": {
              "const": "end"
            }
          },
          "required": [
            "id",
            "flowRef",
            "kind"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/Id"
            },
            "flowRef": {
              "$ref": "#/$defs/Id"
            },
            "kind": {
              "const": "call"
            },
            "target": {
              "$ref": "#/$defs/EntryRef"
            },
            "continuation": {
              "$ref": "#/$defs/ExecutableContinuation"
            }
          },
          "required": [
            "id",
            "flowRef",
            "kind",
            "target",
            "continuation"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "id": {
              "$ref": "#/$defs/Id"
            },
            "flowRef": {
              "$ref": "#/$defs/Id"
            },
            "kind": {
              "const": "return"
            }
          },
          "required": [
            "id",
            "flowRef",
            "kind"
          ],
          "additionalProperties": false
        }
      ],
      "title": "ExecutableNode"
    },
    "ExecutableOperand": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "literal"
            },
            "value": {
              "$ref": "#/$defs/TypedValue"
            }
          },
          "required": [
            "kind",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "variable"
            },
            "variableRef": {
              "$ref": "#/$defs/Id"
            }
          },
          "required": [
            "kind",
            "variableRef"
          ],
          "additionalProperties": false
        }
      ],
      "title": "ExecutableOperand"
    },
    "ExecutableOutcomeBinding": {
      "type": "object",
      "properties": {
        "resultBindings": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Id"
          }
        },
        "continuation": {
          "$ref": "#/$defs/ExecutableContinuation"
        }
      },
      "required": [
        "resultBindings",
        "continuation"
      ],
      "additionalProperties": false,
      "title": "ExecutableOutcomeBinding"
    },
    "ExecutableStory": {
      "type": "object",
      "properties": {
        "format": {
          "const": "vnle.story"
        },
        "containerVersion": {
          "const": 1
        },
        "storyBuildId": {
          "$ref": "#/$defs/Hash"
        },
        "execution": {
          "$ref": "#/$defs/ExecutionContract"
        },
        "content": {
          "type": "object",
          "properties": {
            "sourceLocale": {
              "$ref": "#/$defs/Locale"
            },
            "locales": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Locale"
              },
              "minItems": 1,
              "uniqueItems": true
            },
            "fallbackPolicy": {
              "$ref": "#/$defs/FallbackPolicy"
            },
            "texts": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ContentTextEntry"
              }
            },
            "translations": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"
              },
              "additionalProperties": {
                "type": "object",
                "propertyNames": {
                  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
                },
                "additionalProperties": {
                  "$ref": "#/$defs/Translation"
                },
                "minProperties": 1
              }
            },
            "characters": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ContentCharacter"
              }
            },
            "quests": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ContentQuestDefinition"
              }
            },
            "items": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ContentItemDefinition"
              }
            },
            "locations": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ContentLocationDefinition"
              }
            },
            "minigames": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ContentMinigameDefinition"
              }
            },
            "assets": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ContentAsset"
              }
            },
            "variableDefinitions": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ContentVariableDefinition"
              }
            },
            "commandDefinitions": {
              "type": "object",
              "propertyNames": {
                "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
              },
              "additionalProperties": {
                "$ref": "#/$defs/ContentCommandDefinition"
              }
            }
          },
          "required": [
            "sourceLocale",
            "locales",
            "fallbackPolicy",
            "texts",
            "translations",
            "characters",
            "quests",
            "items",
            "locations",
            "minigames",
            "assets",
            "variableDefinitions",
            "commandDefinitions"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "format",
        "containerVersion",
        "storyBuildId",
        "execution",
        "content"
      ],
      "additionalProperties": false,
      "title": "ExecutableStory"
    },
    "ExecutableTextUse": {
      "type": "object",
      "properties": {
        "textRef": {
          "$ref": "#/$defs/Id"
        },
        "bindings": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/ExecutableOperand"
          }
        }
      },
      "required": [
        "textRef",
        "bindings"
      ],
      "additionalProperties": false,
      "title": "ExecutableTextUse"
    },
    "ExecutionContract": {
      "type": "object",
      "properties": {
        "format": {
          "const": "vnle.execution"
        },
        "contractVersion": {
          "$ref": "#/$defs/RuntimeVersion"
        },
        "projectId": {
          "$ref": "#/$defs/Id"
        },
        "requiredCapabilities": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Capability"
          },
          "uniqueItems": true
        },
        "limits": {
          "type": "object",
          "properties": {
            "maxAutomaticTransitions": {
              "const": 1000
            },
            "maxConditionDepth": {
              "const": 32
            },
            "maxConditionTerms": {
              "const": 1024
            },
            "maxCallDepth": {
              "const": 32
            }
          },
          "required": [
            "maxAutomaticTransitions",
            "maxConditionDepth",
            "maxConditionTerms",
            "maxCallDepth"
          ],
          "additionalProperties": false
        },
        "entries": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/RuntimeEntry"
          }
        },
        "nodes": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/ExecutableNode"
          }
        },
        "variables": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/RuntimeVariable"
          }
        },
        "commands": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/RuntimeSignature"
          }
        },
        "textContracts": {
          "type": "object",
          "propertyNames": {
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/PlaceholderContract"
          }
        }
      },
      "required": [
        "format",
        "contractVersion",
        "projectId",
        "requiredCapabilities",
        "limits",
        "entries",
        "nodes",
        "variables",
        "commands",
        "textContracts"
      ],
      "additionalProperties": false,
      "title": "ExecutionContract"
    },
    "FallbackPolicy": {
      "type": "string",
      "enum": [
        "block",
        "source"
      ],
      "title": "FallbackPolicy"
    },
    "Hash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$",
      "title": "Hash"
    },
    "Id": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
      "title": "Id"
    },
    "Key": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9_.-]{0,127}$",
      "title": "Key"
    },
    "Locale": {
      "type": "string",
      "pattern": "^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",
      "title": "Locale"
    },
    "Message": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "segments"
        },
        "segments": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "const": "text"
                  },
                  "text": {
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "text"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "const": "placeholder"
                  },
                  "placeholderRef": {
                    "$ref": "#/$defs/Id"
                  }
                },
                "required": [
                  "kind",
                  "placeholderRef"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "required": [
        "kind",
        "segments"
      ],
      "additionalProperties": false,
      "title": "Message"
    },
    "OutcomeDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ResultDefinition"
          }
        }
      },
      "required": [
        "id",
        "name",
        "results"
      ],
      "additionalProperties": false,
      "title": "OutcomeDefinition"
    },
    "ParameterDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "valueType": {
          "$ref": "#/$defs/ValueType"
        },
        "defaultValue": {
          "$ref": "#/$defs/TypedValue"
        }
      },
      "required": [
        "id",
        "name",
        "valueType"
      ],
      "additionalProperties": false,
      "title": "ParameterDefinition"
    },
    "PlaceholderContract": {
      "type": "object",
      "propertyNames": {
        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
      },
      "additionalProperties": {
        "$ref": "#/$defs/ScalarType"
      },
      "title": "PlaceholderContract"
    },
    "PlaceholderDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "displayName": {
          "type": "string"
        },
        "valueType": {
          "$ref": "#/$defs/ScalarType"
        }
      },
      "required": [
        "id",
        "displayName",
        "valueType"
      ],
      "additionalProperties": false,
      "title": "PlaceholderDefinition"
    },
    "QuestObjective": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "labelTextRef": {
          "$ref": "#/$defs/Id"
        },
        "descriptionTextRef": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "id",
        "labelTextRef"
      ],
      "additionalProperties": false,
      "title": "QuestObjective"
    },
    "RelativePath": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024,
      "title": "RelativePath"
    },
    "ResultDefinition": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "type": "string"
        },
        "valueType": {
          "$ref": "#/$defs/ValueType"
        }
      },
      "required": [
        "id",
        "name",
        "valueType"
      ],
      "additionalProperties": false,
      "title": "ResultDefinition"
    },
    "RuntimeEntry": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "flowRef": {
          "$ref": "#/$defs/Id"
        },
        "nodeRef": {
          "$ref": "#/$defs/Id"
        }
      },
      "required": [
        "id",
        "flowRef",
        "nodeRef"
      ],
      "additionalProperties": false,
      "title": "RuntimeEntry"
    },
    "RuntimeSignature": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "inputs": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/Id"
              },
              "valueType": {
                "$ref": "#/$defs/ValueType"
              },
              "defaultValue": {
                "$ref": "#/$defs/TypedValue"
              }
            },
            "required": [
              "id",
              "valueType"
            ],
            "additionalProperties": false
          }
        },
        "outcomes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/$defs/Id"
              },
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "$ref": "#/$defs/Id"
                    },
                    "valueType": {
                      "$ref": "#/$defs/ValueType"
                    }
                  },
                  "required": [
                    "id",
                    "valueType"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "id",
              "results"
            ],
            "additionalProperties": false
          },
          "minItems": 1
        }
      },
      "required": [
        "id",
        "inputs",
        "outcomes"
      ],
      "additionalProperties": false,
      "title": "RuntimeSignature"
    },
    "RuntimeVariable": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/Id"
        },
        "valueType": {
          "$ref": "#/$defs/ScalarType"
        },
        "defaultValue": {
          "$ref": "#/$defs/ScalarValue"
        }
      },
      "required": [
        "id",
        "valueType",
        "defaultValue"
      ],
      "additionalProperties": false,
      "title": "RuntimeVariable"
    },
    "RuntimeVersion": {
      "type": "object",
      "properties": {
        "major": {
          "const": 1
        },
        "minor": {
          "const": 1
        }
      },
      "required": [
        "major",
        "minor"
      ],
      "additionalProperties": false,
      "title": "RuntimeVersion"
    },
    "ScalarType": {
      "type": "string",
      "enum": [
        "boolean",
        "integer",
        "string"
      ],
      "title": "ScalarType"
    },
    "ScalarValue": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "boolean"
            },
            "value": {
              "type": "boolean"
            }
          },
          "required": [
            "type",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "integer"
            },
            "value": {
              "type": "integer",
              "minimum": -2147483648,
              "maximum": 2147483647
            }
          },
          "required": [
            "type",
            "value"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "string"
            },
            "value": {
              "type": "string"
            }
          },
          "required": [
            "type",
            "value"
          ],
          "additionalProperties": false
        }
      ],
      "title": "ScalarValue"
    },
    "Translation": {
      "type": "object",
      "properties": {
        "textRef": {
          "$ref": "#/$defs/Id"
        },
        "locale": {
          "$ref": "#/$defs/Locale"
        },
        "message": {
          "$ref": "#/$defs/Message"
        },
        "allowEmpty": {
          "type": "boolean"
        },
        "workflowStatus": {
          "type": "string",
          "enum": [
            "draft",
            "translated",
            "reviewed"
          ]
        },
        "basedOnSourceFingerprint": {
          "$ref": "#/$defs/Hash"
        },
        "reviewedContextFingerprint": {
          "$ref": "#/$defs/Hash"
        }
      },
      "required": [
        "textRef",
        "locale",
        "message",
        "allowEmpty",
        "workflowStatus",
        "basedOnSourceFingerprint"
      ],
      "additionalProperties": false,
      "title": "Translation"
    },
    "TypedValue": {
      "oneOf": [
        {
          "$ref": "#/$defs/ScalarValue"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "const": "reference"
            },
            "entityType": {
              "$ref": "#/$defs/EntityType"
            },
            "value": {
              "$ref": "#/$defs/Id"
            }
          },
          "required": [
            "type",
            "entityType",
            "value"
          ],
          "additionalProperties": false
        }
      ],
      "title": "TypedValue"
    },
    "ValueType": {
      "oneOf": [
        {
          "$ref": "#/$defs/ScalarType"
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "const": "reference"
            },
            "entityType": {
              "$ref": "#/$defs/EntityType"
            }
          },
          "required": [
            "kind",
            "entityType"
          ],
          "additionalProperties": false
        }
      ],
      "title": "ValueType"
    }
  }
}