{
  "Event": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "oneOf": [
      {
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string"
          },
          "entity": {
            "type": "string"
          },
          "kind": {
            "const": "invoke_action",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "entity",
          "action"
        ],
        "type": "object"
      }
    ],
    "title": "Event"
  },
  "Frame": {
    "$defs": {
      "Color": {
        "additionalProperties": false,
        "properties": {
          "a": {
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": "integer"
          },
          "b": {
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": "integer"
          },
          "g": {
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": "integer"
          },
          "r": {
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "r",
          "g",
          "b",
          "a"
        ],
        "type": "object"
      },
      "Draw": {
        "additionalProperties": false,
        "properties": {
          "color": {
            "$ref": "#/$defs/Color"
          },
          "entity": {
            "type": "string"
          },
          "matrix": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "maxItems": 16,
            "minItems": 16,
            "type": "array"
          },
          "mesh_entity": {
            "type": [
              "string",
              "null"
            ]
          },
          "transform": {
            "$ref": "#/$defs/Transform"
          }
        },
        "required": [
          "entity",
          "transform",
          "matrix",
          "color"
        ],
        "type": "object"
      },
      "Quaternion": {
        "additionalProperties": false,
        "properties": {
          "w": {
            "format": "double",
            "type": "number"
          },
          "x": {
            "format": "double",
            "type": "number"
          },
          "y": {
            "format": "double",
            "type": "number"
          },
          "z": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "x",
          "y",
          "z",
          "w"
        ],
        "type": "object"
      },
      "RuntimeEvent": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "action_applied": {
                "additionalProperties": false,
                "properties": {
                  "action": {
                    "type": "string"
                  },
                  "entity": {
                    "type": "string"
                  }
                },
                "required": [
                  "entity",
                  "action"
                ],
                "type": "object"
              }
            },
            "required": [
              "action_applied"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "effect_proposed": {
                "additionalProperties": false,
                "properties": {
                  "effect": {
                    "type": "string"
                  },
                  "entity": {
                    "type": "string"
                  }
                },
                "required": [
                  "entity",
                  "effect"
                ],
                "type": "object"
              }
            },
            "required": [
              "effect_proposed"
            ],
            "type": "object"
          }
        ]
      },
      "Transform": {
        "additionalProperties": false,
        "properties": {
          "rotation": {
            "$ref": "#/$defs/Quaternion"
          },
          "scale": {
            "$ref": "#/$defs/Vec3"
          },
          "translation": {
            "$ref": "#/$defs/Vec3"
          }
        },
        "required": [
          "translation",
          "rotation",
          "scale"
        ],
        "type": "object"
      },
      "Vec3": {
        "additionalProperties": false,
        "properties": {
          "x": {
            "format": "double",
            "type": "number"
          },
          "y": {
            "format": "double",
            "type": "number"
          },
          "z": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "x",
          "y",
          "z"
        ],
        "type": "object"
      }
    },
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "draws": {
        "items": {
          "$ref": "#/$defs/Draw"
        },
        "type": "array"
      },
      "events": {
        "items": {
          "$ref": "#/$defs/RuntimeEvent"
        },
        "type": "array"
      },
      "time_seconds": {
        "format": "double",
        "type": "number"
      }
    },
    "required": [
      "time_seconds",
      "draws",
      "events"
    ],
    "title": "Frame",
    "type": "object"
  },
  "Observation": {
    "$defs": {
      "Provenance": {
        "additionalProperties": false,
        "properties": {
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "source"
        ],
        "type": "object"
      },
      "Quality": {
        "additionalProperties": false,
        "properties": {
          "confidence": {
            "format": "float",
            "type": "number"
          },
          "valid_for_ms": {
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "confidence",
          "valid_for_ms"
        ],
        "type": "object"
      },
      "Timestamp": {
        "additionalProperties": false,
        "properties": {
          "clock": {
            "type": "string"
          },
          "nanoseconds": {
            "type": "string"
          }
        },
        "required": [
          "clock",
          "nanoseconds"
        ],
        "type": "object"
      }
    },
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "description": "Immutable spatial evidence. It is never inferred to be an authored transform.",
    "properties": {
      "frame": {
        "type": "string"
      },
      "id": {
        "type": "string"
      },
      "provenance": {
        "$ref": "#/$defs/Provenance"
      },
      "quality": {
        "$ref": "#/$defs/Quality"
      },
      "sequence": {
        "type": "string"
      },
      "time": {
        "$ref": "#/$defs/Timestamp"
      }
    },
    "required": [
      "id",
      "frame",
      "time",
      "sequence",
      "quality",
      "provenance"
    ],
    "title": "Observation",
    "type": "object"
  },
  "Receipt": {
    "$defs": {
      "ReceiptStatus": {
        "enum": [
          "applied",
          "proposed"
        ],
        "type": "string"
      },
      "RuntimeEvent": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "action_applied": {
                "additionalProperties": false,
                "properties": {
                  "action": {
                    "type": "string"
                  },
                  "entity": {
                    "type": "string"
                  }
                },
                "required": [
                  "entity",
                  "action"
                ],
                "type": "object"
              }
            },
            "required": [
              "action_applied"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "effect_proposed": {
                "additionalProperties": false,
                "properties": {
                  "effect": {
                    "type": "string"
                  },
                  "entity": {
                    "type": "string"
                  }
                },
                "required": [
                  "entity",
                  "effect"
                ],
                "type": "object"
              }
            },
            "required": [
              "effect_proposed"
            ],
            "type": "object"
          }
        ]
      }
    },
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "event": {
        "$ref": "#/$defs/RuntimeEvent"
      },
      "status": {
        "$ref": "#/$defs/ReceiptStatus"
      }
    },
    "required": [
      "status",
      "event"
    ],
    "title": "Receipt",
    "type": "object"
  },
  "Recording": {
    "$defs": {
      "Event": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "action": {
                "type": "string"
              },
              "entity": {
                "type": "string"
              },
              "kind": {
                "const": "invoke_action",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "entity",
              "action"
            ],
            "type": "object"
          }
        ]
      },
      "RecordedStep": {
        "additionalProperties": false,
        "properties": {
          "events": {
            "items": {
              "$ref": "#/$defs/Event"
            },
            "type": "array"
          },
          "time_seconds": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "time_seconds",
          "events"
        ],
        "type": "object"
      }
    },
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "steps": {
        "items": {
          "$ref": "#/$defs/RecordedStep"
        },
        "type": "array"
      },
      "version": {
        "format": "uint16",
        "maximum": 65535,
        "minimum": 0,
        "type": "integer"
      }
    },
    "required": [
      "version",
      "steps"
    ],
    "title": "Recording",
    "type": "object"
  },
  "SceneDocument": {
    "$defs": {
      "Action": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "toggle_motion",
                "type": "string"
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "color": {
                "$ref": "#/$defs/Color"
              },
              "kind": {
                "const": "change_color",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "color"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "effect": {
                "type": "string"
              },
              "kind": {
                "const": "propose_effect",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "effect"
            ],
            "type": "object"
          }
        ]
      },
      "Animation": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "orbit",
                "type": "string"
              },
              "period_s": {
                "format": "double",
                "type": "number"
              },
              "radius_m": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "kind",
              "radius_m",
              "period_s"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "degrees_per_second": {
                "format": "double",
                "type": "number"
              },
              "kind": {
                "const": "spin",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "degrees_per_second"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "amplitude_m": {
                "format": "double",
                "type": "number"
              },
              "kind": {
                "const": "bob",
                "type": "string"
              },
              "period_s": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "kind",
              "amplitude_m",
              "period_s"
            ],
            "type": "object"
          }
        ]
      },
      "Color": {
        "additionalProperties": false,
        "properties": {
          "a": {
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": "integer"
          },
          "b": {
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": "integer"
          },
          "g": {
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": "integer"
          },
          "r": {
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "r",
          "g",
          "b",
          "a"
        ],
        "type": "object"
      },
      "ConversationMessage": {
        "additionalProperties": false,
        "properties": {
          "role": {
            "$ref": "#/$defs/ConversationRole"
          },
          "scene_references": {
            "default": [],
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "role",
          "text"
        ],
        "type": "object"
      },
      "ConversationRole": {
        "enum": [
          "user",
          "assistant",
          "system"
        ],
        "type": "string"
      },
      "Entity": {
        "additionalProperties": false,
        "properties": {
          "actions": {
            "additionalProperties": {
              "$ref": "#/$defs/Action"
            },
            "type": "object"
          },
          "animations": {
            "items": {
              "$ref": "#/$defs/Animation"
            },
            "type": "array"
          },
          "color": {
            "$ref": "#/$defs/Color"
          },
          "geometry": {
            "$ref": "#/$defs/Geometry"
          },
          "id": {
            "type": "string"
          },
          "material": {
            "$ref": "#/$defs/Material",
            "default": {
              "emissive": 0.0,
              "roughness": 0.6499999761581421
            }
          },
          "parent": {
            "type": [
              "string",
              "null"
            ]
          },
          "transform": {
            "$ref": "#/$defs/Transform"
          }
        },
        "required": [
          "id",
          "transform",
          "geometry",
          "color",
          "animations",
          "actions"
        ],
        "type": "object"
      },
      "Geometry": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "group",
                "type": "string"
              }
            },
            "required": [
              "kind"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "sphere",
                "type": "string"
              },
              "radius_m": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "kind",
              "radius_m"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "torus",
                "type": "string"
              },
              "major_radius_m": {
                "format": "double",
                "type": "number"
              },
              "minor_radius_m": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "kind",
              "major_radius_m",
              "minor_radius_m"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "box",
                "type": "string"
              },
              "size_m": {
                "$ref": "#/$defs/Vec3"
              }
            },
            "required": [
              "kind",
              "size_m"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "height_m": {
                "format": "double",
                "type": "number"
              },
              "kind": {
                "const": "cylinder",
                "type": "string"
              },
              "radius_m": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "kind",
              "radius_m",
              "height_m"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "depth_m": {
                "format": "double",
                "type": "number"
              },
              "kind": {
                "const": "plane",
                "type": "string"
              },
              "width_m": {
                "format": "double",
                "type": "number"
              }
            },
            "required": [
              "kind",
              "width_m",
              "depth_m"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "from_m": {
                "$ref": "#/$defs/Vec3"
              },
              "kind": {
                "const": "line",
                "type": "string"
              },
              "to_m": {
                "$ref": "#/$defs/Vec3"
              }
            },
            "required": [
              "kind",
              "from_m",
              "to_m"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "asset": {
                "type": "string"
              },
              "kind": {
                "const": "mesh",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "asset"
            ],
            "type": "object"
          }
        ]
      },
      "Material": {
        "additionalProperties": false,
        "properties": {
          "emissive": {
            "format": "float",
            "type": "number"
          },
          "roughness": {
            "format": "float",
            "type": "number"
          }
        },
        "required": [
          "roughness",
          "emissive"
        ],
        "type": "object"
      },
      "Quaternion": {
        "additionalProperties": false,
        "properties": {
          "w": {
            "format": "double",
            "type": "number"
          },
          "x": {
            "format": "double",
            "type": "number"
          },
          "y": {
            "format": "double",
            "type": "number"
          },
          "z": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "x",
          "y",
          "z",
          "w"
        ],
        "type": "object"
      },
      "Transform": {
        "additionalProperties": false,
        "properties": {
          "rotation": {
            "$ref": "#/$defs/Quaternion"
          },
          "scale": {
            "$ref": "#/$defs/Vec3"
          },
          "translation": {
            "$ref": "#/$defs/Vec3"
          }
        },
        "required": [
          "translation",
          "rotation",
          "scale"
        ],
        "type": "object"
      },
      "Vec3": {
        "additionalProperties": false,
        "properties": {
          "x": {
            "format": "double",
            "type": "number"
          },
          "y": {
            "format": "double",
            "type": "number"
          },
          "z": {
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "x",
          "y",
          "z"
        ],
        "type": "object"
      }
    },
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "conversation": {
        "default": [],
        "items": {
          "$ref": "#/$defs/ConversationMessage"
        },
        "type": "array"
      },
      "entities": {
        "items": {
          "$ref": "#/$defs/Entity"
        },
        "type": "array"
      },
      "format": {
        "type": "string"
      },
      "id": {
        "type": "string"
      },
      "title": {
        "type": "string"
      },
      "version": {
        "format": "uint16",
        "maximum": 65535,
        "minimum": 0,
        "type": "integer"
      }
    },
    "required": [
      "format",
      "version",
      "id",
      "title",
      "entities"
    ],
    "title": "SceneDocument",
    "type": "object"
  }
}
