{
  "id": "openclaw-channel-xiaozhu",
  "name": "小助",
  "description": "小助 — 通过 HTTP/SSE + OAuth2 接入 OpenClaw 对话，并支持标准消息动作能力",
  "channels": [
    "openclaw-channel-xiaozhu"
  ],
  "actions": [
    "send",
    "upload-file",
    "read",
    "edit",
    "react",
    "reactions",
    "pin",
    "unpin",
    "pins",
    "search",
    "delete",
    "poll",
    "permissions",
    "reply",
    "forward"
  ],
  "skills": [
    "skills"
  ],
  "configSchema": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "enabled": {
        "type": "boolean",
        "default": true,
        "description": "是否启用该渠道"
      },
      "port": {
        "type": "number",
        "default": 18800,
        "description": "HTTP 服务器监听端口"
      },
      "clientId": {
        "type": "string",
        "description": "OAuth clientId（建议配置，可后续补齐）"
      },
      "clientSecret": {
        "type": "string",
        "description": "OAuth clientSecret（建议改用 clientSecretFile，可后续补齐）"
      },
      "clientSecretFile": {
        "type": "string",
        "description": "clientSecret 文件路径（优先级低于 clientSecret）"
      },
      "rateLimitWindowMs": {
        "type": "number",
        "default": 60000,
        "description": "速率限制窗口（毫秒）"
      },
      "rateLimitMax": {
        "type": "number",
        "default": 20,
        "description": "窗口内最大请求数"
      },
      "rateLimitBurst": {
        "type": "number",
        "default": 5,
        "description": "突发请求上限"
      },
      "dedupTtlMs": {
        "type": "number",
        "default": 300000,
        "description": "消息去重 TTL（毫秒）"
      },
      "allowFrom": {
        "type": "array",
        "items": { "type": "string" },
        "description": "允许的发送者 ID 列表（* 表示全部）"
      },
      "webhookUrl": {
        "type": "string",
        "description": "Outbound 消息推送的 Webhook URL"
      },
      "webhookSecret": {
        "type": "string",
        "description": "Webhook HMAC-SHA256 签名密钥"
      },
      "webhookAuthToken": {
        "type": "string",
        "description": "Webhook 回调请求附带的 Authorization Bearer（可选）"
      },
      "accessTokenTtlSec": {
        "type": "number",
        "default": 7200,
        "description": "OAuth2 access_token 有效期（秒，300-86400）"
      },
      "webhookRetry": {
        "type": "object",
        "properties": {
          "maxAttempts": { "type": "number", "default": 3 },
          "baseDelayMs": { "type": "number", "default": 1000 }
        },
        "description": "Webhook 重试配置"
      },
      "allowOrigins": {
        "type": "array",
        "items": { "type": "string" },
        "description": "CORS 允许的 Origin 列表（* 表示全部）"
      },
      "publicBaseUrl": {
        "type": "string",
        "description": "对外公开访问地址（用于生成 /api/media 绝对 URL）"
      },
      "coalesce": {
        "type": "object",
        "properties": {
          "sizeThreshold": { "type": "number", "default": 200 },
          "idleTimeoutMs": { "type": "number", "default": 500 }
        },
        "description": "SSE 文本合并缓冲参数"
      },
      "perIpRateLimit": {
        "type": "object",
        "properties": {
          "windowMs": { "type": "number", "default": 60000 },
          "max": { "type": "number", "default": 10 }
        },
        "description": "Per-IP 速率限制"
      },
      "heartbeatIntervalMs": {
        "type": "number",
        "default": 15000,
        "description": "SSE 心跳间隔（毫秒），0 禁用"
      },
      "textChunkLimit": {
        "type": "number",
        "default": 4000,
        "description": "同步响应文本分块上限（字符数）"
      },
      "commandsEnabled": {
        "type": "boolean",
        "default": true,
        "description": "是否启用聊天命令（/new, /help 等）"
      },
      "networkMode": {
        "type": "string",
        "enum": ["webhook", "cloud"],
        "default": "webhook",
        "description": "网络模式：webhook（直连）或 cloud（云端中继）"
      },
      "relayUrl": {
        "type": "string",
        "description": "自定义中继服务器地址（cloud 模式）"
      },
      "relayToken": {
        "type": "string",
        "description": "中继鉴权密钥（不配则复用 clientSecret）"
      },
      "requireMention": {
        "type": "boolean",
        "default": false,
        "description": "群聊是否需要 @提及 才响应"
      },
      "groupIntroHint": {
        "type": "string",
        "description": "群聊介绍提示语"
      },
      "replyToMode": {
        "type": "string",
        "enum": ["off", "first", "all"],
        "default": "off",
        "description": "回复引用模式"
      },
      "dmPolicy": {
        "type": "string",
        "enum": ["open", "allowlist"],
        "default": "open",
        "description": "DM 安全策略"
      },
      "toolApproval": {
        "type": "object",
        "description": "工具审批策略：可按工具名配置 allow/require/deny",
        "properties": {
          "enabled": { "type": "boolean", "default": true },
          "allow": { "type": "array", "items": { "type": "string" } },
          "require": { "type": "array", "items": { "type": "string" } },
          "deny": { "type": "array", "items": { "type": "string" } },
          "timeoutMs": { "type": "number", "default": 30000 },
          "timeoutBehavior": { "type": "string", "enum": ["allow", "deny"], "default": "deny" },
          "severity": { "type": "string", "enum": ["info", "warning", "critical"], "default": "warning" }
        }
      },
      "accounts": {
        "type": "object",
        "additionalProperties": {
          "type": "object",
          "description": "多账号配置（每个 key 为账号 ID）"
        },
        "description": "多账号模式配置"
      }
    }
  }
}
