{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/clousd-com/json-schema/clousd-com-observation-schema.json",
  "title": "Observation",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clousd-com-openapi.yml#/components/schemas/Observation",
  "type": "object",
  "properties": {
    "seq": {
      "type": "integer"
    },
    "ts": {
      "type": "string",
      "format": "date-time"
    },
    "ms": {
      "type": "integer",
      "description": "time the observation took"
    },
    "screen": {
      "type": "object",
      "properties": {
        "w": {
          "type": "integer"
        },
        "h": {
          "type": "integer"
        }
      }
    },
    "image": {
      "type": "object",
      "properties": {
        "w": {
          "type": "integer"
        },
        "h": {
          "type": "integer"
        },
        "format": {
          "type": "string"
        },
        "data": {
          "type": "string",
          "contentEncoding": "base64"
        }
      }
    },
    "package": {
      "type": "string"
    },
    "activity": {
      "type": "string"
    },
    "ui": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UINode"
      }
    },
    "ui_error": {
      "type": "string",
      "description": "set when the UI tree is not available yet (prefix not_ready)"
    }
  },
  "$defs": {
    "UINode": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "desc": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "class": {
          "type": "string"
        },
        "pkg": {
          "type": "string"
        },
        "b": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "minItems": 4,
          "maxItems": 4,
          "description": "x1, y1, x2, y2 in phone pixels"
        },
        "click": {
          "type": "boolean"
        },
        "long": {
          "type": "boolean"
        },
        "scroll": {
          "type": "boolean"
        },
        "focus": {
          "type": "boolean"
        },
        "focused": {
          "type": "boolean"
        },
        "checked": {
          "type": "boolean"
        },
        "disabled": {
          "type": "boolean"
        },
        "password": {
          "type": "boolean"
        },
        "selected": {
          "type": "boolean"
        }
      }
    }
  }
}