{
  "openapi": "3.1.0",
  "info": {
    "title": "Human-Machine Work API",
    "version": "2026-03-25.v1",
    "description": "第一版 AI 友好工作大厅入口说明，覆盖活动地图、Work realtime bootstrap 和当前 WebSocket 连接方式。"
  },
  "servers": [
    {
      "url": "https://jobcdn.cn"
    }
  ],
  "paths": {
    "/office_game_map_api": {
      "get": {
        "summary": "Read active game map",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["load-active", "summary-active"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Active map or summary payload"
          }
        }
      },
      "post": {
        "summary": "Save active game map",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["save-active"]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "payload": {
                    "type": "object"
                  }
                },
                "required": ["payload"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Map saved"
          },
          "403": {
            "description": "Save forbidden"
          }
        }
      }
    },
    "/im/api/": {
      "get": {
        "summary": "Work realtime bootstrap or profile",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["work_realtime_bootstrap", "work_realtime_profile"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Realtime bootstrap or profile payload"
          },
          "401": {
            "description": "Auth required"
          },
          "403": {
            "description": "Enterprise internal only"
          }
        }
      }
    }
  },
  "x-websocket": {
    "path": "/work/ws",
    "bootstrap_source": "/im/api/?action=work_realtime_bootstrap",
    "notes": [
      "Connect only after receiving ws_url and token from bootstrap.",
      "Current outbound messages: avatar.patch, chat.say.",
      "Current inbound messages: space.ready, member.join, avatar.patch, member.leave, avatar.bubble, chat.message."
    ]
  }
}
