{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hwlab.pikastech.local/protocol/schemas/worker-session.schema.json",
  "title": "HWLAB Worker Session",
  "type": "object",
  "required": [
    "workerSessionId",
    "agentSessionId",
    "projectId",
    "serviceId",
    "status",
    "environment",
    "startedAt",
    "updatedAt"
  ],
  "properties": {
    "workerSessionId": {
      "$ref": "common.json#/$defs/id"
    },
    "agentSessionId": {
      "$ref": "common.json#/$defs/id"
    },
    "projectId": {
      "$ref": "common.json#/$defs/id"
    },
    "serviceId": {
      "const": "hwlab-cloud-api"
    },
    "gatewaySessionId": {
      "$ref": "common.json#/$defs/id"
    },
    "status": {
      "type": "string",
      "enum": ["starting", "active", "blocked", "completed", "failed", "canceled"]
    },
    "environment": {
      "$ref": "common.json#/$defs/environment"
    },
    "startedAt": {
      "$ref": "common.json#/$defs/timestamp"
    },
    "completedAt": {
      "$ref": "common.json#/$defs/timestamp"
    },
    "updatedAt": {
      "$ref": "common.json#/$defs/timestamp"
    },
    "metadata": {
      "$ref": "common.json#/$defs/jsonObject"
    }
  },
  "additionalProperties": false
}
