{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reasonmachines-com/json-schema/reasonmachines-com-managed-device-schema.json",
  "title": "ManagedDevice",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reasonmachines-com-openapi.json#/components/schemas/ManagedDevice",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      "description": "Device id; pass it as `deviceId`."
    },
    "name": {
      "type": "string",
      "description": "Name the Device reported at enrollment."
    },
    "kind": {
      "type": "string",
      "enum": [
        "mac",
        "headless"
      ],
      "description": "The Mac app's Device, or a headless worker such as `reason connect`."
    },
    "os": {
      "type": "string",
      "description": "Operating system the Device reported."
    },
    "architecture": {
      "type": "string",
      "description": "CPU architecture, such as `arm64`."
    },
    "custom_name": {
      "description": "Name the owner gave the Device, if any.",
      "type": [
        "string",
        "null"
      ]
    },
    "device_model": {
      "description": "Hardware model, when reported.",
      "type": [
        "string",
        "null"
      ]
    },
    "device_chip": {
      "description": "Processor, when reported.",
      "type": [
        "string",
        "null"
      ]
    },
    "machine_id": {
      "description": "Machine this headless worker serves, or null for a personal Device.",
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "folder_lane_of": {
      "description": "For a further lane of a CLI folder (a second `reason \"PROMPT\"` running in the same folder at once): the folder's main Device. Lists in Reason show only that Device.",
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "device_location": {
      "description": "Location the Device reported, when known.",
      "type": [
        "string",
        "null"
      ]
    },
    "reason_runtime_version": {
      "type": "string",
      "description": "Version of the Reason runtime on the Device."
    },
    "ara_runtime_version": {
      "type": "string",
      "deprecated": true,
      "description": "Deprecated: use `reason_runtime_version` (same value)."
    },
    "bridge_version": {
      "type": "string",
      "description": "Version of the Device's connection bridge."
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "revoked",
        "expired"
      ],
      "description": "Whether the Device's enrollment is still valid."
    },
    "lifecycle": {
      "description": "For a headless worker: long-lived, or short-lived for one task; null for a Mac.",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "persistent",
            "ephemeral"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "expires_at": {
      "description": "When the enrollment expires; null when it does not.",
      "type": [
        "string",
        "null"
      ]
    },
    "last_seen_at": {
      "description": "Time of the Device's last heartbeat.",
      "type": [
        "string",
        "null"
      ]
    },
    "load": {
      "description": "What the computer said about its own load in the last 90 seconds, while it is online. Absent when its worker does not report it (an older CLI, or Windows) or has not reported recently.",
      "type": "object",
      "properties": {
        "one_minute": {
          "type": "number",
          "description": "The computer's 1-minute load average."
        },
        "cpus": {
          "type": "integer",
          "description": "Its logical CPU count."
        },
        "busy": {
          "type": "boolean",
          "description": "True when the load is at least two runnable tasks per CPU: work already waits for a CPU, so more work there is slow and can time out."
        },
        "observed_at": {
          "type": "string",
          "description": "When the server took this report."
        }
      },
      "required": [
        "one_minute",
        "cpus",
        "busy",
        "observed_at"
      ]
    },
    "online": {
      "type": "boolean",
      "description": "Whether the Device is connected now."
    },
    "compatible": {
      "type": "boolean",
      "description": "Whether a Session can run on the Device now."
    },
    "compatibility_reason": {
      "description": "Why a Session cannot run on it, when `compatible` is false.",
      "oneOf": [
        {
          "type": "string",
          "enum": [
            "offline",
            "protocol_unsupported",
            "worker_update_required",
            "execution_ineligible",
            "file_access_only",
            "revoked"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "description": "When the Device enrolled."
    },
    "updated_at": {
      "type": "string",
      "description": "When the Device's record last changed."
    },
    "protocol_version": {
      "type": "integer",
      "description": "Device protocol version it speaks."
    },
    "capabilities": {
      "type": "object",
      "description": "Features the Device reported supporting."
    },
    "roots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
            "description": "Root id; pass it as `rootId` to change or remove this folder."
          },
          "label": {
            "type": "string",
            "description": "Display name of the folder."
          },
          "path_fingerprint": {
            "type": "string",
            "description": "Keyed fingerprint of the folder's path; the raw path is never published."
          },
          "repository_identity": {
            "description": "Git repository the folder holds, when the Device reported one.",
            "type": [
              "string",
              "null"
            ]
          },
          "permissions": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "Current permissions (read, write, execute, discover_environment, expose_mcp) granted in this folder."
          },
          "permission_ceiling": {
            "description": "Highest permissions enrollment approved; a grant change cannot exceed them.",
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "execution_mode": {
            "description": "Where commands in this folder run: confined to a sandbox, or directly on the host.",
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "confined",
                  "host"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "execution_mode_ceiling": {
            "description": "Highest execution mode enrollment approved.",
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "confined",
                  "host"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "grant_revision": {
            "type": "integer",
            "description": "Revision of this grant; pass it as `expected_grant_revision` to change it."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked"
            ],
            "description": "Whether sessions can still use the folder."
          }
        },
        "required": [
          "id",
          "label",
          "path_fingerprint",
          "repository_identity",
          "permissions",
          "permission_ceiling",
          "execution_mode",
          "execution_mode_ceiling",
          "grant_revision",
          "status"
        ]
      },
      "description": "Folders approved on the Device, with their grants."
    },
    "direct_access_enabled": {
      "description": "The owner's Direct device access choice (Settings > Network): while false, Sessions cannot run on this personal Device. Absent for Machine and compute workers.",
      "type": "boolean"
    },
    "direct_access_revision": {
      "description": "Revision of that choice; pass it as `expected_revision` to updateDeviceDirectAccess.",
      "type": "integer"
    },
    "direct_access_stopping": {
      "description": "True while work stopped by turning direct access off is still winding down.",
      "type": "boolean"
    },
    "can_manage_direct_access": {
      "description": "Whether the caller may change this Device's direct access.",
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "name",
    "kind",
    "os",
    "architecture",
    "device_model",
    "device_chip",
    "device_location",
    "reason_runtime_version",
    "ara_runtime_version",
    "bridge_version",
    "status",
    "lifecycle",
    "expires_at",
    "last_seen_at",
    "online",
    "compatible",
    "compatibility_reason",
    "created_at",
    "updated_at",
    "protocol_version",
    "capabilities",
    "roots"
  ]
}