{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-host-presence-schema.json",
  "title": "Host presence",
  "description": "A device currently connected to `GET /v1/hosts/stream`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-hosts-api-openapi.yml#/components/schemas/HostPresence",
  "type": "object",
  "required": [
    "device_id",
    "name",
    "platform",
    "os",
    "hostname",
    "roots",
    "caps",
    "environment_id",
    "since",
    "last_seen"
  ],
  "properties": {
    "device_id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Device display name."
    },
    "platform": {
      "type": [
        "string",
        "null"
      ],
      "description": "Device platform (see `DevicePlatform`)."
    },
    "os": {
      "type": [
        "string",
        "null"
      ],
      "description": "From the `os` query param of the stream, if given."
    },
    "hostname": {
      "type": [
        "string",
        "null"
      ]
    },
    "roots": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Filesystem roots the host announced."
    },
    "caps": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Capabilities the host announced with `caps=` (`iphone`, `video`, `pty`, …); empty when none."
    },
    "environment_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Environment that serves `video` / `pty` streams for this host over codai-relay (`env=` of the stream), or null."
    },
    "since": {
      "type": "integer",
      "description": "Epoch ms when the current stream was opened."
    },
    "last_seen": {
      "type": "integer",
      "description": "Epoch ms of the last heartbeat."
    }
  }
}