{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "connection": {
      "type": "string",
      "enum": [
        "ws",
        "wss",
        "http"
      ],
      "default": "ws",
      "description": "ws (default), wss (reverse WS), or http (POST webhook + HTTP API outbound)"
    },
    "reconnect_interval": {
      "type": "number",
      "default": 5000
    },
    "heartbeat_interval": {
      "type": "number",
      "default": 30000
    },
    "poll_interval": {
      "type": "number",
      "default": 30000
    },
    "master": {
      "type": [
        "string",
        "number"
      ],
      "description": "框架 master（QQ uin；AI/工具权限、endpoint 管理）。endpoints[i].master 可逐项覆盖"
    },
    "trusted": {
      "type": "array",
      "items": {
        "type": [
          "string",
          "number"
        ],
        "description": "Trusted QQ uin"
      },
      "description": "框架 trusted 用户列表（弱于 master）。endpoints[i].trusted 可逐项追加"
    },
    "endpoints": {
      "type": "array",
      "description": "多账号：一个插件实例挂多个 endpoint。每项与顶层字段同构（id 必填，其余覆盖顶层）",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "master": {
            "type": [
              "string",
              "number"
            ],
            "description": "本 endpoint 的框架 master（QQ uin）；覆盖顶层 master"
          },
          "trusted": {
            "type": "array",
            "items": {
              "type": [
                "string",
                "number"
              ],
              "description": "Trusted QQ uin"
            },
            "description": "本 endpoint 的 trusted 列表"
          },
          "url": {
            "type": "string",
            "description": "NapCat WebSocket URL (required for connection: ws)"
          },
          "path": {
            "type": "string",
            "description": "WS path for reverse-wss"
          },
          "http_url": {
            "type": "string",
            "description": "HTTP API base URL (connection: http outbound)"
          },
          "post_path": {
            "type": "string",
            "description": "HTTP POST event path (connection: http inbound)"
          },
          "access_token": {
            "type": "string",
            "description": "NapCat access token"
          },
          "id": {
            "type": "string",
            "description": "NapCat bot name"
          }
        },
        "required": [
          "id"
        ]
      }
    },
    "commandPrefix": {
      "type": "string",
      "default": "",
      "description": "命令前缀（默认 '' 无前缀，任意文本按命令匹配；如 '/' 要求 / 开头）。endpoints[i] 可逐项覆盖"
    }
  },
  "required": [
    "endpoints"
  ]
}
