{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/srift-app/json-schema/srift-app-daemon-status-schema.json",
  "title": "DaemonStatus",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/srift-app-openapi.yml#/components/schemas/DaemonStatus",
  "type": "object",
  "properties": {
    "session": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "role": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "host",
            "guest",
            null
          ]
        },
        "isConnected": {
          "type": "boolean"
        },
        "userId": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "activeTransfers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Transfer"
      }
    },
    "pendingJoins": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PendingJoin"
      }
    },
    "participants": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Participant"
      }
    },
    "lastUpdated": {
      "type": "string"
    }
  },
  "$defs": {
    "Participant": {
      "type": "object",
      "description": "A session member. Pass userId to /session/kick.",
      "properties": {
        "userId": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "isHost": {
          "type": "boolean"
        },
        "online": {
          "type": "boolean"
        }
      }
    },
    "PendingJoin": {
      "type": "object",
      "properties": {
        "tempUserId": {
          "type": "string",
          "description": "Pass to /session/approve or /session/reject"
        },
        "username": {
          "type": "string"
        }
      }
    },
    "Transfer": {
      "type": "object",
      "properties": {
        "fileId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "size": {
          "type": "number"
        },
        "progress": {
          "type": "number",
          "description": "0-100"
        },
        "speedKBps": {
          "type": "number"
        },
        "etaSeconds": {
          "type": "number"
        },
        "protocol": {
          "type": "string",
          "enum": [
            "websocket",
            "webtorrent"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "uploading",
            "downloading",
            "completed",
            "cancelled",
            "error"
          ]
        },
        "direction": {
          "type": "string",
          "enum": [
            "upload",
            "download"
          ]
        },
        "bytesTransferred": {
          "type": "number"
        }
      }
    }
  }
}