{
  "openapi": "3.1.0",
  "info": {
    "title": "punktfunk management API",
    "description": "Control-plane API for managing a punktfunk streaming host: host capabilities, runtime status, paired clients, the pairing PIN flow, and session control. Authentication: HTTP bearer token, enforced on every route except `/api/v1/health` when the host is started with a management token (mandatory for non-loopback binds).",
    "contact": {
      "name": "unom"
    },
    "license": {
      "name": "MIT OR Apache-2.0",
      "identifier": "MIT OR Apache-2.0"
    },
    "version": "0.47.0"
  },
  "paths": {
    "/api/v1/actions": {
      "get": {
        "tags": [
          "actions"
        ],
        "summary": "List host actions",
        "description": "Per-caller view: platform availability plus whether this caller may invoke each one.\nAdmin: everything permitted. Paired cert: power per the device's live Host-power grant,\n`display.next` while the device streams a session of its own and may choose its screen.\nUnknown ids still render with the server-supplied title.",
        "operationId": "listActions",
        "responses": {
          "200": {
            "description": "The actions, per-caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionList"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/actions/{id}": {
      "post": {
        "tags": [
          "actions"
        ],
        "summary": "Invoke a host action",
        "description": "Id-only, empty body: nothing in the request reaches the privileged path. Power actions\nanswer `202`, end every session (typed HostPower close), wait ~1 s so this response\nflushes, then act; paired-cert callers need Host power and are `409` while another\ndevice's session is live or a seat host doesn't answer, the admin console never is. One\npower action at a time.\n`display.next` answers `200` with the monitor now streamed and ends nothing; a paired\ncert needs a live session of its own and the Choose-its-screen grant.",
        "operationId": "invokeAction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Action id (`power.sleep`, `power.reboot`, `power.shutdown`, `host.restart`, `display.next`)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Done (`display.next`): the monitor streamed from now on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionOutcome"
                }
              }
            }
          },
          "202": {
            "description": "Accepted — sessions are being ended and the action follows in about a second"
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "This caller's access does not include this action (no Host power grant; for `display.next`, no live session of its own or no Choose-its-screen grant)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown action id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Refused: an action is already in flight, another device's session is live or a seat host doesn't answer (cert lane), or the platform said no (a foreign sleep inhibitor, a second local user, a single monitor, …)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "`display.next` could not store the new monitor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "501": {
            "description": "This host platform has no executor for it (macOS host)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/auth/device/challenge": {
      "post": {
        "tags": [
          "host"
        ],
        "summary": "Start a device exchange",
        "operationId": "postDeviceChallenge",
        "responses": {
          "200": {
            "description": "A single-use nonce to sign",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Challenge"
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-scope": "box"
      }
    },
    "/api/v1/auth/device/token": {
      "post": {
        "tags": [
          "host"
        ],
        "summary": "Exchange a device signature for a token",
        "operationId": "postDeviceToken",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A bearer token for the paired-device lane",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenGrant"
                }
              }
            }
          },
          "401": {
            "description": "Unknown device, stale nonce, or a bad signature",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-scope": "box"
      }
    },
    "/api/v1/auth/person/profile": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "The person's own profile",
        "description": "The person lane on a seat host: the session's profile as the box's `profiles.json` in this\nhost's trust copy has it. Only that profile, and only on that lane; every other caller gets\n404.",
        "operationId": "getPersonProfile",
        "responses": {
          "200": {
            "description": "The session's profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonProfile"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No person session, or its profile is not in this host's copy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/auth/person/profile/avatar": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "The person's own picture",
        "description": "As `GET /profiles/{id}/avatar`, for the person session's own profile alone, from this seat\nhost's trust copy.",
        "operationId": "getPersonAvatar",
        "parameters": [
          {
            "name": "If-None-Match",
            "in": "header",
            "description": "An `ETag` from an earlier response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes",
            "content": {
              "image/png": {}
            }
          },
          "304": {
            "description": "The tag in `If-None-Match` is current"
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No person session, or no picture for its profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/auth/person/session": {
      "post": {
        "tags": [
          "host"
        ],
        "summary": "Open a person session",
        "description": "On a seat host, from loopback: trade the one-time ticket `ctl console-url` wrote into the\npage it opened for a session token. The ticket is signed with this host's person token, at\nmost 60 s old, used once, and for this host's own profile. Every other host refuses it. After\nten refused tickets in a minute a refused one answers 429; a good one still opens.",
        "operationId": "openPersonSession",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonTicket"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A session for the person lane of this seat host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonGrant"
                }
              }
            }
          },
          "401": {
            "description": "Not a ticket this host takes, or not from loopback",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Too many refused tickets in the last minute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "host"
        ],
        "summary": "End a person session",
        "description": "From loopback, the session's own token as the bearer. Answers the same whether it was live.",
        "operationId": "closePersonSession",
        "responses": {
          "204": {
            "description": "The session, if it was one, is over"
          },
          "401": {
            "description": "Not from loopback",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-scope": "box"
      }
    },
    "/api/v1/auth/person/verify": {
      "post": {
        "tags": [
          "host"
        ],
        "summary": "Whose a person session is",
        "description": "Admin lane, on a seat host: whether `token` is a live person session here, and for which\nprofile. The box asks before it takes a person session's word for that profile.",
        "operationId": "verifyPersonSession",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonSessionToken"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "A live session, and its profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonOf"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No live session with that token here",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/client-logs": {
      "get": {
        "tags": [
          "logs"
        ],
        "summary": "List uploaded client log bundles",
        "operationId": "clientLogsList",
        "responses": {
          "200": {
            "description": "Stored bundles, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClientLogMeta"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "post": {
        "tags": [
          "logs"
        ],
        "summary": "Upload a client log bundle",
        "description": "A paired device posts plain text under its streaming cert — no bearer. Cap 1 MiB, newest\nfew per device kept. Write-only: uploading grants no read.",
        "operationId": "clientLogsUpload",
        "requestBody": {
          "description": "The client's log text",
          "content": {
            "text/plain": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Bundle stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientLogUploaded"
                }
              }
            }
          },
          "400": {
            "description": "No paired device behind the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The device's access has expired (per-client access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "413": {
            "description": "Bundle exceeds the size cap",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "Empty body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't store the log bundle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/client-logs/{id}": {
      "get": {
        "tags": [
          "logs"
        ],
        "summary": "Download a client log bundle",
        "operationId": "clientLogsGet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The bundle id (its filename stem)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The bundle body",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No bundle with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The bundle file is unreadable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "logs"
        ],
        "summary": "Delete a client log bundle",
        "description": "`404` if there is no such bundle.",
        "operationId": "clientLogsDelete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The bundle id (its filename stem)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Bundle deleted"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No bundle with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't delete the log bundle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/clients": {
      "get": {
        "tags": [
          "clients"
        ],
        "summary": "List paired clients",
        "operationId": "listPairedClients",
        "responses": {
          "200": {
            "description": "All certificate-pinned clients",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PairedClient"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "clients"
        ],
        "summary": "Unpair every client",
        "description": "Collection form of [`unpair_client`]: one persisted write, same revocation across the\nset. Idempotent, so 200 rather than 204/404 — an already-empty store still satisfies\n\"unpair everything\", and the body says whether that was three devices or none.",
        "operationId": "unpairAllClients",
        "responses": {
          "200": {
            "description": "Every client unpaired (possibly none)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnpairAllResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/clients/{fingerprint}": {
      "delete": {
        "tags": [
          "clients"
        ],
        "summary": "Unpair a client",
        "description": "Persisted. A live GameStream session owned by this certificate is ended\n(TERMINATION+disconnect). Removing the last pairing closes the ENet control port.\nnvhttp TLS still completes a handshake with any well-formed client cert — authorization\nis per-request via the paired-fingerprint check.",
        "operationId": "unpairClient",
        "parameters": [
          {
            "name": "fingerprint",
            "in": "path",
            "description": "Hex SHA-256 fingerprint of the client certificate DER (64 chars, case-insensitive)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Client unpaired"
          },
          "400": {
            "description": "Malformed fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No paired client with that fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "patch": {
        "tags": [
          "clients"
        ],
        "summary": "Rename a paired client",
        "description": "Cosmetic: no certificate, no trust change. Stored beside the pairing store; unpairing\nthe device forgets it.",
        "operationId": "renameClient",
        "parameters": [
          {
            "name": "fingerprint",
            "in": "path",
            "description": "Hex SHA-256 fingerprint of the client certificate DER (64 chars, case-insensitive)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameClient"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The client as it now reads",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairedClient"
                }
              }
            }
          },
          "400": {
            "description": "Malformed fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No paired client with that fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/compositors": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "List compositor backends",
        "description": "Each row carries availability and whether `Auto` resolves to it. Clients pass\n`id` to `--compositor` or `PUNKTFUNK_COMPOSITOR_*`.",
        "operationId": "listCompositors",
        "responses": {
          "200": {
            "description": "Compositor backends with availability + the auto-detected default",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AvailableCompositor"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/diagnostics": {
      "get": {
        "tags": [
          "diagnostics"
        ],
        "summary": "Last cached health report",
        "description": "Probes run at startup and on `POST /diagnostics/refresh`.",
        "operationId": "getDiagnostics",
        "responses": {
          "200": {
            "description": "The current verdicts, worst-first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticsReport"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/diagnostics/refresh": {
      "post": {
        "tags": [
          "diagnostics"
        ],
        "summary": "Re-run every probe",
        "description": "Returns the new report. Poll GET; membership and udev rules only change\nafter the operator changes them.",
        "operationId": "refreshDiagnostics",
        "responses": {
          "200": {
            "description": "The refreshed verdicts, worst-first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiagnosticsReport"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/display/clients/{fingerprint}": {
      "get": {
        "tags": [
          "display"
        ],
        "summary": "Read one device's overlay",
        "description": "Absent fields follow the host policy; an unknown device answers with an empty\noverlay rather than 404 — \"follows host\" is a real answer, not a missing one.",
        "operationId": "getDisplayClient",
        "parameters": [
          {
            "name": "fingerprint",
            "in": "path",
            "description": "Pairing fingerprint (hex)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The device's overlay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientOverlay"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "put": {
        "tags": [
          "display"
        ],
        "summary": "Save one device's overlay",
        "description": "The operator writes the WHOLE overlay: a field absent from the body stops being pinned and\nthe device follows the host again. An overlay that pins nothing is dropped, which is the\nsame as `DELETE`. A paired device writes its pick on its own row while its access holds\n`GRANT_DISPLAY` (`0x100`): `screen` alone, keeping the row's `topology`, or `screen` with\n`topology` (`extend`, `primary` or `exclusive`). A monitor drops the row's topology, and a\nnull screen clears the device's pick. Its other fields stay, and it is answered 204.\n`set_by` records who last wrote the pick; the operator's write keeps it while the row's\nscreen and topology are unchanged.",
        "operationId": "setDisplayClient",
        "parameters": [
          {
            "name": "fingerprint",
            "in": "path",
            "description": "Pairing fingerprint (hex)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientOverlay"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Overlay stored; the new settings state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplaySettingsState"
                }
              }
            }
          },
          "204": {
            "description": "A device's pick stored"
          },
          "400": {
            "description": "Empty fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A device wrote another row or more than its screen and topology, or may not choose its screen (`screen_choice_not_granted`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The body is not an overlay, or a device's topology is not `extend`, `primary` or `exclusive`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Overlay could not be persisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "delete": {
        "tags": [
          "display"
        ],
        "summary": "Make one device follow the host again",
        "operationId": "deleteDisplayClient",
        "parameters": [
          {
            "name": "fingerprint",
            "in": "path",
            "description": "Pairing fingerprint (hex)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Overlay cleared; the new settings state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplaySettingsState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Overlay could not be cleared",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/display/layout": {
      "put": {
        "tags": [
          "display"
        ],
        "summary": "Arrange virtual displays",
        "description": "Persist per-identity-slot `(x, y)` offsets and switch the layout to manual. Applies on the next\nconnect (a live group re-applies on its next acquire). Locks current effective behavior into\nexplicit fields so arranging never silently changes keep-alive/topology/conflict/identity.\nSee `design/display-management.md`.",
        "operationId": "setDisplayLayout",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayLayoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Layout stored; the new settings state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplaySettingsState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Layout could not be persisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/display/monitors": {
      "get": {
        "tags": [
          "display"
        ],
        "summary": "Physical monitors",
        "description": "Heads this host has, for a capture-pin picker. Read-only; does not create, move, or disable.\nManaged virtual displays are `/display/state`. See `design/per-monitor-portal-capture.md`.",
        "operationId": "getDisplayMonitors",
        "responses": {
          "200": {
            "description": "The host's physical monitors",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/display/presets": {
      "get": {
        "tags": [
          "display"
        ],
        "summary": "List the saved custom presets",
        "description": "Named field-bundles in `display-presets.json`. Also on `GET /display/settings` as `custom_presets`.",
        "operationId": "listCustomPresets",
        "responses": {
          "200": {
            "description": "The saved custom presets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CustomPreset"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "post": {
        "tags": [
          "display"
        ],
        "summary": "Save a custom preset",
        "description": "Named bundle of the display-behavior axes. Host assigns a stable id in the body. Apply with\n`PUT /display/settings` carrying a `Custom` policy of its `fields` — no separate apply route.",
        "operationId": "createCustomPreset",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomPresetInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Preset created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomPreset"
                }
              }
            }
          },
          "400": {
            "description": "Empty name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/display/presets/{id}": {
      "put": {
        "tags": [
          "display"
        ],
        "summary": "Update a custom preset",
        "operationId": "updateCustomPreset",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The custom preset id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomPresetInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Preset updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomPreset"
                }
              }
            }
          },
          "400": {
            "description": "Empty name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No custom preset with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "display"
        ],
        "summary": "Delete a custom preset",
        "description": "Removes it from the catalog. The active policy is untouched — catalog and\n`display-settings.json` are decoupled.",
        "operationId": "deleteCustomPreset",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The custom preset id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Preset deleted"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No custom preset with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/display/release": {
      "post": {
        "tags": [
          "display"
        ],
        "summary": "Release kept virtual displays",
        "description": "Tear down lingering/pinned displays now. `slot` releases one; omit to release all.\nActive (streaming) displays are never torn down here — that is session control.",
        "operationId": "releaseDisplay",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReleaseDisplayRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The number of kept displays released",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseDisplayResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/display/settings": {
      "get": {
        "tags": [
          "display"
        ],
        "summary": "Display-management policy",
        "description": "Stored policy, preset expansions, and which options this build enforces.\nSee `design/display-management.md`.",
        "operationId": "getDisplaySettings",
        "responses": {
          "200": {
            "description": "Stored policy + preset expansions + enforced options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplaySettingsState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "put": {
        "tags": [
          "display"
        ],
        "summary": "Set the display-management policy",
        "description": "Persists (validated + clamped). Applies on the next connect/teardown; a running session keeps\nthe display it opened on. `keep_alive: forever` pins until `POST /display/release`.",
        "operationId": "setDisplaySettings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayPolicy"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Policy stored; the new state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplaySettingsState"
                }
              }
            }
          },
          "400": {
            "description": "Malformed policy body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Policy could not be persisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/display/state": {
      "get": {
        "tags": [
          "display"
        ],
        "summary": "Live virtual displays",
        "description": "Active (streaming), lingering (countdown to teardown), or pinned.\nSee `design/display-management.md`.",
        "operationId": "getDisplayState",
        "responses": {
          "200": {
            "description": "The live/kept virtual displays",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplayStateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/display/targets": {
      "get": {
        "tags": [
          "display"
        ],
        "summary": "Screen picker",
        "description": "The device's own screen, then each of the host's monitors with the device streaming it\nnow. A paired device also reads what it is set to and whether it may choose. A host with no\nmirror backend lists its own screen alone. `role` names the roles its own screen takes on\nthe desk.",
        "operationId": "getDisplayTargets",
        "responses": {
          "200": {
            "description": "What a device may stream",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisplayTargets"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/downloads": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "List downloads",
        "description": "Every title downloading, queued, paused, or finished in the last ten minutes, live ones\nfirst, with speed and time left while downloading.",
        "operationId": "getDownloads",
        "responses": {
          "200": {
            "description": "The downloads",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Download"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/emulators": {
      "get": {
        "tags": [
          "emulators"
        ],
        "summary": "List the emulators this host knows",
        "description": "Every catalog entry: whether this OS can install it, what hermir installed, and the copies\nthe user installed. A plugin may read this to find a managed copy's program.",
        "operationId": "getEmulators",
        "responses": {
          "200": {
            "description": "One row per catalog emulator",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmulatorStatus"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The catalog or the prefix could not be read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/emulators/catalog": {
      "get": {
        "tags": [
          "emulators"
        ],
        "summary": "Read the emulator registry",
        "description": "Every platform (names, aliases, extensions, folder shape) and every emulator as a library\nsees it: what it plays, whether this OS installs it, which platforms take saves, add-ons and\nfirmware. The facts a plugin needs to list games and pick an emulator.",
        "operationId": "getEmulatorRegistry",
        "responses": {
          "200": {
            "description": "The registry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmulatorRegistry"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The catalog could not be read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/emulators/{id}/adopt": {
      "post": {
        "tags": [
          "emulators"
        ],
        "summary": "Adopt a copy of an emulator",
        "description": "Points the host at a copy of the caller's own, one no rule finds (a portable build unpacked\nanywhere), so it is listed and launched like any other; `forget` drops it again. The\noperator's lane, and a seat's person on their seat host. On a person's own account only that\nperson adopts one: anyone else's copy would run as them.",
        "operationId": "adoptEmulator",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The catalog id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdoptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Adopted, or forgotten",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/EmulatorCopy"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Not a program on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A seat host on a person's own account, from any lane but that person's",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not in the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another install holds the prefix",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/emulators/{id}/content": {
      "post": {
        "tags": [
          "emulators"
        ],
        "summary": "Install a game's update or DLC",
        "description": "Hands the files to the best copy of the emulator the way it takes them: a folder it scans,\nits own installer, or a registration file. One step per file. An emulator with no way says\nwhy. A Windows seat host takes it from the operator alone.",
        "operationId": "installEmulatorContent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The catalog id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "One step per file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmulatorStep"
                  }
                }
              }
            }
          },
          "400": {
            "description": "A malformed platform or kind, no way to install it, or no copy on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A file outside the plugin's reach, or a Windows seat host's plugin asks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not in the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/emulators/{id}/firmware": {
      "get": {
        "tags": [
          "emulators"
        ],
        "summary": "Check a platform's firmware",
        "description": "Whether the best copy of the emulator has the platform's firmware, each file hashed against\nthe good dumps the catalog knows. `null` when the platform needs none. With `profile`, that\nseat's copy; a Linux seat answers once its host has checked it at a launch.",
        "operationId": "getEmulatorFirmware",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The catalog id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "description": "A catalog platform id or alias, like `ps2`",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "description": "A profile with a seat of its own: that seat's copies, on the host with the plugins",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The platform's firmware, or null",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/FirmwareStatusView"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "A malformed platform, or no copy on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not in the catalog, a profile with no seat, or a seat that hasn't checked it yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`profile` on a seat host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/emulators/{id}/install": {
      "post": {
        "tags": [
          "emulators"
        ],
        "summary": "Install an emulator",
        "description": "Fetches the emulator through its own release channel (Flatpak on Linux, the official\nportable build on Windows), verifies it, and places it under the host's emulator prefix.\nReinstalls an existing copy. Admin lane only.",
        "operationId": "installEmulator",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The catalog id, like `pcsx2`",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Installed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEmulator"
                }
              }
            }
          },
          "400": {
            "description": "Not offered on this OS, or never installed by policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not in the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another install holds the prefix",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The files could not be placed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "The release could not be fetched or verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/emulators/{id}/prepare": {
      "post": {
        "tags": [
          "emulators"
        ],
        "summary": "Prepare an emulator for a launch",
        "description": "Every copy of the emulator on this host answers its first-run questions (a setup wizard, a\nwelcome box) the way clicking through would, gets the platform's firmware — copied into\nits firmware folder, or installed by the emulator itself — and has this session's pads\nbound in seat order, which the host undoes when the game exits. Idempotent; each step says\nwhat it did, and a platform still missing its firmware says so. A Windows seat host takes it\nfrom the operator alone.",
        "operationId": "prepareEmulator",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The catalog id, like `pcsx2`",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrepareEmulatorRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "What each copy's preparation did",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PreparedCopy"
                  }
                }
              }
            }
          },
          "400": {
            "description": "A malformed platform, or a firmware folder that isn't one",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The firmware folder is outside the calling plugin's state directory, or a Windows seat host's plugin asks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not in the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The catalog or the firmware folder could not be read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/emulators/{id}/remove": {
      "post": {
        "tags": [
          "emulators"
        ],
        "summary": "Remove a managed emulator",
        "description": "Takes the release's files away and keeps the emulator's own data unless `purge` is set.\nA Flatpak is uninstalled. Grants on its folder stay until the operator forgets them.",
        "operationId": "removeEmulator",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The catalog id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveEmulatorRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not in the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another install holds the prefix",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Not installed by the host, or the files could not be removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/emulators/{id}/saves": {
      "get": {
        "tags": [
          "emulators"
        ],
        "summary": "List a platform's saves",
        "description": "The save units of the platform on the best copy of the emulator: name, kind, size and a\nstamp that changes with the save. A plugin needs the operator's save grant. With `profile`,\nthat seat's units; a Linux seat's are what its host exported at its last launch or exit. A\nWindows seat host lists them for the operator alone.",
        "operationId": "getEmulatorSaves",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The catalog id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "description": "A catalog platform id or alias, like `ps2`",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "game",
            "in": "query",
            "description": "The game's folder, for an emulator that keeps saves beside its games",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "description": "A profile with a seat of its own: that seat's copies, on the host with the plugins",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The save units",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SaveUnitView"
                  }
                }
              }
            }
          },
          "400": {
            "description": "A malformed platform, or no copy on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "No save grant, a game folder outside the plugin's reach, or a Windows seat host's plugin asks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not in the catalog, or a profile with no seat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`profile` on a seat host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/emulators/{id}/saves/export": {
      "post": {
        "tags": [
          "emulators"
        ],
        "summary": "Copy saves out",
        "description": "Writes each named unit into `dir`: the save file, or a tar of a save folder with nothing in\nits headers that differs between machines. A plugin's `dir` is inside its own state folder.\nWith `profile`, that seat's units; a Linux seat's files are its host's last export, and a\nunit it didn't export is left out. A Windows seat host takes it from the operator alone.",
        "operationId": "exportEmulatorSaves",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The catalog id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "description": "A profile with a seat of its own: that seat's copies, on the host with the plugins",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportUnitsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The files written",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExportedUnitView"
                  }
                }
              }
            }
          },
          "400": {
            "description": "A malformed platform or unit, or no copy on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "No save grant, a folder outside the plugin's reach, or a Windows seat host's plugin asks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not in the catalog, or a profile with no seat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`profile` on a seat host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/emulators/{id}/saves/import": {
      "post": {
        "tags": [
          "emulators"
        ],
        "summary": "Put saves back",
        "description": "Each unit goes where the emulator keeps it, in the first of its kinds with a place for its\nname; what was there is kept in hermir's save backups. A unit with no place yet is a step\nthat says so. A plugin's files are inside its own state folder. With `profile`, into that\nseat's copies; a Linux seat's host puts each back before its next game starts, and the step\nsays so. A Windows seat host takes it from the operator alone.",
        "operationId": "importEmulatorSaves",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The catalog id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile",
            "in": "query",
            "description": "A profile with a seat of its own: that seat's copies, on the host with the plugins",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportUnitsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "One step per unit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EmulatorStep"
                  }
                }
              }
            }
          },
          "400": {
            "description": "A malformed platform or unit, a missing file, or no copy on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "No save grant, a file outside the plugin's reach, or a Windows seat host's plugin asks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not in the catalog, or a profile with no seat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`profile` on a seat host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/events": {
      "get": {
        "tags": [
          "events"
        ],
        "summary": "Stream host lifecycle events (SSE)",
        "description": "`id:` is `seq`, `event:` is kind, `data:` is HostEvent JSON. Resume with `Last-Event-ID`\nor `?since=`; `event: dropped` means the ring no longer has that cursor — resync from REST.\n`event: live` follows the catch-up; frames after it happened after you connected.",
        "operationId": "streamEvents",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "description": "Resume cursor: only events with `seq` greater than this are sent (the ring keeps the newest ~1024). `Last-Event-ID` takes precedence.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "kinds",
            "in": "query",
            "description": "Comma-separated server-side kind filter: exact kinds (`pairing.pending`) or `domain.*` prefixes (`stream.*`).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "description": "SSE auto-reconnect cursor — the `id:` of the last received frame.",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream; each frame's `data:` is one HostEvent",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/HostEvent"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Concurrent event-stream cap reached — retry shortly",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/events/relay": {
      "post": {
        "tags": [
          "events"
        ],
        "summary": "Relay an event from the box's door",
        "description": "The door pairs and places, so `pairing.*`, `access.*`, `host.*`, `action.*` and `update.*`\nhappen there; this host's hooks run on them from here. A seat's `game.*` keeps its `seat`:\nthis host's plugins hear it, its hooks don't, and a `game.launching` with a `hold` answers\nonce the plugins that hold the stage are done. Admin lane only: the door holds this host's\ntoken. The event joins this host's bus as new.",
        "operationId": "relayEvent",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RelayedEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "The event is on this host's bus, and a seat's held launch is through this host's plugins"
          },
          "400": {
            "description": "Not a host event",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/game/end": {
      "post": {
        "tags": [
          "session"
        ],
        "summary": "End a launched game",
        "description": "Ends games nobody is streaming: those waiting out the reconnect window and\nlaunches left running after their session ended (`detached` in `GET /status`).\nWith `streaming`, also ends games still on a live session; the session itself\nstays up (`DELETE /session` plus `game_on_session_end`). `app_id` narrows it to\none title. A paired device ends only games it launched.",
        "operationId": "endGame",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EndGameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "How many games were ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndGameResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "This device's access has expired",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "No game in reach to end",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/game/holds/{token}/release": {
      "post": {
        "tags": [
          "session"
        ],
        "summary": "Release a seat's held launch",
        "description": "A seat host runs no plugins, so its `game.launching` carries a `hold` token and the launch\nwaits, up to the longest plugin hold plus 10 s, for the host with the plugins to call this\nonce they are done. Admin lane only: the door, or the Windows box host, holds the token.",
        "operationId": "releaseGameHold",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "description": "The `hold` of the seat's `game.launching`",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The launch goes ahead"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No launch waits on that token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/gpus": {
      "get": {
        "tags": [
          "gpu"
        ],
        "summary": "GPU inventory and selection",
        "description": "Preference changes apply to the next session; a running session keeps its GPU.",
        "operationId": "listGpus",
        "responses": {
          "200": {
            "description": "GPU inventory + selection state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GpuState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/gpus/preference": {
      "put": {
        "tags": [
          "gpu"
        ],
        "summary": "Set the GPU preference",
        "description": "`auto` = env pin else max VRAM on Windows, NVIDIA else the encode render node on Linux;\n`manual` pins capture+encode. Applies to the next session.\nAn absent preferred GPU falls back to auto rather than failing the session.",
        "operationId": "setGpuPreference",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetGpuPreference"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Preference stored; the new selection state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GpuState"
                }
              }
            }
          },
          "400": {
            "description": "Unknown mode, or `gpu_id` missing / not a listed GPU",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Preference could not be persisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/health": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "Liveness probe",
        "description": "Unauthenticated: `require_auth` exempts it.",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Host is up",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-scope": "host"
      }
    },
    "/api/v1/hooks": {
      "get": {
        "tags": [
          "hooks"
        ],
        "summary": "Get the hook configuration",
        "description": "Empty document when none is stored. On a seat host on a person's own account, empty on\nevery lane but that person's own: their hooks may carry their webhooks' secrets.",
        "operationId": "getHooks",
        "responses": {
          "200": {
            "description": "The stored hook configuration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HooksConfig"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      },
      "put": {
        "tags": [
          "hooks"
        ],
        "summary": "Replace the hook configuration",
        "description": "Whole-document PUT, not a patch. Applies from the next event. Commands run as the host\nuser (the interactive session on Windows). An `elevated` hook is refused until an\nadministrator turns elevated commands on at the host (`HostInfo.elevated_commands`). A\nseat host on a person's own account takes hooks from that person's own session alone, and\nruns only those. On a Windows seat that session names no `hmac_secret_file`.",
        "operationId": "setHooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HooksConfig"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Configuration stored; the new state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HooksConfig"
                }
              }
            }
          },
          "400": {
            "description": "Structurally invalid configuration, an `elevated` hook this host won't run, or a person's secret file on Windows",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A seat host on a person's own account, from any lane but that person's",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Configuration could not be persisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/host": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "Host identity and capabilities",
        "operationId": "getHostInfo",
        "responses": {
          "200": {
            "description": "Host identity, versions, codecs, and port map",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostInfo"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/host/audio/apps": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "List apps playing audio",
        "description": "Audio output streams on the host right now, by app. Empty on a host that cannot list them.",
        "operationId": "getPlayingApps",
        "responses": {
          "200": {
            "description": "Apps playing audio now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayingApps"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/host/settings": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "Get the host settings",
        "description": "Every setting this host acts on, with the value in force and what set it.",
        "operationId": "getHostSettings",
        "responses": {
          "200": {
            "description": "The settings, in page order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostSettingsState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      },
      "patch": {
        "tags": [
          "host"
        ],
        "summary": "Change host settings",
        "description": "Partial: only the named settings change, and `null` resets one. Every value is checked\nbefore anything is written. Applies per setting's `apply`: at once, the next session, or a\nrestart. `tray_autostart` rewrites the tray's autostart entry here.",
        "operationId": "patchHostSettings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HostSettingsPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored; the new state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostSettingsState"
                }
              }
            }
          },
          "400": {
            "description": "An unknown setting or a value it does not accept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The settings file could not be written",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/host/theme": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "Host desktop theme",
        "description": "The mode and accent colour of the desktop this host runs on, for a console that follows it.\nEvery field is nullable: \"no answer\" is a real state, and the console renders it as\n\"none detected\" rather than guessing.",
        "operationId": "getHostTheme",
        "responses": {
          "200": {
            "description": "The desktop's mode and accent, as far as this host can see",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostTheme"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/library": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "List every title this host knows, sorted by title.",
        "description": "Plugin-synced entries plus custom ones. Art the host can serve is rewritten to this API's\nart proxy, local paths and remote URLs alike; a URL the proxy already refused passes\nthrough. `?provider=` / `?platform=` (case-insensitive) narrow. `?as=` names a profile: the\nlibrary as it plays it, the box's with the profile's own layer on top, and each title it has\nlaunched carries its own numbers in `stats.mine`.\n\nThe operator lane sees hidden titles (`hidden: true`) so the console can un-hide them; with\n`as`, those the profile hides, and none the box hides. Every other lane is filtered upstream\nand cannot tell they exist.",
        "operationId": "getLibrary",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "description": "Only entries owned by this external provider",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "description": "Only entries on this platform (case-insensitive, e.g. `PS2`)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: the library as that profile plays it, its own play stats in `stats.mine`",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Unified library across all stores (the operator's lane also gets hidden entries, flagged)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OperatorGameEntry"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/art/{id}/{kind}": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "Stream one cover-art image for a library entry.",
        "description": "Resolves `kind` (`portrait` | `hero` | `logo` | `header`) for a catalog id and returns the\nbytes: a launcher's cover cache on the host disk, or a remote URL the host fetches once on\nthe first miss and then serves from its own store. Unknown id or kind is 404 so the client\ncan try the next candidate, and so is a URL the fetch refused — `GET /library` advertises\nthat one verbatim again. The response carries `Cache-Control` and an `ETag` of the bytes; a\nrequest whose `If-None-Match` names that tag gets 304 with no body. On a Linux door the\ncovers are in the owner's home, and the owner's host serves them while it runs. With `as`,\nthe art as that profile sees it: its own picks first.",
        "operationId": "getLibraryArt",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The store-qualified library id, e.g. `steam:570`",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "description": "`portrait` | `hero` | `logo` | `header`",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: the art as that profile sees it",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "description": "An `ETag` from an earlier response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes",
            "content": {
              "image/jpeg": {}
            }
          },
          "304": {
            "description": "The tag in `If-None-Match` is current"
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No art of that kind for that id, or `as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/custom": {
      "post": {
        "tags": [
          "library"
        ],
        "summary": "Create a custom title",
        "description": "A user-curated entry. The host assigns a stable id, returned in the body. On a seat host it is\nthat host's own title, under an `own:` id, kept in its own config folder and run as its\naccount; the box lists its name and picture for the seat's profile. On a profile that uses an\nexisting account only that person adds one, from their own session.",
        "operationId": "createCustomGame",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Entry created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomEntry"
                }
              }
            }
          },
          "400": {
            "description": "Empty title",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A field this lane may not set, or a seat on a person's own account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/custom/{id}": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One custom entry as stored, `detect` and `prep` included",
        "description": "Operator lane only: the hint names host paths, which is why the catalog read\nmodel leaves it out. The paired-cert allowlist names `GET /library` exactly. On a person's\nown account a title of its own is that person's alone to read: any other lane gets the 404.",
        "operationId": "getCustomGame",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The custom entry id (without the `custom:` prefix), or a seat host's own `own:` id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The stored entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomEntry"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No custom entry with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "put": {
        "tags": [
          "library"
        ],
        "operationId": "updateCustomGame",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The custom entry id (without the `custom:` prefix), or a seat host's own `own:` id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Entry updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomEntry"
                }
              }
            }
          },
          "400": {
            "description": "Empty title",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A plugin named a row its own provider does not publish",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No custom entry with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A seat host named a row of the box's",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "delete": {
        "tags": [
          "library"
        ],
        "operationId": "deleteCustomGame",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The custom entry id (without the `custom:` prefix), or a seat host's own `own:` id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Entry deleted"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A plugin named a row its own provider does not publish",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No custom entry with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A seat host named a row of the box's",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/hidden/{id}": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Hide or un-hide one library title.",
        "description": "Curation, not access control: the title leaves every play surface and launch resolution\nbut is not deleted. The operator console still lists it (`hidden: true`) so it can return.\nThe id is not required to exist now — a plugin mid-sync or an unmounted drive would\notherwise refuse a choice that should stick. With `as`, the hide is that profile's own; it\ncannot bring back a title the box hides. A paired device that is that locked profile's person\nmay set it too, hiding only a title the profile's library lists. Emits `library.changed` only\non a real change.",
        "operationId": "setLibraryEntryHidden",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The library entry id (e.g. `steam:70`)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: hide it for that profile only",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HiddenToggle"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored; the entry's visibility after the call",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HiddenState"
                }
              }
            }
          },
          "400": {
            "description": "Empty entry id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A device that isn't the person of the profile `as` names, or a plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host, or a device hides a title the profile's library doesn't list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/install/{id}": {
      "post": {
        "tags": [
          "library"
        ],
        "summary": "Install a title",
        "description": "Asks the plugin that lists the title to download it, or to resume a paused download. The\noperator always may; a paired device may when it holds the launch grant. Answers the\ndownload's row.",
        "operationId": "installLibraryEntry",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The library entry id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The plugin started or resumed the download",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Download"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "This device may not launch titles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such title",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Already installed, not a title a plugin installs, or the plugin refused (its sentence)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "The plugin didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "delete": {
        "tags": [
          "library"
        ],
        "summary": "Remove a title's files",
        "description": "The plugin deletes what it downloaded for the title; saves stay. Refused while the title\nruns or a launch waits for it. A paired device needs the manage-games grant.",
        "operationId": "uninstallLibraryEntry",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The library entry id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "This device may not manage games",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such title",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Running, downloading, not installed, or the plugin refused (its sentence)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "The plugin didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/install/{id}/cancel": {
      "post": {
        "tags": [
          "library"
        ],
        "summary": "Cancel a title's download",
        "description": "The plugin stops and discards what it downloaded.",
        "operationId": "cancelLibraryInstall",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The library entry id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Cancelled"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such title",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Not downloading or paused, or the plugin refused (its sentence)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "The plugin didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/install/{id}/pause": {
      "post": {
        "tags": [
          "library"
        ],
        "summary": "Pause a title's download",
        "description": "The plugin stops and keeps what it has; installing again resumes. The operator always may;\na paired device may when it holds the manage-games grant.",
        "operationId": "pauseLibraryInstall",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The library entry id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Paused"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "This device may not manage games",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such title",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Not downloading, or the plugin refused (its sentence)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "The plugin didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/metadata": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "List Art & Metadata sources",
        "description": "Every source that has pushed a result, in the operator's order, with its switches and how\nmany entries it has something for.",
        "operationId": "listLibraryMetadata",
        "responses": {
          "200": {
            "description": "Sources in the operator's order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MetadataSourceInfo"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Order and switch Art & Metadata sources",
        "description": "The array is the new order; each row sets `enabled` and `replace` (\"Use for every game\",\nart only). A source the array leaves out keeps its switches and goes after the named ones.\nEmits `library.changed`.",
        "operationId": "setLibraryMetadata",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MetadataSourceUpdate"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored; the sources in their new order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MetadataSourceInfo"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/metadata/{source}": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Replace an Art & Metadata source's result",
        "description": "Everything the source has, keyed by library id: art for the four slots and `GameMeta`\nfields. The host merges it into `GET /library` at read time; a source fills only what the\nentry lacks unless the operator set it to replace art. A value the host does not store is\ndropped, not refused. A new source takes its place in the order by `matching`, exact first.\nEmits `library.changed` with the source as `source` when anything changed.",
        "operationId": "putLibraryMetadata",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "The source's plugin id ([a-z0-9._-], `manual` reserved)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MetadataInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored; what the host kept",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Invalid source id or payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A plugin wrote another plugin's source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "delete": {
        "tags": [
          "library"
        ],
        "summary": "Forget an Art & Metadata source",
        "description": "Its result and its place in the order, for plugin uninstall. Emits `library.changed`\nwhen there was anything to forget.",
        "operationId": "deleteLibraryMetadata",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "The source's plugin id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Whether anything was removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataRemoved"
                }
              }
            }
          },
          "400": {
            "description": "Invalid source id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A plugin removed another plugin's source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/overrides": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "Read the game overrides",
        "description": "The shared overrides, each game's entry and each source's, as `library-overrides.json`\nholds them. `GET /library` carries what each title resolves to. With `as`, the profile's own\nfile: where it has an entry for a game or its source, that entry wins over the box's. Beside\nit, `box_sets`: the box's shared overrides it may point at, which only the console changes,\nand `box_games` and `box_sources`: the box's entries for what that profile's library lists.",
        "operationId": "getLibraryOverrides",
        "parameters": [
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: that profile's own overrides",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The shared overrides and every game's and source's entry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverridesAnswer"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/overrides/games/{id}": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Set one game's overrides",
        "description": "`{ \"set\": id }` points the game at a shared override; fields alone are its own values;\n`{ \"none\": true }` leaves it to the device, whatever the source sets; `{}` clears its entry,\nand the game takes its source's. The id is not required to exist now, as with hiding.\nWith `as`, the entry is that profile's own and `set` may name the box's shared override or\nthe profile's; `{}` hands the game back to the box's entry. A paired device that is that\nlocked profile's person may set it too, for a title the profile's library lists. Emits\n`library.changed`.",
        "operationId": "setGameOverrides",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The library entry id (e.g. `steam:70`)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: set it for that profile only",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OverrideEntry"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored; the game's entry after the call",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverrideEntry"
                }
              }
            }
          },
          "400": {
            "description": "Empty id, a value out of range, or `set` or `none` beside another field",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A device that isn't the person of the profile `as` names, or a plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`set` names no shared override, `as` names no profile on this host, or a device names a title the profile's library doesn't list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the overrides",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/overrides/sets": {
      "post": {
        "tags": [
          "library"
        ],
        "summary": "Create a shared override",
        "description": "A named set of stream settings that games and sources point at. The host assigns its id.\nWith `as`, it is that profile's own.",
        "operationId": "createOverrideSet",
        "parameters": [
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: create it for that profile",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GameOverrides"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created, with its id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverrideSet"
                }
              }
            }
          },
          "400": {
            "description": "No name, or a value out of range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another shared override has this name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the overrides",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/overrides/sets/{id}": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Change a shared override",
        "description": "A field left out keeps its value; `null` clears it. Every game and source that uses it\nfollows. With `as`, one of that profile's own. Emits `library.changed` for each source they\nbelong to.",
        "operationId": "updateOverrideSet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The shared override's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: one of that profile's own",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OverrideSetPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored; the shared override after the call",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverrideSet"
                }
              }
            }
          },
          "400": {
            "description": "No name left, or a value out of range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No shared override with that id, or `as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another shared override has this name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the overrides",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "delete": {
        "tags": [
          "library"
        ],
        "summary": "Delete a shared override",
        "description": "The games and sources that used it lose their entry and go back to what the device\ndecides. The answer counts them. With `as`, one of that profile's own, and only its entries\nlose theirs. Emits `library.changed` for each source they belong to.",
        "operationId": "deleteOverrideSet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The shared override's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: one of that profile's own",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted; how many games and sources used it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverrideUsers"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No shared override with that id, or `as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the overrides",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/overrides/sources/{source}": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Set one source's overrides",
        "description": "The same body as a game's, without `none`: `{}` clears the source's entry. Each title of\nthe source without an entry of its own takes it. With `as`, the entry is that profile's own\nand `set` may name the box's shared override or the profile's. A paired device that is that\nlocked profile's person, and that profile's person session, may set it too, for a source\nwith a title the profile's library lists. Emits `library.changed`.",
        "operationId": "setSourceOverrides",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "The source, the store part of a library id (e.g. `lutris`)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: set it for that profile only",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OverrideEntry"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored; the source's entry after the call",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverrideEntry"
                }
              }
            }
          },
          "400": {
            "description": "Empty source, a value out of range, `set` beside values, or `none`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A device that isn't the person of the profile `as` names, or a plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`set` names no shared override, `as` names no profile on this host, or a device or person names a source with no title in the profile's library",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the overrides",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/own": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "A seat host's own titles, as the box may see them",
        "description": "The custom entries this seat host keeps in its own config folder, each by its `own:` id,\ntitle, platform and `http(s)` art: never how it starts, and never a cover on its disk. The box\nasks when the seat's library changes and when the seat comes up, and lists them for the seat's\nprofile. A host that keeps none answers an empty list.",
        "operationId": "listOwnTitles",
        "responses": {
          "200": {
            "description": "This seat host's own titles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OwnTitle"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Store a seat's own titles for its profile",
        "description": "What a seat host's `GET /library/own` answered, for the profile `as` names, on the host that\nwrites the library: the door hands it here, and a Windows box stores its seats' itself. Rows\nare checked as an Art & Metadata source's are: a row with a bad id or title, a cover that isn't\n`http(s)` and a bad platform are dropped. An answer that isn't a list, lists more than 500 or\nnames an id twice is refused, and the stored titles stay. Emits `library.changed` on a change.",
        "operationId": "storeOwnTitles",
        "parameters": [
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: the profile whose seat answered",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/OwnTitle"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Stored"
          },
          "400": {
            "description": "Not an answer the box keeps",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not the admin lane",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`as` names no profile with a seat of its own",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the titles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/library/page": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One page of the library.",
        "description": "Title order, `limit` titles a page (60 when absent, 200 at most). `next_cursor` names the\nlast title sent; pass it back as `cursor` for the next page. It is a place in the order, not\nan offset: a title added or removed between two pages neither repeats nor skips one.\n`q` matches inside the title, any case. `provider`, `platform`, `role` (`game`,\n`launcher`) and `install` (`installed`, `missing`) narrow, and `id` names one title, for a\ncaller that needs only that entry. Lanes see what `GET /library` shows them, `as`\nincluded. `hidden=true` lists only hidden titles: every one on the operator's lane, and to\na device that is the person of the profile `as` names, the titles that profile hides. Any\nother caller gets the page it would get without it.",
        "operationId": "getLibraryPage",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Titles per page, 1 to 200. 60 when absent",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` of the page before",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Only titles containing this text, any case",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "description": "Only entries owned by this external provider",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "description": "Only entries on this platform (case-insensitive, e.g. `PS2`)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "role",
            "in": "query",
            "description": "`game` or `launcher`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "description": "Only the entry with this library id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "install",
            "in": "query",
            "description": "`installed` (on this host) or `missing` (not installed)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hidden",
            "in": "query",
            "description": "`true`: only hidden titles, each `hidden: true`. The operator's lane sees every one; a device that is the person of the profile `as` names sees the titles that profile hides. Ignored for any other caller",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: the library as that profile plays it, its own play stats in `stats.mine`",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page, the total and the platform counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryPage"
                }
              }
            }
          },
          "400": {
            "description": "The cursor isn't one this host issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/picks/{id}": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Pick the art for one slot of a library entry",
        "description": "The operator's choice beats the entry's own art and every metadata source, and survives\nthe provider's next reconcile. `url: null` clears the pick. The id is not required to\nexist now, as with hiding. With `as`, the pick is that profile's own and beats the box's for\nthe same slot. Emits `library.changed`.",
        "operationId": "setLibraryArtPick",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The library entry id (e.g. `steam:70`)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: pick it for that profile only",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArtPickInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored; the entry's picks after the call",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Artwork"
                }
              }
            }
          },
          "400": {
            "description": "Empty id, unknown kind, or a URL that is not http(s)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the picks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/provider/{provider}": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Replace a provider's entries",
        "description": "The payload is the desired set, keyed by `external_id`. The host diffs, keeps surviving\nhost ids stable, and drops orphans. Empty array removes everything this provider owns.\nEmits `library.changed` with the provider as `source` when its rows or claim change.\n\n`?store=` claims that store: entries surface as `<store>:<external_id>` with the store\nbadge. One provider per store; a second claimant gets 409. Release the claim with\n`DELETE`, not an empty reconcile — a store can have zero installed titles.",
        "operationId": "reconcileProviderEntries",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "description": "The provider id ([a-z0-9._-], `manual` reserved)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "store",
            "in": "query",
            "description": "Claim this store for the provider ([a-z0-9_-], `custom`/`own`/`manual` reserved)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ProviderEntryInput"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The provider's resulting entries (host ids assigned/kept)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CustomEntry"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid provider id, store id, or payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "That store is already claimed by another provider",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      },
      "delete": {
        "tags": [
          "library"
        ],
        "summary": "Delete a provider's entries",
        "description": "Everything owned by `{provider}`, for plugin uninstall. Emits `library.changed`\nwhen anything was removed.",
        "operationId": "deleteProviderEntries",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "description": "The provider id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How many entries were removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderRemoved"
                }
              }
            }
          },
          "400": {
            "description": "Invalid provider id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/library/provider/{provider}/downloads": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Report a provider's downloads",
        "description": "The body restates every title the plugin is downloading, has paused, or just finished,\nkeyed by `external_id`. Send it on change at most once a second, and every 5 s while any\nrow is `queued`, `downloading` or `installing`: a row not restated for 30 s counts as\nstalled, and a launch waiting on it gives up.",
        "operationId": "reportProviderDownloads",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "description": "The provider id ([a-z0-9._-], `manual` reserved)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DownloadsReport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The report was applied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadsAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Invalid provider id or payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A plugin reported another plugin's titles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/library/provider/{provider}/running": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Report which of a provider's titles are running.",
        "description": "Live counterpart to reconcile `detect` hints: the body is the complete running set\n([`crate::runstate`]). Missed events and plugin restarts self-correct on the next PUT.\n\nAuthoritative for [`crate::runstate::REPORT_TTL`] unless restated; a dead plugin then\nfalls back to process scanning. Re-report on change and on a timer inside the window.\nTitles the provider does not currently publish count as `unknown`, not an error — a\nreport may race its own reconcile.",
        "operationId": "reportProviderRunning",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "description": "The provider id ([a-z0-9._-], `manual` reserved)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderRunningInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The report was accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderRunningAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Invalid provider id or payload",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A plugin reported another plugin's titles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/library/scanners": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "List library sources",
        "description": "One row per installed library plugin, with its enable state. Sources default to\nenabled; disabling hides titles from the next read. The custom store is not a\nsource and is always on. Every row is\n`origin: \"plugin\"`. With `as`, a source is off when the box or the profile turned it off, and\n`off_by` says which.",
        "operationId": "listLibraryScanners",
        "parameters": [
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: the sources as that profile has them",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "This host's scanners with their enable state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScannerInfo"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/library/scanners/{id}": {
      "put": {
        "tags": [
          "library"
        ],
        "summary": "Enable or disable a library source.",
        "description": "Takes effect on the next library read. Disabling hides titles; the plugin may keep\nreconciling while off. Nothing is deleted. With `as`, the switch is that profile's own: it\nturns a source off for the profile, and cannot turn on one the box turned off. A paired device\nthat is that locked profile's person may set it too. Emits `library.changed` when the state\nchanges.",
        "operationId": "setLibraryScanner",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The scanner id (e.g. `steam`)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: switch it for that profile only",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScannerToggle"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Toggle stored; the full scanner list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScannerInfo"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "A plugin toggled another plugin's source or named a profile, or a device that isn't the person of the profile `as` names",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such scanner on this platform, or `as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/local/summary": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "Loopback tray summary",
        "description": "Bearer: `<config>/tray-token`, which every local account but a seat's may read; loopback only.",
        "operationId": "getLocalSummary",
        "responses": {
          "200": {
            "description": "Non-sensitive local host status (loopback peers only)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocalSummary"
                }
              }
            }
          },
          "401": {
            "description": "Non-loopback peer, or not the tray token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "This host minted no tray token (a seat host)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-scope": "host"
      }
    },
    "/api/v1/logs": {
      "get": {
        "tags": [
          "logs"
        ],
        "summary": "Read the log ring",
        "description": "In-memory, DEBUG and above, independent of `RUST_LOG`. Poll with `after` = last\n`next`. `dropped: true` means the ring wrapped between polls and entries were\nevicted.",
        "operationId": "logsGet",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "description": "Return entries with seq greater than this (omitted/0 = oldest retained)",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max entries per response (default and cap 1000)",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entries after the cursor, oldest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogPage"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/native/clients": {
      "get": {
        "tags": [
          "native"
        ],
        "summary": "List native paired clients",
        "operationId": "listNativeClients",
        "responses": {
          "200": {
            "description": "Paired native clients",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NativeClient"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "native"
        ],
        "summary": "Unpair every native client",
        "description": "One persisted write, not a loop (a mid-loop failure would half-empty the\nstore), and every live native session those clients own is stopped.\nIdempotent, so 200 rather than the single unpair's 204/404: an empty store\nstill succeeds, and `unpaired` tells the operator what it meant.",
        "operationId": "unpairAllNativeClients",
        "responses": {
          "200": {
            "description": "Every native client unpaired (possibly none)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnpairAllResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the paired-device list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Native host not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/native/clients/{fingerprint}": {
      "delete": {
        "tags": [
          "native"
        ],
        "summary": "Unpair a native client",
        "operationId": "unpairNativeClient",
        "parameters": [
          {
            "name": "fingerprint",
            "in": "path",
            "description": "Hex SHA-256 of the client certificate (case-insensitive)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Client unpaired"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No paired native client with that fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Native host not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "patch": {
        "tags": [
          "native"
        ],
        "summary": "Update a native client's access",
        "description": "Partial edit of grants/expiry. Omitted fields keep their current value;\nlive sessions pick it up immediately. 404 if the fingerprint is not paired\n— this is not a pair path.",
        "operationId": "updateNativeClientAccess",
        "parameters": [
          {
            "name": "fingerprint",
            "in": "path",
            "description": "Hex SHA-256 of the client certificate (case-insensitive)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNativeAccess"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Access updated; the stored record as now in force",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativeClient"
                }
              }
            }
          },
          "400": {
            "description": "Reserved grant bits set, or expires_in_secs together with clear_expiry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No paired native client with that fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the paired-device list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Native host not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/native/pair": {
      "get": {
        "tags": [
          "native"
        ],
        "summary": "Native pairing status",
        "description": "Poll while armed to show the PIN and countdown. `enabled: false` means\nthis process runs no native plane.",
        "operationId": "getNativePairing",
        "responses": {
          "200": {
            "description": "Native pairing status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativePairStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "native"
        ],
        "summary": "Disarm native pairing",
        "operationId": "disarmNativePairing",
        "responses": {
          "204": {
            "description": "Pairing disarmed"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Native host not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/native/pair/arm": {
      "post": {
        "tags": [
          "native"
        ],
        "summary": "Arm native pairing",
        "description": "Opens a window and mints a PIN. `grants` / `expires_in_secs` apply to\nwhichever device completes the ceremony.",
        "operationId": "armNativePairing",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArmNativePairing"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Pairing armed; the response carries the PIN to display",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativePairStatus"
                }
              }
            }
          },
          "400": {
            "description": "Reserved grant bits set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A seat host: devices pair with the box",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Native host not available in this process",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/native/pending": {
      "get": {
        "tags": [
          "native"
        ],
        "summary": "List devices awaiting pairing approval",
        "description": "Unpaired knocks while pairing is required. Approve to pair without a PIN.\nEntries expire after ~10 minutes.",
        "operationId": "listPendingDevices",
        "responses": {
          "200": {
            "description": "Devices awaiting approval (empty when none, or when the native host is not enabled)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingDevice"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/native/pending/{id}/approve": {
      "post": {
        "tags": [
          "native"
        ],
        "summary": "Approve a pending device",
        "description": "Pairs the fingerprint immediately (no PIN). `{}` keeps the knock name and\nstored access (full/permanent on first pairing). The response is the stored\nrecord, not necessarily this request's inputs.",
        "operationId": "approvePendingDevice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pending-request id from the pending list",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovePending"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Device paired; the stored record as now in force",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NativeClient"
                }
              }
            }
          },
          "400": {
            "description": "Reserved grant bits set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No pending request with that id (expired?)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Knock came from the internet, through the web client or from a page this host does not know; arm a fingerprint-bound PIN instead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the paired-device list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Native host not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/native/pending/{id}/deny": {
      "post": {
        "tags": [
          "native"
        ],
        "summary": "Deny a pending device",
        "description": "Drops the request. Not a blocklist — the next attempt knocks again.",
        "operationId": "denyPendingDevice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Pending-request id from the pending list",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Request dropped"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No pending request with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Native host not enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/pair": {
      "get": {
        "tags": [
          "pairing"
        ],
        "summary": "Pairing-flow status",
        "description": "Poll this to know when to prompt for the PIN Moonlight displays.",
        "operationId": "getPairingStatus",
        "responses": {
          "200": {
            "description": "Whether a pairing handshake is waiting for a PIN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/pair/pin": {
      "post": {
        "tags": [
          "pairing"
        ],
        "summary": "Submit the pairing PIN",
        "description": "Completes the out-of-band half of the handshake.",
        "operationId": "submitPairingPin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitPin"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "PIN delivered to the waiting handshake"
          },
          "400": {
            "description": "Malformed PIN or unparseable JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "No pairing handshake is waiting for a PIN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "Body is not application/json",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "JSON body does not match the schema",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/plugin-access": {
      "get": {
        "tags": [
          "plugin-access"
        ],
        "summary": "List every plugin's folder access",
        "description": "Admin lane only: grants, pending requests, and denials across all plugins.",
        "operationId": "getPluginAccess",
        "responses": {
          "200": {
            "description": "All plugins' access state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PluginAccessSnapshot"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not reachable on the plugin or device lane",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/plugin-access/requests": {
      "get": {
        "tags": [
          "plugin-access"
        ],
        "summary": "List this plugin's own access rows",
        "description": "Grants, pending requests, and denials for the calling plugin only.",
        "operationId": "getPluginAccessRequests",
        "responses": {
          "200": {
            "description": "The calling plugin's access state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginAccessSnapshot"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The shared runner token has no plugin identity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      },
      "post": {
        "tags": [
          "plugin-access"
        ],
        "summary": "Ask for folders this plugin cannot reach",
        "description": "Each path is validated against the real filesystem before it becomes a row the operator\nsees: `granted` (already reachable), `pending`, `denied` (a sticky no), or `refused:<rule>`.",
        "operationId": "requestPluginAccess",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Per-path outcomes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AccessPathOutcome"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The shared runner token has no plugin identity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The request could not be recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/plugin-access/{plugin}/decide": {
      "post": {
        "tags": [
          "plugin-access"
        ],
        "summary": "Grant, deny, or forget an access request",
        "description": "`allow` turns a pending request into a grant (the platform ACL lands first, so a failed\ngrant stores nothing), or with `write` set grants a path the operator handed over, on\nbehalf of `form` when named; `deny` remembers the no; `forget` removes a grant or denial.\nA folder that takes longer answers 202 and lists its walk until the record lands. On a seat\nhost the grant is for its own runner: a folder the seat's account can't list is refused, and\non Windows that account places the folder's access. On a person's own account only that person\ndecides, and an emulator or core install is refused, as it is to a Windows seat's person.",
        "operationId": "decidePluginAccess",
        "parameters": [
          {
            "name": "plugin",
            "in": "path",
            "description": "The plugin id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecideRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The plugin's access state after the decision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginAccessSnapshot"
                }
              }
            }
          },
          "202": {
            "description": "The folder's access is still changing; `walks` lists it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginAccessSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Invalid path or a limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not reachable on the plugin or device lane, or an install on a person's own account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No pending request for that path",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The decision could not be recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/plugin-access/{plugin}/release": {
      "post": {
        "tags": [
          "plugin-access"
        ],
        "summary": "Let a plugin form go of the paths it no longer hands over",
        "description": "`keep` is every path the form still holds. Each grant the form holds outside it loses the\nform, and a grant only forms made goes with its last one. The operator's own grants stay.",
        "operationId": "releasePluginAccess",
        "parameters": [
          {
            "name": "plugin",
            "in": "path",
            "description": "The plugin id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReleaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The plugin's access state after the release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginAccessSnapshot"
                }
              }
            }
          },
          "202": {
            "description": "The folder's access is still changing; `walks` lists it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginAccessSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Invalid form name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not reachable on the plugin or device lane",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The release could not be recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/plugins": {
      "get": {
        "tags": [
          "plugins"
        ],
        "summary": "List registered plugins",
        "description": "Live, secret-free directory. The console fetches the secret separately, server-side.",
        "operationId": "listPlugins",
        "responses": {
          "200": {
            "description": "Live plugin registrations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PluginSummary"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/plugins/logs": {
      "post": {
        "tags": [
          "plugins"
        ],
        "summary": "Ingest runner log lines",
        "description": "Plugins are not host children — their output never hits the host `tracing` subscriber. Lines\nshare the host ring as `plugin:<source>` so `GET /logs` needs no second cursor.",
        "operationId": "ingestPluginLogs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginLogBatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Lines ingested"
          },
          "400": {
            "description": "Batch too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/plugins/{id}": {
      "put": {
        "tags": [
          "plugins"
        ],
        "summary": "Register or renew a plugin",
        "description": "Idempotent lease renew (~30 s). Emits `plugins.changed` only when an operator-visible field\nchanged; a pure renewal is silent.",
        "operationId": "registerPlugin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The plugin id (its `definePlugin` name: `[a-z][a-z0-9-]*`)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginRegistration"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Registered / renewed"
          },
          "400": {
            "description": "Invalid id or registration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      },
      "delete": {
        "tags": [
          "plugins"
        ],
        "summary": "Deregister a plugin",
        "description": "Immediate remove (SDK finalizer on SIGTERM). Emits `plugins.changed` only for a live entry;\nunknown/expired is a silent 204.",
        "operationId": "deregisterPlugin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The plugin id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deregistered (or already absent)"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/plugins/{id}/ui-credential": {
      "get": {
        "tags": [
          "plugins"
        ],
        "summary": "Fetch a plugin UI's proxy credential",
        "description": "Server-side `{port, secret}` for the console proxy. The console BFF denylists this from the\nbrowser.",
        "operationId": "getPluginUiCredential",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The plugin id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The proxy credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UiCredential"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No live plugin with that id, or it serves no UI",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/plugins/{id}/ui/attach": {
      "get": {
        "tags": [
          "plugins"
        ],
        "summary": "Attach a plugin UI channel",
        "description": "`Upgrade: punktfunk-ui` from the plugin, on its own pipe. The connection is kept for the\nconsole's next request to the plugin's page, which the host sends down it as plain HTTP.",
        "operationId": "attachPluginUi",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The plugin id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "The connection is parked for the plugin's page"
          },
          "400": {
            "description": "Not an `Upgrade: punktfunk-ui` request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not this plugin's own identity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/profiles": {
      "get": {
        "tags": [
          "profiles"
        ],
        "summary": "List the profiles with what the console manages",
        "description": "On the plugin lane each row is `id`, `display_name` and `avatar` alone.",
        "operationId": "listProfiles",
        "responses": {
          "200": {
            "description": "The profiles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProfileAdmin"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "This host has no profiles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "post": {
        "tags": [
          "profiles"
        ],
        "summary": "Add a profile",
        "description": "A seat profile (the default) gets a desktop of its own, whose account is made here, or runs\non `seat_account`, an existing account, once `seat_password` is its password: a local account\non Windows Server, a person's own login on a Linux door. A Linux row never starts while that\nperson sits at the machine, and the host keeps no password. One with `seat: false` plays the\nbox's own session under its own name. A seat needs seats on (Windows) or the door (Linux).",
        "operationId": "createProfile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The new profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileAdmin"
                }
              }
            }
          },
          "400": {
            "description": "No name, an accent that is not #RRGGBB, an unknown account, or a password missing or refused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another profile has that name or account, seats are off (Windows), the door is off (Linux), or an account a seat can't use (an administrator, a system account, the box owner)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The box already has eight profiles, or four seats",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Too many wrong passwords for that account; the sentence says when to try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/default": {
      "put": {
        "tags": [
          "profiles"
        ],
        "summary": "Where a device that names no profile lands",
        "operationId": "setDefaultProfile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DefaultProfile"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Set"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/doctor": {
      "get": {
        "tags": [
          "profiles"
        ],
        "summary": "Check the seats",
        "description": "The supervisor's own report: Windows, Remote Desktop, the seat display driver, Steam, and\neach seat's account, Steam, state and ports, each row one sentence with the next move.\nAdmin lane only.",
        "operationId": "getSeatsDoctor",
        "responses": {
          "200": {
            "description": "The report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeatsDoctor"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "This host has no seats to check",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor doesn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/door": {
      "put": {
        "tags": [
          "profiles"
        ],
        "summary": "Turn Reachable without logging in on or off",
        "description": "Linux. On moves the box's host to a system service that runs from boot, places every connect\non a seat of the box and keeps the box's files in `/var/lib/punktfunk`; the owner plays on a\nseat of their own. Off hands the door's own settings to the owner's host, then puts the files\nand the host back. The answer is 202 once the switch is\nqueued: the console reloads and polls `GET /host`, whose `door` says which host answers. The\nowner's user must be in the `punktfunk-update` group. Admin lane only.",
        "operationId": "setDoor",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DoorChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "The switch is under way; poll `GET /host` for `door`"
          },
          "204": {
            "description": "The host is already so"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The owner's user isn't in the punktfunk-update group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Not a Linux host, or this install lacks the switch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "The owner's host didn't take the door's settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "systemd didn't take the switch, or the owner's host is starting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/enumerate": {
      "get": {
        "tags": [
          "profiles"
        ],
        "summary": "List the profiles a device can pick",
        "description": "The profiles the asking device may open, the owner first, and the locked ones that take a\nPIN; the console lists every profile. A client shows this as its picker. Each row's `unlock`\nsays what the asking device sends with its connect: a profile on a person's own Linux account\nneeds the account's password, or a key proof from a device that enrolled one, until the\ndevice is signed in to its running desktop; a locked profile whose list lacks the device\nneeds its PIN. `person` marks the rows whose own library view this device may change now.",
        "operationId": "enumerateProfiles",
        "responses": {
          "200": {
            "description": "The profiles",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProfilePublic"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "This host has no profiles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/pads": {
      "get": {
        "tags": [
          "profiles"
        ],
        "summary": "List the controllers plugged into this PC",
        "description": "Every game controller plugged into the PC that can be given to a profile, and every one a\nprofile holds, plugged in or not. A keyboard, a mouse or any other device is never listed.\nA host that can't give controllers away answers `supported: false`. Admin lane only.",
        "operationId": "listDeskPads",
        "responses": {
          "200": {
            "description": "The controllers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeskPads"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/pads/{key}": {
      "put": {
        "tags": [
          "profiles"
        ],
        "summary": "Give a controller to a profile, or back to this PC",
        "description": "With a profile: only that profile's seat sees the controller, from its next start or at once\nwhen it runs, and this PC's own desktop and every other seat stop seeing it. With `null`: it\nplays at this PC's desktop again. Either way the controller reconnects once. A controller a\nprofile holds stays that profile's while it is unplugged; giving one away needs it plugged\nin. Answers the list as it is after. Admin lane only.",
        "operationId": "setDeskPadHolder",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "description": "The controller's key, from the list",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeskPadHolder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The controllers, after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeskPads"
                }
              }
            }
          },
          "400": {
            "description": "Not a controller's key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The profile has no seat, holds four controllers already, the controller isn't plugged in or isn't a game controller, or this host can't give controllers away",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer, or couldn't hand the controller over",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/seating": {
      "get": {
        "tags": [
          "profiles"
        ],
        "summary": "Whether seats are on",
        "description": "Windows reports whether the box's seats are on and what turning them on needs: Windows\nServer, the Remote Desktop Session Host role, licensing and a graphics card. A Linux door\nreports its supervisor's checks with `platform: linux`. Other hosts answer `enabled: false`\nwith `platform: other`. Admin lane only.",
        "operationId": "getSeating",
        "responses": {
          "200": {
            "description": "Seats now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seating"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor doesn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "put": {
        "tags": [
          "profiles"
        ],
        "summary": "Turn seats on or off",
        "description": "On runs the checks, installs the seat display driver, turns Remote Desktop on for this\nmachine and records its certificate. With `prepare` it first installs the Session Host role\nand sets licensing to Per User where they are missing. A check that fails changes nothing:\nthe answer is 200 with `enabled: false` and the failed check as an `error`. The driver\nreplaces the display of every Remote Desktop session on the machine. Off stops every seat,\nkeeps their accounts and restores what on changed. Admin lane only.",
        "operationId": "setSeating",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SeatingChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Seats as they are after the change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seating"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "This host has no seats to turn on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor doesn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/windows-accounts": {
      "get": {
        "tags": [
          "profiles"
        ],
        "summary": "Windows accounts a new profile can bind to",
        "description": "The enabled local Windows accounts on this PC that no profile holds: none a seat signs in to,\nnone a take-turns profile uses, none of punktfunk's own seat accounts. Empty on every other\nOS. The console's **Add profile** reads this for **Own account (take turns)** and for **Own\ndesktop** on an existing account.",
        "operationId": "windowsAccounts",
        "responses": {
          "200": {
            "description": "Bindable local Windows account names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}": {
      "put": {
        "tags": [
          "profiles"
        ],
        "summary": "Rename, recolour or rehome a profile",
        "description": "`seat_password` gives a seat on an existing Windows account that account's new password.\nThe seat supervisor checks it with Windows before it keeps it, then the rest applies.",
        "operationId": "updateProfile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileAdmin"
                }
              }
            }
          },
          "400": {
            "description": "An empty name, an accent that is not #RRGGBB, or a password Windows refused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another profile has that name, or a password for a profile with no existing Windows account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "profiles"
        ],
        "summary": "Remove a profile",
        "description": "Sessions playing as it end with `SEAT_UNAVAILABLE`. With `erase`, its Steam home and picture\ngo too; without, the home stays. A Windows seat's account goes with its profile, and an\nexisting account a seat signs in to is released and stays; removing either needs `erase`.",
        "operationId": "deleteProfile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "erase",
            "in": "query",
            "description": "Also delete its Steam home and picture.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The owner profile can't be removed, or a Windows seat's without `erase`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer (Windows)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/avatar": {
      "get": {
        "tags": [
          "profiles"
        ],
        "summary": "A profile's picture",
        "description": "The stored image with an `ETag` of its bytes; a request whose `If-None-Match` names that tag\ngets 304 with no body.",
        "operationId": "getProfileAvatar",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "description": "An `ETag` from an earlier response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes",
            "content": {
              "image/png": {}
            }
          },
          "304": {
            "description": "The tag in `If-None-Match` is current"
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No picture for that profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "put": {
        "tags": [
          "profiles"
        ],
        "summary": "Set a profile's picture",
        "description": "PNG, JPEG or WebP, at most 1 MiB. The console crops it square first.",
        "operationId": "setProfileAvatar",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "image/png": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32",
                  "minimum": 0
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Stored"
          },
          "400": {
            "description": "Not a PNG, JPEG or WebP image, or over 1 MiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "profiles"
        ],
        "summary": "Remove a profile's picture",
        "operationId": "deleteProfileAvatar",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/devices": {
      "get": {
        "tags": [
          "profiles"
        ],
        "summary": "List the devices signed in to a profile",
        "description": "For a profile on a person's own Linux account: each device that unlocked it, and how it gets\nback on. For any other profile: the devices its lock lets in, the same rows, kept while it is\nopen. Admin lane only.",
        "operationId": "listProfileDevices",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The signed-in devices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SignedInDevice"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A profile on the owner's lock, or a lock file that doesn't read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "post": {
        "tags": [
          "profiles"
        ],
        "summary": "Let a paired device open a profile",
        "description": "Puts a device paired with this host, Punktfunk or Moonlight, on the profile's list until it\nis signed out. Answers the list. Admin lane only.",
        "operationId": "addProfileDevice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileDeviceAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The profile's devices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SignedInDevice"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not a device fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such profile, or no paired device with that fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A person's own account, a profile on the owner's lock, or a lock file that doesn't read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The list is full",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "profiles"
        ],
        "summary": "Sign every device out of a profile",
        "description": "For a profile on a person's own Linux account: every device needs the account's password\nagain and every unlock key is forgotten. For any other: its lock's list empties, and every\nsession on it from a device off the list ends. Admin lane only.",
        "operationId": "signOutProfileDevices",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Signed out"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A profile on the owner's lock, or a lock file that doesn't read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/devices/{fingerprint}": {
      "delete": {
        "tags": [
          "profiles"
        ],
        "summary": "Sign a device out of a profile",
        "description": "For a profile on a person's own Linux account: the device needs the account's password again\nand its unlock key is forgotten. For any other: the device leaves its lock's list, and a\nsession it plays there ends. Admin lane only.",
        "operationId": "signOutProfileDevice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fingerprint",
            "in": "path",
            "description": "The device's certificate SHA-256, lowercase hex",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Signed out"
          },
          "400": {
            "description": "Not a device fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A profile on the owner's lock, or a lock file that doesn't read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/end": {
      "post": {
        "tags": [
          "profiles"
        ],
        "summary": "End the session on a profile's seat",
        "description": "Disconnects whoever plays there and keeps the seat running for the next connect.",
        "operationId": "endProfileSession",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The profile, its seat free",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileAdmin"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The profile has no seat of its own",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat's host didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/lock": {
      "get": {
        "tags": [
          "profiles"
        ],
        "summary": "Read a profile's lock",
        "description": "Whether it is locked, whether it has a PIN, and the wrong PINs counted against it. Its\ndevices are `GET /profiles/{id}/devices`. Admin lane only.",
        "operationId": "getProfileLock",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The lock",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileLock"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A person's own account, a profile on the owner's lock, or a lock file that doesn't read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "post": {
        "tags": [
          "profiles"
        ],
        "summary": "Lock a profile",
        "description": "From now its list is exactly `devices`, paired devices, so a lock keeps the ones someone\nplays on, and with `pin` that is its PIN; a session from any other device ends. One step: on\nany refusal nothing changed. On a profile already locked it changes nothing and takes only\ndevices the profile lets in and no PIN, so it never widens who opens it: the device and PIN\nroutes change a locked profile. Admin lane only.",
        "operationId": "lockProfile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Its devices and PIN; an empty list and the PIN it has when absent",
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LockProfile"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Locked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileLock"
                }
              }
            }
          },
          "400": {
            "description": "Not a device fingerprint, or a PIN that isn't 4 to 8 digits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such profile, or no paired device with a fingerprint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A person's own account, a profile on the owner's lock, a lock file that doesn't read, or a locked profile asked for another device or a PIN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "profiles"
        ],
        "summary": "Unlock a profile",
        "description": "Every paired device opens it again. Its list and its PIN stay for the next lock. Admin lane\nonly.",
        "operationId": "unlockProfile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileLock"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A person's own account, a profile on the owner's lock, or a lock file that doesn't read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/lock/pin": {
      "put": {
        "tags": [
          "profiles"
        ],
        "summary": "Set a profile's PIN",
        "description": "While it is locked, a device off its list opens it with this PIN, and the PIN puts it on the\nlist. Replaces any PIN it had. Admin lane only.",
        "operationId": "setProfilePin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfilePin"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileLock"
                }
              }
            }
          },
          "400": {
            "description": "Not 4 to 8 digits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A person's own account, a profile on the owner's lock, or a lock file that doesn't read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      },
      "delete": {
        "tags": [
          "profiles"
        ],
        "summary": "Clear a profile's PIN",
        "description": "While it is locked, only the devices on its list open it. Admin lane only.",
        "operationId": "clearProfilePin",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cleared",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileLock"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A person's own account, a profile on the owner's lock, or a lock file that doesn't read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/start": {
      "post": {
        "tags": [
          "profiles"
        ],
        "summary": "Start a profile's seat",
        "description": "The console's **Start**: as `wake`, from the console. A profile on a person's own Linux\naccount is refused: only its person's password at connect starts it.",
        "operationId": "startProfileSeat",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The profile, its seat `starting`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileAdmin"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The profile has no seat of its own, or opens with its account password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/stop": {
      "post": {
        "tags": [
          "profiles"
        ],
        "summary": "Stop a profile's seat",
        "description": "Logs the seat off; whoever plays there is disconnected. The next pick starts it again.",
        "operationId": "stopProfileSeat",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The profile, its seat stopped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileAdmin"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The profile has no seat of its own",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/unlock-challenge": {
      "post": {
        "tags": [
          "profiles"
        ],
        "summary": "Ask for a key unlock's challenge",
        "description": "For a device that enrolled an unlock key: 32 random bytes for the key to sign, and what the\nsigned message names, the seat id for a profile on a person's own Linux account or the\nprofile id for a locked profile. It is good for one proof within two minutes, and a new one\nreplaces it. A device without a key is refused; it unlocks with the account's password or the\nprofile's PIN. Paired devices only.",
        "operationId": "unlockChallenge",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The challenge",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnlockChallenge"
                }
              }
            }
          },
          "400": {
            "description": "This machine's identity changed: unlock with the password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not a paired device",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "This device has no unlock key for the profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "The seat supervisor didn't answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/profiles/{id}/wake": {
      "post": {
        "tags": [
          "profiles"
        ],
        "summary": "Get a profile's seat ready",
        "description": "Starts a stopped seat so the next connect lands in it, and answers at once with the seat\n`starting`; poll `enumerate` until it is `ready`. A profile with no seat to start only gets\nits row back. A paired device wakes the profile it lands in when it names none; any other\nneeds its launch grant, and a locked one a device on its list. A profile on a person's own\nLinux account is never woken: its desktop starts when the connect brings the account's\npassword.",
        "operationId": "wakeProfile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The profile, its seat as it is now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfilePublic"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "This device may not start that profile's seat",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No profile with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "The profile opens with its account password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/session": {
      "delete": {
        "tags": [
          "session"
        ],
        "summary": "Stop the session",
        "description": "A deliberate stop: skip keep-alive linger and apply `game_on_session_end`.",
        "operationId": "stopSession",
        "parameters": [
          {
            "name": "reason",
            "in": "query",
            "description": "Why the host stops. `power` closes every session the way a power action does, so clients\nread that the host is going down; the box's door sends it to its seat hosts. A host that\npredates it, and any other value, stop plainly.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Session stopped (or none was active)"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/session/idr": {
      "post": {
        "tags": [
          "session"
        ],
        "operationId": "requestIdr",
        "responses": {
          "202": {
            "description": "Keyframe requested"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "No active video stream",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/session/last": {
      "get": {
        "tags": [
          "session"
        ],
        "summary": "Recently finished sessions",
        "description": "What each session came to — mode, codec, bitrate, frames, bring-up, and why it ended\n— newest first, at most the last eight. This is the whole of what the host knows, so\nthe answer is what a bug report should carry.\n\nA host that has not streamed since it started answers with an empty list.",
        "operationId": "getRecentSessions",
        "responses": {
          "200": {
            "description": "Finished sessions, newest first; empty if none",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecentSessions"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/session/settings": {
      "get": {
        "tags": [
          "session"
        ],
        "operationId": "getSessionSettings",
        "parameters": [
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: what that profile's own seat plays with",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stored settings + which axes this build enforces",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionSettingsState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "`as` names a profile that plays on the host's own desktop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "put": {
        "tags": [
          "session"
        ],
        "summary": "Set the session policy",
        "description": "Persisted clamped. Takes effect on the next decision, including a session\nalready streaming — policy is read at session end, not start. With `as`, the settings of\nthat profile's own seat; a profile on the host's own desktop has none of its own. A paired\ndevice that is that locked profile's person may set them too.",
        "operationId": "setSessionSettings",
        "parameters": [
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: set what that profile's own seat plays with",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settings stored; the new state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionSettingsState"
                }
              }
            }
          },
          "400": {
            "description": "Malformed settings body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "`as` on a plugin's lane, or a device that isn't the person of the profile `as` names",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A seat's own host, or `as` names a profile that plays on the host's own desktop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the session settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      },
      "delete": {
        "tags": [
          "session"
        ],
        "summary": "Drop a profile's own session settings",
        "description": "Its seat plays with the box's Seat defaults again; the answer is what `GET` with the same\n`as` answers, `configured: false`. Dropping settings a profile never had is the same answer.\n`as` is required: the host's own settings are changed with `PUT`, never dropped. A paired\ndevice that is that locked profile's person may drop them too.",
        "operationId": "clearSessionSettings",
        "parameters": [
          {
            "name": "as",
            "in": "query",
            "description": "Profile id: the profile whose own settings to drop",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dropped; the profile's state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionSettingsState"
                }
              }
            }
          },
          "400": {
            "description": "No `as`, or `as` names the owner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "`as` on a plugin's lane, or a device that isn't the person of the profile `as` names",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "`as` names no profile on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "A seat's own host, or `as` names a profile that plays on the host's own desktop",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't remove the settings file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-data"
      }
    },
    "/api/v1/session/{id}": {
      "delete": {
        "tags": [
          "session"
        ],
        "summary": "Stop one session",
        "description": "Same deliberate stop as `DELETE /session`, for the one id. Every other live\nsession keeps streaming.",
        "operationId": "stopOneSession",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Session id from `GET /status`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Session stopped"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No live session with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/session/{id}/access": {
      "put": {
        "tags": [
          "session"
        ],
        "summary": "Change one session's access level",
        "description": "Re-points the LIVE grant set — the mask the input thread already checks every\nevent against — so a guest gets the pad, or loses it, without reconnecting.\nThe pairing's stored access is untouched, and a later edit to it wins.\n\nThe ceiling is the pairing's own mask: what is asked for is ANDed with it, so this\nroute can narrow or restore, never grant a device something it was not paired for.\nThe applied mask comes back, which is how a caller sees the clamp.",
        "operationId": "setSessionAccess",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Session id from `GET /status`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionAccessRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Applied mask, after the pairing clamp",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionAccess"
                }
              }
            }
          },
          "400": {
            "description": "No level or grants, an unknown level, or reserved bits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No live session with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/session/{id}/audio": {
      "put": {
        "tags": [
          "session"
        ],
        "summary": "Mute or unmute one session",
        "description": "Drops this session's audio at the wire, nothing else: the capturer and the sink\nstay up, so a session sharing the display keeps hearing. The client is told, so\nits overlay can name the silence instead of the player guessing.",
        "operationId": "setSessionAudio",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Session id from `GET /status`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionAudioRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Applied"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No live session with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/session/{id}/idr": {
      "post": {
        "tags": [
          "session"
        ],
        "summary": "Request a keyframe on one session",
        "operationId": "requestSessionIdr",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Session id from `GET /status`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Keyframe requested"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No live session with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/session/{id}/pads": {
      "get": {
        "tags": [
          "session"
        ],
        "summary": "Watch this session's pads (SSE)",
        "description": "One frame per pad state the host applies — what it injects, not what the client\nsays it sent — so a controller question is answered from the host's own hand\ninstead of an evdev dump. `data:` is a [`PadFrame`]; `event:` is `pad.state`.\nAttaching replays every live pad, so a button already held draws at once.\n\nConsole lane only: a paired certificate is not bound to a session id, and this\nis the operator's own machine watching its own input.\n\nNothing is published while nobody is attached, so a console on another page —\nor none at all — costs the input thread one atomic load per pad event.",
        "operationId": "streamSessionPads",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Session id from `GET /status`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream; each frame's `data:` is one PadFrame",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/PadFrame"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No live session with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Concurrent event-stream cap reached — retry shortly",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/session/{id}/player": {
      "put": {
        "tags": [
          "session"
        ],
        "summary": "Place one session's player slot",
        "description": "Which controller this session is: slot 0 is Player 1, and a local co-op game\nreads that order. Without a pick the slot is whichever comes free, so the pad\nthat moves first takes Player 1 and the order changes on every reconnect.\n\nThe pick is a reservation, not a seizure. A pad already built keeps the slot it\nwas created under until it re-plugs; a slot another live session asked for first\nstays theirs and this call answers `reserved: false`. It is remembered against\nthe device's pairing, so the same device reconnects as the same player — an\nanonymous session's pick lasts only as long as the session.",
        "operationId": "setSessionPlayer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Session id from `GET /status`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionPlayerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The pick, and whether it took the slot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionPlayer"
                }
              }
            }
          },
          "400": {
            "description": "Slot past the host's pad count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No live session with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/stats/capture/live": {
      "get": {
        "tags": [
          "stats"
        ],
        "operationId": "statsCaptureLive",
        "responses": {
          "200": {
            "description": "The in-progress capture (meta + samples so far)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Capture"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No capture is currently recording",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/stats/capture/start": {
      "post": {
        "tags": [
          "stats"
        ],
        "summary": "Arm a capture. Idempotent if one is already running.",
        "description": "Streaming loops emit aggregated samples every 1–2 s into the in-progress\ncapture (`GET /stats/capture/live`).",
        "operationId": "statsCaptureStart",
        "responses": {
          "200": {
            "description": "Capture armed (or already running)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/stats/capture/status": {
      "get": {
        "tags": [
          "stats"
        ],
        "operationId": "statsCaptureStatus",
        "responses": {
          "200": {
            "description": "In-progress capture status (idle when not armed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/stats/capture/stop": {
      "post": {
        "tags": [
          "stats"
        ],
        "summary": "Disarm and write the capture to disk atomically.",
        "operationId": "statsCaptureStop",
        "responses": {
          "200": {
            "description": "Capture stopped and saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaptureMeta"
                }
              }
            }
          },
          "204": {
            "description": "Nothing was recording"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't save the recording",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/stats/recordings": {
      "get": {
        "tags": [
          "stats"
        ],
        "summary": "List saved captures",
        "description": "Summaries only (`meta`, no sample body), newest first.",
        "operationId": "statsRecordingsList",
        "responses": {
          "200": {
            "description": "Saved capture summaries, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CaptureMeta"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/stats/recordings/{id}": {
      "get": {
        "tags": [
          "stats"
        ],
        "operationId": "statsRecordingGet",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The recording id (its filename stem)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The full capture",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Capture"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No recording with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "The recording file is unreadable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      },
      "delete": {
        "tags": [
          "stats"
        ],
        "operationId": "statsRecordingDelete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The recording id (its filename stem)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Recording deleted"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No recording with that id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Couldn't delete the recording",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/status": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "Live host status",
        "operationId": "getStatus",
        "responses": {
          "200": {
            "description": "Streaming/pairing state and the active session, if any",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "host"
      }
    },
    "/api/v1/store/catalog": {
      "get": {
        "tags": [
          "store"
        ],
        "summary": "Browse the plugin catalog",
        "description": "Merged view across sources, annotated with what this host has and can run. A source past its\nfreshness window is refreshed first; a miss keeps the last copy marked `stale` — the pin\ntravelled with the entry.",
        "operationId": "getPluginCatalog",
        "responses": {
          "200": {
            "description": "The merged catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/store/install": {
      "post": {
        "tags": [
          "store"
        ],
        "summary": "Install a plugin",
        "description": "`{source, id}` installs the catalog pin after re-checking integrity, or `{spec,\naccept_unverified: true}` installs unreviewed code the operator owns. `202` + job id; watch at\n`GET /store/jobs/{id}`. A seat host installs into the seat's own plugins, which its own runner\nruns as the seat's account. On a person's own account it installs for that person's own\nsession, from the built-in source alone: what it installs runs as them. A Windows seat's\nperson installs from the built-in source alone too.\n\nOne package operation at a time (`409` otherwise): `bun` shares a lockfile and `node_modules`.",
        "operationId": "installPlugin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InstallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Install job started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobRef"
                }
              }
            }
          },
          "400": {
            "description": "Unknown entry, bad spec, or missing acknowledgement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token, or a plugin from outside the built-in source on a seat host on a person's own account or for a Windows seat's person",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another package operation is in flight",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/store/installed": {
      "get": {
        "tags": [
          "store"
        ],
        "summary": "List installed plugins",
        "description": "Plugins-dir packages, with provenance and live registration. No provenance record means CLI\ninstall (`tier: \"cli\"`); absence is the answer, not a gap.",
        "operationId": "listInstalledPlugins",
        "responses": {
          "200": {
            "description": "Installed plugin packages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InstalledView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/store/jobs": {
      "get": {
        "tags": [
          "store"
        ],
        "summary": "List recent package jobs",
        "operationId": "listPluginJobs",
        "responses": {
          "200": {
            "description": "Recent install/uninstall jobs, oldest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Job"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/store/jobs/{id}": {
      "get": {
        "tags": [
          "store"
        ],
        "summary": "Follow one package job",
        "description": "Poll this while `state` is `running`; `log` carries the tail of the package manager's output.",
        "operationId": "getPluginJob",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The job id returned by install/uninstall",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No such job (they are kept for a bounded history)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/store/refresh": {
      "post": {
        "tags": [
          "store"
        ],
        "summary": "Refresh every catalog now",
        "description": "Bypasses the freshness window, re-fetches all sources, returns the merged catalog.",
        "operationId": "refreshPluginCatalog",
        "responses": {
          "200": {
            "description": "The freshly-fetched catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/store/runtime": {
      "get": {
        "tags": [
          "store"
        ],
        "summary": "Plugin runner state",
        "description": "Plugins run only while the runner is on. The runner discovers units at startup, so a freshly\ninstalled plugin may not have appeared yet. On a seat host on a person's own account the\nrunner is theirs: any lane but their own session reads it as not installed.",
        "operationId": "getPluginRuntime",
        "responses": {
          "200": {
            "description": "Runner state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeView"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      },
      "post": {
        "tags": [
          "store"
        ],
        "summary": "Turn the plugin runner on or off",
        "description": "On a seat host on a person's own account only their own session switches it.",
        "operationId": "setPluginRuntime",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RuntimeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The resulting runner state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeView"
                }
              }
            }
          },
          "400": {
            "description": "The runner could not be switched",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/store/sources": {
      "get": {
        "tags": [
          "store"
        ],
        "summary": "List catalog sources",
        "operationId": "listPluginSources",
        "responses": {
          "200": {
            "description": "Configured sources, built-in first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SourceView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/store/sources/{name}": {
      "put": {
        "tags": [
          "store"
        ],
        "summary": "Add or update a catalog source",
        "description": "Its entries become installable and attributed to it. They never carry `verified`; that badge is\nthe built-in source alone.",
        "operationId": "putPluginSource",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Source slug (`[a-z][a-z0-9-]*`)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourceInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Source saved"
          },
          "400": {
            "description": "Invalid name, url or key — or the reserved built-in name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      },
      "delete": {
        "tags": [
          "store"
        ],
        "summary": "Remove a catalog source",
        "operationId": "deletePluginSource",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Source slug",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed (or already absent)"
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "The built-in source cannot be removed, or the plugin token is not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/store/uninstall": {
      "post": {
        "tags": [
          "store"
        ],
        "summary": "Uninstall a plugin",
        "description": "Drops the package and its provenance, then restarts the runner. Only names the runner would\nsupervise: a shared dependency cannot be ripped out of the tree.",
        "operationId": "uninstallPlugin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UninstallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Uninstall job started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobRef"
                }
              }
            }
          },
          "400": {
            "description": "Not a plugin package name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized for the plugin token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Another package operation is in flight",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "profile-exec"
      }
    },
    "/api/v1/update/apply": {
      "post": {
        "tags": [
          "update"
        ],
        "summary": "Start a one-click update",
        "description": "Only for install kinds that support it. No version or URL in the body — the host\ninstalls the verified manifest. Poll `GET /update/status` (`job`); after restart,\nthe outcome is `last_result`.",
        "operationId": "applyUpdate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Apply started — poll `GET /update/status`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Refused: unsupported install kind, apply disabled (PUNKTFUNK_UPDATE_APPLY=0), a job already running, an active streaming session without `force`, or nothing newer to apply",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/update/check": {
      "post": {
        "tags": [
          "update"
        ],
        "summary": "Force a manifest fetch and verification.",
        "description": "One forced check per 30 s. `last_error` is a failed check; `not_published`\nis an empty channel, not a failure.",
        "operationId": "forceUpdateCheck",
        "responses": {
          "200": {
            "description": "Refreshed update-check state (`last_error` carries a failed check; `not_published` an empty channel, which is not one)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Update checks are disabled on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "A forced check ran less than 30 s ago",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/update/status": {
      "get": {
        "tags": [
          "update"
        ],
        "summary": "Cached update-check state.",
        "description": "A cache older than 6 h may kick a background refresh. The response never\nblocks on the network.",
        "operationId": "getUpdateStatus",
        "responses": {
          "200": {
            "description": "Current update-check state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid bearer token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-scope": "box"
      }
    },
    "/api/v1/webtransport": {
      "get": {
        "tags": [
          "host"
        ],
        "summary": "Where to reach the browser plane",
        "operationId": "getWebTransport",
        "responses": {
          "200": {
            "description": "The live certificate hash and port",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebTransportInfo"
                }
              }
            }
          },
          "404": {
            "description": "The browser plane is not enabled on this host",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {}
        ],
        "x-scope": "box"
      }
    }
  },
  "components": {
    "schemas": {
      "AccessPathOutcome": {
        "type": "object",
        "description": "One path's answer: `granted`, `pending`, `denied`, or `refused:<rule>`.",
        "required": [
          "path",
          "outcome"
        ],
        "properties": {
          "outcome": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        }
      },
      "AccessPathRequest": {
        "type": "object",
        "required": [
          "path"
        ],
        "properties": {
          "files": {
            "type": "boolean",
            "description": "`true` asks for the folder and the files directly in it, nothing below. On Windows this\nlands at once where a whole folder rewrites every file in its tree. Ignored with `write`."
          },
          "path": {
            "type": "string",
            "description": "The directory the plugin wants, absolute on the host."
          },
          "write": {
            "type": "boolean",
            "description": "`true` asks for write access too; a grant is read-only unless the operator allows it."
          }
        }
      },
      "AccessRequest": {
        "type": "object",
        "properties": {
          "cores": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "libretro cores the plugin wants in RetroArch (`snes9x`). Each answers with RetroArch's\ncores folder; `refused:no_retroarch` without one on this host."
          },
          "emulators": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Catalog ids of emulators the plugin wants installed (`pcsx2`). Each answers with the\nfolder the install lands in; the operator's yes installs it, then grants that folder."
          },
          "paths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessPathRequest"
            }
          },
          "ports": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "TCP ports on this computer the plugin wants to connect to, for a server that runs\nbeside the host. Each answers as `127.0.0.1:<port>`, where the plugin connects once the\noperator says yes: a network plugin reaches nothing else on this computer. Refused for\na plugin without `network`, for a port of the host's own, and off Linux."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the plugin wants it, in the plugin's words. Optional, sanitized, ≤120 chars."
          },
          "saves": {
            "type": "boolean",
            "description": "Ask to read and restore emulator saves. One yes covers every emulator on this host; the\nanswer names the folder the grant lands on."
          }
        }
      },
      "AccessWalk": {
        "type": "object",
        "description": "One folder whose access is changing.",
        "required": [
          "path",
          "removing",
          "seconds"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "removing": {
            "type": "boolean",
            "description": "The folder is being taken back, not opened."
          },
          "seconds": {
            "type": "integer",
            "format": "int64",
            "description": "How long it has been running.",
            "minimum": 0
          }
        }
      },
      "ActionInfo": {
        "type": "object",
        "description": "One action as the caller sees it (`GET /actions`).",
        "required": [
          "id",
          "title",
          "group",
          "danger",
          "available",
          "permitted"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "Platform probe. A VM that cannot S3 lists sleep as unavailable rather than a dead switch."
          },
          "danger": {
            "type": "boolean",
            "description": "Double-confirm hint: reboot/shutdown lose state."
          },
          "group": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "description": "Invoke path parameter (`power.sleep`, …).",
            "example": "power.sleep"
          },
          "permitted": {
            "type": "boolean",
            "description": "Whether THIS caller may invoke it. Admin: always. Cert: the live `GRANT_POWER` bit for\npower, its own live session for `display.next`."
          },
          "title": {
            "type": "string",
            "description": "Clients localize known ids and fall back to this for unknown ones."
          },
          "unavailable_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The id of `unavailable_reason`: the host message `apierr_<code>`. Absent when the reason\nis the system's own words."
          },
          "unavailable_reason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ActionList": {
        "type": "object",
        "required": [
          "actions"
        ],
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActionInfo"
            }
          }
        }
      },
      "ActionOutcome": {
        "type": "object",
        "description": "What `display.next` did (`200`). Power actions answer `202` with no body.",
        "required": [
          "monitor"
        ],
        "properties": {
          "monitor": {
            "type": "string",
            "description": "Connector streamed from now on.",
            "example": "HDMI-A-1"
          }
        }
      },
      "ActiveGame": {
        "type": "object",
        "required": [
          "client",
          "title",
          "plane",
          "state"
        ],
        "properties": {
          "app_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Store-qualified library id (`steam:570`); matches `GET /library`. Absent for a typed GameStream command."
          },
          "awaiting_window": {
            "type": "boolean",
            "description": "Present and true while `running` on a host that will report `window` next. A launch hold\nwaits for that instead of revealing a game that is still loading."
          },
          "client": {
            "type": "string",
            "description": "Client-supplied device name of the session that launched it; may be empty."
          },
          "endable": {
            "type": "boolean",
            "description": "Present and true when this caller may end it with `POST /game/end`: the operator any\nlaunched game, a paired device only a game it launched."
          },
          "grace_remaining_s": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Seconds until this game is ended — only present on a `grace` row.",
            "minimum": 0
          },
          "plane": {
            "$ref": "#/components/schemas/Plane",
            "description": "`native`, `gamestream` or `web`."
          },
          "seat": {
            "type": [
              "string",
              "null"
            ],
            "description": "On a door, to the operator: the profile whose seat host runs it, whose proxy reaches it."
          },
          "session_id": {
            "type": "integer",
            "format": "int64",
            "description": "Streaming session; `null` on the compat plane's game and on a `grace`, `detached` or\nwaiting-launch row. Pass it to `DELETE /session/{id}` to stop that one session.",
            "minimum": 0
          },
          "state": {
            "type": "string",
            "description": "`launching` | `running` | `window` (its window is on the streamed screen) | `exited` |\n`untracked` (exit will never be seen) | `grace` (reconnect window) | `detached` (still\nrunning, no session holds it).",
            "example": "running"
          },
          "store": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which store surfaced it (`steam`, `heroic`, `custom`, …), when known."
          },
          "title": {
            "type": "string"
          }
        }
      },
      "AdoptRequest": {
        "type": "object",
        "required": [
          "exe"
        ],
        "properties": {
          "exe": {
            "type": "string",
            "description": "The copy's program, absolute."
          },
          "forget": {
            "type": "boolean",
            "description": "Forget the copy instead."
          }
        }
      },
      "ApiActiveGpu": {
        "type": "object",
        "description": "GPU live encode sessions are on now (not the next-session pick).",
        "required": [
          "id",
          "name",
          "vendor",
          "backend",
          "sessions"
        ],
        "properties": {
          "backend": {
            "type": "string",
            "description": "Label of the encode branch that opened, e.g. `nvenc`, `vaapi-native`, `vulkan`,\n`software`, `driver-amf`."
          },
          "id": {
            "type": "string",
            "description": "Matches a `gpus` entry; empty when encoding on CPU/software."
          },
          "name": {
            "type": "string"
          },
          "sessions": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "vendor": {
            "type": "string",
            "description": "`nvidia` | `amd` | `intel` | `other`."
          }
        }
      },
      "ApiCodec": {
        "type": "string",
        "description": "Wire token is the stack's canonical codec name (`Codec::label`). `H265` serializes as `\"hevc\"`, not `\"h265\"`.",
        "enum": [
          "h264",
          "hevc",
          "av1",
          "pyrowave"
        ]
      },
      "ApiDisplayInfo": {
        "type": "object",
        "description": "One live or kept virtual display.",
        "required": [
          "slot",
          "backend",
          "mode",
          "state",
          "sessions",
          "group",
          "display_index",
          "x",
          "y",
          "topology"
        ],
        "properties": {
          "backend": {
            "type": "string",
            "description": "`pf-vdisplay`, `kwin`, …"
          },
          "client": {
            "type": [
              "string",
              "null"
            ]
          },
          "display_index": {
            "type": "integer",
            "format": "int32",
            "description": "Ordinal within the group, acquire order, 0-based.",
            "minimum": 0
          },
          "expires_in_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Milliseconds until a lingering display is torn down (absent when active/pinned).",
            "minimum": 0
          },
          "group": {
            "type": "integer",
            "format": "int32",
            "description": "Shared-desktop group id; same group = one desktop.",
            "minimum": 0
          },
          "identity_slot": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Per-client identity slot (absent = shared/anonymous). Keys persistent config and manual layout.",
            "minimum": 0
          },
          "mode": {
            "type": "string",
            "description": "`WIDTHxHEIGHT@HZ`."
          },
          "sessions": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "slot": {
            "type": "integer",
            "format": "int64",
            "description": "Stable-enough id for the `/display/release` `slot` argument.",
            "minimum": 0
          },
          "state": {
            "type": "string",
            "description": "`active` | `lingering` | `pinned`."
          },
          "topology": {
            "type": "string",
            "description": "Group topology: `extend` | `primary` | `exclusive`."
          },
          "x": {
            "type": "integer",
            "format": "int32",
            "description": "Desktop-space top-left (auto-row or manual layout)."
          },
          "y": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ApiError": {
        "type": "object",
        "description": "Envelope for every non-2xx body.\n\nA sentence written for a person carries `code`: an app words it as the host message\n`apierr_<code>` with `params`, and shows `error` for a code it does not know. Without\n`code`, `error` is developer text and an app words the failure itself.",
        "required": [
          "error"
        ],
        "properties": {
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sentence's id: the message `apierr_<code>` in the host's messages."
          },
          "error": {
            "type": "string",
            "description": "The sentence in English, or developer text when `code` is absent."
          },
          "params": {
            "type": [
              "object",
              "null"
            ],
            "description": "The values of that message's placeholders, by name.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ApiGpu": {
        "type": "object",
        "description": "Hardware GPU. Software/WARP adapters are never listed.",
        "required": [
          "id",
          "name",
          "vendor",
          "vram_mb"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "`vendorid-deviceid-occurrence` (hex PCI). Stable across reboot/driver; not an index or LUID.",
            "example": "10de-2c05-0"
          },
          "name": {
            "type": "string",
            "example": "NVIDIA GeForce RTX 5070 Ti"
          },
          "vendor": {
            "type": "string",
            "description": "`nvidia` | `amd` | `intel` | `other`."
          },
          "vram_mb": {
            "type": "integer",
            "format": "int64",
            "description": "0 when the platform does not expose dedicated VRAM.",
            "minimum": 0
          }
        }
      },
      "ApiMonitorInfo": {
        "type": "object",
        "description": "Physical monitor as the compositor reports it.",
        "required": [
          "connector",
          "description",
          "mode",
          "x",
          "y",
          "scale",
          "primary",
          "enabled",
          "managed",
          "selected"
        ],
        "properties": {
          "connector": {
            "type": "string",
            "description": "Connector (`DP-1`, `HDMI-A-2`) — the value `PUNKTFUNK_CAPTURE_MONITOR` takes."
          },
          "description": {
            "type": "string",
            "description": "Picker label (`make model`, else the connector)."
          },
          "enabled": {
            "type": "boolean",
            "description": "Driven right now. Disabled heads stay listed so they are not missing from the picker."
          },
          "managed": {
            "type": "boolean",
            "description": "One of our virtual displays, not a real head. Best-effort on Sway, whose\n`HEADLESS-N` may be the operator's own."
          },
          "mode": {
            "type": "string",
            "description": "`WIDTHxHEIGHT@HZ` of the current mode (size only when the refresh is unknown)."
          },
          "primary": {
            "type": "boolean"
          },
          "scale": {
            "type": "number",
            "format": "double"
          },
          "selected": {
            "type": "boolean",
            "description": "True when the host-wide pin (`PUNKTFUNK_CAPTURE_MONITOR`, else the stored policy) names\nthis monitor."
          },
          "x": {
            "type": "integer",
            "format": "int32",
            "description": "Desktop-space top-left. Distinguishes two heads of the same size."
          },
          "y": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ApiSelectedGpu": {
        "type": "object",
        "description": "GPU the next session opens on. A running session keeps the GPU it already opened.",
        "required": [
          "id",
          "name",
          "vendor",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "description": "`preference` | `env` | `auto` | `preference_missing` (manual pick absent → auto, still stream)."
          },
          "vendor": {
            "type": "string",
            "description": "`nvidia` | `amd` | `intel` | `other`."
          }
        }
      },
      "ApplyRequest": {
        "type": "object",
        "properties": {
          "force": {
            "type": "boolean",
            "description": "Apply even with a live stream (the stream drops when the host restarts)."
          }
        }
      },
      "ApprovePending": {
        "type": "object",
        "description": "Approve body. `{}` keeps the knock name and, on re-approve, stored access\n(full/permanent on a first pairing).",
        "properties": {
          "expires_in_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Access lifetime from now, seconds. Host stores the absolute deadline.\nAlone: full control until then.",
            "example": 14400,
            "minimum": 0
          },
          "grants": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Grant mask. Reserved bits are 400. Omit both access fields to keep\nstored access; `grants` alone is permanent.",
            "example": 1,
            "minimum": 0
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Label; defaults to the name the device knocked with.",
            "example": "Living Room TV"
          },
          "until_disconnect": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Drop the device's record once its last session ends, rather than at a clock time.\nCombines with `expires_in_secs`: whichever comes first ends the grant. Send it with an\naccess level, never alone (400) — like the other access fields it is part of a whole\nreplacement, so sending `grants` without it clears it."
          }
        }
      },
      "ArmNativePairing": {
        "type": "object",
        "properties": {
          "expires_in_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Access lifetime from now, seconds — not `ttl_secs`. Host stores the\nabsolute deadline. Omit for permanent (`grants` set) or preserved (neither).",
            "example": 14400,
            "minimum": 0
          },
          "fingerprint": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hex SHA-256 fingerprint that may consume this window. Omit for any\ndevice (trusted-LAN only).",
            "example": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
          },
          "grants": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Grant mask for the device that completes the window. Reserved bits are\n400. Omit both access fields for full (new) or preserved (re-pair).",
            "example": 1,
            "minimum": 0
          },
          "ttl_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Window length, seconds. Default 120; clamped to 15–600.",
            "example": 120,
            "minimum": 0
          },
          "until_disconnect": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Drop the device's record once its last session ends, rather than at a clock time.\nCombines with `expires_in_secs`: whichever comes first ends the grant. Send it with an\naccess level, never alone (400) — like the other access fields it is part of a whole\nreplacement, so sending `grants` without it clears it."
          }
        }
      },
      "ArtPickInput": {
        "type": "object",
        "description": "`PUT /library/picks/{id}`.",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "`portrait`, `hero`, `logo` or `header`.",
            "example": "portrait"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "An `http(s)` URL; `null` clears the pick."
          }
        }
      },
      "Artwork": {
        "type": "object",
        "description": "Cover art. The client prefers `portrait` for a grid and falls back to `header`\nwhen a title has no 600×900 capsule (common for older Steam apps).",
        "properties": {
          "header": {
            "type": [
              "string",
              "null"
            ],
            "description": "Steam `header.jpg` — the universal fallback."
          },
          "hero": {
            "type": [
              "string",
              "null"
            ],
            "description": "Steam `library_hero.jpg`."
          },
          "logo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Steam `logo.png`."
          },
          "portrait": {
            "type": [
              "string",
              "null"
            ],
            "description": "Steam `library_600x900.jpg`."
          }
        }
      },
      "AudioEgress": {
        "type": "object",
        "description": "Audio egress for the whole session. Absent when the session had no audio plane.",
        "required": [
          "sent",
          "infilled",
          "late",
          "max_late_ms",
          "reanchors"
        ],
        "properties": {
          "infilled": {
            "type": "integer",
            "format": "int64",
            "description": "Frames synthesized over a capture hole. Wire continuity is not captured continuity.",
            "minimum": 0
          },
          "late": {
            "type": "integer",
            "format": "int64",
            "description": "Departures a whole frame or more behind their slot.",
            "minimum": 0
          },
          "max_late_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "reanchors": {
            "type": "integer",
            "format": "int64",
            "description": "Times the pacer fell far enough behind to forgive its debt and re-anchor.",
            "minimum": 0
          },
          "sent": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "AudioPolicy": {
        "type": "object",
        "description": "Audio while this title runs: which of the sessions on its display hear it.\n`all` is the same as no policy and is stored as none.",
        "properties": {
          "sessions": {
            "$ref": "#/components/schemas/AudioSessions"
          }
        }
      },
      "AudioSessions": {
        "type": "string",
        "description": "Which sessions hear a title's audio (`audio.sessions` on a custom entry).",
        "enum": [
          "all",
          "owner",
          "joined",
          "launcher"
        ]
      },
      "AudioWiring": {
        "type": "object",
        "description": "Windows audio wiring: which endpoint carries each role. Names are the Sound-settings friendly names.",
        "required": [
          "readiness",
          "mic_withheld",
          "last_resort"
        ],
        "properties": {
          "last_resort": {
            "type": "boolean",
            "description": "Loopback is the degraded last resort; desktop audio may be silent until endpoints change."
          },
          "loopback": {
            "type": [
              "string",
              "null"
            ],
            "description": "Desktop-audio loopback friendly name; absent = unavailable."
          },
          "mic": {
            "type": [
              "string",
              "null"
            ],
            "description": "Virtual-mic write-target friendly name; absent = unavailable."
          },
          "mic_withheld": {
            "type": "boolean",
            "description": "Mic withheld so game audio keeps the only working sink."
          },
          "narrowing": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the chosen loopback endpoint NARROWS the desktop mix (rate/channels), when it does."
          },
          "readiness": {
            "type": "string",
            "description": "`full` | `audio_only` | `mic_only` | `none`.",
            "example": "full"
          }
        }
      },
      "AvailableCompositor": {
        "type": "object",
        "description": "A compositor backend and whether it is usable now.",
        "required": [
          "id",
          "label",
          "available",
          "default"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "Usable now: the live session's compositor, the `PUNKTFUNK_COMPOSITOR` pin, or a backend\nwhose own probe passes."
          },
          "default": {
            "type": "boolean",
            "description": "True for the backend an `Auto` (unspecified) request resolves to right now."
          },
          "id": {
            "type": "string",
            "description": "Stable id (`kwin` | `gamescope` | `mutter` | `wlroots` | `hyprland` | `niri` | `umbriel`);\npass to `--compositor`."
          },
          "label": {
            "type": "string"
          }
        }
      },
      "BitrateSpan": {
        "type": "object",
        "description": "What the encoder's target did over the session. Absent when no encoder opened.",
        "required": [
          "min_kbps",
          "avg_kbps",
          "max_kbps",
          "adaptive_steps"
        ],
        "properties": {
          "adaptive_steps": {
            "type": "integer",
            "format": "int32",
            "description": "Times the target moved after the opening rate: adaptive-bitrate decisions, plus a\nrebuild re-resolving what it actually encodes.",
            "minimum": 0
          },
          "avg_kbps": {
            "type": "integer",
            "format": "int32",
            "description": "Mean of the targets the session ran at, NOT weighted by how long each held.\nA rate held for a second counts as much as one held for an hour.",
            "minimum": 0
          },
          "max_kbps": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "min_kbps": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "Capture": {
        "type": "object",
        "description": "Wire and on-disk shape: summary plus sample time-series.",
        "required": [
          "meta",
          "samples"
        ],
        "properties": {
          "link": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkMinute"
            },
            "description": "One row per minute of link health per native session, so a freeze report carries the\nloss, recovery and ABR history the bounded log ring may already have evicted. Empty on\na GameStream capture and on recordings older than this field."
          },
          "meta": {
            "$ref": "#/components/schemas/CaptureMeta"
          },
          "samples": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StatsSample"
            }
          }
        }
      },
      "CaptureEpisode": {
        "type": "object",
        "description": "One closed staged-recovery episode.",
        "required": [
          "stall_class",
          "recovered",
          "took_ms",
          "stages",
          "consecutive_failures",
          "cooldown_ms"
        ],
        "properties": {
          "consecutive_failures": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "cooldown_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "recovered": {
            "type": "boolean"
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaptureStage"
            },
            "description": "The rungs run, in ladder order."
          },
          "stall_class": {
            "type": "string"
          },
          "took_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "CaptureHealth": {
        "type": "object",
        "description": "Per-session capture health (Windows IDD-push): the live classifier verdict, the driver\nencoder's self-report and the last staged-recovery episode.",
        "required": [
          "class",
          "source_gap_ms",
          "late_frames",
          "detached",
          "published_total",
          "dropped_total",
          "episodes_suppressed"
        ],
        "properties": {
          "backend_opened": {
            "type": [
              "string",
              "null"
            ],
            "description": "The backend the driver opened: `nvenc` / `amf` / `qsv` / `pyrowave` / `mf`. Absent as above."
          },
          "class": {
            "type": "string",
            "description": "`healthy` / `idle` / `suspect` / `stalled` / `recovering` / `rebuilding` / `secure_desktop`.",
            "example": "healthy"
          },
          "cooldown_remaining_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Time left in the post-failure cooldown, while one is in force.",
            "minimum": 0
          },
          "current_stage": {
            "type": [
              "string",
              "null"
            ],
            "description": "The recovery stage running now, while an episode is open."
          },
          "detached": {
            "type": "integer",
            "format": "int32",
            "description": "Encode threads the driver abandoned after a wedge; two opens the driver cycle.",
            "minimum": 0
          },
          "dropped_total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "encoder_state": {
            "type": [
              "string",
              "null"
            ],
            "description": "The driver encoder's own state word: `closed` / `open` / `encoding` / `wedged`.\nAbsent until the session's first `SET_ENCODE`."
          },
          "episodes_suppressed": {
            "type": "integer",
            "format": "int32",
            "description": "Stalled verdicts refused for budget or cooldown since the last episode.",
            "minimum": 0
          },
          "evidence": {
            "type": [
              "string",
              "null"
            ],
            "description": "Activity evidence behind the verdict: `input` / `canary`."
          },
          "last_episode": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CaptureEpisode",
                "description": "The last closed recovery episode."
              }
            ]
          },
          "late_frames": {
            "type": "boolean",
            "description": "`present_to_arrival_ms` is past the classifier's bound: frames come late rather than not\nat all. Reported only — no recovery rung fires on it."
          },
          "present_to_arrival_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "The newest access unit's OS present stamp against the moment the host took it.",
            "minimum": 0
          },
          "published_total": {
            "type": "integer",
            "format": "int64",
            "description": "Access units the driver published, and frames it dropped at its encode pool.",
            "minimum": 0
          },
          "source_gap_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Time since the last real source frame.",
            "minimum": 0
          },
          "stall_class": {
            "type": [
              "string",
              "null"
            ],
            "description": "When `class` is `stalled`: `worker` / `encoder` / `presentation` / `driver`."
          }
        }
      },
      "CaptureMeta": {
        "type": "object",
        "description": "Filename stem plus negotiated mode/codec/client. On-disk head;\n[`StatsRecorder::list`] returns this without the sample body.",
        "required": [
          "id",
          "started_unix_ms",
          "duration_ms",
          "kind",
          "width",
          "height",
          "fps",
          "codec",
          "client",
          "sample_count"
        ],
        "properties": {
          "client": {
            "type": "string",
            "description": "Fingerprint prefix, or `\"\"` if unknown."
          },
          "codec": {
            "type": "string",
            "description": "`\"h264\" | \"hevc\" | \"av1\"`."
          },
          "duration_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "encoder_backend": {
            "type": "string",
            "description": "Backend that actually opened (`\"nvenc\"`, `\"vaapi\"`, `\"vulkan\"`, `\"amf\"`,\n`\"qsv\"`, `\"software\"`, …), from `pf_gpu::active()`. Stage timings are\nunreadable without it. `\"\"` if nothing was streaming at registration."
          },
          "fps": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "gpu": {
            "type": "string",
            "description": "GPU name from `pf_gpu::active()`, or `\"\"`."
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "id": {
            "type": "string",
            "description": "Filename stem, e.g. `2026-06-26T20-14-03Z_5120x1440`."
          },
          "kind": {
            "type": "string",
            "description": "`\"native\" | \"gamestream\" | \"web\"`."
          },
          "sample_count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "started_unix_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "truncated": {
            "type": "boolean",
            "description": "The sample cap was hit: samples past it were dropped and the start kept."
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "CaptureStage": {
        "type": "object",
        "description": "One recovery rung of an episode.",
        "required": [
          "stage",
          "outcome",
          "took_ms"
        ],
        "properties": {
          "outcome": {
            "type": "string",
            "description": "`applied` / `failed` / `unsupported` / `timed_out`."
          },
          "stage": {
            "type": "string",
            "description": "`encoder_reset` / `swap_chain_reset` / `presentation_reset` / `driver_cycle`."
          },
          "took_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "CatalogEntry": {
        "type": "object",
        "required": [
          "id",
          "pkg",
          "title",
          "description",
          "author",
          "version",
          "source",
          "tier",
          "platforms",
          "compatible",
          "update_available",
          "categories"
        ],
        "properties": {
          "author": {
            "type": "string"
          },
          "blocked": {
            "type": [
              "string",
              "null"
            ],
            "description": "Revocation of the catalogued version; listed, never offered quietly."
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Browse filters; the Game-sources add-rail is exactly the `library` entries."
          },
          "compatible": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "detected": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Host-side existence probe for the launcher this plugin scans. `null` = no probe for this\nplatform (unknown, not \"not installed\")."
          },
          "homepage": {
            "type": [
              "string",
              "null"
            ]
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "incompatible_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "installed_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "license": {
            "type": [
              "string",
              "null"
            ]
          },
          "min_host": {
            "type": [
              "string",
              "null"
            ]
          },
          "pkg": {
            "type": "string"
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reviewed_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "When unom reviewed this exact tarball (built-in source only)."
          },
          "source": {
            "type": "string"
          },
          "tier": {
            "type": "string",
            "description": "`verified` (built-in) or `external` (operator-added). Never `unverified`: those come from a\nraw spec and are not listed."
          },
          "title": {
            "type": "string"
          },
          "update_available": {
            "type": "boolean"
          },
          "version": {
            "type": "string",
            "description": "The one installable version this entry pins."
          }
        }
      },
      "CatalogResponse": {
        "type": "object",
        "required": [
          "host",
          "sources",
          "plugins",
          "busy"
        ],
        "properties": {
          "busy": {
            "type": "boolean"
          },
          "host": {
            "$ref": "#/components/schemas/HostFacts"
          },
          "plugins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CatalogEntry"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceView"
            }
          }
        }
      },
      "Challenge": {
        "type": "object",
        "description": "`POST /auth/device/challenge` → the nonce to sign.",
        "required": [
          "nonce",
          "expires_in"
        ],
        "properties": {
          "expires_in": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds this nonce remains signable.",
            "minimum": 0
          },
          "nonce": {
            "type": "string",
            "description": "32 random bytes, lowercase hex. Single-use, and short-lived."
          }
        }
      },
      "CheckLevel": {
        "type": "string",
        "description": "What a seat check found. An `error` stops seats from turning on.",
        "enum": [
          "info",
          "warning",
          "error"
        ]
      },
      "CheckSource": {
        "type": "string",
        "description": "Origin of a verdict. `Event` is one an event source pushes ([`Diagnostics::set`]).",
        "enum": [
          "startup",
          "event",
          "refresh"
        ]
      },
      "CheckStatus": {
        "type": "string",
        "description": "Probe result. `Inapplicable` is not `Ok`: \"never on this box\" and \"works here\" are different\nanswers on the troubleshooting page.",
        "enum": [
          "ok",
          "warn",
          "fail",
          "inapplicable"
        ]
      },
      "ClientLogMeta": {
        "type": "object",
        "required": [
          "id",
          "device_name",
          "fingerprint_prefix",
          "received_ms",
          "size_bytes"
        ],
        "properties": {
          "device_name": {
            "type": "string",
            "description": "Paired device name at upload, filesystem-sanitized."
          },
          "fingerprint_prefix": {
            "type": "string",
            "description": "First 16 hex chars of the pairing fingerprint — enough to match the roster\nwithout repeating the full identity in every filename."
          },
          "id": {
            "type": "string",
            "description": "Filename stem; pass to fetch/delete."
          },
          "received_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Upload time (unix ms from the file mtime, not the stem timestamp).",
            "minimum": 0
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ClientLogUploaded": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          }
        }
      },
      "ClientOverlay": {
        "type": "object",
        "description": "One paired device's deviations from the host policy\n(`design/web-console-overhaul.md` §6.1).\n\nEvery field is optional and absent means **follow the host**. That is the\nwhole point: a copied policy would silently stop following host changes,\nwhile an overlay only pins what the operator actually chose for this\ndevice. The TV wants take-over and keep-forever; the tablet wants its own\nscreen and no linger — one host policy cannot serve both.\n\n`max_displays` and `layout` are deliberately absent: they are properties of\nthe host's desktop, not of a device connecting to it.",
        "properties": {
          "capture_monitor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Deprecated: `screen`'s connector, kept one release for older consoles and SDKs.",
            "deprecated": true
          },
          "game_session": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GameSession"
              }
            ]
          },
          "identity": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Identity"
              }
            ]
          },
          "keep_alive": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/KeepAlive"
              }
            ]
          },
          "max_mode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Largest mode this device is granted, `WIDTHxHEIGHT@HZ`. A phone asking for 4K120\non a weak host degrades every other session; the operator caps it once and the\nclient is told the smaller mode rather than silently given one."
          },
          "mode_conflict": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ModeConflict"
              }
            ]
          },
          "scale": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Scale this device's screen is created at, when the desktop has not already\nremembered one for it (`display-management.md` §5.4). Mutter mints a fresh EDID\nserial per session, so its own `monitors.xml` never rematches — without this the\noperator re-sets the scale on every connect."
          },
          "screen": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DisplayTarget",
                "description": "What this device streams. `own` opts it out of a host-wide monitor; absent follows\nthe host. The device may write this field and `topology` on its own row."
              }
            ]
          },
          "set_by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SetBy",
                "description": "Who last wrote `screen` or `topology`. Absent when neither is set."
              }
            ]
          },
          "topology": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Topology"
              }
            ]
          }
        }
      },
      "ClientRef": {
        "type": "object",
        "required": [
          "name",
          "plane"
        ],
        "properties": {
          "fingerprint": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string",
            "description": "Display name: the trust-store name (a console rename wins), else the name the client\nsent. On the compat plane it is the name the operator gave the device, since Moonlight\nsends none. Empty when there is no name at all."
          },
          "plane": {
            "$ref": "#/components/schemas/Plane"
          },
          "preset": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PresetRef",
                "description": "The preset the client dialled with. Absent for plain settings and on GameStream."
              }
            ]
          },
          "profile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileRef",
                "description": "The profile the session plays as. Absent on GameStream."
              }
            ]
          }
        }
      },
      "ContentRequest": {
        "type": "object",
        "required": [
          "platform",
          "kind",
          "files"
        ],
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The add-on files: absolute under a folder the plugin was granted, or relative to its own\nstate folder."
          },
          "kind": {
            "type": "string",
            "description": "`update` or `dlc`."
          },
          "platform": {
            "type": "string"
          }
        }
      },
      "CustomEntry": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameMeta"
          },
          {
            "type": "object",
            "required": [
              "id",
              "title"
            ],
            "properties": {
              "art": {
                "$ref": "#/components/schemas/Artwork"
              },
              "audio": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AudioPolicy",
                    "description": "Which sessions hear this title. Absent = every session."
                  }
                ]
              },
              "detect": {
                "$ref": "#/components/schemas/DetectHint",
                "description": "How to find this title after a command that hands off and exits. Without it the\nhost tracks only the child it spawned."
              },
              "external_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Provider's reconcile key. Present iff `provider` is, so the host `id` can stay put."
              },
              "icon": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Brand token (`steam`, `heroic`) a client draws. Never bytes, never a URL. See [`GameEntry::icon`]."
              },
              "id": {
                "type": "string",
                "description": "Host-assigned row id; the `{id}` in the CRUD path. Not the surfaced library id."
              },
              "ids": {
                "type": "object",
                "description": "Catalog ids a metadata source matches on. Set only by provider reconcile.",
                "additionalProperties": {
                  "type": "string"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "install": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/Install",
                    "description": "Whether the title's files are on this host. Set only by provider reconcile."
                  }
                ]
              },
              "launch": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LaunchSpec"
                  }
                ]
              },
              "on_window": {
                "$ref": "#/components/schemas/OnWindow",
                "description": "Which workspace this title opens on ([`crate::library::OnWindow`]).\nAbsent follows the host's display policy."
              },
              "person": {
                "type": "boolean",
                "description": "A seat host's own title its person wrote, in their own session, or one of their plugins\npublished. On a person's own account a title without it is neither listed nor started.\nSet by the host, never from a body.",
                "readOnly": true
              },
              "prep": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PrepCmd"
                },
                "description": "Each `do` runs before launch; each `undo` at session end in reverse ([`crate::hooks::run_prep`])."
              },
              "provider": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Set only by provider reconcile. `None` is a manual row: reconcile never touches it, and\nmanual CRUD refuses provider-owned rows."
              },
              "role": {
                "$ref": "#/components/schemas/GameRole"
              },
              "store": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Store this row was claimed under. `None` surfaces as `custom`. Stamped on the\nrow so id and badge stay correct while [`Catalog::claims`] is being rewritten."
              },
              "title": {
                "type": "string"
              }
            }
          }
        ],
        "description": "One stored row. Same shape the API returns and the console edits."
      },
      "CustomInput": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameMeta",
            "description": "Flattened [`GameMeta`]. Replaced wholesale on update — an edit must send every field it wants kept."
          },
          {
            "type": "object",
            "required": [
              "title"
            ],
            "properties": {
              "art": {
                "$ref": "#/components/schemas/Artwork"
              },
              "audio": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AudioPolicy",
                    "description": "Absent on an update keeps the stored policy; `{\"sessions\":\"all\"}` clears it."
                  }
                ]
              },
              "detect": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/DetectHint",
                    "description": "Absent on an update keeps the stored hint, as with `prep`."
                  }
                ]
              },
              "icon": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Brand token. A hand-added \"Steam\" tile can look like one. See [`GameEntry::icon`]."
              },
              "launch": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LaunchSpec"
                  }
                ]
              },
              "on_window": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/OnWindow",
                    "description": "Absent on an update keeps the stored placement, as with `prep`."
                  }
                ]
              },
              "prep": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "$ref": "#/components/schemas/PrepCmd"
                },
                "description": "Run as the host user; operator-privileged. See [`privileged_field`]. Absent on an\nupdate keeps the stored list: a writer that never read it must not clear it."
              },
              "role": {
                "$ref": "#/components/schemas/GameRole",
                "description": "A hand-added launcher tile is legal without installing the matching plugin."
              },
              "title": {
                "type": "string"
              }
            }
          }
        ],
        "description": "Create/replace body. No `id` — the host assigns it."
      },
      "CustomPreset": {
        "type": "object",
        "description": "Operator-named bundle of the six axes plus game-session, stored in\n`<config>/display-presets.json`. Applying one writes a `Custom`\n[`DisplayPolicy`] via `PUT /display/settings`. Editing the catalog never\nmutates the running policy; re-apply to adopt.",
        "required": [
          "id",
          "name",
          "fields"
        ],
        "properties": {
          "fields": {
            "$ref": "#/components/schemas/EffectivePolicy"
          },
          "game_session": {
            "$ref": "#/components/schemas/GameSession",
            "description": "Unlike a built-in preset, applying a custom preset sets this axis."
          },
          "id": {
            "type": "string",
            "description": "Host-assigned, stable for the life of the entry."
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CustomPresetInput": {
        "type": "object",
        "description": "Create/replace body. No `id` — the host owns it.",
        "required": [
          "name",
          "fields"
        ],
        "properties": {
          "fields": {
            "$ref": "#/components/schemas/EffectivePolicy"
          },
          "game_session": {
            "$ref": "#/components/schemas/GameSession"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "DecideRequest": {
        "type": "object",
        "required": [
          "path",
          "decision"
        ],
        "properties": {
          "decision": {
            "$ref": "#/components/schemas/DecisionInput"
          },
          "form": {
            "type": [
              "string",
              "null"
            ],
            "description": "With `allow` and `write`: the plugin form handing the path over (`config`,\n`game:<entry id>`). Its grant goes once every form that handed it lets go."
          },
          "path": {
            "type": "string",
            "description": "The path as it appears in the request or grant list. A port on this computer is spelled\n`127.0.0.1:<port>`; `allow` grants one with or without a pending request."
          },
          "write": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "With `allow`: grant the path directly, pending request or not, read-write when true.\nA file grants its folder. The same refusals apply as to a request."
          }
        }
      },
      "DecisionInput": {
        "type": "string",
        "enum": [
          "allow",
          "deny",
          "forget"
        ]
      },
      "DefaultProfile": {
        "type": "object",
        "description": "`PUT /profiles/default`.",
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "`null` is the owner."
          }
        }
      },
      "DeskPad": {
        "type": "object",
        "description": "A game controller plugged into this PC, or one a profile holds.",
        "required": [
          "key",
          "name",
          "vendor_id",
          "product_id",
          "present",
          "state"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Names the controller in `PUT /profiles/pads/{key}`. Stable across a replug and a restart.",
            "example": "usb-28de-1304-s-FXA99614007BD"
          },
          "name": {
            "type": "string",
            "description": "What the hardware calls itself.",
            "example": "Steam Controller Puck"
          },
          "present": {
            "type": "boolean",
            "description": "Plugged in now. A controller a profile holds stays listed while it is unplugged."
          },
          "product_id": {
            "type": "integer",
            "format": "int32",
            "description": "The USB product id.",
            "example": 4868,
            "minimum": 0
          },
          "profile": {
            "type": [
              "string",
              "null"
            ],
            "description": "The profile it is given to."
          },
          "state": {
            "$ref": "#/components/schemas/DeskPadState"
          },
          "vendor_id": {
            "type": "integer",
            "format": "int32",
            "description": "The USB vendor id.",
            "example": 10462,
            "minimum": 0
          }
        }
      },
      "DeskPadHolder": {
        "type": "object",
        "description": "Who a controller goes to.",
        "properties": {
          "profile": {
            "type": [
              "string",
              "null"
            ],
            "description": "The profile to give it to. `null` gives it back to this PC."
          }
        }
      },
      "DeskPadState": {
        "type": "string",
        "description": "Who has a controller now.",
        "enum": [
          "desk",
          "live",
          "parked"
        ]
      },
      "DeskPads": {
        "type": "object",
        "description": "The controllers plugged into this PC.",
        "required": [
          "supported",
          "pads"
        ],
        "properties": {
          "pads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeskPad"
            }
          },
          "supported": {
            "type": "boolean",
            "description": "Whether this host can give a controller to a profile. `false` lists nothing."
          }
        }
      },
      "DetectHint": {
        "type": "object",
        "description": "Inbound wire half of [`DetectSpec`]: what an operator or plugin can name about\nrecognizing a title. Every field optional; all empty is no hint.\n\nNot returned by the catalog API — detect data does not go outbound.",
        "properties": {
          "env_marker": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EnvMarker"
              }
            ]
          },
          "exe": {
            "type": [
              "string",
              "null"
            ]
          },
          "install_dir": {
            "type": [
              "string",
              "null"
            ]
          },
          "process_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Weakest signal — see [`DetectSpec::process_name`]."
          },
          "steam_appid": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Without this a Steam plugin degrades from reaper match to install-dir prefix.",
            "minimum": 0
          }
        }
      },
      "DeviceRef": {
        "type": "object",
        "required": [
          "name",
          "fingerprint",
          "plane"
        ],
        "properties": {
          "fingerprint": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Pairing-store copy, already sanitized."
          },
          "plane": {
            "$ref": "#/components/schemas/Plane",
            "description": "The store the device is paired in. Browsers pair into the native store, so `native`."
          }
        }
      },
      "DiagnosticsReport": {
        "type": "object",
        "description": "The `GET /diagnostics` body.",
        "required": [
          "ran_at_unix",
          "checks"
        ],
        "properties": {
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HostCheck"
            },
            "description": "Every registered check, worst-first, including `ok` and `inapplicable`. The console decides\nwhat to hide."
          },
          "ran_at_unix": {
            "type": "integer",
            "format": "int64",
            "description": "Last probe run, unix seconds.",
            "minimum": 0
          }
        }
      },
      "DisconnectReason": {
        "type": "string",
        "description": "`Quit` is the typed close; `Timeout` is transport idle; `Error` is everything else.",
        "enum": [
          "quit",
          "timeout",
          "error"
        ]
      },
      "DisplayHealth": {
        "type": "object",
        "description": "Host-wide Windows display health: the topology transaction log and the leases the stream holds.",
        "required": [
          "topology_generation",
          "pnp_leases",
          "host_protocol"
        ],
        "properties": {
          "driver_protocol": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Protocol the installed pf-vdisplay driver answered at the last handshake; absent until a session ran one.",
            "minimum": 0
          },
          "host_protocol": {
            "type": "integer",
            "format": "int32",
            "description": "Protocol this host drives; a driver answering less fails every session.",
            "minimum": 0
          },
          "last_transaction": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TopologyTransaction",
                "description": "The most recent topology transaction, if any."
              }
            ]
          },
          "pnp_leases": {
            "type": "integer",
            "format": "int32",
            "description": "Monitor devnodes disabled for a stream and not yet re-enabled (a leftover here after a\ncrash is what the next host start replays).",
            "minimum": 0
          },
          "topology_generation": {
            "type": "integer",
            "format": "int64",
            "description": "Count of topology transactions that observed a change since the host started.",
            "minimum": 0
          }
        }
      },
      "DisplayLayoutRequest": {
        "type": "object",
        "description": "Manual layout: identity-slot id as string (same id `/display/state` reports) → desktop offset.",
        "properties": {
          "positions": {
            "type": "object",
            "description": "`{\"<identity_slot>\": {\"x\": …, \"y\": …}}` desktop top-left per slot.",
            "additionalProperties": {
              "$ref": "#/components/schemas/Position"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "DisplayPolicy": {
        "type": "object",
        "description": "File + mgmt GET/PUT shape. When [`preset`](Self::preset) is not\n[`Preset::Custom`], explicit fields are ignored; [`effective`](Self::effective)\nresolves both to [`EffectivePolicy`].",
        "properties": {
          "capture_monitor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Deprecated: `screen`'s connector, kept one release for older consoles and SDKs. Read\nwhen `screen` is absent; written from `screen`.",
            "deprecated": true
          },
          "clients": {
            "type": "object",
            "description": "Per-device deviations, keyed by pairing fingerprint — what identity\nslots, admission and the device list already key on (never an address:\na dual-boot box keeps its fingerprint and changes its IP).\n\nWritten only through `/display/clients/{fp}`; the host-wide PUT refuses\na non-empty `clients` key, so a stale console cannot round-trip the\nwhole map back over a change it never saw.",
            "additionalProperties": {
              "$ref": "#/components/schemas/ClientOverlay"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "ddc_power_off": {
            "type": "boolean",
            "description": "Windows: DDC/CI panel off (VCP 0xD6) before Exclusive isolate, on at\nrestore. Cuts standby auto-input-scan / DP link churn on a dark\nphysical. Best-effort; no DDC/CI → skip. Orthogonal to `preset`; default off."
          },
          "edid_lock": {
            "type": "boolean",
            "description": "Windows/AMD: pin connector EDID emulation while streaming\n(`pf_win_display::adl_emul`). Locked at first Exclusive isolate\nbefore physicals deactivate (awake sink answers the live-EDID read),\nunlocked at last-member teardown, crash-journaled. Inert without\n`atiadlxx.dll`. Orthogonal to `preset`; default off."
          },
          "game_session": {
            "$ref": "#/components/schemas/GameSession",
            "description": "Game-launch routing. Orthogonal to `preset`; `#[serde(default)]` is\n`Dedicated`. A saved file always names its value and keeps it."
          },
          "identity": {
            "$ref": "#/components/schemas/Identity"
          },
          "keep_alive": {
            "$ref": "#/components/schemas/KeepAlive"
          },
          "keep_monitors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Connectors that stay lit while streaming, even under `exclusive`\n(`design/web-console-overhaul.md` §5.5).\n\nThe shared-desktop case the all-or-nothing topology axis cannot express: the\ncouch TV streams on the sole screen while the desk monitor stays usable. Only\nmeaningful under `exclusive` — nothing else turns a monitor off."
          },
          "launch_workspace": {
            "$ref": "#/components/schemas/WorkspacePlacement",
            "description": "Default for a launch whose library entry names no `on_window.workspace`.\nOrthogonal to `preset`; `#[serde(default)]` is `own`, so an older\n`display-settings.json` opts in with the rest."
          },
          "layout": {
            "$ref": "#/components/schemas/Layout"
          },
          "max_displays": {
            "type": "integer",
            "format": "int32",
            "description": "Simultaneous live virtual displays. Clamped to `1..=16` (connector ceiling).",
            "minimum": 0
          },
          "mode_conflict": {
            "$ref": "#/components/schemas/ModeConflict"
          },
          "pnp_disable_monitors": {
            "type": "boolean",
            "description": "Windows: disable the PnP nodes of the physical monitors the isolate\nswitched off, for the stream; re-enabled at teardown. Persistent so a\nre-HPD stays off. Inactive externals are [`standby_sink_neutralise`]'s.\nA crash journal re-enables leftovers. Orthogonal to `preset`; default\non, and a v1 file migrates to on."
          },
          "preset": {
            "$ref": "#/components/schemas/Preset"
          },
          "screen": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DisplayTarget",
                "description": "What a device with no `screen` of its own streams; absent is its own screen.\nHost-wide, orthogonal to `preset`. `PUNKTFUNK_CAPTURE_MONITOR` overrides it so\n`host.env` can pin without a console write undoing it."
              }
            ]
          },
          "topology": {
            "$ref": "#/components/schemas/Topology"
          },
          "version": {
            "type": "integer",
            "format": "int32",
            "description": "Schema version. Unknown versions load best-effort\n([`DisplayPolicyStore::load_from`] warns) and write pins current.",
            "minimum": 0
          }
        }
      },
      "DisplaySettingsState": {
        "type": "object",
        "description": "Stored policy, preset expansions, effective policy, and which options this build enforces.",
        "required": [
          "settings",
          "configured",
          "effective",
          "auto_topology",
          "presets",
          "custom_presets",
          "enforced",
          "client_enforced",
          "clients"
        ],
        "properties": {
          "auto_topology": {
            "$ref": "#/components/schemas/Topology",
            "description": "What `topology: auto` resolves to on this host, never `auto` (`effective_topology`)."
          },
          "client_enforced": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Overlay fields this build acts on PER DEVICE. Not a subset of `enforced`:\n`max_mode` and `scale` are only here, and an axis can be host-wide and not yet\nper-device. The console must not offer a device control the host would store and\nignore (`design/web-console-overhaul.md` D1)."
          },
          "clients": {
            "type": "object",
            "description": "Stored per-device overlays, so one fetch paints the device rows.\nREAD-ONLY here — writes go to `/display/clients/{fingerprint}`, and the\nPUT below refuses a body carrying this key.",
            "additionalProperties": {
              "$ref": "#/components/schemas/ClientOverlay"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "configured": {
            "type": "boolean",
            "description": "True once `display-settings.json` exists."
          },
          "custom_presets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomPreset"
            },
            "description": "Saved custom presets (`display-presets.json`). Apply via a `Custom` policy of their fields."
          },
          "effective": {
            "$ref": "#/components/schemas/EffectivePolicy"
          },
          "enforced": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names this build acts on (live vs coming-soon). Per-backend nuance is on `/display/state`."
          },
          "presets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PresetInfo"
            }
          },
          "settings": {
            "$ref": "#/components/schemas/DisplayPolicy",
            "description": "Stored policy, or the built-in default when unconfigured."
          }
        }
      },
      "DisplayStateResponse": {
        "type": "object",
        "required": [
          "displays"
        ],
        "properties": {
          "displays": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiDisplayInfo"
            }
          }
        }
      },
      "DisplayTarget": {
        "oneOf": [
          {
            "type": "string",
            "description": "A virtual display the host creates for this device.",
            "enum": [
              "own"
            ]
          },
          {
            "type": "object",
            "description": "A physical head, by connector (`DP-1`, `HDMI-A-2`).",
            "required": [
              "monitor"
            ],
            "properties": {
              "monitor": {
                "type": "string",
                "description": "A physical head, by connector (`DP-1`, `HDMI-A-2`)."
              }
            }
          }
        ],
        "description": "What a device streams: a screen of its own, or one of the host's monitors by connector.\nJSON `\"own\"` or `{\"monitor\": \"HDMI-A-1\"}`."
      },
      "DisplayTargets": {
        "type": "object",
        "description": "What a device may stream (`GET /display/targets`).",
        "required": [
          "locked",
          "host_default",
          "may_choose",
          "targets"
        ],
        "properties": {
          "host_default": {
            "$ref": "#/components/schemas/DisplayTarget",
            "description": "What a device with no screen of its own streams."
          },
          "locked": {
            "type": "boolean",
            "description": "`PUNKTFUNK_CAPTURE_MONITOR` fixes the screen for every device."
          },
          "may_choose": {
            "type": "boolean",
            "description": "Whether the caller may choose the screen: a paired device's `GRANT_DISPLAY`, always on\nthe operator and plugin lanes. A device's write without it is 403."
          },
          "role": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScreenRoles",
                "description": "The roles a device's own screen takes on this desk. Absent on a contract seat, a host\nwith no mirror backend, a gamescope session, and a desktop that lists no physical\nmonitor."
              }
            ]
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenRow"
            }
          },
          "yours": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DisplayTarget",
                "description": "What the calling device is set to, before a taken or missing monitor falls back to its\nown screen. A screen it set itself counts only while `may_choose`. Null on the operator\nand plugin lanes."
              }
            ]
          }
        }
      },
      "DoorChange": {
        "type": "object",
        "description": "`PUT /profiles/door`.",
        "required": [
          "on"
        ],
        "properties": {
          "on": {
            "type": "boolean",
            "description": "`true` makes the box reachable without anyone logging in; `false` hands it back."
          }
        }
      },
      "Download": {
        "type": "object",
        "description": "One title's download as the host serves it.",
        "required": [
          "app_id",
          "title",
          "state",
          "done_bytes",
          "started_at",
          "updated_at"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "description": "Library id, as `GET /library` lists it."
          },
          "by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who asked for it: `console`, a client's label. Absent when the plugin started it."
          },
          "done_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "eta_s": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds left at the pace over the last [`ETA_WINDOW`], while downloading with a known\ntotal.",
            "minimum": 0
          },
          "phase": {
            "type": [
              "string",
              "null"
            ]
          },
          "rate_bps": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes per second over the last [`RATE_WINDOW`], while downloading.",
            "minimum": 0
          },
          "started_at": {
            "type": "string",
            "description": "RFC 3339."
          },
          "state": {
            "$ref": "#/components/schemas/DownloadState"
          },
          "title": {
            "type": "string"
          },
          "total_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "updated_at": {
            "type": "string",
            "description": "RFC 3339."
          }
        }
      },
      "DownloadReport": {
        "type": "object",
        "description": "One title in a plugin's report.",
        "required": [
          "external_id",
          "state"
        ],
        "properties": {
          "done_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed, one sentence for the player."
          },
          "external_id": {
            "type": "string"
          },
          "phase": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the plugin is doing, in its words: `File 2 of 3`, `Verifying`. Cut to\n[`PHASE_MAX`] bytes."
          },
          "state": {
            "$ref": "#/components/schemas/DownloadState"
          },
          "total_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Absent while the size isn't known yet.",
            "minimum": 0
          }
        }
      },
      "DownloadState": {
        "type": "string",
        "enum": [
          "queued",
          "downloading",
          "paused",
          "installing",
          "done",
          "failed",
          "cancelled"
        ]
      },
      "DownloadsAccepted": {
        "type": "object",
        "required": [
          "matched",
          "unknown"
        ],
        "properties": {
          "matched": {
            "type": "integer",
            "description": "Rows naming one of the provider's titles.",
            "minimum": 0
          },
          "unknown": {
            "type": "integer",
            "description": "Rows naming a title the provider doesn't list (the report raced a reconcile).",
            "minimum": 0
          }
        }
      },
      "DownloadsReport": {
        "type": "object",
        "description": "A plugin's downloads: every title it is downloading, paused or just finished.",
        "required": [
          "downloads"
        ],
        "properties": {
          "downloads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadReport"
            }
          }
        }
      },
      "EffectivePolicy": {
        "type": "object",
        "description": "The six axes after preset expansion. What lifecycle/registry read, and\nwhat mgmt echoes as in-force.\n\nEvery field is required on the wire. This type is also\n[`CustomPresetInput::fields`] (`POST/PUT /display/presets`) and a\nresponse member three times. `#[serde(default)]` would turn\n`{\"name\":\"Kiosk\",\"fields\":{}}` into a 201 storing six unchosen axes and\nmake all six optional in OpenAPI. Catalog tolerance for older entries\nlives on the read path only: [`StoredEffectivePolicy`].",
        "required": [
          "keep_alive",
          "topology",
          "mode_conflict",
          "identity",
          "layout",
          "max_displays"
        ],
        "properties": {
          "identity": {
            "$ref": "#/components/schemas/Identity"
          },
          "keep_alive": {
            "$ref": "#/components/schemas/KeepAlive"
          },
          "layout": {
            "$ref": "#/components/schemas/Layout"
          },
          "max_displays": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "mode_conflict": {
            "$ref": "#/components/schemas/ModeConflict"
          },
          "topology": {
            "$ref": "#/components/schemas/Topology"
          }
        }
      },
      "EmulatorCopy": {
        "type": "object",
        "description": "One copy of an emulator on this host.",
        "required": [
          "kind",
          "exe"
        ],
        "properties": {
          "config_root": {
            "type": [
              "string",
              "null"
            ]
          },
          "cores": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "RetroArch: the libretro cores this copy has (`snes9x`)."
          },
          "exe": {
            "type": "string",
            "description": "The program, or `flatpak run <app id>`."
          },
          "kind": {
            "type": "string",
            "description": "`managed`, `flatpak`, `native` or `portable`."
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EmulatorRegistry": {
        "type": "object",
        "description": "hermir's registry, as hermir writes it; its JSON Schema is hermir's own."
      },
      "EmulatorStatus": {
        "type": "object",
        "required": [
          "id",
          "name",
          "platforms",
          "offered",
          "detected",
          "home"
        ],
        "properties": {
          "detected": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmulatorCopy"
            }
          },
          "home": {
            "type": "string",
            "description": "The folder a plugin is granted to reach the managed copy."
          },
          "id": {
            "type": "string"
          },
          "managed": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ManagedEmulator"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "offered": {
            "type": "boolean",
            "description": "Whether this host's OS has an install channel. A detect-only entry is never offered."
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Platform ids the emulator plays."
          }
        }
      },
      "EmulatorStep": {
        "type": "object",
        "description": "What one save or add-on step did.",
        "required": [
          "target",
          "outcome"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "outcome": {
            "type": "string",
            "description": "`applied`, `present`, `skipped`, `conflict` or `failed`."
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "target": {
            "type": "string"
          }
        }
      },
      "EndGameRequest": {
        "type": "object",
        "properties": {
          "app_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Store-qualified id (`steam:570`); omit to reach every title."
          },
          "streaming": {
            "type": "boolean",
            "description": "Also end games on a live session, not only games nobody is streaming."
          }
        }
      },
      "EndGameResult": {
        "type": "object",
        "required": [
          "ended"
        ],
        "properties": {
          "ended": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "EntryStats": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameStats"
          },
          {
            "type": "object",
            "properties": {
              "mine": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/GameStats"
                  }
                ]
              }
            }
          }
        ],
        "description": "One title on `GET /library`: the host-wide numbers, plus `mine` for the profile the\nrequest named (`?as=`) once that profile has launched the title."
      },
      "EnvMarker": {
        "type": "object",
        "description": "Plugin-owned stores must name this on [`DetectHint`]; the host does not\nread the launcher's files. Heroic's `HEROIC_APP_NAME` is the only signal\nunder Proton.",
        "required": [
          "key"
        ],
        "properties": {
          "key": {
            "type": "string",
            "example": "HEROIC_APP_NAME"
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "`None` matches key presence only — safe solely for one-game-at-a-time launchers."
          }
        }
      },
      "EventKind": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "client",
              "kind"
            ],
            "properties": {
              "client": {
                "$ref": "#/components/schemas/ClientRef"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "client.connected"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "client",
              "reason",
              "kind"
            ],
            "properties": {
              "client": {
                "$ref": "#/components/schemas/ClientRef"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "client.disconnected"
                ]
              },
              "reason": {
                "$ref": "#/components/schemas/DisconnectReason"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "session",
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "session.started"
                ]
              },
              "session": {
                "$ref": "#/components/schemas/SessionRef"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "session",
              "summary",
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "session.ended"
                ]
              },
              "session": {
                "$ref": "#/components/schemas/SessionRef"
              },
              "summary": {
                "$ref": "#/components/schemas/SessionSummary",
                "description": "Every number the host has for the finished session, including why it ended."
              }
            }
          },
          {
            "type": "object",
            "required": [
              "stream",
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "stream.started"
                ]
              },
              "stream": {
                "$ref": "#/components/schemas/StreamRef"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "stream",
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "stream.stopped"
                ]
              },
              "stream": {
                "$ref": "#/components/schemas/StreamRef"
              }
            }
          },
          {
            "type": "object",
            "description": "Fires before the host spawns a launched game, never on adopt. Plugins and hooks that\nhold this stage run first ([`crate::holds`]).",
            "required": [
              "game",
              "kind"
            ],
            "properties": {
              "game": {
                "$ref": "#/components/schemas/GameRefPayload"
              },
              "hold": {
                "type": "string",
                "description": "On a seat host, which runs no plugins: the launch also waits for the host with the\nplugins to `POST /game/holds/{hold}/release`. Absent everywhere else."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "game.launching"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Fires once the host has seen the game process, not merely spawned its launcher.",
            "required": [
              "game",
              "kind"
            ],
            "properties": {
              "game": {
                "$ref": "#/components/schemas/GameRefPayload"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "game.running"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Fires when the game's own window reaches the screen, which is often far\nlater than its process: a Proton prefix build, a splash on a black\nwindow, an emulator loading a ROM.",
            "required": [
              "game",
              "title",
              "app_id",
              "kind"
            ],
            "properties": {
              "app_id": {
                "type": "string",
                "description": "Wayland `app_id` or X11 class; `steam_app_<id>` under gamescope; empty on Windows."
              },
              "game": {
                "$ref": "#/components/schemas/GameRefPayload"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "game.window"
                ]
              },
              "title": {
                "type": "string",
                "description": "Title the compositor or the desktop reports for that window."
              }
            }
          },
          {
            "type": "object",
            "required": [
              "game",
              "reason",
              "kind"
            ],
            "properties": {
              "game": {
                "$ref": "#/components/schemas/GameRefPayload"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "game.exited"
                ]
              },
              "reason": {
                "$ref": "#/components/schemas/GameEndReason"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "device",
              "kind"
            ],
            "properties": {
              "device": {
                "$ref": "#/components/schemas/DeviceRef"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "pairing.pending"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "device",
              "kind"
            ],
            "properties": {
              "device": {
                "$ref": "#/components/schemas/DeviceRef"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "pairing.completed"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "device",
              "kind"
            ],
            "properties": {
              "device": {
                "$ref": "#/components/schemas/DeviceRef"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "pairing.denied"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Explicit operator choice (`add_with_access(Some)`). A pairing with no choice\nemits only `pairing.completed` — see `design/per-client-access.md`.",
            "required": [
              "device",
              "grants",
              "kind"
            ],
            "properties": {
              "device": {
                "$ref": "#/components/schemas/DeviceRef"
              },
              "expires_unix": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64",
                "description": "Host wall-clock unix seconds; absent = permanent."
              },
              "grants": {
                "type": "integer",
                "format": "int32",
                "description": "`GRANT_*` bits; reserved bits already cleared.",
                "minimum": 0
              },
              "kind": {
                "type": "string",
                "enum": [
                  "access.granted"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Post-pairing edit (console sheet / extend / expire-now), not the original grant.",
            "required": [
              "device",
              "grants",
              "kind"
            ],
            "properties": {
              "device": {
                "$ref": "#/components/schemas/DeviceRef"
              },
              "expires_unix": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64"
              },
              "grants": {
                "type": "integer",
                "format": "int32",
                "minimum": 0
              },
              "kind": {
                "type": "string",
                "enum": [
                  "access.changed"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Deadline fire on a live session. A device with no session expires silently.",
            "required": [
              "device",
              "kind"
            ],
            "properties": {
              "device": {
                "$ref": "#/components/schemas/DeviceRef"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "access.expired"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "backend",
              "mode",
              "kind"
            ],
            "properties": {
              "backend": {
                "type": "string",
                "description": "`VirtualDisplay::name` of the backend that minted it."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "display.created"
                ]
              },
              "mode": {
                "type": "string",
                "description": "`WxH@Hz`."
              }
            }
          },
          {
            "type": "object",
            "required": [
              "count",
              "kind"
            ],
            "properties": {
              "count": {
                "type": "integer",
                "format": "int32",
                "description": "How many kept displays this release retired.",
                "minimum": 0
              },
              "kind": {
                "type": "string",
                "enum": [
                  "display.released"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "source",
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "library.changed"
                ]
              },
              "source": {
                "type": "string",
                "description": "`\"manual\"`, or a provider id."
              }
            }
          },
          {
            "type": "object",
            "description": "Once per discovered version; a steady \"newer exists\" does not re-fire on every refresh.",
            "required": [
              "version",
              "channel",
              "install_kind",
              "kind"
            ],
            "properties": {
              "channel": {
                "type": "string",
                "description": "`stable` or `canary`."
              },
              "install_kind": {
                "type": "string",
                "description": "`apt`, `windows-installer`, … so a hook can hint how to update without a second call."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "update.available"
                ]
              },
              "version": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "description": "Boot-time reconciliation by the NEW binary after a successful apply.",
            "required": [
              "from",
              "to",
              "kind"
            ],
            "properties": {
              "from": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "update.applied"
                ]
              },
              "to": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "description": "A managed emulator was installed or removed. Re-read `GET /api/v1/emulators`.",
            "required": [
              "id",
              "kind"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "emulators.changed"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "A title's download changed state, or its files were removed. Re-read `GET /api/v1/downloads`.",
            "required": [
              "app",
              "title",
              "state",
              "kind"
            ],
            "properties": {
              "app": {
                "type": "string",
                "description": "Library id, as `GET /library` lists it."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "downloads.changed"
                ]
              },
              "state": {
                "type": "string",
                "description": "The download's state, or `removed` after an uninstall."
              },
              "title": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "id",
              "kind"
            ],
            "properties": {
              "id": {
                "type": "string",
                "description": "Plugin that registered, restarted, deregistered, or lease-expired. Re-read `GET /api/v1/plugins`."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "plugins.changed"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Payload-free: the store is a join. Re-read `GET /api/v1/store/catalog` / `…/installed`.",
            "required": [
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "store.changed"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "The operator changed host settings. Re-read `GET /api/v1/host/settings`.",
            "required": [
              "ids",
              "kind"
            ],
            "properties": {
              "ids": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Setting ids the write named."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "settings.changed"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Emitted on ACCEPT, and again if the executor later fails. A succeeded power\naction ends this process, so \"accepted with no later failure\" is success.",
            "required": [
              "id",
              "outcome",
              "kind"
            ],
            "properties": {
              "device": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/DeviceRef",
                    "description": "Cert-lane invoker; absent for the operator console (admin lane)."
                  }
                ]
              },
              "id": {
                "type": "string",
                "description": "`power.sleep`, `power.reboot`, `power.shutdown`, `host.restart`, `display.next`."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "action.invoked"
                ]
              },
              "outcome": {
                "type": "string",
                "description": "`accepted`, or `failed: <executor error>`."
              }
            }
          },
          {
            "type": "object",
            "required": [
              "version",
              "gamestream",
              "kind"
            ],
            "properties": {
              "gamestream": {
                "type": "boolean"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "host.started"
                ]
              },
              "version": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "host.stopping"
                ]
              }
            }
          }
        ],
        "description": "Internally tagged `\"kind\": \"<domain>.<verb>\"`, flattened into [`HostEvent`].\nAdditive-only within [`SCHEMA_VERSION`]."
      },
      "ExportUnitsRequest": {
        "type": "object",
        "required": [
          "platform",
          "units",
          "dir"
        ],
        "properties": {
          "dir": {
            "type": "string",
            "description": "The folder the files go to: relative to a plugin's own state folder, absolute for the\noperator. Made when missing."
          },
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "platform": {
            "type": "string"
          },
          "units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnitRef"
            }
          }
        }
      },
      "ExportedUnitView": {
        "type": "object",
        "required": [
          "kind",
          "name",
          "file",
          "size",
          "md5"
        ],
        "properties": {
          "file": {
            "type": "string",
            "description": "The file written, spelled the way the request spelled `dir`."
          },
          "kind": {
            "type": "string"
          },
          "md5": {
            "type": "string",
            "description": "MD5, hex."
          },
          "name": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "FirmwareFileView": {
        "type": "object",
        "required": [
          "name",
          "md5"
        ],
        "properties": {
          "known": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true` a known good dump, `false` named right but not one, absent when no hashes are known."
          },
          "md5": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "The file's name."
          }
        }
      },
      "FirmwareStatusView": {
        "type": "object",
        "description": "One platform's firmware on the best copy.",
        "required": [
          "platform",
          "ok",
          "optional",
          "any_of",
          "found"
        ],
        "properties": {
          "any_of": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Accepted file names."
          },
          "found": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FirmwareFileView"
            }
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the platform needs, in a phrase a UI shows."
          },
          "ok": {
            "type": "boolean",
            "description": "The need is met."
          },
          "optional": {
            "type": "boolean"
          },
          "platform": {
            "type": "string"
          }
        }
      },
      "GameEndReason": {
        "type": "string",
        "enum": [
          "exited",
          "terminated"
        ]
      },
      "GameEntry": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameMeta"
          },
          {
            "type": "object",
            "required": [
              "id",
              "store",
              "title",
              "art"
            ],
            "properties": {
              "art": {
                "$ref": "#/components/schemas/Artwork"
              },
              "filled": {
                "type": "object",
                "description": "Where each borrowed value came from: art slot or meta field → source id, or `pick`\n([`PICK`]). Values the entry carried itself are absent. Not sent to paired clients.",
                "additionalProperties": {
                  "type": "string"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "icon": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Brand-mark token (`steam`, `heroic`) — never bytes or a URL. See [`is_icon_token`].\n\nThe art proxy serves raster only ([`art::local_art_bytes`] refuses SVG as\nscript-capable XML), so the mark stays a name the client already ships.",
                "example": "steam"
              },
              "id": {
                "type": "string",
                "description": "Stable, store-qualified id (`steam:570`, `custom:<id>`); `library_id_for` mints a\nstored row's.",
                "example": "steam:570"
              },
              "ids": {
                "type": "object",
                "description": "Catalog ids a metadata source matches on (`steam`, `gog`, `libretro`, `sgdb` → value),\nset by the plugin that lists the entry. Not sent to paired clients.",
                "additionalProperties": {
                  "type": "string"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "install": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/Install",
                    "description": "Whether the title's files are on this host. Absent means they are."
                  }
                ]
              },
              "launch": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LaunchSpec"
                  }
                ]
              },
              "on_window": {
                "$ref": "#/components/schemas/OnWindow",
                "description": "Which workspace this title's windows open on, where the compositor can\nplace them ([`OnWindow`])."
              },
              "overrides": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/GameOverrides",
                    "description": "The stream settings this host sets for the title (`overrides.rs`), resolved: its own, a\nshared override's with that one's `name`, or its source's. Joined at read time."
                  }
                ]
              },
              "own": {
                "type": "boolean",
                "description": "One of the profile in view's own titles (`own:` id). Its seat host keeps how it starts;\nanywhere else it is a name and a picture, and starts nothing."
              },
              "provider": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Plugin that owns this entry; `None` when no plugin on this host does: an operator's row,\nthe Game Mode tile, a seat's own title as the box lists it.\n`GET /library?provider=` filters on it."
              },
              "role": {
                "$ref": "#/components/schemas/GameRole"
              },
              "stats": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/EntryStats",
                    "description": "Play stats, once this host has launched the title (`stats.rs`). Joined at read\ntime from `library-stats.json`, never stored on the entry."
                  }
                ]
              },
              "store": {
                "type": "string",
                "description": "Which store surfaced it: the claimed store (`\"steam\"`), `\"custom\"` for a row with no\nclaim, `\"host\"` for the host's own Game Mode tile.",
                "example": "steam"
              },
              "title": {
                "type": "string"
              }
            }
          }
        ],
        "description": "One title in the unified library, regardless of store."
      },
      "GameMeta": {
        "type": "object",
        "description": "Optional display metadata, `#[serde(flatten)]`-ed into [`GameEntry`].\n\nValues are free-form strings, not enums — emulation sources (RomM, EmuDeck,\nPlaynite) each have their own vocabulary and the host does not normalize it.",
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "developer": {
            "type": [
              "string",
              "null"
            ]
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "platform": {
            "type": [
              "string",
              "null"
            ],
            "description": "`\"PS2\"`, `\"Xbox 360\"`, `\"SNES\"`, … Installed-store scanners stamp `\"PC\"`;\n`GET /library?platform=` filters on it (case-insensitive).",
            "example": "PS2"
          },
          "players": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "publisher": {
            "type": [
              "string",
              "null"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Year of first release — the granularity metadata sources agree on.",
            "example": 2001,
            "minimum": 0
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GameOnNewLaunch": {
        "type": "string",
        "description": "What to do with a title this client already has running when it launches a\n**different** one.\n\nA third axis, not a fourth [`GameOnSessionEnd`] value: that one is \"this\nsession is over\"; this one is \"the player asked for something else\". An\noperator who wants a game to survive a disconnect can still want it closed\nwhen they pick another title.\n\nScoped to this client's own launches, and only launches this host performed\n([`crate::launchreg`]). A game the player started at the machine was never\nrecorded, so this cannot close it.",
        "enum": [
          "keep",
          "end"
        ]
      },
      "GameOnSessionEnd": {
        "type": "string",
        "description": "What to do with the launched game when its session ends.",
        "enum": [
          "keep",
          "on_quit",
          "always"
        ]
      },
      "GameOverrides": {
        "type": "object",
        "description": "Stream settings this host sets for a game. A field left out is the device's to decide.",
        "properties": {
          "beyond_screen": {
            "type": "boolean",
            "description": "`lines` also reaches a device whose screen is smaller, scaled down there."
          },
          "gamepad": {
            "type": [
              "string",
              "null"
            ],
            "description": "A controller by the Hello's name for it: `xbox360`, `dualsense`, `dualshock4`, `auto`, …\nThe host stores the name itself, so `ds` reads back as `dualsense`.",
            "example": "dualsense"
          },
          "hdr": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "hz": {
            "type": "integer",
            "format": "int32",
            "description": "Refresh rate in Hz, never above the device's screen.",
            "example": 60,
            "maximum": 240,
            "minimum": 24
          },
          "lines": {
            "type": "integer",
            "format": "int32",
            "description": "Height in lines: 2160 for 4K. The width follows the device's aspect.",
            "example": 1080,
            "maximum": 4320,
            "minimum": 360
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The shared override these values came from. A game's or source's own values have none.",
            "example": "1080p60 DualSense"
          }
        }
      },
      "GameRefPayload": {
        "type": "object",
        "required": [
          "title",
          "client",
          "plane"
        ],
        "properties": {
          "app": {
            "type": [
              "string",
              "null"
            ],
            "description": "Store-qualified id (`steam:570`). Absent for an operator-typed GameStream `apps.json` command."
          },
          "client": {
            "type": "string"
          },
          "fingerprint": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stable id of the device that launched it; the filter handle a name cannot be."
          },
          "plane": {
            "$ref": "#/components/schemas/Plane"
          },
          "preset": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PresetRef",
                "description": "The preset of the session that launched it. See [`ClientRef::preset`]."
              }
            ]
          },
          "profile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileRef",
                "description": "The profile of the session that launched it. See [`ClientRef::profile`]."
              }
            ]
          },
          "store": {
            "type": [
              "string",
              "null"
            ],
            "description": "`steam`, `heroic`, `custom`, … when known."
          },
          "title": {
            "type": "string"
          }
        }
      },
      "GameRole": {
        "type": "string",
        "description": "Presentation hint: ordinary title vs the launcher itself (Steam Big Picture,\nHeroic, Playnite fullscreen). A launcher entry launches, leases, and lists\nlike a game (design D4). Serde-default `game`; skipped when default so the\nwire is unchanged for entries that don't opt in.",
        "enum": [
          "game",
          "launcher"
        ]
      },
      "GameSession": {
        "type": "string",
        "description": "How a session that launches a game is served\n(`design/gamemode-and-dedicated-sessions.md`). Top-level\n[`DisplayPolicy`] field, not part of [`EffectivePolicy`], so a preset\nnever clobbers it. Linux-only in effect.",
        "enum": [
          "auto",
          "dedicated"
        ]
      },
      "GameStats": {
        "type": "object",
        "description": "One title's numbers. On the wire as `GameEntry.stats`; absent until the first launch.",
        "required": [
          "last_played_unix_ms",
          "play_time_ms",
          "last_run_ms",
          "launch_count"
        ],
        "properties": {
          "last_played_unix_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Unix ms of the most recent launch. Stamped at launch, so a game just started sorts first.",
            "minimum": 0
          },
          "last_run_ms": {
            "type": "integer",
            "format": "int64",
            "description": "The run that started at `last_played_unix_ms`. Still growing while it runs.",
            "minimum": 0
          },
          "launch_count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "play_time_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Every run added up.",
            "minimum": 0
          }
        }
      },
      "GpuState": {
        "type": "object",
        "required": [
          "gpus",
          "mode",
          "preferred_available"
        ],
        "properties": {
          "active": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiActiveGpu"
              }
            ]
          },
          "encoder_pin": {
            "type": [
              "string",
              "null"
            ],
            "description": "`PUNKTFUNK_ENCODER` when pinned (`qsv` / `nvenc` / …, not `auto`). A vendor mismatch is\noverridden at session open (adapter wins); the console uses this to flag a stale pin."
          },
          "env_override": {
            "type": [
              "string",
              "null"
            ],
            "description": "`PUNKTFUNK_RENDER_ADAPTER` when set. Windows honours it in `auto`; a manual pick\noverrides it."
          },
          "gpus": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiGpu"
            }
          },
          "mode": {
            "type": "string",
            "description": "`auto` or `manual`."
          },
          "preferred_available": {
            "type": "boolean"
          },
          "preferred_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stored manual pick; retained in `auto` so the console can switch back. May name an absent GPU."
          },
          "preferred_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Label for the stored pick, kept even when that GPU is absent."
          },
          "selected": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApiSelectedGpu"
              }
            ]
          }
        }
      },
      "Grant": {
        "type": "object",
        "description": "One root the operator granted, as recorded on disk. `at`/`by` are audit fields:\nRFC3339 and `console`/`cli`/`legacy`/`form` (a v1 entry has neither).",
        "required": [
          "path",
          "write",
          "at",
          "by"
        ],
        "properties": {
          "at": {
            "type": "string"
          },
          "by": {
            "type": "string"
          },
          "files": {
            "type": "boolean",
            "description": "The folder and the files directly in it, nothing below. Its ACE lands at once however\nlarge the tree under it is, where a recursive one rewrites every file."
          },
          "forms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The plugin forms that handed this path over (`config`, `game:<entry id>`). A grant\nwith `by: \"form\"` goes when the last of them lets go."
          },
          "path": {
            "type": "string"
          },
          "write": {
            "type": "boolean"
          }
        }
      },
      "GyroCadence": {
        "type": "object",
        "description": "Client gyro arrival counts. Absent when no pad ever sent motion.",
        "required": [
          "samples",
          "stalls"
        ],
        "properties": {
          "samples": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "stalls": {
            "type": "integer",
            "format": "int64",
            "description": "Gaps of 500 ms or more — the feed stopping, not jitter.",
            "minimum": 0
          }
        }
      },
      "Health": {
        "type": "object",
        "required": [
          "status",
          "version",
          "abi_version"
        ],
        "properties": {
          "abi_version": {
            "type": "integer",
            "format": "int32",
            "description": "`punktfunk-core` C ABI version.",
            "minimum": 0
          },
          "status": {
            "type": "string",
            "description": "Always `\"ok\"` when the host responds.",
            "example": "ok"
          },
          "version": {
            "type": "string",
            "description": "`punktfunk-host` crate version."
          }
        }
      },
      "HiddenState": {
        "type": "object",
        "required": [
          "id",
          "hidden"
        ],
        "properties": {
          "hidden": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "HiddenToggle": {
        "type": "object",
        "required": [
          "hidden"
        ],
        "properties": {
          "hidden": {
            "type": "boolean"
          }
        }
      },
      "Home": {
        "type": "string",
        "enum": [
          "desktop",
          "bigpicture"
        ]
      },
      "HookEntry": {
        "type": "object",
        "description": "One hook: `run` and/or `webhook` when `on` (+ `filter`) matches.",
        "required": [
          "on"
        ],
        "properties": {
          "debounce_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Minimum interval between firings, in milliseconds. 0 = fire every time. A `hold` ignores it.",
            "minimum": 0
          },
          "elevated": {
            "type": "boolean",
            "description": "Windows: `run` gets the signed-in administrator's full token, with no UAC prompt. Runs\nonly after an administrator ran `punktfunk-host hooks elevated on`."
          },
          "filter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/HookFilter",
                "description": "Exact-match constraints; every present field must match."
              }
            ]
          },
          "hmac_secret_file": {
            "type": [
              "string",
              "null"
            ],
            "description": "HMAC secret file (`X-Punktfunk-Signature: sha256=<hex>`). Warns if world-readable."
          },
          "hold": {
            "type": "boolean",
            "description": "The launch waits for this hook, up to `timeout_s`. Only with `on: game.launching`."
          },
          "on": {
            "type": "string",
            "description": "Exact kind (`stream.started`) or `domain.*` prefix; same vocabulary as SSE `?kinds=`."
          },
          "run": {
            "type": [
              "string",
              "null"
            ],
            "description": "Detached shell command: event JSON on stdin, `PF_EVENT_*` env."
          },
          "timeout_s": {
            "type": "integer",
            "format": "int32",
            "description": "Exec timeout in seconds (1–600, default 30); the process group is killed on expiry.",
            "minimum": 0
          },
          "webhook": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HookFilter": {
        "type": "object",
        "description": "Exact-match filters on event identity fields. Absent fields do not constrain;\na field set on a kind that does not carry it (e.g. `client` on `host.started`) never matches.",
        "properties": {
          "app": {
            "type": [
              "string",
              "null"
            ],
            "description": "Launched app id/title (`stream.*` events)."
          },
          "client": {
            "type": [
              "string",
              "null"
            ],
            "description": "Client/device name (`session.*`: the Dashboard's short client label)."
          },
          "fingerprint": {
            "type": [
              "string",
              "null"
            ],
            "description": "Certificate fingerprint (hex, case-insensitive)."
          },
          "plane": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Plane"
              }
            ]
          },
          "preset": {
            "type": [
              "string",
              "null"
            ],
            "description": "The dialled settings preset, by id or name (`client.*`, `session.*`, `stream.*`, `game.*`)."
          },
          "profile": {
            "type": [
              "string",
              "null"
            ],
            "description": "The profile played as, by id (`client.*`, `session.*`, `stream.*`, `game.*`)."
          }
        }
      },
      "HooksConfig": {
        "type": "object",
        "description": "Operator hook config: `hooks.json` and the `/api/v1/hooks` body.",
        "properties": {
          "hooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HookEntry"
            }
          }
        }
      },
      "HostCheck": {
        "type": "object",
        "description": "One health verdict — the wire shape.",
        "required": [
          "id",
          "status",
          "severity",
          "summary",
          "impact",
          "params",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Console i18n key. See [`ids`]."
          },
          "impact": {
            "type": "string",
            "description": "What breaks. Empty only on `ok`/`inapplicable`."
          },
          "impact_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The host message `impact` is the English of."
          },
          "params": {
            "type": "object",
            "description": "Interpolation for localized strings (`{user}`, `{group}`). Only the host can see these.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "remedy": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Remedy"
              }
            ]
          },
          "remedy_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The host message the remedy's `text` is the English of."
          },
          "severity": {
            "$ref": "#/components/schemas/Severity",
            "description": "Meaningless on `ok`/`inapplicable`; carried so the wire shape never changes as status flips."
          },
          "since_unix": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "First non-ok observation this run. Per-run stamp, not a history.",
            "minimum": 0
          },
          "source": {
            "$ref": "#/components/schemas/CheckSource"
          },
          "status": {
            "$ref": "#/components/schemas/CheckStatus"
          },
          "summary": {
            "type": "string",
            "description": "English fallback. Console localizes when it knows `id`."
          },
          "summary_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The host message `summary` is the English of, worded with `params`."
          }
        }
      },
      "HostEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/EventKind",
            "description": "Flattened as `\"kind\": \"stream.started\"` plus payload fields."
          },
          {
            "type": "object",
            "required": [
              "seq",
              "ts_ms",
              "schema"
            ],
            "properties": {
              "schema": {
                "type": "integer",
                "format": "int32",
                "minimum": 0
              },
              "seat": {
                "type": "string",
                "description": "On a door, the profile whose host raised it: a seat's event, on the door's bus for the\nconsole. Absent on the host's own."
              },
              "seq": {
                "type": "integer",
                "format": "int64",
                "description": "Rises by one per event, past every earlier boot's. Resume with `since = last seen`.",
                "minimum": 0
              },
              "ts_ms": {
                "type": "integer",
                "format": "int64",
                "description": "Unix milliseconds — the [`crate::log_capture::LogEntry`] convention.",
                "minimum": 0
              }
            }
          }
        ],
        "description": "One lifecycle event as it appears on the wire (`data:` of one SSE frame)."
      },
      "HostFacts": {
        "type": "object",
        "description": "The console greys out rows this host cannot install.",
        "required": [
          "version",
          "platform"
        ],
        "properties": {
          "platform": {
            "type": "string",
            "description": "`linux` / `windows` / `macos`."
          },
          "version": {
            "type": "string"
          }
        }
      },
      "HostInfo": {
        "type": "object",
        "description": "Host identity and capabilities.",
        "required": [
          "hostname",
          "uniqueid",
          "local_ip",
          "version",
          "abi_version",
          "app_version",
          "gfe_version",
          "os",
          "os_name",
          "codecs",
          "gamestream",
          "door",
          "ports"
        ],
        "properties": {
          "abi_version": {
            "type": "integer",
            "format": "int32",
            "description": "`punktfunk-core` C ABI version.",
            "minimum": 0
          },
          "app_version": {
            "type": "string",
            "description": "GameStream host version advertised to Moonlight clients."
          },
          "codecs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiCodec"
            },
            "description": "Codecs this host can encode (`Resolved::wire_caps`, not the compile-time list). Empty\non a door."
          },
          "door": {
            "type": "boolean",
            "description": "This host is the door (Linux, **Reachable without logging in**): a system service that\nplaces every connect on a seat and streams nothing itself."
          },
          "door_off_unfinished": {
            "type": "boolean",
            "description": "An off didn't hand everything back, and this is the owner's own host: the door counts as\non until an off here finishes it. Admin lane only."
          },
          "door_switch_failed": {
            "type": "boolean",
            "description": "The switch this host last started ran and failed, so the console stops waiting for it.\nAdmin lane only."
          },
          "door_unavailable": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why turning the door on would be refused here, as the operator's next move, such as the\nfiles a channel installs it with missing, or the account not in `punktfunk-update`. `null`\nwhen it would start, on the door itself and on a seat host, and for every lane but the\nadmin one. The answer is up to 30 s old; a switch request drops it."
          },
          "door_unavailable_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The id of `door_unavailable`: the host message `apierr_<code>`."
          },
          "door_unavailable_params": {
            "type": [
              "object",
              "null"
            ],
            "description": "The values of that message's placeholders, by name.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "elevated_commands": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether hooks and prep steps marked `elevated` run as administrator: `true` once an\nadministrator ran `punktfunk-host hooks elevated on` here. `null` where commands can't\nelevate (every OS but Windows), and for every lane but the admin one."
          },
          "fingerprint": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hex SHA-256 of this host's leaf certificate — what a client pins. Public by\nconstruction: every client reads it off the handshake. Carried here so a connect link\ncan name it, and a first connect over an untrusted path is verified rather than blind.\n`null` only if the identity could not be parsed.",
            "example": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
          },
          "gamestream": {
            "type": "boolean",
            "description": "GameStream/Moonlight-compat planes are running (`--gamestream`). `false` is the default (native only)."
          },
          "gfe_version": {
            "type": "string",
            "description": "GFE version advertised to Moonlight clients."
          },
          "hostname": {
            "type": "string"
          },
          "local_ip": {
            "type": "string",
            "description": "Fresh LAN IP each request — do not cache. Cold-boot and network-move report\n`127.0.0.1` until a real address exists."
          },
          "os": {
            "type": "string",
            "description": "OS chain, generic → specific, slash-separated (`windows` | `macos` |\n`linux[/<family>][/<id>]`). Walk most-specific-first; an unknown distro still matches its family.",
            "example": "linux/fedora/bazzite"
          },
          "os_name": {
            "type": "string",
            "description": "Human-readable OS name (os-release `PRETTY_NAME`; `\"Windows\"`/`\"macOS\"` elsewhere).",
            "example": "Bazzite 42 (Kinoite)"
          },
          "ports": {
            "$ref": "#/components/schemas/PortMap"
          },
          "uniqueid": {
            "type": "string",
            "description": "Persisted host id; pairing matches on this."
          },
          "version": {
            "type": "string",
            "description": "`punktfunk-host` crate version."
          }
        }
      },
      "HostSettingsPatch": {
        "type": "object",
        "description": "Setting id → new value; `null` returns a setting to its default.",
        "additionalProperties": {},
        "propertyNames": {
          "type": "string"
        },
        "example": {
          "clipboard": "text",
          "max_fps": null
        }
      },
      "HostSettingsState": {
        "type": "object",
        "required": [
          "settings",
          "restart_pending",
          "env_file"
        ],
        "properties": {
          "env_file": {
            "type": "string",
            "description": "The file an operator edits to pin a setting.",
            "example": "/home/me/.config/punktfunk/host.env"
          },
          "restart_pending": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Setting ids waiting for a restart."
          },
          "settings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SettingState"
            },
            "description": "Rows this host acts on, in page order."
          }
        }
      },
      "HostTheme": {
        "type": "object",
        "description": "The desktop's appearance, as far as this host can see it.",
        "properties": {
          "accent": {
            "type": [
              "string",
              "null"
            ],
            "description": "`#rrggbb`, or `null` when the desktop has no accent to report."
          },
          "mode": {
            "type": [
              "string",
              "null"
            ],
            "description": "`light` | `dark`, or `null` when the desktop expresses no preference."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where the answer came from, for the console's \"Follow host — Windows\" line.\n`null` when nothing answered.",
            "example": "gnome"
          }
        }
      },
      "Identity": {
        "type": "string",
        "description": "Stable identity so DEs persist per-display config (KDE scaling). Carried\nas Windows EDID serial + IddCx connector index, KWin per-slot output\nname, and the host-persisted Mutter scale map.",
        "enum": [
          "shared",
          "per-client",
          "per-client-mode"
        ]
      },
      "ImportUnit": {
        "type": "object",
        "required": [
          "kind",
          "name",
          "file"
        ],
        "properties": {
          "file": {
            "type": "string",
            "description": "The file to put back: relative to a plugin's own state folder, absolute for the operator."
          },
          "kind": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ImportUnitsRequest": {
        "type": "object",
        "required": [
          "platform",
          "units"
        ],
        "properties": {
          "game": {
            "type": [
              "string",
              "null"
            ]
          },
          "others": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The names a server holds for the same game."
          },
          "platform": {
            "type": "string"
          },
          "units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportUnit"
            },
            "description": "Rows of one name go to the first of their kinds with a place for it."
          }
        }
      },
      "InputCounts": {
        "type": "object",
        "description": "Client datagrams this session took, by class.\n\nCounted up to the moment the session was summarized: the reader task ends with the\nconnection, which closes after this, so a last straggler can fall outside.",
        "required": [
          "events",
          "mic",
          "rich",
          "dropped"
        ],
        "properties": {
          "dropped": {
            "type": "integer",
            "format": "int64",
            "description": "Offers the input queue refused because it was full. Not a wire loss.",
            "minimum": 0
          },
          "events": {
            "type": "integer",
            "format": "int64",
            "description": "Keyboard, pointer and touch events.",
            "minimum": 0
          },
          "mic": {
            "type": "integer",
            "format": "int64",
            "description": "Opus microphone frames.",
            "minimum": 0
          },
          "rich": {
            "type": "integer",
            "format": "int64",
            "description": "Gamepad and stylus batches.",
            "minimum": 0
          }
        }
      },
      "Install": {
        "type": "object",
        "description": "Whether a title's files are on this host, as the plugin that lists it reports.",
        "required": [
          "state"
        ],
        "properties": {
          "free_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Free space under `target`, filled in by the host when it serves the entry.",
            "minimum": 0
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Download size while `missing`, size on disk once `installed`.",
            "minimum": 0
          },
          "state": {
            "$ref": "#/components/schemas/InstallState"
          },
          "target": {
            "type": [
              "string",
              "null"
            ],
            "description": "The folder the files go into. Must lie under one of the plugin's write grants; the\noperator's lane only."
          }
        }
      },
      "InstallRequest": {
        "type": "object",
        "description": "Catalog `{source, id}` or a raw `spec` the operator owns.",
        "properties": {
          "accept_unverified": {
            "type": "boolean",
            "description": "Required with [`Self::spec`]. Without it the API refuses; a caller cannot skip the\nunverified decision."
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "With [`Self::source`]: catalogued install."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "With [`Self::id`]: catalogued install."
          },
          "spec": {
            "type": [
              "string",
              "null"
            ],
            "description": "Raw spec (`@scope/name`, `@scope/name@1.2.3`, https tarball or git+https). Nothing reviewed\nit and nothing pins it."
          }
        }
      },
      "InstallState": {
        "type": "string",
        "enum": [
          "missing",
          "installed"
        ]
      },
      "InstalledView": {
        "type": "object",
        "required": [
          "pkg",
          "tier",
          "running"
        ],
        "properties": {
          "blocked": {
            "type": [
              "string",
              "null"
            ],
            "description": "Revocation of the installed version. Reported, never auto-removed."
          },
          "entry_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "installed_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "pkg": {
            "type": "string"
          },
          "plugin_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Key for `GET /plugins`."
          },
          "running": {
            "type": "boolean"
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "takes_ports": {
            "type": "boolean",
            "description": "The plugin uses the network on a host that can forward it a port of this computer\n(Linux): the console offers to allow one."
          },
          "tier": {
            "type": "string",
            "description": "Install-time tier; unverified stays unverified after the dialog is gone."
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "update_available": {
            "type": [
              "string",
              "null"
            ],
            "description": "Catalog version when newer than installed (a version string, not a bool)."
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Job": {
        "type": "object",
        "description": "Snake_case matches the management API; index/sources/manifest files use npm camelCase.",
        "required": [
          "id",
          "kind",
          "target",
          "state",
          "phase",
          "log",
          "started_at"
        ],
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "finished_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "log": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "phase": {
            "type": "string"
          },
          "started_at": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "state": {
            "$ref": "#/components/schemas/State"
          },
          "target": {
            "type": "string"
          },
          "walk": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AccessWalk",
                "description": "The oldest folder whose access is changing while the job runs, whoever it is for."
              }
            ]
          }
        }
      },
      "JobRef": {
        "type": "object",
        "required": [
          "job"
        ],
        "properties": {
          "job": {
            "type": "string"
          }
        }
      },
      "KeepAlive": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "mode"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "off"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Linger `seconds` after the last session leaves; a reconnect inside\nthe window reuses the display.",
            "required": [
              "seconds",
              "mode"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "duration"
                ]
              },
              "seconds": {
                "type": "integer",
                "format": "int32",
                "description": "Linger seconds, clamped to `0..=86400` on write. Longer is\n`forever` in practice; unclamped `u32` is ~136 years and a\nnonsense `expires_in_ms`.",
                "minimum": 0
              }
            }
          },
          {
            "type": "object",
            "description": "Until host shutdown or `POST /display/release` (force-releases\n`Pinned` like `Lingering`). The `gaming-rig` preset selects this.",
            "required": [
              "mode"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "forever"
                ]
              }
            }
          }
        ],
        "description": "Linger after the last client detaches. Tagged on `mode` so the web form\nand OpenAPI stay `{\"mode\":\"off\"}` / `{\"mode\":\"duration\",\"seconds\":N}` /\n`{\"mode\":\"forever\"}`. On gamescope's bare spawn this also keeps the\nnested session and its game."
      },
      "LaunchArg": {
        "type": "object",
        "description": "One named value: an `exec` template's `{param}`, or an `emulator` argument.",
        "required": [
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The parameter's name in the template."
          },
          "value": {
            "type": "string"
          }
        }
      },
      "LaunchSpec": {
        "type": "object",
        "description": "How the host launches a title. Open-ended so new stores slot in: the host builds each\nkind's command (`steam_appid` → `steam://rungameid/<value>`); `command` runs `<value>`\nthrough `sh -c` or `cmd.exe /c`.",
        "required": [
          "kind",
          "value"
        ],
        "properties": {
          "args": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/LaunchArg"
            },
            "description": "Values for an `exec` template's parameters, or an `emulator` entry's `platform`, `file`\nand `core`. Each is checked against its character class, and a path must sit inside the\npaths the publishing plugin's manifest names.\nA list rather than a map: a map of strings generates as an untyped object in the SDK."
          },
          "kind": {
            "type": "string",
            "description": "The launch kind (`\"steam_appid\"`, `\"command\"`, `\"exec\"`, …); `launch.rs` resolves each.",
            "example": "steam_appid"
          },
          "value": {
            "type": "string",
            "description": "Appid for `steam_appid`, the shell command for `command`, or — for `exec` — the name of a\ntemplate in the publishing plugin's manifest."
          }
        }
      },
      "Layer": {
        "type": "string",
        "description": "Whose file a value came from.",
        "enum": [
          "box",
          "profile"
        ]
      },
      "Layout": {
        "type": "object",
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/LayoutMode"
          },
          "positions": {
            "type": "object",
            "description": "Canonical decimal identity-slot ids (`\"1\"`..`\"15\"`) — the exact\nstring `arrange` looks up. [`DisplayPolicy::sanitized`] maps `\"01\"`\n→ `\"1\"` and drops non-ids; a key that never matches is a pin the\nconsole still shows while every session auto-rows past it.",
            "additionalProperties": {
              "$ref": "#/components/schemas/Position"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "LayoutMode": {
        "type": "string",
        "description": "Arrangement in desktop space. Computed only in `layout::arrange`: `/display/state`, the\nWindows manager and Linux position apply (KWin, Hyprland, sway, niri) consume it.",
        "enum": [
          "auto-row",
          "manual"
        ]
      },
      "LibraryPage": {
        "type": "object",
        "description": "One page of the library in title order.",
        "required": [
          "items",
          "total",
          "platforms"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OperatorGameEntry"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hand back as `cursor` for the page after this one. Absent on the last page."
          },
          "not_installed": {
            "type": "integer",
            "description": "Titles not installed on this host among those matching every filter but `install`.\nAbsent when there are none.",
            "minimum": 0
          },
          "platforms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlatformCount"
            },
            "description": "Platforms among the titles matching every filter but `platform`, largest first."
          },
          "total": {
            "type": "integer",
            "description": "Titles matching the filters, across every page.",
            "minimum": 0
          }
        }
      },
      "LinkMinute": {
        "type": "object",
        "description": "One minute of link health for one session. Every field is a delta for the window except\nthe bands, which are min..max over it.",
        "required": [
          "session_id",
          "secs",
          "windows",
          "loss_windows",
          "loss_max_ppm",
          "loss_mean_ppm",
          "unrecovered",
          "rfi",
          "rfi_declined",
          "anchor_p",
          "intra_refresh",
          "acked_p",
          "keyframe_req",
          "idr",
          "fec_min_pct",
          "fec_max_pct",
          "abr_min_kbps",
          "abr_max_kbps",
          "abr_backoffs",
          "retargets",
          "gaps",
          "egress_kbps",
          "link_kbps",
          "shape",
          "resend_pkts",
          "loss_head",
          "loss_mid",
          "loss_tail",
          "sock_drops"
        ],
        "properties": {
          "abr_backoffs": {
            "type": "integer",
            "format": "int32",
            "description": "Client bitrate asks below the rate the encoder was running. The host cannot see which\nof loss, delay or decode drove them — only that the client's controller retreated.",
            "minimum": 0
          },
          "abr_max_kbps": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "abr_min_kbps": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "acked_p": {
            "type": "integer",
            "format": "int32",
            "description": "Frames encoded against one the client confirmed, while the link showed loss.",
            "minimum": 0
          },
          "anchor_p": {
            "type": "integer",
            "format": "int32",
            "description": "What the encoder answered an RFI with: a clean P against a surviving reference, or a\nwave that recodes the picture over at most a quarter second.",
            "minimum": 0
          },
          "egress_kbps": {
            "type": "integer",
            "format": "int32",
            "description": "Sealed wire throughput over the window.",
            "minimum": 0
          },
          "fec_max_pct": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "fec_min_pct": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "gaps": {
            "type": "integer",
            "format": "int32",
            "description": "Pipeline gaps this host announced: its own stalls, not the network's.",
            "minimum": 0
          },
          "idr": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "intra_refresh": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "keyframe_req": {
            "type": "integer",
            "format": "int32",
            "description": "Client decode-recovery asks, and the IDRs actually forced (the cooldown coalesces).",
            "minimum": 0
          },
          "link_kbps": {
            "type": "integer",
            "format": "int32",
            "description": "The link rate the client last reported, which the pacer resolves its `L` from.\n`0` = none.",
            "minimum": 0
          },
          "loss_head": {
            "type": "integer",
            "format": "int32",
            "description": "Shards the client never got, by where in their frame they fell: the first twelve\ndata shards, the middle, and the last twelve with all parity.",
            "minimum": 0
          },
          "loss_max_ppm": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "loss_mean_ppm": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "loss_mid": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "loss_tail": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "loss_windows": {
            "type": "integer",
            "format": "int32",
            "description": "Of `windows`, those that reported any loss.",
            "minimum": 0
          },
          "resend_pkts": {
            "type": "integer",
            "format": "int32",
            "description": "Packets resent on a client's NACK.",
            "minimum": 0
          },
          "retargets": {
            "type": "integer",
            "format": "int32",
            "description": "Times the encoder's rate actually moved.",
            "minimum": 0
          },
          "rfi": {
            "type": "integer",
            "format": "int32",
            "description": "Client reference-frame invalidation asks, and those the encoder refused (each refusal\ncosts an IDR).",
            "minimum": 0
          },
          "rfi_declined": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "secs": {
            "type": "integer",
            "format": "int32",
            "description": "Seconds this line covers. 60, except the last line of a session.",
            "minimum": 0
          },
          "session_id": {
            "type": "integer",
            "format": "int64",
            "description": "The `/status` session id, so a line ties to a row.",
            "minimum": 0
          },
          "shape": {
            "$ref": "#/components/schemas/LinkShape",
            "description": "The shape the client asked for."
          },
          "sock_drops": {
            "type": "integer",
            "format": "int32",
            "description": "Packets the client's own receive buffer dropped.",
            "minimum": 0
          },
          "unrecovered": {
            "type": "integer",
            "format": "int32",
            "description": "Windows that closed with frames parity could not repair.",
            "minimum": 0
          },
          "windows": {
            "type": "integer",
            "format": "int32",
            "description": "Client loss reports that closed here. 0 = the client sent none, which is itself a fault.",
            "minimum": 0
          }
        }
      },
      "LinkShape": {
        "type": "string",
        "description": "How the client asked for its frames: paced, or the wake shape (a small first group and a\ngap on every frame).",
        "enum": [
          "auto",
          "wake"
        ]
      },
      "LocalSummary": {
        "type": "object",
        "description": "Tray snapshot for loopback.\n`require_auth` admits the tray token from loopback; nothing here is a secret.",
        "required": [
          "version",
          "video_streaming",
          "audio_streaming",
          "paired_clients",
          "native_paired_clients",
          "pin_pending",
          "pending_approvals",
          "kept_displays"
        ],
        "properties": {
          "audio_streaming": {
            "type": "boolean",
            "description": "True while audio is streaming on either plane (same rule as `video_streaming`)."
          },
          "client_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "First live session's display name (trust-store, else connect-time). `null` when idle or\nnameless."
          },
          "conflicts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Other GameStream hosts on this machine, detected at startup. Running one alongside is unsupported."
          },
          "games": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Compact labels (`Hades`, `Hades (closing in 4:12)`). Countdown means the client is gone and the host will end the game when the window closes."
          },
          "kept_displays": {
            "type": "integer",
            "format": "int32",
            "description": "Lingering or pinned virtual displays with no live session. Active (in-use) displays are not counted.",
            "minimum": 0
          },
          "native_paired_clients": {
            "type": "integer",
            "format": "int32",
            "description": "Native-plane pairing count.",
            "minimum": 0
          },
          "paired_clients": {
            "type": "integer",
            "format": "int32",
            "description": "GameStream paired-cert count.",
            "minimum": 0
          },
          "pending_approvals": {
            "type": "integer",
            "format": "int32",
            "description": "Native pairing knocks awaiting the operator's approval (count only).",
            "minimum": 0
          },
          "pin_pending": {
            "type": "boolean",
            "description": "GameStream pairing is waiting for a PIN."
          },
          "session": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SessionInfo",
                "description": "GameStream launch if present, else the first live native session. `null` when idle."
              }
            ]
          },
          "version": {
            "type": "string",
            "description": "Host version (mirrors `/health`)."
          },
          "video_streaming": {
            "type": "boolean",
            "description": "Video streaming on either plane. The GameStream flag alone misses native sessions."
          }
        }
      },
      "LockProfile": {
        "type": "object",
        "description": "`POST /profiles/{id}/lock`, optional.",
        "properties": {
          "devices": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Paired devices, by certificate SHA-256 hex: the list it locks with, in place of any an\nearlier lock left. A profile already locked takes only devices it lets in."
          },
          "pin": {
            "type": [
              "string",
              "null"
            ],
            "description": "4 to 8 digits: its PIN from now. Absent keeps the PIN it has. A profile already locked\ntakes none.",
            "example": "2468"
          }
        }
      },
      "LockSummary": {
        "type": "object",
        "description": "A profile's lock, as the profile list shows it.",
        "required": [
          "locked",
          "pin",
          "failed_pins"
        ],
        "properties": {
          "failed_pins": {
            "type": "integer",
            "format": "int32",
            "description": "Wrong PINs in the last 15 minutes over all devices. At 10, PIN entry waits.",
            "minimum": 0
          },
          "locked": {
            "type": "boolean",
            "description": "Only the devices on its list, and a device that brings its PIN, open it. Also `true` for\nevery profile while the lock file doesn't read."
          },
          "pin": {
            "type": "boolean",
            "description": "It has a PIN."
          },
          "shared_with": {
            "type": [
              "string",
              "null"
            ],
            "description": "The owner profile whose lock opens it, for a profile that shares the owner's desktop:\nthe other fields are that lock's."
          }
        }
      },
      "LogEntry": {
        "type": "object",
        "required": [
          "seq",
          "ts_ms",
          "level",
          "target",
          "msg"
        ],
        "properties": {
          "level": {
            "type": "string",
            "description": "`ERROR` | `WARN` | `INFO` | `DEBUG` | `TRACE`."
          },
          "msg": {
            "type": "string",
            "description": "Formatted message; structured fields appended as `key=value`."
          },
          "seq": {
            "type": "integer",
            "format": "int64",
            "description": "Monotonic sequence number (1-based) — pass the last one back as the `after` cursor.",
            "minimum": 0
          },
          "target": {
            "type": "string"
          },
          "ts_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "LogPage": {
        "type": "object",
        "required": [
          "entries",
          "next",
          "dropped"
        ],
        "properties": {
          "dropped": {
            "type": "boolean",
            "description": "Entries between `after` and the first returned one were already evicted."
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogEntry"
            }
          },
          "next": {
            "type": "integer",
            "format": "int64",
            "description": "Last returned seq, or the request's `after` when the page is empty.",
            "minimum": 0
          }
        }
      },
      "ManagedEmulator": {
        "type": "object",
        "description": "What hermir installed, and from where.",
        "required": [
          "channel",
          "exe",
          "installed_at"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "description": "`flatpak`, `github` or `url`."
          },
          "exe": {
            "type": "string"
          },
          "installed_at": {
            "type": "string",
            "description": "RFC 3339."
          },
          "release": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Matching": {
        "type": "string",
        "description": "How a source finds its games. A new source lands after the last one of its kind, exact first.",
        "enum": [
          "exact",
          "search"
        ]
      },
      "MetadataAccepted": {
        "type": "object",
        "required": [
          "entries",
          "dropped"
        ],
        "properties": {
          "dropped": {
            "type": "integer",
            "description": "Values dropped because the host does not store them (non-`http(s)` art, overlong text).",
            "minimum": 0
          },
          "entries": {
            "type": "integer",
            "description": "Entries the host kept.",
            "minimum": 0
          }
        }
      },
      "MetadataEntryInput": {
        "type": "object",
        "description": "One entry in a source's push.",
        "required": [
          "id"
        ],
        "properties": {
          "art": {
            "$ref": "#/components/schemas/Artwork",
            "description": "`http(s)` URLs only; the host fetches and keeps them like a provider's CDN art."
          },
          "id": {
            "type": "string",
            "description": "Library id, as `GET /library` lists it (`steam:570`, `custom:3f9a0c1b2d4e`)."
          },
          "meta": {
            "$ref": "#/components/schemas/GameMeta"
          }
        }
      },
      "MetadataInput": {
        "type": "object",
        "description": "`PUT /library/metadata/{source}`: the source's whole result.",
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetadataEntryInput"
            }
          },
          "matching": {
            "$ref": "#/components/schemas/Matching"
          }
        }
      },
      "MetadataRemoved": {
        "type": "object",
        "required": [
          "removed"
        ],
        "properties": {
          "removed": {
            "type": "boolean"
          }
        }
      },
      "MetadataSourceInfo": {
        "type": "object",
        "description": "One Art & Metadata source as the console lists it, in the operator's order.",
        "required": [
          "id",
          "matching",
          "enabled",
          "replace",
          "entries"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "entries": {
            "type": "integer",
            "description": "Entries the source has something for.",
            "minimum": 0
          },
          "id": {
            "type": "string",
            "description": "The source's plugin id.",
            "example": "steamgriddb"
          },
          "matching": {
            "$ref": "#/components/schemas/Matching"
          },
          "replace": {
            "type": "boolean",
            "description": "\"Use for every game\": this source's art beats the entry's own. Art only."
          }
        }
      },
      "MetadataSourceUpdate": {
        "type": "object",
        "description": "One row of `PUT /library/metadata`. The array's order is the new order.",
        "required": [
          "id",
          "enabled",
          "replace"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "replace": {
            "type": "boolean"
          }
        }
      },
      "ModeConflict": {
        "type": "string",
        "description": "Admission when a new client asks for a different mode than the live\ndisplay. [`super::admission`] runs this before Welcome so `reject` is a\nhandshake error, not a half-built session.",
        "enum": [
          "separate",
          "steal",
          "join",
          "reject"
        ]
      },
      "MonitorsResponse": {
        "type": "object",
        "required": [
          "monitors",
          "pin_supported"
        ],
        "properties": {
          "compositor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Enumeration source (`kwin`, `mutter`, `windows`), when resolved."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Enumeration failure. `None` with an empty list means the host has no heads."
          },
          "monitors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiMonitorInfo"
            },
            "description": "Heads sorted by `(x, y, connector)`; Windows keeps CCD path priority order."
          },
          "pin_supported": {
            "type": "boolean",
            "description": "True when this build can stream a chosen physical head: Linux and Windows.\n\nEnumeration and capture are separate, so a host can list heads it cannot stream. The\nconsole treats `false` as a read-only picker."
          },
          "pinned": {
            "type": [
              "string",
              "null"
            ],
            "description": "Configured pin, even when it matches no head (console can show a dangling pin)."
          }
        }
      },
      "NativeClient": {
        "type": "object",
        "required": [
          "name",
          "fingerprint",
          "until_disconnect"
        ],
        "properties": {
          "access_level": {
            "type": [
              "string",
              "null"
            ],
            "description": "`full` | `controller` | `view` | `custom`. Derived from `grants`;\nabsent only on hosts older than this field.",
            "example": "controller"
          },
          "expires_unix": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Absolute expiry, unix seconds on the host clock. `null` = permanent.\nAn expired device stays listed; it is just not authorized."
          },
          "fingerprint": {
            "type": "string",
            "description": "Hex SHA-256 of the client certificate — the stable id."
          },
          "granted_unix": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Last grant time, unix seconds. Display/audit only; never enforced."
          },
          "grants": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "`GRANT_*` bits 0–8 (`0x100` is choosing its screen), as this host reads the record: an\nolder host's Full reads `0x1FF`, and `0xFF` is everything but the screen choice. `null`\nis a pre-grants record, which means full.",
            "example": 1,
            "minimum": 0
          },
          "name": {
            "type": "string",
            "example": "Living Room iPad"
          },
          "preferred_pad_slot": {
            "type": "integer",
            "format": "int32",
            "description": "Player slot this device's pads take, 0-based; `null` = whichever comes free.\nSet through `PUT /session/{id}/player` while the device streams.",
            "minimum": 0
          },
          "until_disconnect": {
            "type": "boolean",
            "description": "The record is dropped when the device's last session ends, rather than at a clock\ntime. `expires_unix` may also be set; whichever comes first ends the grant."
          }
        }
      },
      "NativePairStatus": {
        "type": "object",
        "description": "Native pairing window. Unlike GameStream, the host mints the PIN (SPAKE2\nneeds it client-side first); the console displays it.",
        "required": [
          "enabled",
          "armed",
          "paired_clients"
        ],
        "properties": {
          "armed": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean",
            "description": "True when this process runs the native plane, as `serve` always does."
          },
          "expires_in_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Seconds left in the window. `null` if disarmed, or armed with no expiry (CLI flag).",
            "minimum": 0
          },
          "paired_clients": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "pin": {
            "type": [
              "string",
              "null"
            ],
            "example": "1234"
          }
        }
      },
      "OnWindow": {
        "type": "object",
        "description": "Per-entry window placement, applied once when the game's own window first\nreaches the screen. Absent keys take the defaults below; `workspace` alone\nfalls back to the host's `launch_workspace` display policy.",
        "properties": {
          "focus": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Raise it. Default on: the player launched it, so it is what they want\nin front — a launcher that steals focus back leaves them on the desk."
          },
          "fullscreen": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Make it full-screen. Default off: most games set their own mode, and\nforcing it fights a title that wanted a window."
          },
          "move_to_stream_output": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Move it onto the streamed head if it opened elsewhere. Default on: a\ngame the player cannot see is the whole failure this stage exists for."
          },
          "workspace": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WorkspacePlacement"
              }
            ]
          }
        }
      },
      "OperatorGameEntry": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameEntry"
          },
          {
            "type": "object",
            "properties": {
              "hidden": {
                "type": "boolean",
                "description": "Set by [`set_entry_hidden`]. Omitted when false so the shape only grows for hidden titles.\nWith a profile in view (`as`), the profile hid it: a title the box hides is not listed."
              },
              "profile": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ProfileValues",
                    "description": "With a profile in view, the values on this row that are the profile's own."
                  }
                ]
              }
            }
          }
        ],
        "description": "A library entry plus the operator's view of it — whether they hid it.\n\nA field on [`GameEntry`] would leak onto every lane: `GET /library` returns\n`Vec<GameEntry>` except on the operator's lane, so a hidden flag cannot\nreach a paired client. `flatten` keeps the wire a plain entry plus one key."
      },
      "OverrideEntry": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameOverrides"
          },
          {
            "type": "object",
            "properties": {
              "none": {
                "type": "boolean",
                "description": "A game's alone, with no other field: the device decides, and the source's entry is\nskipped. A source that sets nothing has no entry."
              },
              "set": {
                "type": [
                  "string",
                  "null"
                ],
                "example": "a1b2c3d4e5f6"
              }
            }
          }
        ],
        "description": "A game's or a source's entry: `set` names a shared override, the fields are its own, or a\ngame's `none` opts out. Only one of the three; `{}` is no entry. `name` is the shared\noverride's alone."
      },
      "OverrideSet": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameOverrides"
          },
          {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "example": "a1b2c3d4e5f6"
              }
            }
          }
        ],
        "description": "A shared override with its id: what create and update answer."
      },
      "OverrideSetPatch": {
        "type": "object",
        "description": "`PUT /library/overrides/sets/{id}`: a field left out keeps its value, `null` clears it.",
        "properties": {
          "beyond_screen": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "gamepad": {
            "type": [
              "string",
              "null"
            ]
          },
          "hdr": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "hz": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "lines": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OverrideUsers": {
        "type": "object",
        "description": "How many entries named a deleted shared override. They are removed: those games and sources\ngo back to what the device decides.",
        "required": [
          "games",
          "sources"
        ],
        "properties": {
          "games": {
            "type": "integer",
            "minimum": 0
          },
          "sources": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "OverridesAnswer": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OverridesDoc"
          },
          {
            "type": "object",
            "properties": {
              "box_games": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Beside `box_sets`: the box's entries for the games that profile's library lists, which\napply where it has none of its own.",
                "additionalProperties": {
                  "$ref": "#/components/schemas/OverrideEntry"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "box_sets": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "With `as` naming a profile with a layer of its own: the box's shared overrides by id,\nwhich that profile's entries may name with `set`. Read only here.",
                "additionalProperties": {
                  "$ref": "#/components/schemas/GameOverrides"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "box_sources": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Beside `box_sets`: the box's entries for the sources with a title in that library.",
                "additionalProperties": {
                  "$ref": "#/components/schemas/OverrideEntry"
                },
                "propertyNames": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "description": "The body of `GET /library/overrides`."
      },
      "OverridesDoc": {
        "type": "object",
        "description": "`library-overrides.json`, and the body of `GET /library/overrides`.",
        "properties": {
          "games": {
            "type": "object",
            "description": "Library id (`steam:570`) → its entry.",
            "additionalProperties": {
              "$ref": "#/components/schemas/OverrideEntry"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "sets": {
            "type": "object",
            "description": "Shared overrides by id, 12 lowercase hex.",
            "additionalProperties": {
              "$ref": "#/components/schemas/GameOverrides"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "sources": {
            "type": "object",
            "description": "Source (`lutris`) → the entry each of its titles takes when it has none of its own.",
            "additionalProperties": {
              "$ref": "#/components/schemas/OverrideEntry"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "version": {
            "type": "integer",
            "format": "int32",
            "example": 1,
            "minimum": 0
          }
        }
      },
      "OwnTitle": {
        "type": "object",
        "description": "One of a profile's own titles as its seat host publishes it to the box: what a shelf shows,\nnever what starts it. Built field by field, so a field added to [`CustomEntry`] stays on the\nseat until it is added here.",
        "required": [
          "id",
          "title"
        ],
        "properties": {
          "art": {
            "$ref": "#/components/schemas/Artwork",
            "description": "`http(s)` URLs alone: a cover on the seat's disk stays there."
          },
          "id": {
            "type": "string",
            "description": "`own:` and 12 lowercase hex, minted by the seat host.",
            "example": "own:3f9a0c1b2d4e"
          },
          "platform": {
            "type": [
              "string",
              "null"
            ],
            "example": "PC"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "PadFrame": {
        "type": "object",
        "description": "One pad's whole state as the host holds it — the `data:` of one SSE frame.\n\nWhole state, not a delta: a page that attaches mid-press draws what is held without\nreplaying history, and the console derives its event log by diffing consecutive frames.",
        "required": [
          "pad",
          "ts_ms",
          "device",
          "present",
          "buttons",
          "left_trigger",
          "right_trigger",
          "ls_x",
          "ls_y",
          "rs_x",
          "rs_y"
        ],
        "properties": {
          "buttons": {
            "type": "integer",
            "format": "int32",
            "description": "`punktfunk_core::input::gamepad::BTN_*` mask, as applied.",
            "minimum": 0
          },
          "declared": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the client declared at arrival, when it declared one. Differs from `device`\nwhere the build cannot construct that kind and folded it into one it can."
          },
          "device": {
            "type": "string",
            "description": "The virtual controller the host built: `xbox360`, `dualsense`, `steamdeck`, …"
          },
          "left_trigger": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "ls_x": {
            "type": "integer",
            "format": "int32"
          },
          "ls_y": {
            "type": "integer",
            "format": "int32"
          },
          "pad": {
            "type": "integer",
            "format": "int32",
            "description": "Wire index — the number this client gave the pad.",
            "minimum": 0
          },
          "present": {
            "type": "boolean",
            "description": "`false` is the unplug frame: the host holds no device at this index any more."
          },
          "right_trigger": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "rs_x": {
            "type": "integer",
            "format": "int32"
          },
          "rs_y": {
            "type": "integer",
            "format": "int32"
          },
          "slot": {
            "type": "integer",
            "format": "int32",
            "description": "Host-wide OS slot — the identity every per-pad host resource is named by\n(mailbox, `SwDeviceCreate` instance, pairing MAC). Absent before the first\nframe builds the device.",
            "minimum": 0
          },
          "ts_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Unix milliseconds ([`crate::events::HostEvent`] convention).",
            "minimum": 0
          }
        }
      },
      "PairedClient": {
        "type": "object",
        "description": "A paired (certificate-pinned) Moonlight client.",
        "required": [
          "fingerprint"
        ],
        "properties": {
          "fingerprint": {
            "type": "string",
            "description": "Lowercase hex SHA-256 of the client certificate DER — the client's stable id here.",
            "example": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Operator-assigned display name (`PATCH /clients/{fp}`). The only way to tell two\npaired Moonlight devices apart; absent until somebody names the device.",
            "example": "Living Room TV"
          },
          "not_after_unix": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Certificate validity end (unix seconds)."
          },
          "not_before_unix": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Certificate validity start (unix seconds)."
          },
          "subject": {
            "type": [
              "string",
              "null"
            ],
            "description": "Certificate subject if the DER parses. Do not display as a device name: every\nmoonlight-common-c client self-signs `CN=NVIDIA GameStream Client`, so this names\nthe protocol. [`Self::label`] is the field to show."
          }
        }
      },
      "PairingStatus": {
        "type": "object",
        "description": "Pairing-flow status.",
        "required": [
          "pin_pending",
          "pending"
        ],
        "properties": {
          "pending": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PendingCeremony"
            },
            "description": "Parked ceremonies. Echo this identity in the submit so the PIN addresses the\nceremony the operator saw, not a later arrival."
          },
          "pin_pending": {
            "type": "boolean"
          }
        }
      },
      "PendingCeremony": {
        "type": "object",
        "description": "One pairing handshake parked waiting for its PIN.",
        "required": [
          "uniqueid",
          "fingerprint",
          "peer_ip"
        ],
        "properties": {
          "fingerprint": {
            "type": "string",
            "example": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
          },
          "peer_ip": {
            "type": "string",
            "example": "192.168.1.42"
          },
          "uniqueid": {
            "type": "string",
            "example": "0123456789ABCDEF"
          }
        }
      },
      "PendingDevice": {
        "type": "object",
        "description": "Knock awaiting delegated approval (pair here instead of fetching a PIN).",
        "required": [
          "id",
          "name",
          "fingerprint",
          "age_secs",
          "source",
          "relayed",
          "unfamiliar_origin",
          "until_disconnect"
        ],
        "properties": {
          "access_level": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stored mask's preset. `null` with no stored record — unlike\n[`NativeClient`], where it is always derivable.",
            "example": "controller"
          },
          "age_secs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "expires_unix": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Stored absolute expiry (unix seconds; often already past). `null` if\nunknown or permanent."
          },
          "fingerprint": {
            "type": "string",
            "description": "Hex SHA-256 of the device certificate — what approval pins."
          },
          "granted_unix": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Stored grant time, unix seconds. `null` if unknown."
          },
          "grants": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Stored mask if this fingerprint was paired before (expired-guest\nre-knock). `null` if unknown, or a pre-grants record (= full).",
            "minimum": 0
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "description": "Approve/deny id. Per-process; entries expire after ~10 minutes.",
            "minimum": 0
          },
          "name": {
            "type": "string",
            "description": "Client's own name, else fingerprint-derived.",
            "example": "Enrico's MacBook"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "description": "The page that opened the browser's session. Absent from a client that is not a page.",
            "example": "https://play.example.com"
          },
          "profile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileRef",
                "description": "The profile the device asked to play as. Absent when it named none this host knows."
              }
            ]
          },
          "relayed": {
            "type": "boolean",
            "description": "The knock came through a page server (the web client). Its `source` is then `\"wan\"`,\nwhatever its address."
          },
          "source": {
            "type": "string",
            "description": "Where the knock came from: `\"lan\"` or `\"wan\"`. A `\"wan\"` device cannot be admitted by\napprove — arm a PIN bound to its fingerprint instead.",
            "example": "lan"
          },
          "unfamiliar_origin": {
            "type": "boolean",
            "description": "`origin` is public and no paired device came from it. Its `source` is then `\"wan\"`."
          },
          "until_disconnect": {
            "type": "boolean",
            "description": "Stored \"this session\" setting if this fingerprint was paired before. `false` if unknown."
          }
        }
      },
      "PendingRequest": {
        "type": "object",
        "description": "A path a plugin asked for that the operator has not answered yet.",
        "required": [
          "path",
          "write",
          "at"
        ],
        "properties": {
          "at": {
            "type": "string"
          },
          "core": {
            "type": [
              "string",
              "null"
            ],
            "description": "A libretro core to install into `path` (RetroArch's cores folder) first."
          },
          "emulator": {
            "type": [
              "string",
              "null"
            ],
            "description": "An emulator to install into `path` first: the operator's yes installs, then grants."
          },
          "files": {
            "type": "boolean",
            "description": "The folder and the files directly in it, nothing below. See [`Grant::files`]."
          },
          "listener": {
            "type": "string",
            "description": "That program's name, when it runs as this host's account."
          },
          "listening": {
            "type": "boolean",
            "description": "For a port row the operator lists: whether a program listens on that port right now.\nRead at listing ([`with_listeners`]), never stored, and never told to the plugin."
          },
          "path": {
            "type": "string"
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "description": "The plugin asks to connect to this TCP port on this computer's loopback, not for a\nfolder; `path` then spells it ([`port_path`]).",
            "minimum": 0
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "saves": {
            "type": "boolean",
            "description": "The plugin asks to read and restore emulator saves; `path` is the folder that grant lands on."
          },
          "spelled": {
            "type": [
              "string",
              "null"
            ],
            "description": "How the plugin spelled `path` when that goes through a link. An allow records it in\n[`PluginAccess::links`]: on Windows the link itself needs the runner's ACE."
          },
          "write": {
            "type": "boolean"
          }
        }
      },
      "PersonGrant": {
        "type": "object",
        "description": "A session a ticket opened.",
        "required": [
          "token",
          "expires_at",
          "profile"
        ],
        "properties": {
          "expires_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix seconds; it ends sooner when this host stops or the session is closed."
          },
          "profile": {
            "type": "string",
            "description": "The profile it is for: this seat host's own."
          },
          "token": {
            "type": "string",
            "description": "Present as `Authorization: Bearer <token>` to this seat host, or as\n`X-Punktfunk-Person-Session` to the box. 64 lowercase hex."
          }
        }
      },
      "PersonOf": {
        "type": "object",
        "description": "Whose a live session is. The person lane stamps it on each of its calls.",
        "required": [
          "profile"
        ],
        "properties": {
          "profile": {
            "type": "string"
          }
        }
      },
      "PersonProfile": {
        "type": "object",
        "description": "A person's own profile, as their pages show it.",
        "required": [
          "id",
          "display_name",
          "has_avatar"
        ],
        "properties": {
          "accent": {
            "type": [
              "string",
              "null"
            ],
            "description": "`#RRGGBB`."
          },
          "display_name": {
            "type": "string"
          },
          "has_avatar": {
            "type": "boolean",
            "description": "It has a picture, at `GET /auth/person/profile/avatar`."
          },
          "id": {
            "type": "string"
          }
        }
      },
      "PersonSessionToken": {
        "type": "object",
        "description": "A session token the box asks about.",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string"
          }
        }
      },
      "PersonTicket": {
        "type": "object",
        "description": "The ticket `ctl console-url` wrote into the page it opened.",
        "required": [
          "ticket"
        ],
        "properties": {
          "ticket": {
            "type": "string",
            "description": "`<unix seconds>.<nonce>.<profile id>.<HMAC-SHA256>`, as the page's `ticket` carries it."
          }
        }
      },
      "Phase": {
        "type": "string",
        "description": "Where a session is. It only moves forward; `/status` reports it per row.",
        "enum": [
          "admitted",
          "negotiating",
          "bring_up",
          "streaming",
          "ending",
          "done"
        ]
      },
      "Plane": {
        "type": "string",
        "description": "Origin plane. Every plane must emit; filtering is the consumer's job.",
        "enum": [
          "native",
          "gamestream",
          "web"
        ]
      },
      "PlatformCount": {
        "type": "object",
        "description": "How many titles a platform holds under a page's other filters.",
        "required": [
          "platform",
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "platform": {
            "type": "string"
          }
        }
      },
      "PlayingApps": {
        "type": "object",
        "required": [
          "apps"
        ],
        "properties": {
          "apps": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Lowercased app names, as the voice-chat app list matches them.",
            "example": [
              "discord",
              "firefox"
            ]
          }
        }
      },
      "PlayingDevice": {
        "type": "object",
        "description": "A device playing as a profile now.",
        "required": [
          "name"
        ],
        "properties": {
          "fingerprint": {
            "type": [
              "string",
              "null"
            ],
            "description": "SHA-256 of the device's certificate, lowercase hex. Absent when its session matches no\nsingle paired device: it can't be kept, only warned about."
          },
          "name": {
            "type": "string",
            "description": "The name it paired with, else the name its session gave."
          }
        }
      },
      "PluginAccessSnapshot": {
        "type": "object",
        "description": "What an API read returns for one plugin: its entry plus its pending rows.",
        "required": [
          "plugin",
          "grants",
          "pending",
          "denied"
        ],
        "properties": {
          "denied": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "denied_ports": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Denied ports on this computer."
          },
          "grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Grant"
            }
          },
          "pending": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PendingRequest"
            }
          },
          "plugin": {
            "type": "string"
          },
          "ports": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Granted ports on this computer. See [`PluginAccess::ports`]."
          },
          "walks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessWalk"
            },
            "description": "Folders whose access is changing for this plugin right now."
          }
        }
      },
      "PluginLogBatch": {
        "type": "object",
        "required": [
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PluginLogLine"
            }
          }
        }
      },
      "PluginLogLine": {
        "type": "object",
        "required": [
          "ts_ms",
          "level",
          "source",
          "msg"
        ],
        "properties": {
          "level": {
            "type": "string",
            "description": "Normalized by [`crate::log_capture::LogRing::push_remote`]; unknown becomes INFO."
          },
          "msg": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "ts_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Unix ms, kept verbatim — see [`crate::log_capture::LogRing::push_remote`].",
            "minimum": 0
          }
        }
      },
      "PluginRegistration": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "category": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plugin kind, not a UI field. Console hides `library` from the nav (those plugins already have\nGame sources); omit the field to keep a nav page."
          },
          "hold_timeout_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "How long a hold may take, 1–120 000 ms. Absent means 30 000.",
            "minimum": 0
          },
          "holds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Stages this plugin holds (`game.launching`). The host POSTs the event to `/__hold` on\n`ui.port` and waits for a 2xx. Needs `ui`."
          },
          "title": {
            "type": "string"
          },
          "ui": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PluginUi",
                "description": "Absent `ui` is a live listing with no nav entry — not an error."
              }
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PluginSummary": {
        "type": "object",
        "description": "Listing row. Never carries the secret — the browser reaches the UI only through the console proxy.",
        "required": [
          "id",
          "title"
        ],
        "properties": {
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "ui": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PluginUiPublic"
              }
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PluginUi": {
        "type": "object",
        "description": "Request body only — carries the secret. [`PluginUiPublic`] is the response view.",
        "required": [
          "port",
          "secret"
        ],
        "properties": {
          "config": {
            "type": "boolean",
            "description": "Serves `GET/PUT /__config`, the plugin-wide settings form."
          },
          "game": {
            "type": "boolean",
            "description": "Serves `GET/PUT /__game?entry=<id>`, a tab on each library entry's page."
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "install": {
            "type": "boolean",
            "description": "Serves `POST /__install`: installs, pauses, cancels and removes its titles' files."
          },
          "page": {
            "type": "boolean",
            "description": "Serves a page the console opens and lists in the nav. Absent means yes, as before the flag."
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "description": "Loopback only — the host dials `127.0.0.1:<port>`; a registration cannot carry a hostname.",
            "minimum": 0
          },
          "secret": {
            "type": "string",
            "description": "Per-boot; the console proxy presents it as `Authorization: Bearer`. Rotated on plugin restart."
          }
        }
      },
      "PluginUiPublic": {
        "type": "object",
        "description": "Secret-free UI view for the listing. The secret never goes here.",
        "required": [
          "port",
          "page",
          "config",
          "game",
          "install"
        ],
        "properties": {
          "config": {
            "type": "boolean",
            "description": "See [`PluginUi::config`]."
          },
          "game": {
            "type": "boolean",
            "description": "See [`PluginUi::game`]."
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "install": {
            "type": "boolean",
            "description": "See [`PluginUi::install`]."
          },
          "page": {
            "type": "boolean",
            "description": "See [`PluginUi::page`]."
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "PortMap": {
        "type": "object",
        "description": "Ports a client needs. Moonlight derives stream ports from HTTP; a control pane should not.\nA port the host does not serve right now is left out.",
        "required": [
          "mgmt"
        ],
        "properties": {
          "audio": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "browser": {
            "type": "integer",
            "format": "int32",
            "description": "UDP: the browser client's plane, while it is on.",
            "minimum": 0
          },
          "control": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "http": {
            "type": "integer",
            "format": "int32",
            "description": "nvhttp plain HTTP (serverinfo, pairing). This and the five below: GameStream only.",
            "minimum": 0
          },
          "https": {
            "type": "integer",
            "format": "int32",
            "description": "nvhttp mutual-TLS HTTPS (post-pairing).",
            "minimum": 0
          },
          "mgmt": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "native": {
            "type": "integer",
            "format": "int32",
            "description": "UDP: the native stream port. Video, audio, control and the paired-device library.",
            "minimum": 0
          },
          "rtsp": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "seats": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "UDP: each seat's stream port, while seats are on."
          },
          "video": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "Position": {
        "type": "object",
        "description": "Desktop-space offset (top-left origin).",
        "required": [
          "x",
          "y"
        ],
        "properties": {
          "x": {
            "type": "integer",
            "format": "int32"
          },
          "y": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PrepCmd": {
        "type": "object",
        "description": "Per-app prep (Sunshine `prep-cmd` parity): `do` runs synchronously before launch;\n`undo` runs at session end, reverse order, best-effort, including panic-unwind ([`PrepGuard`]).",
        "required": [
          "do"
        ],
        "properties": {
          "do": {
            "type": "string",
            "description": "Command run before launch. Same recipe and ownership checks as hook `run`; stdin is `{}`."
          },
          "elevated": {
            "type": "boolean",
            "description": "Windows: `do` and `undo` run as administrator, as a hook's `elevated` does."
          },
          "undo": {
            "type": [
              "string",
              "null"
            ],
            "description": "After session end. Skipped when its `do` failed (it never took effect)."
          }
        }
      },
      "PrepareEmulatorRequest": {
        "type": "object",
        "properties": {
          "firmware_dir": {
            "type": [
              "string",
              "null"
            ],
            "description": "A folder whose files are that platform's firmware. From a plugin, a path relative to its\nown state directory (`firmware/ps2`); from the operator, an absolute path."
          },
          "platform": {
            "type": [
              "string",
              "null"
            ],
            "description": "The platform about to play: a catalog id like `ps2`, or an alias (RomM slug, ES-DE\nfolder, libretro name). Without it only first-run questions are answered."
          }
        }
      },
      "PreparedCopy": {
        "type": "object",
        "description": "One copy of the emulator, and what preparing it did.",
        "required": [
          "exe",
          "steps"
        ],
        "properties": {
          "exe": {
            "type": "string",
            "description": "The program, or `flatpak run <app id>`, as the emulator list names it."
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreparedStep"
            }
          }
        }
      },
      "PreparedStep": {
        "type": "object",
        "required": [
          "kind",
          "target",
          "outcome"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "hermir's name for the step, like `first_run`, `firmware`, `firmware_install`,\n`config_root`, or `config` for the session's pads."
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "outcome": {
            "type": "string",
            "description": "`applied`, `present`, `skipped`, `conflict` or `failed`."
          },
          "target": {
            "type": "string",
            "description": "The file the step is about."
          }
        }
      },
      "Preset": {
        "type": "string",
        "description": "Named bundle of the fields below. `Custom` uses the explicit fields;\nany other preset ignores them and expands ([`DisplayPolicy::effective`]).",
        "enum": [
          "custom",
          "default",
          "gaming-rig",
          "shared-desktop",
          "hotdesk",
          "workstation",
          "play-together"
        ]
      },
      "PresetInfo": {
        "type": "object",
        "description": "Picker row. `fields` is the expansion so the console does not hardcode it.",
        "required": [
          "id",
          "summary",
          "fields"
        ],
        "properties": {
          "fields": {
            "$ref": "#/components/schemas/EffectivePolicy",
            "description": "Same fields a `Custom` policy carries."
          },
          "id": {
            "type": "string",
            "description": "`default` | `gaming-rig` | `shared-desktop` | `hotdesk` | `workstation` | `play-together`."
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "PresetRef": {
        "type": "object",
        "description": "The settings preset a client dialled with ([`punktfunk_core::quic::SessionPreset`]). The\nid is the client's own and stable across a rename, so it is what a hook or plugin keys on\ntogether with the device fingerprint; the name is for people.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ProfileAdmin": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProfilePublic"
          },
          {
            "type": "object",
            "required": [
              "default"
            ],
            "properties": {
              "default": {
                "type": "boolean",
                "description": "Where a device that names no profile lands."
              },
              "legacy_device": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The device whose seat became this profile, lowercase hex."
              },
              "lock": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LockSummary",
                    "description": "Its lock. Absent for a profile on a person's own account, which opens with its password."
                  }
                ]
              },
              "steam_home": {
                "type": "boolean",
                "description": "This host keeps a Steam home for it, with that Steam's sign-in and saved games. A removal\nwith `erase` deletes it."
              }
            }
          }
        ],
        "description": "One profile as the console manages it."
      },
      "ProfileCreate": {
        "type": "object",
        "description": "What a new profile starts as.",
        "required": [
          "display_name"
        ],
        "properties": {
          "accent": {
            "type": [
              "string",
              "null"
            ],
            "description": "`#RRGGBB`."
          },
          "display_name": {
            "type": "string"
          },
          "home": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Home",
                "description": "Defaults to `desktop`."
              }
            ]
          },
          "seat": {
            "type": "boolean",
            "description": "A desktop of its own (the default), or the box's own session under another name. A\ndesktop of its own needs seats on Windows and the door on Linux. Ignored when\n[`windows_account`](Self::windows_account) is set."
          },
          "seat_account": {
            "type": [
              "string",
              "null"
            ],
            "description": "With `seat`, an account that already exists, which the seat runs on instead of one\npunktfunk makes: a local Windows standard account on Windows Server, a person's own login\non a Linux door."
          },
          "seat_password": {
            "type": "string",
            "description": "That account's password, entered once. Windows seals it; Linux checks it and keeps\nnothing."
          },
          "windows_account": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bind this profile to a local Windows account that takes the console in turn\n(`design/windows-take-turns.md`). When set, the profile is a take-turns profile and\n`seat` does not apply."
          }
        }
      },
      "ProfileDeviceAdd": {
        "type": "object",
        "description": "`POST /profiles/{id}/devices`.",
        "required": [
          "fingerprint"
        ],
        "properties": {
          "fingerprint": {
            "type": "string",
            "description": "SHA-256 of a paired device's certificate, hex: a Punktfunk device or a Moonlight one."
          }
        }
      },
      "ProfileLock": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LockSummary"
          },
          {
            "type": "object",
            "required": [
              "playing"
            ],
            "properties": {
              "playing": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PlayingDevice"
                },
                "description": "The devices playing as it now, on its desktop's other profiles too: the ones a lock would\ncut off unless they are kept."
              }
            }
          }
        ],
        "description": "A profile's lock, as the console shows it."
      },
      "ProfilePin": {
        "type": "object",
        "description": "`PUT /profiles/{id}/lock/pin`.",
        "required": [
          "pin"
        ],
        "properties": {
          "pin": {
            "type": "string",
            "description": "4 to 8 digits.",
            "example": "2468"
          }
        }
      },
      "ProfilePublic": {
        "type": "object",
        "description": "One profile as a client's picker shows it.",
        "required": [
          "id",
          "display_name",
          "owner",
          "home",
          "last_used_unix"
        ],
        "properties": {
          "accent": {
            "type": [
              "string",
              "null"
            ],
            "description": "`#RRGGBB` behind the initials when there is no picture."
          },
          "avatar": {
            "type": [
              "string",
              "null"
            ],
            "description": "Host-relative URL of the picture."
          },
          "display_name": {
            "type": "string"
          },
          "home": {
            "$ref": "#/components/schemas/Home",
            "description": "What a bare connect opens."
          },
          "id": {
            "type": "string",
            "example": "9a3f1c2b7e40"
          },
          "last_used_unix": {
            "type": "integer",
            "format": "int64",
            "description": "When a session last played as it; `0`: never.",
            "minimum": 0
          },
          "legacy_seat": {
            "type": "boolean",
            "description": "The asking device's old seat became this profile. A client takes it without a picker."
          },
          "owner": {
            "type": "boolean",
            "description": "The box's own session."
          },
          "person": {
            "type": "boolean",
            "description": "The asking device is this locked profile's person now: it may hide a title for it\n(`PUT /library/hidden/{id}?as=`) and list what it hides (`GET /library/page?hidden=true`)."
          },
          "seat": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SeatPublic",
                "description": "Its own seat; absent when it plays on the box's own session."
              }
            ]
          },
          "unlock": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UnlockNeed",
                "description": "What the asking device sends to open it. Every row of `enumerate` has it."
              }
            ]
          }
        }
      },
      "ProfileRef": {
        "type": "object",
        "description": "A profile as events, status and hooks name it.",
        "required": [
          "id",
          "display_name"
        ],
        "properties": {
          "display_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      },
      "ProfileUpdate": {
        "type": "object",
        "description": "A change to a profile; absent fields stay.",
        "properties": {
          "accent": {
            "type": [
              "string",
              "null"
            ],
            "description": "`#RRGGBB`."
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "home": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Home"
              }
            ]
          },
          "seat_password": {
            "type": "string",
            "description": "The new password of an adopted account, after it changed in Windows."
          }
        }
      },
      "ProfileValues": {
        "type": "object",
        "description": "The values on a row that the profile in view (`as`) set itself.",
        "properties": {
          "overrides": {
            "type": "boolean",
            "description": "`overrides` is the profile's: its entry for the game, or for the game's source."
          },
          "picks": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The art slots the profile picked: `portrait`, `hero`, `logo`, `header`."
          }
        }
      },
      "ProviderEntryInput": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GameMeta"
          },
          {
            "type": "object",
            "required": [
              "external_id",
              "title"
            ],
            "properties": {
              "art": {
                "$ref": "#/components/schemas/Artwork"
              },
              "audio": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/AudioPolicy"
                  }
                ]
              },
              "detect": {
                "$ref": "#/components/schemas/DetectHint",
                "description": "Install-dir / process hint. Needed when launch goes through the provider's own client."
              },
              "external_id": {
                "type": "string"
              },
              "icon": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Brand token a plugin sets on its `launchers(cfg)` tiles. See [`GameEntry::icon`]."
              },
              "ids": {
                "type": "object",
                "description": "Catalog ids a metadata source matches on: `steam` → appid, `libretro` →\n`<system>/<No-Intro name>`. Keys `[a-z0-9_]{1,16}`, at most eight; a bad pair is dropped.",
                "additionalProperties": {
                  "type": "string"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "install": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/Install",
                    "description": "Whether the title's files are on this host, for a plugin that serves `/__install`.\nAbsent means they are."
                  }
                ]
              },
              "launch": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LaunchSpec"
                  }
                ]
              },
              "on_window": {
                "$ref": "#/components/schemas/OnWindow",
                "description": "Which workspace the title opens on; absent follows the host's display policy."
              },
              "prep": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PrepCmd"
                },
                "description": "Run as the host user; operator-privileged. See [`privileged_field`]."
              },
              "role": {
                "$ref": "#/components/schemas/GameRole",
                "description": "Plugins emit `launchers(cfg)` tiles with `role: \"launcher\"`."
              },
              "title": {
                "type": "string"
              }
            }
          }
        ],
        "description": "One title in a provider reconcile payload: [`CustomInput`] plus the provider's required stable key."
      },
      "ProviderRemoved": {
        "type": "object",
        "required": [
          "removed"
        ],
        "properties": {
          "removed": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ProviderRunningAccepted": {
        "type": "object",
        "required": [
          "matched",
          "unknown",
          "ttl_s"
        ],
        "properties": {
          "matched": {
            "type": "integer",
            "minimum": 0
          },
          "ttl_s": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds this report stays authoritative without being restated.",
            "minimum": 0
          },
          "unknown": {
            "type": "integer",
            "description": "Ignored because no such entry exists (report raced a reconcile).",
            "minimum": 0
          }
        }
      },
      "ProviderRunningInput": {
        "type": "object",
        "properties": {
          "running": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunningTitle"
            },
            "description": "Complete running set, not a delta: anything absent is reported as stopped."
          }
        }
      },
      "RecentSessions": {
        "type": "object",
        "required": [
          "sessions"
        ],
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionSummary"
            },
            "description": "Newest first. Bounded in memory and lost on a host restart — this is the last\nfew sessions, not a history."
          }
        }
      },
      "RelayedEvent": {
        "type": "object",
        "description": "One event as another host's `GET /events` framed it. Wrapped, because a tagged union is no\nrequest body for every client generator.",
        "required": [
          "event"
        ],
        "properties": {
          "event": {
            "type": "object",
            "description": "A `HostEvent`, as the `data:` of one frame."
          }
        }
      },
      "ReleaseDisplayRequest": {
        "type": "object",
        "description": "Request body for `releaseDisplay`.",
        "properties": {
          "slot": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Slot to release (see `state`); omit to release **all** kept displays.",
            "minimum": 0
          }
        }
      },
      "ReleaseDisplayResult": {
        "type": "object",
        "required": [
          "released"
        ],
        "properties": {
          "released": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ReleaseRequest": {
        "type": "object",
        "required": [
          "form",
          "keep"
        ],
        "properties": {
          "form": {
            "type": "string",
            "description": "The plugin form letting go, as named when it handed the paths over."
          },
          "keep": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every path the form still hands over, as saved."
          }
        }
      },
      "Remedy": {
        "type": "object",
        "description": "Operator action. Copy-paste only: the host is unprivileged and does not run the command.\nJoining `punktfunk` is opt-in — write on the vhci `attach` node materialises arbitrary USB.",
        "required": [
          "text",
          "relogin_required"
        ],
        "properties": {
          "command": {
            "type": [
              "string",
              "null"
            ]
          },
          "relogin_required": {
            "type": "boolean",
            "description": "Fix takes effect only after logout. `systemd --user` keeps the group set it started with."
          },
          "text": {
            "type": "string",
            "description": "English fallback. The console overrides it by check id."
          }
        }
      },
      "RemoveEmulatorRequest": {
        "type": "object",
        "properties": {
          "purge": {
            "type": "boolean",
            "description": "Also delete the emulator's own data (config, saves)."
          }
        }
      },
      "RenameClient": {
        "type": "object",
        "description": "Body of `PATCH /clients/{fingerprint}` — the device's display name.",
        "properties": {
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name. `null` or empty/whitespace clears it (listed by fingerprint alone).\n\nScrubbed with the native-plane sanitizer: control characters and Unicode bidi\noverrides stripped (one device could impersonate another in this list), whitespace\ncollapsed, capped at 64 bytes of UTF-8.",
            "example": "Living Room TV"
          }
        }
      },
      "RunningTitle": {
        "type": "object",
        "required": [
          "external_id"
        ],
        "properties": {
          "external_id": {
            "type": "string",
            "description": "Same key the reconcile payload uses."
          },
          "pid": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Pid the provider started, when it knows one. Re-resolved and pinned to start time\nbefore any signal; a stale or recycled pid contributes nothing.",
            "minimum": 0
          }
        }
      },
      "RuntimeRequest": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "RuntimeStatus": {
        "type": "object",
        "description": "Live status; changes as sessions start and end.",
        "required": [
          "video_streaming",
          "audio_streaming",
          "pin_pending",
          "paired_clients",
          "native_paired_clients",
          "active_sessions",
          "sessions",
          "games"
        ],
        "properties": {
          "active_sessions": {
            "type": "integer",
            "format": "int32",
            "description": "Live sessions on both planes. Native admits concurrent sessions so this can exceed 1;\n`session`/`stream` are one representative and `sessions` is the list.",
            "minimum": 0
          },
          "audio": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AudioWiring",
                "description": "Windows audio-wiring verdict; absent off-Windows and before the first pass. Present while idle."
              }
            ]
          },
          "audio_streaming": {
            "type": "boolean"
          },
          "display": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DisplayHealth",
                "description": "Windows display state: topology transactions and outstanding device leases. Absent off-Windows."
              }
            ]
          },
          "downloads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Download"
            },
            "description": "Titles downloading, queued, paused, or finished in the last ten minutes. A launch hold\njoins its title's row by `app_id`. Absent when there are none."
          },
          "games": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActiveGame"
            },
            "description": "Launched titles: live sessions' games, `grace` and `detached` rows, and launches still\nwaiting for their session. Empty for a desktop-only stream."
          },
          "grants": {
            "type": "integer",
            "format": "int32",
            "description": "The calling device's live access grants (`GRANT_*` bits); 0 once expired. Absent for\nthe operator, who may do everything.",
            "minimum": 0
          },
          "native_paired_clients": {
            "type": "integer",
            "format": "int32",
            "description": "Native-plane pairings (separate store).",
            "minimum": 0
          },
          "paired_clients": {
            "type": "integer",
            "format": "int32",
            "description": "GameStream paired-cert count. Native devices are `native_paired_clients`; sum both for the total.",
            "minimum": 0
          },
          "pin_pending": {
            "type": "boolean",
            "description": "Pairing handshake is waiting for a PIN (`POST /api/v1/pair/pin`)."
          },
          "session": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SessionInfo",
                "description": "GameStream launch if present, else the first live native session. `null` when idle.\n`session_id` says which row of `sessions` this is."
              }
            ]
          },
          "session_id": {
            "type": "integer",
            "format": "int64",
            "description": "Which `sessions` row `session`/`stream` describe. `null` when idle, and while a\nGameStream launch has not reached PLAY.",
            "minimum": 0
          },
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionRow"
            },
            "description": "Every live session, one row each — what the per-session routes take an id from."
          },
          "stream": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StreamInfo",
                "description": "Active stream parameters of that same session. `null` when idle."
              }
            ]
          },
          "video_streaming": {
            "type": "boolean"
          }
        }
      },
      "RuntimeView": {
        "type": "object",
        "required": [
          "installed",
          "enabled",
          "running",
          "unit"
        ],
        "properties": {
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "installed": {
            "type": "boolean"
          },
          "principal": {
            "type": [
              "string",
              "null"
            ],
            "description": "Windows: the account the task runs as."
          },
          "running": {
            "type": "boolean"
          },
          "unit": {
            "type": "string",
            "description": "systemd unit or scheduled-task name."
          }
        }
      },
      "SaveUnitView": {
        "type": "object",
        "description": "One save unit on the best copy.",
        "required": [
          "kind",
          "name",
          "shared",
          "written_at_start",
          "size",
          "files",
          "modified"
        ],
        "properties": {
          "files": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "kind": {
            "type": "string",
            "description": "`save`, `memcard` or `state`."
          },
          "modified": {
            "type": "integer",
            "format": "int64",
            "description": "Its newest change, milliseconds since 1970.",
            "minimum": 0
          },
          "name": {
            "type": "string",
            "description": "The same on every machine; `.tar` ends a folder's."
          },
          "shared": {
            "type": "boolean",
            "description": "It holds every game's data at once (a shared memory card)."
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "written_at_start": {
            "type": "boolean",
            "description": "The emulator writes an empty one when a game first starts."
          }
        }
      },
      "ScannerInfo": {
        "type": "object",
        "description": "One game source and its enable state — the console toggle row.",
        "required": [
          "id",
          "label",
          "enabled",
          "origin"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "entries": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Titles this source currently contributes. `None` on `Builtin` (counting would walk launcher files).",
            "minimum": 0
          },
          "id": {
            "type": "string",
            "description": "Entry `store`, provider id, and store claim. One string, so a disabled\ntoggle survives the store's plugin taking over.",
            "example": "steam"
          },
          "label": {
            "type": "string",
            "example": "Steam"
          },
          "off_by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Layer",
                "description": "With a profile in view (`as`), who turned the source off. Only the box turns on what the\nbox turned off."
              }
            ]
          },
          "origin": {
            "$ref": "#/components/schemas/SourceOrigin",
            "description": "Always `plugin` on this host. `Builtin` remains so OpenAPI still names it for N-1 consoles."
          },
          "provider": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provider id. `None` only for a `Builtin` source an N-1 host still reports."
          }
        }
      },
      "ScannerToggle": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "ScreenRole": {
        "type": "string",
        "description": "How a device's own screen sits among the host's monitors: its `topology`, from its side.",
        "enum": [
          "only",
          "main",
          "second"
        ]
      },
      "ScreenRoles": {
        "type": "object",
        "description": "The roles a device's own screen takes on the desk.",
        "required": [
          "host_default",
          "offered"
        ],
        "properties": {
          "host_default": {
            "$ref": "#/components/schemas/ScreenRole",
            "description": "What a connect gets with no pick of the device's: the console's row for it, else the\nhost's topology."
          },
          "offered": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScreenRole"
            },
            "description": "The roles this host gives. `main` only where the desktop has a main screen."
          },
          "yours": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScreenRole",
                "description": "The role of the calling device's own pick while it counts and its screen is its own.\nNull with no pick, a monitor pick, no `GRANT_DISPLAY`, and on the operator lane."
              }
            ]
          }
        }
      },
      "ScreenRow": {
        "type": "object",
        "description": "One row of the screen picker. The first is always `own`; the rest are the host's heads.",
        "required": [
          "id",
          "label"
        ],
        "properties": {
          "connector": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Driven now. A head another device's exclusive screen switched off is `false`."
          },
          "id": {
            "type": "string",
            "description": "`own`, else the connector."
          },
          "in_use_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "The pairing label of the other device streaming this monitor, else null. Absent on `own`."
          },
          "label": {
            "type": "string",
            "description": "The monitor's name (`make model`, else the connector). `Own screen` on the first row,\nwhich clients word themselves."
          },
          "mode": {
            "type": [
              "string",
              "null"
            ],
            "description": "`WIDTHxHEIGHT@HZ` of the current mode."
          },
          "primary": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "SeatCheck": {
        "type": "object",
        "description": "One thing the seat checks found.",
        "required": [
          "level",
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "A stable id such as `rds_role`.",
            "example": "rds_role"
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The host message `message` is the English of, worded with `params`."
          },
          "level": {
            "$ref": "#/components/schemas/CheckLevel"
          },
          "message": {
            "type": "string",
            "description": "One plain sentence for the operator."
          },
          "params": {
            "type": "object",
            "description": "The values of that message's placeholders, by name.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "seat_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The seat it is about; absent when it is about the box."
          },
          "seat_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The name of the profile that plays on that seat, when one does."
          }
        }
      },
      "SeatKind": {
        "type": "string",
        "description": "What a profile's seat is. A door places every profile on a seat, so a profile on the box's own\nsession has one too: the owner's.",
        "enum": [
          "shared",
          "desktop"
        ]
      },
      "SeatPublic": {
        "type": "object",
        "description": "A profile's seat right now.",
        "required": [
          "state",
          "port",
          "kind"
        ],
        "properties": {
          "account": {
            "type": [
              "string",
              "null"
            ],
            "description": "The account of a seat on an existing one, for the console's card and its Remove\nsentence. Absent for an account punktfunk made, and to a paired device."
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "The progress line while `starting`, or why while `unavailable`."
          },
          "detail_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The host message `detail` is the English of, worded with `detail_params`."
          },
          "detail_params": {
            "type": "object",
            "description": "The values of that message's placeholders, by name.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "kind": {
            "$ref": "#/components/schemas/SeatKind",
            "description": "Which kind of seat it is."
          },
          "mgmt_port": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The management port of the host on its ledger row, for the console. Absent to a paired\ndevice, and for a profile with no row.",
            "minimum": 0
          },
          "occupant": {
            "type": [
              "string",
              "null"
            ],
            "description": "The device playing on it while `occupied`."
          },
          "pin": {
            "type": [
              "string",
              "null"
            ],
            "description": "The certificate fingerprint of the host at `port`, hex, when it is a seat's own: a\nclient dialing `port` directly pins it. Absent: the pin of this host."
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "description": "The port to dial for this profile.",
            "minimum": 0
          },
          "state": {
            "$ref": "#/components/schemas/SeatState"
          },
          "take_turns": {
            "type": "boolean",
            "description": "A take-turns profile: its own Windows account on the one console, not a host of its own.\nIt dials this host like the owner does, so it has no per-seat library of its own and\nremoving it leaves the Windows account alone."
          }
        }
      },
      "SeatState": {
        "type": "string",
        "enum": [
          "ready",
          "starting",
          "stopped",
          "occupied",
          "unavailable"
        ]
      },
      "Seating": {
        "type": "object",
        "description": "Whether this box runs its profiles in seats of their own, with what turning that on needs.",
        "required": [
          "enabled",
          "platform",
          "checks",
          "allow_rdp_from_network"
        ],
        "properties": {
          "allow_rdp_from_network": {
            "type": "boolean",
            "description": "Windows: seats are on and the network may reach Remote Desktop. Off elsewhere."
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeatCheck"
            },
            "description": "The prerequisites, one each. Empty on `other`."
          },
          "enabled": {
            "type": "boolean"
          },
          "platform": {
            "$ref": "#/components/schemas/SeatingPlatform",
            "description": "`other` has no seats to turn on; `linux` has them while the door is on."
          }
        }
      },
      "SeatingChange": {
        "type": "object",
        "description": "`PUT /profiles/seating`.",
        "required": [
          "enabled"
        ],
        "properties": {
          "allow_rdp_from_network": {
            "type": "boolean",
            "description": "Leave Remote Desktop reachable from the network. Off keeps it on this machine."
          },
          "enabled": {
            "type": "boolean"
          },
          "prepare": {
            "type": "boolean",
            "description": "Windows Server: first install the Remote Desktop Session Host role and set licensing to\nPer User where they are missing. Installing the role can take minutes and asks for a\nrestart."
          }
        }
      },
      "SeatingPlatform": {
        "type": "string",
        "enum": [
          "windows",
          "linux",
          "other"
        ]
      },
      "SeatsDoctor": {
        "type": "object",
        "description": "The seat supervisor's own checks.",
        "required": [
          "healthy",
          "diagnostics"
        ],
        "properties": {
          "diagnostics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SeatCheck"
            }
          },
          "healthy": {
            "type": "boolean",
            "description": "No check is an `error`."
          }
        }
      },
      "SessionAccess": {
        "type": "object",
        "required": [
          "grants",
          "level"
        ],
        "properties": {
          "grants": {
            "type": "integer",
            "format": "int32",
            "description": "What now governs the session — the request ANDed with the pairing's mask.",
            "minimum": 0
          },
          "level": {
            "type": "string",
            "description": "`full` | `controller` | `view` | `custom`, derived from `grants`."
          }
        }
      },
      "SessionAccessRequest": {
        "type": "object",
        "properties": {
          "grants": {
            "type": "integer",
            "format": "int32",
            "description": "Exact `GRANT_*` mask, for a level the three names do not cover. Reserved bits are 400.",
            "example": 1,
            "minimum": 0
          },
          "level": {
            "type": [
              "string",
              "null"
            ],
            "description": "`full` | `controller` | `view`. Ignored when `grants` is present.",
            "example": "controller"
          }
        }
      },
      "SessionAudioRequest": {
        "type": "object",
        "required": [
          "muted"
        ],
        "properties": {
          "muted": {
            "type": "boolean",
            "description": "`true` stops audio leaving for this session."
          }
        }
      },
      "SessionEndReason": {
        "type": "string",
        "description": "Why a session ended, in the client's own words\n([`punktfunk_core::client::PunktfunkEndReason`]) so both ends name the same end the\nsame way. The bytes match that ABI where the two overlap.\n\n[`Self::StoppedByOperator`] from a console stop and [`Self::Stolen`] close as code 0, which\nevery client reads as `host_ended`. A `stopped_by_operator` after an access expiry, an\nunpair, a power action or a closed profile closes with a typed reject code the client names.",
        "enum": [
          "local",
          "game_exited",
          "host_ended",
          "host_error",
          "lost",
          "stopped_by_operator",
          "stolen"
        ]
      },
      "SessionInfo": {
        "type": "object",
        "required": [
          "width",
          "height",
          "fps"
        ],
        "properties": {
          "capture": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CaptureHealth",
                "description": "Live capture health (Windows IDD-push, native plane). Absent on GameStream, on Linux,\nand until the video loop's first publish."
              }
            ]
          },
          "fps": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "SessionPlayer": {
        "type": "object",
        "required": [
          "reserved",
          "pads"
        ],
        "properties": {
          "pads": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "OS pad slots the session holds right now. A pad already built keeps its slot\nuntil it re-plugs, so this can still name the old player for a moment."
          },
          "reserved": {
            "type": "boolean",
            "description": "`false` = another live session asked for that slot first and keeps it; this\nsession stays on the first-free claim."
          },
          "slot": {
            "type": "integer",
            "format": "int32",
            "description": "The pick now stored for this session.",
            "minimum": 0
          }
        }
      },
      "SessionPlayerRequest": {
        "type": "object",
        "properties": {
          "slot": {
            "type": "integer",
            "format": "int32",
            "description": "Player slot, 0-based: `0` is Player 1. Omit or `null` to hand the session\nback to the first-free claim.",
            "example": 1,
            "minimum": 0
          }
        }
      },
      "SessionRef": {
        "type": "object",
        "description": "Plane-neutral A/V session (distinct from a video [`StreamRef`]).",
        "required": [
          "id",
          "client",
          "mode",
          "hdr",
          "plane"
        ],
        "properties": {
          "client": {
            "type": "string",
            "description": "Cert-fingerprint prefix, or peer IP for an anonymous client — not [`ClientRef::name`]."
          },
          "fingerprint": {
            "type": [
              "string",
              "null"
            ],
            "description": "The device's full stable id, for a hook filter. Absent for an anonymous client."
          },
          "hdr": {
            "type": "boolean"
          },
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "mode": {
            "type": "string",
            "description": "`WxH@Hz`, e.g. `\"3840x2160@120\"`."
          },
          "plane": {
            "$ref": "#/components/schemas/Plane",
            "description": "Which plane serves it, as `stream.*` and `game.*` also report."
          },
          "preset": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PresetRef",
                "description": "See [`ClientRef::preset`]."
              }
            ]
          },
          "profile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileRef",
                "description": "See [`ClientRef::profile`]."
              }
            ]
          }
        }
      },
      "SessionRow": {
        "type": "object",
        "description": "One live session as the Dashboard lists it: who, where, since when, and the state\nthe per-session routes change.",
        "required": [
          "plane",
          "phase",
          "client",
          "mode",
          "hdr",
          "join",
          "muted",
          "pads",
          "uptime_s"
        ],
        "properties": {
          "access_level": {
            "type": [
              "string",
              "null"
            ],
            "description": "`full` | `controller` | `view` | `custom`, live — not the pairing's stored level.\n`null` on the compat plane, which is ungoverned."
          },
          "client": {
            "type": "string",
            "description": "Fingerprint prefix, or peer IP for an anonymous client."
          },
          "client_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name (trust store, else the name the client sent). `null` if nameless."
          },
          "hdr": {
            "type": "boolean"
          },
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Pass to `DELETE /session/{id}` and friends.",
            "minimum": 0
          },
          "join": {
            "type": "boolean",
            "description": "Sharing another session's display rather than owning one. Which session it joined\nis not reported yet — the two registries do not share ids (issue #1095)."
          },
          "link": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LinkMinute",
                "description": "The last closed minute of link health: loss, the recovery frames it cost, and the FEC\nand bitrate bands. `null` in a session's first minute, and on the compat plane."
              }
            ]
          },
          "mode": {
            "type": "string",
            "description": "`WxH@Hz`.",
            "example": "3840x2160@120"
          },
          "muted": {
            "type": "boolean",
            "description": "Audio is held back for this session alone (`PUT /session/{id}/audio`)."
          },
          "pads": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "OS pad slots this session holds, lowest first. Slot `n` is player `n + 1` to a\nlocal co-op game. Empty while the session has no controller."
          },
          "phase": {
            "$ref": "#/components/schemas/Phase",
            "description": "Where the session is. `streaming` for most of its life; `ending` once a stop, a\ngame exit or the client's close has been seen and the row is about to go."
          },
          "plane": {
            "$ref": "#/components/schemas/Plane"
          },
          "preferred_pad_slot": {
            "type": "integer",
            "format": "int32",
            "description": "Player slot the operator picked for this session, 0-based (`PUT\n/session/{id}/player`). `null` = the slot is whichever comes free.",
            "minimum": 0
          },
          "preset_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the settings preset the client dialled with. Absent for plain settings."
          },
          "profile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileRef",
                "description": "The profile the session plays as. Blank, like `client_name`, for another device's\nsession on the cert lane."
              }
            ]
          },
          "seat": {
            "type": [
              "string",
              "null"
            ],
            "description": "On a door, to the operator: the profile whose seat host runs it, whose proxy reaches it."
          },
          "shared_path_with": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "description": "Other live sessions from this client's address — one NAT or tunnel, so most likely one\nnetwork path. Their bitrates adapt independently. Absent when there are none."
          },
          "uptime_s": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds since the stream started.",
            "minimum": 0
          },
          "wire": {
            "type": "integer",
            "format": "int32",
            "description": "The punktfunk protocol the session speaks. Absent on the compat plane.",
            "minimum": 0
          }
        }
      },
      "SessionSettings": {
        "type": "object",
        "properties": {
          "disconnect_grace_seconds": {
            "type": "integer",
            "format": "int32",
            "description": "Ignored unless `game_on_session_end` is `Always`.",
            "minimum": 0
          },
          "game_on_new_launch": {
            "$ref": "#/components/schemas/GameOnNewLaunch"
          },
          "game_on_session_end": {
            "$ref": "#/components/schemas/GameOnSessionEnd"
          },
          "session_on_game_exit": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "SessionSettingsState": {
        "type": "object",
        "required": [
          "settings",
          "configured",
          "enforced"
        ],
        "properties": {
          "configured": {
            "type": "boolean",
            "description": "`false` means `settings` are the built-in defaults."
          },
          "enforced": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Axes this build enforces. Empty with no launch path (macOS) so the console\ndoes not offer a no-op switch."
          },
          "settings": {
            "$ref": "#/components/schemas/SessionSettings"
          }
        }
      },
      "SessionSummary": {
        "type": "object",
        "description": "Everything the host knows about one finished session.\n\nThe `session.ended` payload AND the body of `GET /api/v1/session/last`: one struct,\nso a screenshot of the console card is the API answer a bug report would have carried.\nA number the host does not accumulate per session is absent rather than zero.",
        "required": [
          "id",
          "client",
          "started_unix",
          "duration_s",
          "mode",
          "hdr",
          "join",
          "codec",
          "bit_depth",
          "chroma",
          "bitrate_kbps",
          "input",
          "bringup_ms",
          "ended"
        ],
        "properties": {
          "audio": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AudioEgress",
                "description": "Absent when the session ran no audio plane (synthetic source, or the thread never started)."
              }
            ]
          },
          "bit_depth": {
            "type": "integer",
            "format": "int32",
            "description": "8 or 10. Independent of `hdr` — 10-bit SDR is a mode.",
            "minimum": 0
          },
          "bitrate": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BitrateSpan",
                "description": "What the encoder's target did. Absent on a session that opened no encoder."
              }
            ]
          },
          "bitrate_kbps": {
            "type": "integer",
            "format": "int32",
            "description": "The encoder's target when the session ended, kbps. `bitrate` has the span.",
            "minimum": 0
          },
          "bringup_ms": {
            "type": "integer",
            "format": "int32",
            "description": "Hello → first video packet, ms. `0` if no packet ever left.",
            "minimum": 0
          },
          "chroma": {
            "type": "string",
            "description": "`4:2:0` or `4:4:4`."
          },
          "client": {
            "type": "string",
            "description": "Cert-fingerprint prefix, or peer IP for an anonymous client."
          },
          "client_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name (trust store, else the name the client sent). Absent if nameless."
          },
          "codec": {
            "type": "string",
            "description": "`h264` | `hevc` | `av1` | `pyrowave`."
          },
          "duration_s": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "ended": {
            "$ref": "#/components/schemas/SessionEndReason"
          },
          "frames_dropped": {
            "type": "integer",
            "format": "int64",
            "description": "Frames the capturer's encode pool refused. Absent on a capturer that does not\ncount them (everything but the Windows IDD-push and WGC paths), and on GameStream.",
            "minimum": 0
          },
          "frames_sent": {
            "type": "integer",
            "format": "int64",
            "description": "Access units the send thread put on the wire. Absent when the video loop\nnever reached its tail — the `host_error` case — and on GameStream.",
            "minimum": 0
          },
          "gyro": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GyroCadence",
                "description": "Absent when no pad sent motion — most sessions."
              }
            ]
          },
          "hdr": {
            "type": "boolean"
          },
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Same id [`SessionRef`] and the per-session routes carry.",
            "minimum": 0
          },
          "input": {
            "$ref": "#/components/schemas/InputCounts"
          },
          "join": {
            "type": "boolean",
            "description": "Shared another session's display at ITS mode instead of owning one."
          },
          "mode": {
            "type": "string",
            "description": "`WxH@Hz` as last delivered; a mid-session mode switch moves it."
          },
          "path_mtu": {
            "type": "integer",
            "format": "int32",
            "description": "Path MTU the QUIC stack settled on, bytes. Absent as `frames_sent` is.",
            "minimum": 0
          },
          "started_unix": {
            "type": "integer",
            "format": "int64",
            "description": "Host wall clock at stream start, unix seconds."
          }
        }
      },
      "SetBy": {
        "type": "string",
        "description": "Who last wrote a device's pick: its `screen`, its `topology`, or both.",
        "enum": [
          "device",
          "console"
        ]
      },
      "SetGpuPreference": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "gpu_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Required for `manual`: a currently listed GPU `id`.",
            "example": "10de-2c05-0"
          },
          "mode": {
            "type": "string",
            "description": "`auto` (Windows: env pin, else max dedicated VRAM; Linux: NVIDIA when present, else the\nencode render node) or `manual`.",
            "example": "manual"
          }
        }
      },
      "SettingApply": {
        "type": "string",
        "enum": [
          "now",
          "next_session",
          "restart"
        ]
      },
      "SettingGroup": {
        "type": "string",
        "enum": [
          "streaming",
          "video",
          "audio",
          "input",
          "network",
          "game_mode",
          "session",
          "seats",
          "system"
        ]
      },
      "SettingKind": {
        "type": "string",
        "enum": [
          "bool",
          "int",
          "decimal",
          "enum",
          "text",
          "list"
        ]
      },
      "SettingSource": {
        "type": "string",
        "enum": [
          "default",
          "store",
          "env",
          "flag"
        ]
      },
      "SettingState": {
        "type": "object",
        "description": "One setting as the console renders it.",
        "required": [
          "id",
          "group",
          "kind",
          "default",
          "value",
          "source",
          "env",
          "apply",
          "advanced",
          "title",
          "docs",
          "restart_pending"
        ],
        "properties": {
          "advanced": {
            "type": "boolean"
          },
          "apply": {
            "$ref": "#/components/schemas/SettingApply"
          },
          "default": {},
          "docs": {
            "type": "string",
            "description": "docs-site page slug under `/docs/`."
          },
          "env": {
            "type": "string",
            "description": "The name to set in `host.env` to pin this setting."
          },
          "group": {
            "$ref": "#/components/schemas/SettingGroup"
          },
          "id": {
            "type": "string",
            "description": "Store key; the console's copy key is `setting_<id>`."
          },
          "kind": {
            "$ref": "#/components/schemas/SettingKind"
          },
          "max": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "`int` and `decimal` only."
          },
          "max_len": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "`text` only.",
            "minimum": 0
          },
          "min": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "`int` and `decimal` only."
          },
          "options": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "`enum` only, canonical spellings in display order."
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "description": "The env var or CLI flag that set `value` (`source` `env` or `flag`)."
          },
          "restart_pending": {
            "type": "boolean",
            "description": "Changed since the host started, and applies only after a restart."
          },
          "source": {
            "$ref": "#/components/schemas/SettingSource"
          },
          "stored": {
            "description": "The console's value, even while an env var or flag overrides it."
          },
          "title": {
            "type": "string",
            "description": "English label, for a setting the console has no copy for."
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "description": "`int` and `decimal` only, e.g. `fps`."
          },
          "value": {
            "description": "The value in force."
          }
        }
      },
      "Severity": {
        "type": "string",
        "description": "Weight of a non-ok status. Orthogonal to [`CheckStatus`]: a check can `warn` about something\n`critical` (degraded, not dead). The console sorts by both.",
        "enum": [
          "info",
          "warning",
          "critical"
        ]
      },
      "SignedInDevice": {
        "type": "object",
        "description": "A device signed in to a profile on a person's own Linux account, or on a locked profile's\nlist.",
        "required": [
          "fingerprint",
          "name",
          "kind",
          "moonlight",
          "added_unix",
          "last_unix"
        ],
        "properties": {
          "added_unix": {
            "type": "integer",
            "format": "int64",
            "description": "When it first signed in, unix seconds."
          },
          "fingerprint": {
            "type": "string",
            "description": "SHA-256 of the device's certificate, lowercase hex."
          },
          "kind": {
            "$ref": "#/components/schemas/SignedInKind"
          },
          "last_unix": {
            "type": "integer",
            "format": "int64",
            "description": "When it last unlocked or rejoined, unix seconds."
          },
          "moonlight": {
            "type": "boolean",
            "description": "A Moonlight pairing rather than a Punktfunk one. Never on a person's own account."
          },
          "name": {
            "type": "string",
            "description": "The name it paired with."
          }
        }
      },
      "SignedInKind": {
        "type": "string",
        "description": "How a signed-in device gets back on.",
        "enum": [
          "for_now",
          "stay",
          "added",
          "key"
        ]
      },
      "SourceInput": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "public_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "`ed25519:<base64>`. Omitted ⇒ an unsigned source (accepted, flagged everywhere)."
          },
          "url": {
            "type": "string"
          }
        }
      },
      "SourceOrigin": {
        "type": "string",
        "description": "Origin of a [`ScannerInfo`]. This host emits only `Plugin`.",
        "enum": [
          "builtin",
          "plugin"
        ]
      },
      "SourceView": {
        "type": "object",
        "required": [
          "name",
          "url",
          "builtin",
          "signed",
          "stale",
          "entry_count"
        ],
        "properties": {
          "builtin": {
            "type": "boolean",
            "description": "Built-in `unom`: not editable, not removable; only its entries may be `verified`."
          },
          "entry_count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "fetched_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Unix seconds of the cached index, if any.",
            "minimum": 0
          },
          "name": {
            "type": "string"
          },
          "public_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "signed": {
            "type": "boolean",
            "description": "Unsigned sources still serve; the console flags them."
          },
          "stale": {
            "type": "boolean",
            "description": "Last refresh missed; entries still install — the pin travelled with the entry."
          },
          "url": {
            "type": "string"
          }
        }
      },
      "StageTiming": {
        "type": "object",
        "description": "One stage's p50/p99 in an aggregation window (microseconds).",
        "required": [
          "name",
          "p50_us",
          "p99_us"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Pipeline order, named per path. Linux native: `queue capture submit encode send`.\nWindows driver: `pool encode ipc copy send`, or `driver copy send` from a driver that\ndoes not stamp its slots. GameStream: `capture encode packetize send send_spread`, with\nthe same two driver sets on Windows."
          },
          "p50_us": {
            "type": "number",
            "format": "float"
          },
          "p99_us": {
            "type": "number",
            "format": "float"
          }
        }
      },
      "State": {
        "type": "string",
        "enum": [
          "running",
          "done",
          "failed"
        ]
      },
      "StatsSample": {
        "type": "object",
        "description": "One aggregated sample (~2 s native, ~1 s GameStream).",
        "required": [
          "t_ms",
          "session_id",
          "stages",
          "fps",
          "repeat_fps",
          "mbps",
          "bitrate_kbps"
        ],
        "properties": {
          "bitrate_kbps": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "fec_recovered": {
            "type": "integer",
            "format": "int32",
            "description": "FEC shards the receiver recovered. Only a client measures it.",
            "minimum": 0
          },
          "fec_us": {
            "type": "number",
            "format": "float",
            "description": "Sealing one frame, mean µs over the window: FEC parity, AES-GCM, the socket sends.\nNative only; timed while a capture runs."
          },
          "fps": {
            "type": "number",
            "format": "float",
            "description": "Genuine new frames/s from the source (not including repeats)."
          },
          "frames_dropped": {
            "type": "integer",
            "format": "int32",
            "description": "Counters are deltas for this window. `None` = this path cannot see it, never a zero it\ndid not measure. Frames the host dropped: the driver's pool, or GameStream's queue.",
            "minimum": 0
          },
          "host_p50_us": {
            "type": "number",
            "format": "float",
            "description": "Capture → fully sent, p50/p99 µs: the span a client's `host` term reports."
          },
          "host_p99_us": {
            "type": "number",
            "format": "float"
          },
          "mbps": {
            "type": "number",
            "format": "float",
            "description": "Attempted sealed wire Mb/s at seal time (AU + shard framing + FEC, including\ndatagram-aligned zero-pad). Not goodput; socket send drops do not reduce it."
          },
          "packets_dropped": {
            "type": "integer",
            "format": "int32",
            "description": "Receiver-side loss. Only a client measures it; recordings older than this field hold 0.",
            "minimum": 0
          },
          "repeat_fps": {
            "type": "number",
            "format": "float",
            "description": "Re-encoded holds/s — source starvation, not new frames."
          },
          "rtt_us": {
            "type": "integer",
            "format": "int32",
            "description": "Smoothed QUIC round trip to the client, µs.",
            "minimum": 0
          },
          "seal_us": {
            "type": "number",
            "format": "float"
          },
          "send_dropped": {
            "type": "integer",
            "format": "int32",
            "description": "Host send-buffer overflow / EAGAIN.",
            "minimum": 0
          },
          "session_id": {
            "type": "integer",
            "format": "int32",
            "description": "Distinguishes concurrent sessions (usually constant for one loop).",
            "minimum": 0
          },
          "sock_us": {
            "type": "number",
            "format": "float"
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StageTiming"
            }
          },
          "t_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Milliseconds since capture start (monotonic; stamped by [`StatsRecorder::push_sample`]).",
            "minimum": 0
          }
        }
      },
      "StatsStatus": {
        "type": "object",
        "description": "In-progress capture, as the management API reports it.",
        "required": [
          "armed",
          "sample_count",
          "started_unix_ms",
          "elapsed_ms",
          "kind"
        ],
        "properties": {
          "armed": {
            "type": "boolean"
          },
          "elapsed_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Host monotonic elapsed ms (`0` if idle). Do not subtract `started_unix_ms`\nfrom the console's wall clock — that clock may be skewed.",
            "minimum": 0
          },
          "kind": {
            "type": "string",
            "description": "`\"native\" | \"gamestream\" | \"web\"`, or `\"\"` if idle."
          },
          "sample_count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "started_unix_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Unix start of the in-progress capture (`0` if idle).",
            "minimum": 0
          }
        }
      },
      "StreamInfo": {
        "type": "object",
        "description": "Negotiated stream parameters (RTSP on GameStream; live mode on native).",
        "required": [
          "width",
          "height",
          "fps",
          "bitrate_kbps",
          "packet_size",
          "min_fec",
          "codec"
        ],
        "properties": {
          "bitrate_kbps": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "codec": {
            "$ref": "#/components/schemas/ApiCodec"
          },
          "fps": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "last_resize_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Last mid-stream resize, reconfigure → rebuilt, ms. Native only; `null` if none / GameStream.",
            "minimum": 0
          },
          "min_fec": {
            "type": "integer",
            "format": "int32",
            "description": "Client's parity floor per FEC block (`minRequiredFecPackets`).",
            "minimum": 0
          },
          "packet_size": {
            "type": "integer",
            "format": "int32",
            "description": "Video payload size per packet (bytes).",
            "minimum": 0
          },
          "time_to_first_frame_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Hello → first video packet, ms. Native only; `null` on GameStream or while still bringing up.",
            "minimum": 0
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "StreamRef": {
        "type": "object",
        "description": "Live video stream (what the stream marker file reflects).",
        "required": [
          "mode",
          "hdr",
          "client",
          "plane"
        ],
        "properties": {
          "app": {
            "type": [
              "string",
              "null"
            ],
            "description": "Store-qualified id on the native plane, app title on GameStream."
          },
          "client": {
            "type": "string"
          },
          "fingerprint": {
            "type": [
              "string",
              "null"
            ],
            "description": "The device's stable id — what a hook filter should key on, since a display name is\nneither unique nor fixed. Absent for an anonymous client."
          },
          "hdr": {
            "type": "boolean"
          },
          "mode": {
            "type": "string",
            "description": "`WxH@Hz`."
          },
          "plane": {
            "$ref": "#/components/schemas/Plane"
          },
          "preset": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PresetRef",
                "description": "See [`ClientRef::preset`]."
              }
            ]
          },
          "profile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ProfileRef",
                "description": "See [`ClientRef::profile`]."
              }
            ]
          }
        }
      },
      "SubmitPin": {
        "type": "object",
        "description": "PIN plus the exact ceremony selected from `GET /pair`.",
        "required": [
          "pin",
          "uniqueid",
          "fingerprint",
          "peer_ip"
        ],
        "properties": {
          "fingerprint": {
            "type": "string"
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name for this device, scrubbed like `PATCH /clients/{fp}` and stored once the pairing\ncompletes. Every Moonlight client names itself the same, so without one the device is\nlisted by fingerprint until somebody renames it.",
            "example": "Living Room TV"
          },
          "peer_ip": {
            "type": "string"
          },
          "pin": {
            "type": "string",
            "example": "1234"
          },
          "uniqueid": {
            "type": "string"
          }
        }
      },
      "TokenGrant": {
        "type": "object",
        "required": [
          "token",
          "expires_at",
          "fingerprint"
        ],
        "properties": {
          "expires_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix seconds."
          },
          "fingerprint": {
            "type": "string",
            "description": "The device's own fingerprint, so a client can show which identity it is using."
          },
          "token": {
            "type": "string",
            "description": "Present as `Authorization: Bearer <token>`."
          }
        }
      },
      "TokenRequest": {
        "type": "object",
        "description": "`POST /auth/device/token` — what a paired browser presents.",
        "required": [
          "device_key",
          "nonce",
          "signature"
        ],
        "properties": {
          "device_key": {
            "type": "string",
            "description": "Base64 SPKI of the device's P-256 public key — the same bytes it paired with, whose\nSHA-256 the host stored."
          },
          "nonce": {
            "type": "string",
            "description": "The nonce from `challenge`."
          },
          "signature": {
            "type": "string",
            "description": "Base64 ECDSA-P256-SHA256 signature, ASN.1 DER, over the same message the control stream\nuses: context, the host's identity fingerprint, then the nonce."
          }
        }
      },
      "Topology": {
        "type": "string",
        "description": "Host topology while managed virtual displays are up.",
        "enum": [
          "auto",
          "extend",
          "primary",
          "exclusive"
        ]
      },
      "TopologyTransaction": {
        "type": "object",
        "description": "One topology transaction as the display actor recorded it.",
        "required": [
          "reason",
          "outcome",
          "took_ms"
        ],
        "properties": {
          "outcome": {
            "type": "string",
            "description": "`changed` / `unchanged` / `unknown`."
          },
          "reason": {
            "type": "string",
            "description": "`acquire-isolate` / `exclusive-reassert` / …"
          },
          "took_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "UiCredential": {
        "type": "object",
        "description": "The only shape that returns a secret. The console BFF denylists this lookup from the browser.",
        "required": [
          "port",
          "secret"
        ],
        "properties": {
          "port": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "secret": {
            "type": "string"
          }
        }
      },
      "UninstallRequest": {
        "type": "object",
        "required": [
          "pkg"
        ],
        "properties": {
          "pkg": {
            "type": "string"
          }
        }
      },
      "UnitRef": {
        "type": "object",
        "required": [
          "kind",
          "name"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "`save`, `memcard` or `state`."
          },
          "name": {
            "type": "string"
          }
        }
      },
      "UnlockChallenge": {
        "type": "object",
        "description": "`POST /profiles/{id}/unlock-challenge`: `seat` for a profile on a person's own Linux account,\n`profile` for a locked one, never both.",
        "required": [
          "challenge"
        ],
        "properties": {
          "challenge": {
            "type": "string",
            "description": "32 random bytes, lowercase hex: good for one proof within two minutes.",
            "example": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
          },
          "profile": {
            "type": "string",
            "description": "The locked profile's id, as its signed message names it.",
            "example": "9a3f1c2b7e40"
          },
          "seat": {
            "type": "string",
            "description": "The seat's id, 32 lowercase hex characters, as the signed message names it.",
            "example": "0123456789abcdef0123456789abcdef"
          }
        }
      },
      "UnlockNeed": {
        "type": "string",
        "description": "What a device sends with its connect to open a profile: a profile on a person's own Linux\naccount, or a locked one. A client that doesn't know a word reads it as `password`.",
        "enum": [
          "none",
          "password",
          "key",
          "pin",
          "pin_key"
        ]
      },
      "UnpairAllResult": {
        "type": "object",
        "description": "Bulk-unpair result, shared by `/clients` and `/native/clients`.\n\nA count, not 204: unpair-everything is idempotent, and the operator still\nneeds to know whether that was three devices or none.",
        "required": [
          "unpaired"
        ],
        "properties": {
          "unpaired": {
            "type": "integer",
            "format": "int32",
            "example": 3,
            "minimum": 0
          }
        }
      },
      "UpdateJobInfo": {
        "type": "object",
        "description": "In-process apply, or a leftover installer that has not resolved yet.",
        "required": [
          "target_version",
          "stage",
          "received_bytes",
          "started_unix"
        ],
        "properties": {
          "received_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "stage": {
            "type": "string",
            "description": "`downloading` | `verifying` | `applying` | `restarting`."
          },
          "started_unix": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "target_version": {
            "type": "string"
          },
          "total_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "UpdateManifestInfo": {
        "type": "object",
        "required": [
          "version",
          "serial",
          "published_at",
          "notes_url",
          "stale"
        ],
        "properties": {
          "notes_url": {
            "type": "string",
            "description": "Forge-pinned by the manifest validator."
          },
          "published_at": {
            "type": "string",
            "description": "RFC-3339; display only, never compared."
          },
          "serial": {
            "type": "integer",
            "format": "int64",
            "description": "Unix seconds; monotonic per channel.",
            "minimum": 0
          },
          "stale": {
            "type": "boolean",
            "description": "Last verified manifest older than 45 days."
          },
          "version": {
            "type": "string"
          }
        }
      },
      "UpdateNativeAccess": {
        "type": "object",
        "description": "Partial PATCH of a paired device's grants/expiry. Omitted fields keep their\ncurrent value.",
        "properties": {
          "clear_expiry": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "`true` makes access permanent. Mutually exclusive with `expires_in_secs` (400)."
          },
          "expires_in_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "New expiry from now, seconds. `0` expires now. Omit to keep current.\nMutually exclusive with `clear_expiry` (400).",
            "example": 14400,
            "minimum": 0
          },
          "grants": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "New `GRANT_*` mask; reserved bits are 400. Omit to keep current grants.",
            "example": 1,
            "minimum": 0
          },
          "until_disconnect": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Drop the record once the device's last session ends. Omit to keep the current setting."
          }
        }
      },
      "UpdateResultInfo": {
        "type": "object",
        "description": "Last apply outcome. Survives the host's own restart.",
        "required": [
          "ok",
          "from",
          "to",
          "finished_unix"
        ],
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The failure in words, as the host message `hostupdate_<error_code>` with `from`, `to`\nand `error_params`; `error` keeps the detail."
          },
          "error_params": {
            "type": [
              "object",
              "null"
            ],
            "description": "The values of that message's other placeholders, by name.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "finished_unix": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "from": {
            "type": "string"
          },
          "log_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "ok": {
            "type": "boolean"
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "description": "Failed stage; absent on success."
          },
          "staged": {
            "type": "boolean",
            "description": "Applied; activates on the next reboot (rpm-ostree)."
          },
          "to": {
            "type": "string"
          }
        }
      },
      "UpdateStatus": {
        "type": "object",
        "required": [
          "install_kind",
          "channel",
          "current_version",
          "apply",
          "channel_hint",
          "check_disabled",
          "available",
          "not_published"
        ],
        "properties": {
          "apply": {
            "type": "string",
            "description": "`notify` (show the command) | `full` (one-click) | `staged` (apply + reboot)."
          },
          "available": {
            "type": "boolean",
            "description": "Newer than `current_version` on this channel. Unparseable pairs never flag."
          },
          "channel": {
            "type": "string",
            "description": "`stable` | `canary`."
          },
          "channel_hint": {
            "type": "string",
            "description": "Copy-paste update command for this install kind."
          },
          "check_disabled": {
            "type": "boolean",
            "description": "`PUNKTFUNK_UPDATE_CHECK=0`."
          },
          "current_version": {
            "type": "string"
          },
          "install_kind": {
            "type": "string",
            "description": "`windows-installer` | `sysext` | `rpm-ostree` | `apt` | `dnf` | `pacman` |\n`steamos-source` | `nix` | `source`."
          },
          "job": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateJobInfo"
              }
            ]
          },
          "last_checked_unix": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Last successful check (unix seconds).",
            "minimum": 0
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last check failure, verbatim."
          },
          "last_result": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateResultInfo"
              }
            ]
          },
          "manifest": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateManifestInfo"
              }
            ]
          },
          "not_published": {
            "type": "boolean",
            "description": "Feed 404 for this channel: nothing published yet, not a check failure.\nMutually exclusive with `last_error`. Never set once a manifest has been\nseen — a feed that then 404s is an error."
          },
          "opt_in_hint": {
            "type": [
              "string",
              "null"
            ],
            "description": "One-click apply is possible but not opted in — command to run\n(Linux: join `punktfunk-update`)."
          }
        }
      },
      "WebTransportInfo": {
        "type": "object",
        "description": "Everything `new WebTransport(url, { serverCertificateHashes })` needs.",
        "required": [
          "port",
          "cert_hash_sha256",
          "expires_at",
          "allow_pooling"
        ],
        "properties": {
          "allow_pooling": {
            "type": "boolean",
            "description": "`allowPooling: true` is a `TypeError` when combined with `serverCertificateHashes`, so a\nclient must pass this. Stated here because a browser that ignores it fails at Web PKI\nvalidation with no useful error."
          },
          "cert_hash_sha256": {
            "type": "string",
            "description": "Lowercase hex SHA-256 of the leaf certificate DER — the bytes that go in\n`serverCertificateHashes[0].value`."
          },
          "cert_hash_sig": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hex ECDSA-P256-SHA256 signature (ASN.1 DER) by the host's long-lived native identity over\n`\"punktfunk-wt-cert-v1:\" + cert_hash_sha256`. Absent when that identity is not a P-256\nkey. A browser that has paired MUST check this; one that has not cannot, and does not."
          },
          "expires_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix seconds. Past this the certificate has rotated and the hash above is stale; fetch\nagain rather than cache. Always under two weeks out — the spec refuses anything longer.",
            "minimum": 0
          },
          "host_cert_der": {
            "type": [
              "string",
              "null"
            ],
            "description": "Base64 DER of the native identity's leaf certificate — the key that verifies\n`cert_hash_sig`. A browser hashes it and compares with the fingerprint it stored at\npairing; trusting it without that check would defeat the whole exercise."
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "description": "UDP port the plane listens on. Not the management port, and not the native plane's.",
            "minimum": 0
          }
        }
      },
      "WorkspacePlacement": {
        "type": "string",
        "description": "Where a library launch's windows open on the streamed head.\n\nDefault `own`: the player gets the game on an empty workspace instead of\nthe operator's desk. Honoured only by the backends that can place a launch\n(`claim_workspace`); everywhere else a launch is always `current`.\n\n[`DisplayPolicy`] field, not part of [`EffectivePolicy`]: a preset never\nclobbers it. A library entry's own `on_window.workspace` outranks it.",
        "enum": [
          "own",
          "current"
        ]
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "host",
      "description": "Host identity, capabilities, and liveness"
    },
    {
      "name": "diagnostics",
      "description": "Host health checks: what is wrong, what it breaks, and how to fix it (admin lane only)"
    },
    {
      "name": "gpu",
      "description": "GPU inventory and selection: list the host's GPUs, choose automatic or a preferred GPU, see the one in use"
    },
    {
      "name": "display",
      "description": "Virtual-display management policy: lifecycle (keep-alive), topology (primary/exclusive), conflict handling, identity, and layout"
    },
    {
      "name": "clients",
      "description": "Paired Moonlight client management"
    },
    {
      "name": "pairing",
      "description": "Pairing PIN delivery (the out-of-band half of the GameStream pairing handshake)"
    },
    {
      "name": "native",
      "description": "Native pairing: arm a window, display the host PIN, manage paired devices"
    },
    {
      "name": "session",
      "description": "Active streaming session control"
    },
    {
      "name": "library",
      "description": "Game library: the titles each installed library plugin syncs, plus user-curated custom entries"
    },
    {
      "name": "profiles",
      "description": "The people on this box: the list a client's picker shows, their pictures, and the console's edits"
    },
    {
      "name": "stats",
      "description": "Streaming performance-stats capture: arm/stop a recording, read the live + saved time-series for graphing"
    },
    {
      "name": "logs",
      "description": "Host log stream: the newest in-memory log entries, cursor-paged for live following"
    },
    {
      "name": "events",
      "description": "Host lifecycle events: an SSE stream (client/session/stream lifecycle, pairing, displays, library, host) with Last-Event-ID resume and server-side kind filters"
    },
    {
      "name": "hooks",
      "description": "Operator hooks: commands and webhooks fired on lifecycle events (fire-and-forget — hooks observe, never veto)"
    },
    {
      "name": "plugins",
      "description": "Plugin directory: running `punktfunk-plugin-*` processes register a lease and, optionally, a loopback UI the web console proxies and adds to its nav"
    },
    {
      "name": "plugin-access",
      "description": "Plugin folder access: a plugin requests a directory (its own token), the operator grants or denies it (admin lane only)"
    },
    {
      "name": "emulators",
      "description": "Managed emulators (hermir): the catalog, what is installed or detected, install and remove (admin lane only)"
    },
    {
      "name": "store",
      "description": "Plugin store: browse signed catalogs (verified first-party entries, attributed third-party sources), install/uninstall as tracked jobs, and switch the plugin runner on"
    },
    {
      "name": "update",
      "description": "Host update check: install kind + channel, the last verified release manifest, and whether a newer host exists (admin lane only)"
    },
    {
      "name": "actions",
      "description": "Host actions: discover what this host offers (per-caller availability + permission) and invoke one by id — v1: sleep, restart, shut down the machine, gated per device by the Host power grant"
    }
  ]
}
