{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quay.local/schemas/scene.schema.json",
  "title": "QUAY SceneDocument",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "schemaVersion",
    "sceneId",
    "revision",
    "name",
    "createdAt",
    "updatedAt",
    "units",
    "coordinateSystem",
    "seed",
    "environment",
    "assets",
    "instances",
    "relations",
    "diagnostics",
    "unplacedInstanceIds",
    "camera",
    "provenance"
  ],
  "properties": {
    "schema": {
      "const": "quay.scene"
    },
    "schemaVersion": {
      "const": "1.0.0"
    },
    "sceneId": {
      "type": "string",
      "format": "uuid"
    },
    "revision": {
      "type": "integer",
      "minimum": 0
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "units": {
      "const": "metres"
    },
    "coordinateSystem": {
      "const": "right-handed-y-up-negative-z-forward"
    },
    "seed": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4294967295
    },
    "environment": {
      "$ref": "#/$defs/environment"
    },
    "assets": {
      "type": "array",
      "maxItems": 500,
      "items": {
        "$ref": "#/$defs/asset"
      }
    },
    "imageAssets": {
      "type": "array",
      "maxItems": 1000,
      "items": {
        "$ref": "#/$defs/imageAsset"
      }
    },
    "instances": {
      "type": "array",
      "maxItems": 2000,
      "items": {
        "$ref": "#/$defs/instance"
      }
    },
    "relations": {
      "type": "array",
      "maxItems": 5000,
      "items": {
        "$ref": "#/$defs/resolvedRelation"
      }
    },
    "diagnostics": {
      "type": "array",
      "maxItems": 1000,
      "items": {
        "$ref": "#/$defs/diagnostic"
      }
    },
    "unplacedInstanceIds": {
      "type": "array",
      "maxItems": 2000,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "camera": {
      "$ref": "#/$defs/camera"
    },
    "provenance": {
      "$ref": "#/$defs/provenance"
    },
    "materials": {
      "type": "array",
      "maxItems": 1000,
      "items": {
        "type": "object",
        "properties": {
          "version": {
            "const": "quay.material/1",
            "type": "string"
          },
          "identity": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "anyOf": [
              {
                "const": "generic",
                "type": "string"
              },
              {
                "const": "wood",
                "type": "string"
              },
              {
                "const": "metal",
                "type": "string"
              },
              {
                "const": "stone",
                "type": "string"
              },
              {
                "const": "concrete",
                "type": "string"
              },
              {
                "const": "ceramic",
                "type": "string"
              },
              {
                "const": "fabric",
                "type": "string"
              },
              {
                "const": "glass",
                "type": "string"
              },
              {
                "const": "paper",
                "type": "string"
              },
              {
                "const": "plastic",
                "type": "string"
              },
              {
                "const": "paint",
                "type": "string"
              }
            ]
          },
          "shader": {
            "anyOf": [
              {
                "const": "standard",
                "type": "string"
              },
              {
                "const": "unlit",
                "type": "string"
              }
            ]
          },
          "color": {
            "type": "string"
          },
          "roughness": {
            "type": "number"
          },
          "metalness": {
            "type": "number"
          },
          "emissive": {
            "type": "string"
          },
          "emissiveIntensity": {
            "type": "number"
          },
          "opacity": {
            "type": "number"
          },
          "alphaMode": {
            "anyOf": [
              {
                "const": "opaque",
                "type": "string"
              },
              {
                "const": "mask",
                "type": "string"
              },
              {
                "const": "blend",
                "type": "string"
              }
            ]
          },
          "alphaCutoff": {
            "type": "number"
          },
          "side": {
            "anyOf": [
              {
                "const": "front",
                "type": "string"
              },
              {
                "const": "back",
                "type": "string"
              },
              {
                "const": "double",
                "type": "string"
              }
            ]
          },
          "preset": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ]
          },
          "maps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slot": {
                  "anyOf": [
                    {
                      "const": "color",
                      "type": "string"
                    },
                    {
                      "const": "normal",
                      "type": "string"
                    },
                    {
                      "const": "roughness",
                      "type": "string"
                    },
                    {
                      "const": "metalness",
                      "type": "string"
                    },
                    {
                      "const": "emissive",
                      "type": "string"
                    },
                    {
                      "const": "occlusion",
                      "type": "string"
                    },
                    {
                      "const": "alpha",
                      "type": "string"
                    }
                  ]
                },
                "image": {
                  "type": "object",
                  "properties": {
                    "assetId": {
                      "type": "string"
                    },
                    "uri": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string"
                    },
                    "byteLength": {
                      "type": "number"
                    },
                    "mediaType": {
                      "anyOf": [
                        {
                          "const": "image/png",
                          "type": "string"
                        },
                        {
                          "const": "image/jpeg",
                          "type": "string"
                        },
                        {
                          "const": "image/webp",
                          "type": "string"
                        }
                      ]
                    },
                    "displayName": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "assetId",
                    "uri",
                    "sha256",
                    "byteLength",
                    "mediaType",
                    "displayName"
                  ],
                  "additionalProperties": false
                },
                "repeat": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "number"
                    }
                  ],
                  "minItems": 2,
                  "maxItems": 2,
                  "items": false
                },
                "offset": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "number"
                    }
                  ],
                  "minItems": 2,
                  "maxItems": 2,
                  "items": false
                },
                "rotation": {
                  "type": "number"
                },
                "wrap": {
                  "anyOf": [
                    {
                      "const": "repeat",
                      "type": "string"
                    },
                    {
                      "const": "clamp",
                      "type": "string"
                    },
                    {
                      "const": "mirror",
                      "type": "string"
                    }
                  ]
                }
              },
              "required": [
                "slot",
                "image",
                "repeat",
                "offset",
                "rotation",
                "wrap"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "version",
          "identity",
          "alias",
          "label",
          "description",
          "category",
          "shader",
          "color",
          "roughness",
          "metalness",
          "emissive",
          "emissiveIntensity",
          "opacity",
          "alphaMode",
          "alphaCutoff",
          "side",
          "preset",
          "maps"
        ],
        "additionalProperties": false
      }
    }
  },
  "$defs": {
    "vec3": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ],
      "items": false
    },
    "length2": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ],
      "items": false
    },
    "positiveLength2": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "prefixItems": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "number",
          "exclusiveMinimum": 0
        }
      ],
      "items": false
    },
    "positiveVec3": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "prefixItems": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "number",
          "exclusiveMinimum": 0
        }
      ],
      "items": false
    },
    "quaternion": {
      "type": "array",
      "minItems": 4,
      "maxItems": 4,
      "prefixItems": [
        {
          "type": "number"
        },
        {
          "type": "number"
        },
        {
          "type": "number"
        },
        {
          "type": "number"
        }
      ],
      "items": false
    },
    "color": {
      "type": "string",
      "pattern": "^#[0-9A-Fa-f]{6}$"
    },
    "bounds": {
      "type": "object",
      "additionalProperties": false,
      "required": ["min", "max"],
      "properties": {
        "min": {
          "$ref": "#/$defs/vec3"
        },
        "max": {
          "$ref": "#/$defs/vec3"
        }
      }
    },
    "transform": {
      "type": "object",
      "additionalProperties": false,
      "required": ["position", "quaternion", "scale"],
      "properties": {
        "position": {
          "$ref": "#/$defs/vec3"
        },
        "quaternion": {
          "$ref": "#/$defs/quaternion"
        },
        "scale": {
          "$ref": "#/$defs/positiveVec3"
        }
      }
    },
    "environment": {
      "type": "object",
      "additionalProperties": false,
      "required": ["room", "background", "fog", "floor", "lights"],
      "properties": {
        "room": {
          "type": "object",
          "additionalProperties": false,
          "required": ["width", "depth", "height", "floorY"],
          "properties": {
            "width": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 10000
            },
            "depth": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 10000
            },
            "height": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 10000
            },
            "floorY": {
              "type": "number"
            }
          }
        },
        "background": {
          "$ref": "#/$defs/color"
        },
        "fog": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "additionalProperties": false,
              "required": ["color", "near", "far"],
              "properties": {
                "color": {
                  "$ref": "#/$defs/color"
                },
                "near": {
                  "type": "number",
                  "minimum": 0
                },
                "far": {
                  "type": "number",
                  "exclusiveMinimum": 0
                }
              }
            }
          ]
        },
        "floor": {
          "type": "object",
          "additionalProperties": false,
          "required": ["visible", "color", "receiveShadow", "gridVisible"],
          "properties": {
            "visible": {
              "type": "boolean"
            },
            "color": {
              "$ref": "#/$defs/color"
            },
            "receiveShadow": {
              "type": "boolean"
            },
            "gridVisible": {
              "type": "boolean"
            }
          }
        },
        "lights": {
          "type": "array",
          "maxItems": 16,
          "items": {
            "$ref": "#/$defs/light"
          }
        }
      }
    },
    "light": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type", "color", "intensity", "position", "castShadow"],
      "properties": {
        "type": {
          "enum": ["ambient", "hemisphere", "directional", "point"]
        },
        "color": {
          "$ref": "#/$defs/color"
        },
        "groundColor": {
          "$ref": "#/$defs/color"
        },
        "intensity": {
          "type": "number",
          "minimum": 0,
          "maximum": 100000
        },
        "position": {
          "$ref": "#/$defs/vec3"
        },
        "castShadow": {
          "type": "boolean"
        }
      }
    },
    "asset": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "assetId",
        "uri",
        "sha256",
        "byteLength",
        "mediaType",
        "displayName",
        "description",
        "category",
        "canonicalSize",
        "normalization",
        "placement",
        "supportsObjects",
        "supportSurfaces"
      ],
      "properties": {
        "library": {
          "type": "object",
          "properties": {
            "version": {
              "const": "quay.asset-library/1",
              "type": "string"
            },
            "alias": {
              "type": "string"
            },
            "scope": {
              "anyOf": [
                {
                  "const": "standard",
                  "type": "string"
                },
                {
                  "const": "user",
                  "type": "string"
                },
                {
                  "const": "project",
                  "type": "string"
                }
              ]
            },
            "projectId": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "string"
                }
              ]
            },
            "origin": {
              "type": "object",
              "properties": {
                "provider": {
                  "type": "string"
                },
                "originalAssetId": {
                  "type": "string"
                },
                "originalUrl": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "author": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "license": {
                  "type": "string"
                },
                "attributionRequired": {
                  "anyOf": [
                    {
                      "const": false,
                      "type": "boolean"
                    },
                    {
                      "const": true,
                      "type": "boolean"
                    }
                  ]
                },
                "originalFilename": {
                  "type": "string"
                },
                "downloadedAt": {
                  "type": "string"
                },
                "contentHash": {
                  "type": "string"
                },
                "sourceHash": {
                  "type": "string"
                }
              },
              "required": [
                "provider",
                "originalAssetId",
                "originalUrl",
                "author",
                "license",
                "attributionRequired",
                "originalFilename",
                "downloadedAt",
                "contentHash",
                "sourceHash"
              ],
              "additionalProperties": false
            },
            "semantics": {
              "type": "object",
              "properties": {
                "taxonomy": {
                  "const": "quay.asset-taxonomy/1",
                  "type": "string"
                },
                "category": {
                  "type": "string"
                },
                "styles": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "roomTypes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "affordances": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "capacity": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "confidence": {
                  "type": "number"
                },
                "state": {
                  "anyOf": [
                    {
                      "const": "accepted",
                      "type": "string"
                    },
                    {
                      "const": "suggested",
                      "type": "string"
                    },
                    {
                      "const": "unknown",
                      "type": "string"
                    }
                  ]
                },
                "producer": {
                  "type": "string"
                },
                "model": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              },
              "required": [
                "taxonomy",
                "category",
                "styles",
                "roomTypes",
                "affordances",
                "capacity",
                "confidence",
                "state",
                "producer",
                "model"
              ],
              "additionalProperties": false
            },
            "manifestId": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "string"
                }
              ]
            },
            "archetypeId": {
              "anyOf": [
                {
                  "type": "null"
                },
                {
                  "type": "string"
                }
              ]
            },
            "cost": {
              "type": "object",
              "properties": {
                "triangles": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "materials": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "textureBytes": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "texturePixels": {
                  "anyOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "number"
                    }
                  ]
                }
              },
              "required": [
                "triangles",
                "materials",
                "textureBytes",
                "texturePixels"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "version",
            "alias",
            "scope",
            "projectId",
            "origin",
            "semantics",
            "manifestId",
            "archetypeId",
            "cost"
          ],
          "additionalProperties": false
        },
        "assetId": {
          "type": "string",
          "format": "uuid"
        },
        "uri": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "byteLength": {
          "type": "integer",
          "minimum": 1
        },
        "mediaType": {
          "const": "model/gltf-binary"
        },
        "displayName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "category": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "canonicalSize": {
          "$ref": "#/$defs/positiveVec3"
        },
        "normalization": {
          "type": "object",
          "additionalProperties": false,
          "required": ["rawBounds", "scale", "baseOffset", "forwardCorrection"],
          "properties": {
            "rawBounds": {
              "$ref": "#/$defs/bounds"
            },
            "scale": {
              "$ref": "#/$defs/positiveVec3"
            },
            "baseOffset": {
              "$ref": "#/$defs/vec3"
            },
            "forwardCorrection": {
              "$ref": "#/$defs/quaternion"
            }
          }
        },
        "placement": {
          "enum": ["floor_only", "support_only", "floor_or_support"]
        },
        "supportsObjects": {
          "type": "boolean"
        },
        "wallAlignment": {
          "type": ["string", "null"],
          "enum": ["left", "center", "right", null]
        },
        "availability": {
          "enum": ["global", "local"]
        },
        "roomId": {
          "type": ["string", "null"]
        },
        "supportSurfaces": {
          "type": "array",
          "maxItems": 50,
          "items": {
            "$ref": "#/$defs/supportSurface"
          }
        }
      }
    },
    "imageAsset": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "assetId",
        "uri",
        "sha256",
        "byteLength",
        "mediaType",
        "displayName"
      ],
      "properties": {
        "assetId": {
          "type": "string",
          "format": "uuid"
        },
        "uri": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{64}$"
        },
        "byteLength": {
          "type": "integer",
          "minimum": 1
        },
        "mediaType": {
          "enum": ["image/png", "image/jpeg", "image/webp"]
        },
        "displayName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      }
    },
    "supportSurface": {
      "type": "object",
      "additionalProperties": false,
      "required": ["surfaceId", "label", "center", "normal", "size", "source"],
      "properties": {
        "surfaceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "center": {
          "$ref": "#/$defs/vec3"
        },
        "normal": {
          "$ref": "#/$defs/vec3"
        },
        "size": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "prefixItems": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "type": "number",
              "exclusiveMinimum": 0
            }
          ],
          "items": false
        },
        "source": {
          "enum": ["bounds", "mesh", "manual"]
        }
      }
    },
    "instance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "instanceId",
        "assetId",
        "name",
        "transform",
        "visible",
        "castShadow",
        "receiveShadow",
        "locked",
        "placement",
        "tags"
      ],
      "properties": {
        "instanceId": {
          "type": "string",
          "format": "uuid"
        },
        "assetId": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "transform": {
          "$ref": "#/$defs/transform"
        },
        "normalization": {
          "$ref": "#/$defs/asset/properties/normalization"
        },
        "wallImage": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "wallInstanceId",
            "assetId",
            "position",
            "size",
            "surfaceOffset",
            "preserveAspectRatio"
          ],
          "properties": {
            "wallInstanceId": {
              "type": "string",
              "format": "uuid"
            },
            "assetId": {
              "type": "string",
              "format": "uuid"
            },
            "position": {
              "$ref": "#/$defs/length2"
            },
            "size": {
              "$ref": "#/$defs/positiveLength2"
            },
            "surfaceOffset": {
              "type": "number",
              "minimum": 0
            },
            "preserveAspectRatio": {
              "type": "boolean"
            },
            "surface": {
              "enum": ["wall", "floor"]
            }
          }
        },
        "visible": {
          "type": "boolean"
        },
        "castShadow": {
          "type": "boolean"
        },
        "receiveShadow": {
          "type": "boolean"
        },
        "locked": {
          "type": "boolean"
        },
        "placement": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "source",
            "supportingInstanceId",
            "supportSurfaceId",
            "solverStatus"
          ],
          "properties": {
            "source": {
              "enum": ["solver", "manual", "imported"]
            },
            "supportingInstanceId": {
              "type": ["string", "null"],
              "format": "uuid"
            },
            "supportSurfaceId": {
              "type": ["string", "null"],
              "maxLength": 100
            },
            "solverStatus": {
              "enum": ["placed", "fallback", "unresolved"]
            }
          }
        },
        "tags": {
          "type": "array",
          "maxItems": 50,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        },
        "materialId": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "resolvedRelation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "relationId",
        "type",
        "subjectInstanceId",
        "targetInstanceId",
        "strength",
        "status",
        "message"
      ],
      "properties": {
        "relationId": {
          "type": "string",
          "format": "uuid"
        },
        "type": {
          "enum": [
            "ON",
            "NEAR",
            "LEFT_OF",
            "RIGHT_OF",
            "IN_FRONT_OF",
            "BEHIND",
            "FACING",
            "CENTERED_ON",
            "ALIGNED_WITH",
            "AGAINST_WALL",
            "KEEP_CLEAR_OF"
          ]
        },
        "subjectInstanceId": {
          "type": "string",
          "format": "uuid"
        },
        "targetInstanceId": {
          "type": ["string", "null"],
          "format": "uuid"
        },
        "strength": {
          "enum": ["hard", "soft"]
        },
        "status": {
          "enum": ["satisfied", "degraded", "unresolved"]
        },
        "message": {
          "type": "string",
          "maxLength": 500
        }
      }
    },
    "diagnostic": {
      "type": "object",
      "additionalProperties": false,
      "required": ["code", "severity", "message", "instanceIds", "relationId"],
      "properties": {
        "code": {
          "type": "string",
          "pattern": "^[A-Z][A-Z0-9_]{1,63}$"
        },
        "severity": {
          "enum": ["info", "warning", "error"]
        },
        "message": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1000
        },
        "instanceIds": {
          "type": "array",
          "maxItems": 50,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "format": "uuid"
          }
        },
        "relationId": {
          "type": ["string", "null"],
          "format": "uuid"
        },
        "measurements": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          }
        }
      }
    },
    "camera": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "position",
        "target",
        "up",
        "fovDegrees",
        "near",
        "far"
      ],
      "properties": {
        "type": {
          "const": "perspective"
        },
        "position": {
          "$ref": "#/$defs/vec3"
        },
        "target": {
          "$ref": "#/$defs/vec3"
        },
        "up": {
          "$ref": "#/$defs/vec3"
        },
        "fovDegrees": {
          "type": "number",
          "exclusiveMinimum": 1,
          "exclusiveMaximum": 179
        },
        "near": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "far": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      }
    },
    "provenance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "createdBy",
        "planner",
        "layoutEngineVersion",
        "threeVersion",
        "sourcePrompt"
      ],
      "properties": {
        "createdBy": {
          "enum": ["quay", "import"]
        },
        "planner": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "provider",
                "model",
                "promptTemplateVersion",
                "requestId"
              ],
              "properties": {
                "provider": {
                  "enum": ["openai", "fake"]
                },
                "model": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "promptTemplateVersion": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 50
                },
                "requestId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              }
            }
          ]
        },
        "layoutEngineVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        },
        "threeVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        },
        "sourcePrompt": {
          "type": "string",
          "maxLength": 4000
        }
      }
    }
  }
}
