{
  "$defs": {
    "__schema0": {
      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
      "title": "EntityId",
      "type": "string"
    },
    "__schema1": {
      "pattern": "^[a-z][a-z0-9]*(?:[-_][a-z0-9]+)*$",
      "title": "LayoutContractId",
      "type": "string"
    },
    "__schema10": {
      "additionalProperties": false,
      "properties": {
        "defaultValue": {
          "$ref": "#/$defs/__schema8"
        },
        "items": {
          "$ref": "#/$defs/__schema5"
        },
        "nullable": {
          "default": false,
          "type": "boolean"
        },
        "type": {
          "const": "array",
          "type": "string"
        }
      },
      "required": [
        "type",
        "items"
      ],
      "type": "object"
    },
    "__schema11": {
      "additionalProperties": false,
      "properties": {
        "defaultValue": {
          "$ref": "#/$defs/__schema8"
        },
        "fields": {
          "additionalProperties": {
            "additionalProperties": false,
            "properties": {
              "required": {
                "default": true,
                "type": "boolean"
              },
              "shape": {
                "$ref": "#/$defs/__schema5"
              }
            },
            "required": [
              "shape"
            ],
            "type": "object"
          },
          "default": {},
          "propertyNames": {
            "$ref": "#/$defs/__schema1"
          },
          "type": "object"
        },
        "nullable": {
          "default": false,
          "type": "boolean"
        },
        "type": {
          "const": "object",
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "__schema12": {
      "oneOf": [
        {
          "$ref": "#/$defs/__schema13"
        },
        {
          "$ref": "#/$defs/__schema14"
        },
        {
          "$ref": "#/$defs/__schema16"
        }
      ],
      "x-noveltea-documentation": {
        "constraints": [
          "For RML/RCSS, sourceMode 'file' owns the companion records/layouts/<layout-id>/layout.rml or layout.rcss file respectively.",
          "When an RML/RCSS selector is not 'file', the corresponding companion file must be absent."
        ]
      }
    },
    "__schema13": {
      "additionalProperties": false,
      "properties": {
        "sourceMode": {
          "const": "file",
          "type": "string"
        }
      },
      "required": [
        "sourceMode"
      ],
      "type": "object"
    },
    "__schema14": {
      "additionalProperties": false,
      "properties": {
        "sourceAsset": {
          "minLength": 1,
          "type": "string"
        },
        "sourceMode": {
          "const": "asset",
          "type": "string"
        }
      },
      "required": [
        "sourceMode",
        "sourceAsset"
      ],
      "type": "object"
    },
    "__schema15": {
      "minLength": 1,
      "type": "string"
    },
    "__schema16": {
      "additionalProperties": false,
      "properties": {
        "sourceMode": {
          "const": "none",
          "type": "string"
        }
      },
      "required": [
        "sourceMode"
      ],
      "type": "object"
    },
    "__schema17": {
      "additionalProperties": false,
      "properties": {
        "sourceMode": {
          "const": "file",
          "type": "string"
        }
      },
      "required": [
        "sourceMode"
      ],
      "type": "object"
    },
    "__schema18": {
      "additionalProperties": false,
      "properties": {
        "sourceMode": {
          "const": "none",
          "type": "string"
        }
      },
      "required": [
        "sourceMode"
      ],
      "type": "object"
    },
    "__schema19": {
      "additionalProperties": false,
      "properties": {
        "targets": {
          "$ref": "#/$defs/__schema20"
        }
      },
      "title": "LuaExplicitDependencies",
      "type": "object"
    },
    "__schema2": {
      "enum": [
        "boolean",
        "integer",
        "number",
        "string"
      ],
      "type": "string"
    },
    "__schema20": {
      "default": [],
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/__schema21"
          },
          {
            "$ref": "#/$defs/__schema22"
          },
          {
            "$ref": "#/$defs/__schema23"
          },
          {
            "$ref": "#/$defs/__schema24"
          }
        ],
        "title": "LuaDependencyTarget"
      },
      "type": "array"
    },
    "__schema21": {
      "additionalProperties": false,
      "properties": {
        "collection": {
          "enum": [
            "assets",
            "animations",
            "variables",
            "materials",
            "layouts",
            "archetypes",
            "characters",
            "rooms",
            "interactables",
            "verbs",
            "interactions",
            "dialogues",
            "scenes",
            "maps",
            "scripts",
            "tests"
          ],
          "type": "string"
        },
        "id": {
          "minLength": 1,
          "type": "string"
        },
        "kind": {
          "const": "record",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "collection",
        "id"
      ],
      "type": "object"
    },
    "__schema22": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "property-value",
          "type": "string"
        },
        "owner": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "minLength": 1,
              "type": "string"
            },
            "kind": {
              "enum": [
                "room",
                "character",
                "interactable"
              ],
              "type": "string"
            }
          },
          "required": [
            "kind",
            "id"
          ],
          "type": "object"
        },
        "propertyId": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "kind",
        "owner",
        "propertyId"
      ],
      "type": "object"
    },
    "__schema23": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "room-placement",
          "type": "string"
        },
        "placementId": {
          "minLength": 1,
          "type": "string"
        },
        "roomId": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "kind",
        "roomId",
        "placementId"
      ],
      "type": "object"
    },
    "__schema24": {
      "additionalProperties": false,
      "properties": {
        "exitId": {
          "minLength": 1,
          "type": "string"
        },
        "kind": {
          "const": "room-exit",
          "type": "string"
        },
        "roomId": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "kind",
        "roomId",
        "exitId"
      ],
      "type": "object"
    },
    "__schema25": {
      "$ref": "#/$defs/__schema0"
    },
    "__schema26": {
      "additionalProperties": false,
      "properties": {
        "collection": {
          "const": "materials",
          "type": "string"
        },
        "id": {
          "$ref": "#/$defs/__schema0"
        }
      },
      "required": [
        "collection",
        "id"
      ],
      "type": "object"
    },
    "__schema27": {
      "additionalProperties": {
        "additionalProperties": false,
        "properties": {
          "source": {
            "$ref": "#/$defs/__schema29"
          },
          "type": {
            "$ref": "#/$defs/__schema28"
          }
        },
        "required": [
          "type",
          "source"
        ],
        "title": "MaterialParameterOverride",
        "type": "object",
        "x-noveltea-documentation": {
          "name": "MaterialParameterOverride"
        }
      },
      "default": {},
      "propertyNames": {
        "minLength": 1,
        "type": "string"
      },
      "type": "object"
    },
    "__schema28": {
      "enum": [
        "float",
        "vec2",
        "vec3",
        "vec4",
        "color",
        "int",
        "bool"
      ],
      "type": "string"
    },
    "__schema29": {
      "oneOf": [
        {
          "$ref": "#/$defs/__schema30"
        },
        {
          "$ref": "#/$defs/__schema38"
        },
        {
          "$ref": "#/$defs/__schema39"
        }
      ],
      "title": "MaterialParameterSource",
      "x-noveltea-documentation": {
        "name": "MaterialParameterSource"
      }
    },
    "__schema3": {
      "default": false,
      "type": "boolean"
    },
    "__schema30": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "literal",
          "type": "string"
        },
        "value": {
          "anyOf": [
            {
              "$ref": "#/$defs/__schema31"
            },
            {
              "$ref": "#/$defs/__schema32"
            },
            {
              "$ref": "#/$defs/__schema33"
            },
            {
              "$ref": "#/$defs/__schema34"
            },
            {
              "$ref": "#/$defs/__schema35"
            },
            {
              "$ref": "#/$defs/__schema36"
            },
            {
              "$ref": "#/$defs/__schema37"
            }
          ],
          "title": "ShaderUniformValue"
        }
      },
      "required": [
        "kind",
        "value"
      ],
      "type": "object"
    },
    "__schema31": {
      "type": "null"
    },
    "__schema32": {
      "type": "number"
    },
    "__schema33": {
      "type": "boolean"
    },
    "__schema34": {
      "items": false,
      "maxItems": 2,
      "minItems": 2,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ],
      "type": "array"
    },
    "__schema35": {
      "items": false,
      "maxItems": 3,
      "minItems": 3,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ],
      "type": "array"
    },
    "__schema36": {
      "items": false,
      "maxItems": 4,
      "minItems": 4,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        },
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ],
      "type": "array"
    },
    "__schema37": {
      "additionalProperties": false,
      "properties": {
        "a": {
          "type": "number"
        },
        "b": {
          "type": "number"
        },
        "g": {
          "type": "number"
        },
        "r": {
          "type": "number"
        }
      },
      "required": [
        "r",
        "g",
        "b",
        "a"
      ],
      "type": "object"
    },
    "__schema38": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "property",
          "type": "string"
        },
        "property": {
          "$ref": "#/$defs/__schema0"
        }
      },
      "required": [
        "kind",
        "property"
      ],
      "type": "object"
    },
    "__schema39": {
      "additionalProperties": false,
      "properties": {
        "facet": {
          "enum": [
            "occurrence-time",
            "paint-width",
            "paint-height",
            "viewport-width",
            "viewport-height",
            "camera-zoom"
          ],
          "type": "string"
        },
        "kind": {
          "const": "standard-facet",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "facet"
      ],
      "type": "object"
    },
    "__schema4": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "boolean"
        },
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "__schema40": {
      "additionalProperties": {
        "additionalProperties": false,
        "properties": {
          "source": {
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "source"
        ],
        "title": "MaterialTextureOverride",
        "type": "object",
        "x-noveltea-documentation": {
          "name": "MaterialTextureOverride"
        }
      },
      "default": {},
      "propertyNames": {
        "minLength": 1,
        "type": "string"
      },
      "type": "object"
    },
    "__schema41": {
      "minLength": 1,
      "type": "string"
    },
    "__schema42": {
      "$ref": "#/$defs/__schema43",
      "title": "JsonValue"
    },
    "__schema43": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "boolean"
        },
        {
          "type": "number"
        },
        {
          "type": "string"
        },
        {
          "items": {
            "$ref": "#/$defs/__schema42"
          },
          "type": "array"
        },
        {
          "additionalProperties": {
            "$ref": "#/$defs/__schema42"
          },
          "propertyNames": {
            "type": "string"
          },
          "type": "object"
        }
      ]
    },
    "__schema5": {
      "$ref": "#/$defs/__schema6",
      "title": "LayoutStateShape",
      "x-noveltea-documentation": {
        "constraints": [
          "Every State Shape defaultValue must recursively match the declared shape, required fields, and nullability."
        ]
      }
    },
    "__schema6": {
      "oneOf": [
        {
          "$ref": "#/$defs/__schema7"
        },
        {
          "$ref": "#/$defs/__schema10"
        },
        {
          "$ref": "#/$defs/__schema11"
        }
      ]
    },
    "__schema7": {
      "additionalProperties": false,
      "properties": {
        "defaultValue": {
          "$ref": "#/$defs/__schema8"
        },
        "nullable": {
          "default": false,
          "type": "boolean"
        },
        "type": {
          "enum": [
            "boolean",
            "integer",
            "number",
            "string"
          ],
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "__schema8": {
      "$ref": "#/$defs/__schema9",
      "title": "LayoutPersistableValue"
    },
    "__schema9": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "boolean"
        },
        {
          "type": "number"
        },
        {
          "type": "string"
        },
        {
          "items": {
            "$ref": "#/$defs/__schema8"
          },
          "type": "array"
        },
        {
          "additionalProperties": {
            "$ref": "#/$defs/__schema8"
          },
          "propertyNames": {
            "minLength": 1,
            "type": "string"
          },
          "type": "object"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "data": {
      "additionalProperties": false,
      "properties": {
        "contract": {
          "additionalProperties": false,
          "default": {
            "inputs": {},
            "signals": {}
          },
          "properties": {
            "inputs": {
              "additionalProperties": {
                "additionalProperties": false,
                "properties": {
                  "defaultValue": {
                    "$ref": "#/$defs/__schema4"
                  },
                  "nullable": {
                    "$ref": "#/$defs/__schema3"
                  },
                  "type": {
                    "$ref": "#/$defs/__schema2"
                  }
                },
                "required": [
                  "type"
                ],
                "type": "object",
                "x-noveltea-documentation": {
                  "constraints": [
                    "Layout input defaultValue must match the declared type and nullability."
                  ]
                }
              },
              "default": {},
              "propertyNames": {
                "$ref": "#/$defs/__schema1"
              },
              "type": "object"
            },
            "signals": {
              "additionalProperties": {
                "additionalProperties": false,
                "properties": {
                  "fields": {
                    "additionalProperties": {
                      "additionalProperties": false,
                      "properties": {
                        "nullable": {
                          "default": false,
                          "type": "boolean"
                        },
                        "required": {
                          "default": true,
                          "type": "boolean"
                        },
                        "type": {
                          "enum": [
                            "boolean",
                            "integer",
                            "number",
                            "string"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type"
                      ],
                      "type": "object"
                    },
                    "default": {},
                    "propertyNames": {
                      "$ref": "#/$defs/__schema1"
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              "default": {},
              "propertyNames": {
                "$ref": "#/$defs/__schema1"
              },
              "type": "object"
            },
            "state": {
              "$ref": "#/$defs/__schema5"
            }
          },
          "type": "object"
        },
        "dependencies": {
          "additionalProperties": false,
          "default": {
            "fonts": [],
            "images": [],
            "materials": [],
            "scripts": [],
            "stylesheets": [],
            "templates": []
          },
          "properties": {
            "data": {
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            },
            "fonts": {
              "default": [],
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            },
            "images": {
              "default": [],
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            },
            "materials": {
              "default": [],
              "items": {
                "additionalProperties": false,
                "properties": {
                  "material": {
                    "$ref": "#/$defs/__schema0"
                  },
                  "parameters": {
                    "$ref": "#/$defs/__schema27"
                  },
                  "textures": {
                    "$ref": "#/$defs/__schema40"
                  }
                },
                "required": [
                  "material"
                ],
                "title": "MaterialApplication",
                "type": "object",
                "x-noveltea-documentation": {
                  "name": "MaterialApplication"
                }
              },
              "type": "array"
            },
            "scripts": {
              "default": [],
              "items": {
                "pattern": "^scripts\\/(?!.*(?:^|\\/)\\.\\.(?:\\/|$))(?!.*\\\\)(?!.*\\/\\/)[^/].*\\.lua$",
                "type": "string"
              },
              "type": "array"
            },
            "stylesheets": {
              "default": [],
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            },
            "templates": {
              "default": [],
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        "displayName": {
          "type": "string"
        },
        "layoutKind": {
          "default": "document",
          "enum": [
            "document",
            "fragment"
          ],
          "type": "string"
        },
        "lua": {
          "oneOf": [
            {
              "$ref": "#/$defs/__schema17"
            },
            {
              "$ref": "#/$defs/__schema18"
            }
          ],
          "x-noveltea-documentation": {
            "constraints": [
              "For Lua, sourceMode 'file' owns records/layouts/<layout-id>/layout.lua; sourceMode 'none' requires that companion file to be absent."
            ]
          }
        },
        "mount": {
          "additionalProperties": false,
          "default": {
            "scopedStyles": true
          },
          "properties": {
            "defaultParent": {
              "type": "string"
            },
            "scopedStyles": {
              "default": true,
              "type": "boolean"
            }
          },
          "type": "object"
        },
        "preview": {
          "additionalProperties": false,
          "default": {
            "background": "dark"
          },
          "properties": {
            "background": {
              "default": "dark",
              "enum": [
                "transparent",
                "checker",
                "dark",
                "light"
              ],
              "type": "string"
            }
          },
          "type": "object"
        },
        "rcss": {
          "$ref": "#/$defs/__schema12"
        },
        "rml": {
          "$ref": "#/$defs/__schema12"
        },
        "sampleState": {
          "additionalProperties": {
            "$ref": "#/$defs/__schema42"
          },
          "default": {},
          "propertyNames": {
            "type": "string"
          },
          "type": "object"
        },
        "scalePolicy": {
          "additionalProperties": false,
          "properties": {
            "text": {
              "enum": [
                "inherit",
                "ignore"
              ],
              "type": "string"
            },
            "ui": {
              "enum": [
                "inherit",
                "ignore"
              ],
              "type": "string"
            }
          },
          "required": [
            "ui",
            "text"
          ],
          "type": "object"
        },
        "script": {
          "additionalProperties": false,
          "default": {
            "enabled": true
          },
          "properties": {
            "additionalDependencies": {
              "$ref": "#/$defs/__schema19"
            },
            "enabled": {
              "default": true,
              "type": "boolean"
            },
            "namespace": {
              "type": "string"
            }
          },
          "type": "object"
        },
        "target": {
          "default": "default-ui",
          "enum": [
            "default-ui",
            "dialogue-ui",
            "scene-overlay",
            "room-overlay",
            "menu-ui",
            "custom-overlay"
          ],
          "type": "string"
        }
      },
      "required": [
        "rml",
        "rcss",
        "lua"
      ],
      "type": "object"
    },
    "description": {
      "type": "string"
    },
    "id": {
      "$ref": "#/$defs/__schema0"
    },
    "label": {
      "minLength": 1,
      "type": "string"
    },
    "narrativeRefs": {
      "items": {
        "pattern": "^(?:creative-direction|arc|milestone|event|character|fact|world-entity|relationship|revelation|choice-point|puzzle|authored-content|narrative-position)\\.[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "label",
    "data"
  ],
  "type": "object"
}
