{
  "version": "2026.11.25.1",
  "baseUrl": "https://flowbot.efguc.com",
  "auth": {
    "summary": "所有 /api/* 接口只需要 robotId(授权码)。放在 URL 参数 robotId=...,POST 时也可放在 JSON body 的 robotId 字段。授权码被禁用后立即全部 401。路径 /api/xxx 与 /wx/api/xxx 等价(2026-10-07 起,与 FlowBot 文档同路径:业务系统只需把 FlowBot 的域名换成 flowbot.efguc.com)。",
    "format": "xyb + 32 位十六进制,例如 xyb1f2a…",
    "envelope": "{ \"code\": 200, \"message\": \"...\", \"data\": {...} }"
  },
  "groups": [
    {
      "id": "status",
      "title": "状态与健康"
    },
    {
      "id": "send",
      "title": "发任务"
    },
    {
      "id": "result",
      "title": "拿结果"
    },
    {
      "id": "read",
      "title": "读消息"
    },
    {
      "id": "callback",
      "title": "回调(平台引擎接管)"
    }
  ],
  "endpoints": [
    {
      "id": "getRobotInfo",
      "group": "status",
      "method": "GET / POST",
      "path": "/api/getRobotInfo?robotId=<授权码>",
      "title": "查询机器人在线状态",
      "summary": "按手机心跳 TTL 判断这个微信号是否在线。发送前预检;online=false 只代表手机上的 Agent App 没有上报心跳。",
      "params": [
        {
          "name": "robotId",
          "required": true,
          "desc": "授权码"
        }
      ],
      "response": "{\n  \"code\": 200,\n  \"message\": \"查询成功\",\n  \"data\": {\n    \"robotId\": \"xyb1f2a…\",\n    \"channel\": \"wecom\",\n    \"robotName\": \"小宇\",\n    \"deviceId\": \"dev_xxx\",\n    \"androidId\": \"dev_xxx\",\n    \"status\": \"online\",\n    \"online\": true,\n    \"isOnline\": 1,\n    \"accessibilityEnabled\": true,\n    \"expired_at\": \"2030-12-31 00:00:00\",\n    \"callBackUrl\": \"https://your-backend/callback\",\n    \"lastLogin_at\": \"2026-10-07 10:00:00\",\n    \"agentVersion\": \"0.8.0\",\n    \"appVersion\": \"4.1.38\",\n    \"onlineTtl\": 29,\n    \"pendingTaskCount\": 3\n  }\n}",
      "curl": "curl -s \"https://flowbot.efguc.com/api/getRobotInfo?robotId=$ROBOT_ID\"",
      "notes": [
        "pendingTaskCount = 这台手机前面还排着几条业务任务(待下发 + 执行中;不含自动未读看护)。手机串行执行,开推前可据此估算等待时间;查询失败时为 null。",
        "online=false 时 sendTask 仍会 200 入库,任务排队等手机上线,超过 timeoutSeconds 变 timeout。",
        "授权码被禁用返回 401 robotId无效,而不是 online=false。",
        "企微通道按 FlowBot 企微文档返回 isOnline 0/1(无障碍断了算 0)、androidId、expired_at、callBackUrl、lastLogin_at;个微通道 isOnline 仍为布尔。"
      ]
    },
    {
      "id": "sendTask",
      "group": "send",
      "method": "POST",
      "path": "/api/sendTask?robotId=<授权码>",
      "title": "下发任务(发消息 / 发圈 / 群管理 / 加好友 / 账号管理…)",
      "summary": "taskList 里每条一个任务,按顺序在手机上串行执行。返回 200 只表示入库排队,不代表已发出;结果用 getTaskStatus 轮询。",
      "params": [
        {
          "name": "taskList[].type",
          "required": true,
          "desc": "任务类型号,见下方任务类型表"
        },
        {
          "name": "taskList[].searchText",
          "required": false,
          "desc": "微信里显示的联系人/群名,必须一字不差;朋友圈/视频号/抖音/小红书/通讯录类型可不填。若传的是入站回调里被截断的群名(以「…」结尾),网关会按该手机发过/收到过的完整群名唯一匹配补全,匹配不到则原样下发;回调里的 searchText 仍是你传入的原名字"
        },
        {
          "name": "taskList[].targetType",
          "required": false,
          "desc": "friend(默认)或 group;发群消息、群 @ 必须 group"
        },
        {
          "name": "taskList[].message",
          "required": false,
          "desc": "正文 / 图片 URL / 文件 URL,随类型变化"
        },
        {
          "name": "taskList[].idempotencyKey",
          "required": false,
          "desc": "强烈建议:业务消息的稳定唯一 ID,重试不重复发送"
        },
        {
          "name": "taskList[].timeoutSeconds",
          "required": false,
          "desc": "默认 90,手机离线时最多等这么久"
        },
        {
          "name": "taskList[].priority",
          "required": false,
          "desc": "默认 5,越小越先执行"
        },
        {
          "name": "taskList[].important",
          "required": false,
          "desc": "true=插队(企微文档「指令插队」),抬高优先级"
        },
        {
          "name": "taskList[].type=FORCE_OFFLINE|STOP_SCRIPT|START_SCRIPT|CLEAR_TASK_QUEUE",
          "required": false,
          "desc": "字符串型控制指令(企微文档机器人管理/指令管理):立即执行不排队——解绑下线 / 远程暂停 / 恢复 / 清空待执行队列"
        }
      ],
      "request": "{\n  \"taskList\": [\n    {\n      \"type\": 10001,\n      \"searchText\": \"超逸\",\n      \"message\": \"您好,您的订单已发货,单号 SF123456。\",\n      \"idempotencyKey\": \"order-1001-shipped\"\n    }\n  ]\n}",
      "response": "{\n  \"code\": 200,\n  \"message\": \"指令发送成功\",\n  \"taskId\": \"task_xxx\",\n  \"data\": {\n    \"taskList\": [\n      { \"taskId\": \"task_xxx\", \"status\": \"pending\", \"searchText\": \"超逸\", \"type\": 10001 }\n    ]\n  }\n}",
      "curl": "curl -s \"https://flowbot.efguc.com/api/sendTask?robotId=$ROBOT_ID\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"taskList\":[{\"type\":10001,\"searchText\":\"超逸\",\"message\":\"你好\"}]}'",
      "notes": [
        "每次请求建议 ≤ 5 条;批量发送条间随机 8~20 秒,单个微信号每小时 ≤ 60、每天 ≤ 300,新号头三天减半。",
        "图片/文件/视频 URL 必须是手机能下载的公网 http(s) 地址。",
        "400 的 message 会指出具体字段,如 taskList[0].message不能为空。",
        "顶层 taskId 与 FlowBot 企微文档一致(多条时为第一条);完整列表在 data.taskList。"
      ]
    },
    {
      "id": "getTaskStatus",
      "group": "result",
      "method": "GET / POST",
      "path": "/api/getTaskStatus?robotId=<授权码>&taskId=task_xxx",
      "title": "查询任务状态 / 终态",
      "summary": "只能查本 robotId 通过 sendTask 创建的任务。status:pending → dispatched → running → succeeded / failed / cancelled / timeout。",
      "params": [
        {
          "name": "robotId",
          "required": true,
          "desc": "授权码"
        },
        {
          "name": "taskId",
          "required": true,
          "desc": "sendTask 返回的 taskId;POST 时可放 body"
        }
      ],
      "response": "{\n  \"code\": 200,\n  \"message\": \"查询成功\",\n  \"data\": {\n    \"taskId\": \"task_xxx\",\n    \"type\": 10001,\n    \"taskType\": \"send_text\",\n    \"status\": \"succeeded\",\n    \"finished\": true,\n    \"success\": true,\n    \"searchText\": \"超逸\",\n    \"result\": { \"sent\": true },\n    \"errorCode\": null,\n    \"errorMessage\": null,\n    \"finishedAt\": \"2026-09-08T10:00:12+00:00\"\n  }\n}",
      "curl": "curl -s \"https://flowbot.efguc.com/api/getTaskStatus?robotId=$ROBOT_ID&taskId=task_xxx\"",
      "notes": [
        "轮询节奏:入库后先等 10 秒,之后每 5 秒一次,最多轮到 timeoutSeconds + 30 秒。",
        "result 因类型而异:发送类 {sent:true};20006 有 result.profile;20007 有 result.contacts[]。",
        "别的机器人的任务、平台原生接口创建的任务一律 404。"
      ]
    },
    {
      "id": "getChatHisList",
      "group": "read",
      "method": "GET / POST",
      "path": "/api/getChatHisList?robotId=<授权码>&searchText=超逸&limit=20",
      "title": "读取聊天记录(只读,排障用)",
      "summary": "返回 xiyebot 通过无障碍看到的消息,按时间正序。role=user 是客户发来的,assistant 是这个微信号发出去的;type 为 text / image / voice。",
      "params": [
        {
          "name": "searchText",
          "required": false,
          "desc": "会话名;不传 = 最近消息(跨会话)"
        },
        {
          "name": "limit",
          "required": false,
          "desc": "1~100,默认 20"
        },
        {
          "name": "page",
          "required": false,
          "desc": "企微通道翻页(每页 limit 条,默认 20),与 FlowBot 企微文档一致"
        }
      ],
      "response": "{\n  \"code\": 200,\n  \"message\": \"查询成功\",\n  \"data\": {\n    \"robotId\": \"xyb…\",\n    \"list\": [\n      { \"searchText\": \"超逸\", \"role\": \"user\", \"type\": \"text\", \"message\": \"在吗\", \"createdAt\": \"2026-09-08T09:58:00+00:00\" },\n      { \"searchText\": \"超逸\", \"role\": \"assistant\", \"type\": \"text\", \"message\": \"在的,您说。\", \"createdAt\": \"2026-09-08T09:58:20+00:00\" }\n    ]\n  }\n}",
      "curl": "curl -s \"https://flowbot.efguc.com/api/getChatHisList?robotId=$ROBOT_ID&searchText=超逸&limit=20\"",
      "notes": [
        "不是微信数据库导出,会缺失手机不在前台时的消息、撤回、表情包等。",
        "图片和语音是占位([图片]、3秒)或已转写的文字。",
        "企微通道返回 FlowBot 企微文档形态:data 直接是数组 [{role:user|admin|system, msgtime, msgtype, message, extra}];个微通道仍为 data.list。"
      ]
    },
    {
      "id": "updateCallBackUrl",
      "group": "callback",
      "method": "POST",
      "path": "/api/updateCallBackUrl?robotId=<授权码>",
      "title": "配置回调地址",
      "summary": "每个 robotId 只保存一个回调地址。接入希也家获客 AgentOS 的机器人由平台引擎自动配置,客户二开代码严禁再调用(会让 AI 员工收不到消息)。自建业务系统直连时才需要自己配置。",
      "params": [
        {
          "name": "callBackUrl",
          "required": true,
          "desc": "http(s) 地址,配置后先收到一次 mode=init"
        }
      ],
      "request": "{ \"callBackUrl\": \"https://your-backend.example.com/xiyebot/callback\" }",
      "response": "{ \"code\": 200, \"message\": \"回调地址更新成功\" }",
      "curl": "curl -s \"https://flowbot.efguc.com/api/updateCallBackUrl?robotId=$ROBOT_ID\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"callBackUrl\":\"https://your-backend.example.com/xiyebot/callback\"}'",
      "notes": [
        "回调体统一为 { robotId, mode, searchText, data:[...] },mode 见下方回调表。",
        "回调地址收到请求返回任意 2xx 即视为成功;失败会指数退避重试三次。"
      ]
    },
    {
      "id": "updateAutoReadConfig",
      "group": "callback",
      "method": "POST",
      "path": "/api/updateAutoReadConfig?robotId=<授权码>",
      "title": "自动读取消息开关(企微文档【定制】)",
      "summary": "关闭后手机不再自动扫未读、服务端也不再排未读看护任务;发消息不受影响。个微/企微通道都可用。",
      "params": [
        {
          "name": "autoRead",
          "required": true,
          "desc": "true 开 / false 关"
        }
      ],
      "request": "{ \"autoRead\": true }",
      "response": "{ \"code\": 200, \"message\": \"配置更新成功\", \"data\": { \"robotId\": \"xyb…\", \"autoRead\": true, \"autoBatchSending\": false } }",
      "curl": "curl -s \"https://flowbot.efguc.com/api/updateAutoReadConfig?robotId=$ROBOT_ID\" -H \"Content-Type: application/json\" -d '{\"autoRead\":true}'",
      "notes": [
        "配置随手机心跳下发,30 秒内生效。"
      ]
    },
    {
      "id": "updateAutoBatchSendingConfig",
      "group": "callback",
      "method": "POST",
      "path": "/api/updateAutoBatchSendingConfig?robotId=<授权码>",
      "title": "自动确认群发开关(企微文档【定制】)",
      "summary": "企微「群发助手」需要在手机上点确认;开启后 Agent 自动确认。配置存服务端随心跳下发(手机端自动确认流程待真机校准)。",
      "params": [
        {
          "name": "autoBatchSending",
          "required": true,
          "desc": "true 开 / false 关"
        }
      ],
      "request": "{ \"autoBatchSending\": true }",
      "response": "{ \"code\": 200, \"message\": \"配置更新成功\", \"data\": { \"robotId\": \"xyb…\", \"autoRead\": true, \"autoBatchSending\": true } }",
      "curl": "curl -s \"https://flowbot.efguc.com/api/updateAutoBatchSendingConfig?robotId=$ROBOT_ID\" -H \"Content-Type: application/json\" -d '{\"autoBatchSending\":true}'",
      "notes": []
    },
    {
      "method": "POST",
      "path": "/api/updateWechatSuspendConfig?robotId=<授权码>",
      "name": "个微风控养号开关(xiyebot 扩展)",
      "params": [
        {
          "name": "wechatSuspended",
          "required": true,
          "desc": "true=养号:拒绝一切会唤起微信的任务(423 WECHAT_SUSPENDED)、停未读看护与通讯录扫描、手机端不再碰微信,并关掉 autoRead;false=恢复(autoRead 同步打开,除非显式传 autoRead=false)。小红书/抖音任务与设备在线状态不受影响"
        }
      ],
      "desc": "业务后台「风控养号」开关对接此接口;getRobotInfo 返回 wechatSuspended 字段;开启时顺手取消该号所有待执行的微信任务(返回 cancelledTasks)"
    },
    {
      "method": "POST",
      "path": "/api/resumeRobotLocal?robotId=<授权码>",
      "name": "远程恢复运行(xiyebot 扩展)",
      "params": [],
      "desc": "手机上被点了「停止运行」(getRobotInfo.localPaused=true)时,让它在 10 秒内自己恢复运行,不必到手机上操作。需 Agent ≥ 0.9.21;手机 App 已不在运行或不是停止状态时返回 409。有人正在手机上手动操作时慎用,恢复后自动化会抢屏幕"
    },
    {
      "method": "POST",
      "path": "/api/updateAlertConfig?robotId=<授权码>",
      "name": "掉线告警群(xiyebot 扩展)",
      "params": [
        {
          "name": "webhookUrl",
          "required": true,
          "desc": "企业微信群机器人 Webhook 地址(https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=…);传空串=取消"
        },
        {
          "name": "test",
          "required": false,
          "desc": "true=保存后往群里发一条测试消息"
        }
      ],
      "desc": "配置后这台手机掉线超过 5 分钟、被停止运行超过 10 分钟、无障碍关闭超过 5 分钟、电量≤20% 且未充电、内存持续紧张 15 分钟时发告警到该群,恢复后再发一条;同一故障不重复发。未配置的手机走平台默认告警群。getRobotInfo 返回 localPaused / pausedSeconds / health{memAvailMb,memTotalMb,batteryPercent,charging,wifiRssi,wifiConnected,uptimeHours,storageFreeMb,lowMemory…} / healthSummary / healthAt(Agent 0.9.21 起有 health,老版本为 null)"
    },
    {
      "method": "POST",
      "path": "/api/cardLinkConfig?robotId=<授权码>",
      "name": "链接卡片取链接(xiyebot 扩展)",
      "params": [
        {
          "name": "conversations",
          "required": false,
          "desc": "要取链接的会话名数组,和微信里显示的一字不差(群名不含人数);「*」= 全部会话(不建议);最多 50 个"
        },
        {
          "name": "enabled",
          "required": false,
          "desc": "默认:conversations 非空即 true;false = 关闭(名单保留)"
        },
        {
          "name": "miniProgramSnapshot",
          "required": false,
          "desc": "名单内的小程序卡片是否截一张卡片图(data.imageUrl),默认 true"
        }
      ],
      "desc": "需 Agent ≥ 0.9.22。群聊/私聊里的网页链接卡片(1688、淘宝、小红书、公众号文章等)默认只上报标题和来源(logs 回调 data.messageType=link,data.url 为空)。会话加进名单后,手机读到该会话的链接卡片会点开网页、在菜单里复制链接,真实地址放在 data.url(入站消息 raw_payload.url);小程序卡片拿不到链接,改为截卡片图。不带任何字段 = 只读当前配置。每次读会话最多点开 2 张、每张约 8~12 秒,期间其它任务排队,所以只加确实需要链接的会话;取失败时 url 为空、卡片照常上报,同一张卡片最多尝试 2 次"
    },
    {
      "method": "POST",
      "path": "/wx/api/friendRequestConfig?robotId=<授权码>",
      "name": "好友申请自动通过策略(xiyebot 扩展,个人微信通道)",
      "params": [
        {
          "name": "enabled",
          "required": false,
          "desc": "是否让手机定时扫描「新的朋友」,默认 true"
        },
        {
          "name": "autoAccept",
          "required": false,
          "desc": "always=全部通过 | code_only=只通过验证语里带暗号(2 个汉字 + 2 位数字,如「桂花17」)的 | off=只上报不通过。默认 code_only"
        },
        {
          "name": "acceptPerHour",
          "required": false,
          "desc": "每小时最多自动通过几个,默认 20"
        },
        {
          "name": "acceptPerDay",
          "required": false,
          "desc": "每天最多自动通过几个,默认 100"
        }
      ],
      "desc": "不带任何字段 = 只读当前策略。没配置过的授权码手机不扫描好友申请。配置后手机空闲时约每 60 秒看一次「新的朋友」,每条申请通过 friendRequest 回调上报(received / accepted / skipped / failed)。当天已通过数在 getRobotInfo.friendAcceptsToday"
    },
    {
      "method": "POST",
      "path": "/api/forceLogout?robotId=<授权码>",
      "name": "踢下线 / 解绑(同 /api/forcedOffline)",
      "params": [
        {
          "name": "unbind",
          "required": false,
          "desc": "1 / true = 同时解绑:授权码回到未使用状态,手机清掉本地注册,可绑到另一台手机(等同企微指令 FORCE_OFFLINE)。默认只踢下线、不解绑"
        }
      ],
      "desc": "让这台手机立刻显示为离线并触发 offline 回调。不解绑时手机下一次心跳会重新上线;要换手机请带 unbind=1。GET、POST 均可"
    }
  ],
  "taskTypes": [
    {
      "type": 10001,
      "internal": "send_text",
      "platform": "wechat",
      "name": "发文字",
      "fields": "searchText, message, targetType",
      "status": "stable",
      "desc": "搜索联系人 → 进会话 → 输入 → 发送;企微通道真机通过",
      "channels": [
        "wechat",
        "wecom"
      ]
    },
    {
      "type": 10002,
      "internal": "send_image / send_images",
      "platform": "wechat",
      "name": "发图片",
      "fields": "searchText, message=图片URL, imageUrls(可选,图片URL数组,≤9,一帖多图), text(可选,商品文案,需配 imageUrls), textPosition(before|after,默认 before), fileName",
      "status": "stable",
      "desc": "下载入相册后从会话相册发送;企微通道真机通过。Agent 0.8.8 起:传 imageUrls(2~9 张)整组作为一个任务(开一次相册按传入顺序勾 N 张、核对「发送(N)」、发后核对新增 N 个出站图片气泡),只传 message 或 1 张时仍是单图任务;发后核验失败报 IMAGE_SEND_NOT_CONFIRMED / IMAGE_SEND_WRONG_CHAT / IMAGE_ALBUM_PICKER_LOST,不再假成功;多图未显式传 timeoutSeconds 时默认 60+20×张数 秒。Agent 0.9.15 起「一个商品一条任务」:imageUrls(1~9 张)+ text,手机进群后先发文案再一次勾选发出全部图片(textPosition=after 则图后发文案),默认超时 90+20×张数 秒;文案已发出而图片失败时错误码带 TEXT_SENT_ 前缀(如 TEXT_SENT_IMAGE_SEND_NOT_CONFIRMED),重试只补发图片;图已发出而文案失败带 IMAGES_SENT_ 前缀;设备 Agent 低于 0.9.15 时带 text 直接返回 400(旧版会只发图、丢文案),请分开下发 10001 + 10002",
      "channels": [
        "wechat",
        "wecom"
      ]
    },
    {
      "type": 10006,
      "internal": "send_file",
      "platform": "wechat",
      "name": "发文件 / 视频",
      "fields": "searchText, fileUrl|url|message, fileName, mimeType(视频传 video/mp4), fileExtension(企微文档,与 fileName 分开传), sendMode(可选,视频传 album = 走会话相册发视频)",
      "status": "stable",
      "desc": "下载后发到会话:文档(Excel/PDF/…)以文件卡片、视频(video/mp4 或 .mp4)作为可播放视频发送;群聊/私聊通用。推视频务必用本类型,勿用发文本发 URL;企微通道真机通过(系统分享面板→发送给同事→选择联系人);个微 0.8.2 起文档/图片/视频一律用 MediaStore 公共 URI 分享(私有 FileProvider 在小米 Android 14 微信 8.0.66 报「获取资源失败」),并处理小米系统分享面板的「仅此一次」确认与预选态(浅浅机真机通过);单文件上限 200MB(Agent 0.8.6 起,0.8.5 及之前为 50MB,超限 fail=FILE_TOO_LARGE,task_logs 记 file_too_large 含 declaredBytes/limitBytes);视频类(mimeType video/* 或 .mp4/.mov)未显式传 timeoutSeconds 时默认 180s;Agent 0.8.8 起视频可选 sendMode=album:进会话 → + → 相册勾视频 → 发送 → 核对新出站视频气泡(核验失败报 VIDEO_SEND_NOT_CONFIRMED);缺省仍走系统分享,非视频忽略该字段",
      "channels": [
        "wechat",
        "wecom"
      ]
    },
    {
      "type": 10010,
      "internal": "send_miniprogram",
      "platform": "wechat",
      "name": "发小程序链接",
      "fields": "searchText, message=#小程序://…, sendMode=mini_program_link, title, description",
      "status": "stable",
      "desc": "发的是可点击链接文字,不是卡片",
      "channels": [
        "wechat",
        "wecom"
      ]
    },
    {
      "type": 10020,
      "internal": "publish_moments",
      "platform": "wechat",
      "name": "发朋友圈",
      "fields": "imageUrl | imageUrls[](≤9) | videoUrl(文案+视频), caption, dryRun",
      "status": "stable",
      "desc": "图片:下载→朋友圈→选图→文案→发表;视频:传 videoUrl 发单视频朋友圈(与图片互斥);dryRun=true 停在发表前",
      "channels": [
        "wechat"
      ]
    },
    {
      "type": 10021,
      "internal": "publish_channel_video",
      "platform": "wechat",
      "name": "发视频号",
      "fields": "videoUrl, caption|description|message, fileName, videoIndex, dryRun",
      "status": "stable",
      "desc": "视频下载入相册 → 视频号发布页 → 选最新一格 → 发布",
      "channels": [
        "wechat"
      ]
    },
    {
      "type": 10022,
      "internal": "publish_douyin_video",
      "platform": "douyin",
      "name": "抖音发布视频",
      "fields": "videoUrl, caption|description|message, fileName, dryRun",
      "status": "publish-only",
      "desc": "视频入相册 → 拉起抖音发布 → 填文案 → 发布。评论/私信/数据回读开发中",
      "channels": [
        "wechat"
      ]
    },
    {
      "type": 10023,
      "internal": "publish_xhs_video",
      "platform": "xhs",
      "name": "小红书发布视频",
      "fields": "videoUrl, title, caption|description|message, fileName, aiDeclare(内容声明:true=含 AI 合成内容,false=无需声明;不传=true), dryRun",
      "status": "publish-only",
      "desc": "视频入相册 → 拉起小红书发布 → 标题+正文 → 按 aiDeclare 选「笔记内容声明」(默认「含 AI 合成内容」,false 选「无需声明」;需 Agent 0.9.34+,旧版一律勾 AI)→ 发布。评论/私信/数据回读开发中",
      "channels": [
        "wechat"
      ]
    },
    {
      "type": 10024,
      "internal": "publish_xhs_image_note",
      "platform": "xhs",
      "name": "小红书发布图文笔记",
      "fields": "imageUrls[](1~9 张,必填;别名 images / imageUrl), title, content|caption|description|message, topics[](话题,不带 #;别名 tags), dailyNoteLimit(每天最多发几篇,默认 2), aiDeclare(内容声明:true=含 AI 合成内容,false=无需声明;不传=true), noteUrlOnly(true=不发布,只按 title 取已发笔记的分享链接,此时 imageUrls 可不传), dryRun",
      "status": "limited",
      "desc": "图片下载到手机 → 分享进小红书发布页 → 填标题 / 正文(话题以 #话题 追加在正文末尾)→ 按 aiDeclare 选「笔记内容声明」(默认「含 AI 合成内容」,false 选「无需声明」;需 Agent 0.9.34+,旧版一律勾 AI)→ 发布。任务结果带 aiDeclared(是否勾了含 AI 合成内容)、declaration(ai|none)、declarationApplied(声明项是否点上)。dryRun=true 走到发布页不点发布。超过 dailyNoteLimit 时返回 skipped(reason=rate_limited)。真机验证到 dryRun;发布成功后手机进「我 → 笔记」按标题找到刚发的那篇 → 分享 → 复制链接,把剪贴板原文(含 xhslink 短链 / 带 xsec_token 的链接)放进任务结果 noteUrl;拿不到则不带该键,原因见 noteUrlReason(需 Agent 0.9.38+)。noteUrlOnly=true 时不发布,只做取链接这一步(回补历史笔记链接用,结果带 found)。searchText 可不传",
      "channels": [
        "wechat"
      ]
    },
    {
      "type": 10026,
      "internal": "xhs_nurture",
      "platform": "xhs",
      "name": "小红书养号(浏览 / 点赞 / 收藏 / 关注 / 搜索)",
      "fields": "actions[](browse_feed|view_note|like|favorite|follow|search,缺省 browse_feed+view_note+like), scrollScreens(1~60,默认 12), likeCount(0~30,默认 3), favoriteCount(0~20,默认 1), followCount(0~10,默认 0), keywords[](search 用), durationSec(30~1200,默认 180), dailyNurtureLimit(每天最多几轮,默认 6), dryRun",
      "status": "limited",
      "desc": "模拟真实用户刷小红书:按 actions 浏览首页、点开笔记、在预算内点赞 / 收藏 / 关注、按关键词搜索。超过 dailyNurtureLimit 返回 skipped(reason=rate_limited)。不依赖微信,个微风控养号(wechatSuspended)期间照常执行。searchText 可不传",
      "channels": [
        "wechat"
      ]
    },
    {
      "type": 20004,
      "internal": "update_remark",
      "platform": "wechat",
      "name": "改好友备注",
      "fields": "searchText=当前显示名, remark|remarkName|message, newNickName(企微文档字段)",
      "status": "stable",
      "desc": "",
      "channels": [
        "wechat",
        "wecom"
      ]
    },
    {
      "type": 20005,
      "internal": "add_friend",
      "platform": "wechat",
      "name": "加好友",
      "fields": "searchText|phone|wxid|account, message|verifyMessage",
      "status": "stable",
      "desc": "发出申请;对方是否通过 xiyebot 不知道;企微通道:首页+→添加客户→搜索手机号添加→输入手机号→添加(流程已按 4.1.32 校准,未用真实号码验证)",
      "channels": [
        "wechat",
        "wecom"
      ]
    },
    {
      "type": 20006,
      "internal": "friend_detail",
      "platform": "wechat",
      "name": "读好友资料",
      "fields": "searchText",
      "status": "stable",
      "desc": "结果在 getTaskStatus 的 result.profile;企微通道真机通过,response 含 nickName/sourceType/addTime/source",
      "channels": [
        "wechat",
        "wecom"
      ]
    },
    {
      "type": 20007,
      "internal": "read_contacts",
      "platform": "wechat",
      "name": "同步通讯录",
      "fields": "contactTypes=[friend,group], maxItems, maxScrolls",
      "status": "slow",
      "desc": "翻通讯录页,结果在 result.contacts[];很慢,一天最多一两次;企微通道请用 50010 读群列表",
      "channels": [
        "wechat",
        "wecom"
      ]
    },
    {
      "type": 50009,
      "internal": "group_at",
      "platform": "wechat",
      "name": "群里 @ 某人",
      "fields": "searchText=群名, targetType=group, atName|at|memberName, message, atList[](企微文档,可含 \"@所有人\")",
      "status": "stable",
      "desc": ";企微通道真机通过",
      "channels": [
        "wechat",
        "wecom"
      ]
    },
    {
      "type": 10000,
      "internal": "recall_message",
      "platform": "wecom",
      "channels": [
        "wechat",
        "wecom"
      ],
      "name": "撤回文本消息",
      "fields": "searchText, recallText",
      "status": "stable",
      "desc": "真机通过:长按 2 分钟内自己发的气泡→撤回;个微 0.8.2 起支持:进会话找正文=recallText 的气泡→长按→撤回(2 分钟内),浅浅机真机通过"
    },
    {
      "type": 10011,
      "internal": "send_miniprogram",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "发送小程序消息【定制】",
      "fields": "searchText, appid, title, imgUrl, page, menuName",
      "status": "limited",
      "desc": "企微卡片依赖企业自建快捷工具栏菜单(menuName);当前 Agent 以 标题+链接 文本发出"
    },
    {
      "type": 10012,
      "internal": "send_link",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "发送链接消息【定制】",
      "fields": "searchText, link, title, desc, imgUrl, menuName",
      "status": "limited",
      "desc": "同上:以 标题+描述+链接 文本发出"
    },
    {
      "type": 10013,
      "internal": "send_text",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "发送引用消息",
      "fields": "searchText, quoteRole, quoteNickName, quoteText, message",
      "status": "stable",
      "desc": "真机通过:长按被引用气泡→引用→追加正文→发送"
    },
    {
      "type": 10014,
      "internal": "forward_messages",
      "platform": "wechat",
      "channels": [
        "wechat",
        "wecom"
      ],
      "name": "多选转发会话最近 N 条消息(一次 ≤9 个会话)",
      "fields": "searchText=种子会话(群/好友), receivers[](任意个数,网关按 ≤9 拆成多个任务顺序执行), limit(锚定机器人自己最近 N 条,≤30), segments[]={start,count}(按段转发:文案/连续图片/视频各自一段,0=最早;缺省一段全选), onlyMine(默认 true), startText(可选,起点文案锚定), forwardKey(24h 去重键,缺省按 robot+会话+limit+当天), excludeForwarded(默认 true:同 forwardKey 已转过的 receivers 跳过,返回 data.skippedReceivers), timeoutSeconds(缺省 60+40×段数)",
      "status": "available",
      "desc": "个微 Agent 0.9.4 起:进种子会话,把 segments 圈定的消息按从早到晚**逐条**长按 → 转发 → 选聊天「多选」勾 ≤9 个会话 → 发送(微信的多选→逐条转发只要含图片/视频就会被静默丢弃,所以不走多选),接收方看到的顺序与种子会话一致;每条约 20~35 秒。结果 result={forwarded[], failed[{name,reason}], messageCount, segmentsDone};succeeded 后 forwarded 记入 forwardKey 去重集合。注意:微信对 >25MB 的视频消息转发会静默丢弃(整段不发),大视频请用 10006 直发;企微 Agent 仍未实现(UNSUPPORTED_ON_WECOM_AGENT)"
    },
    {
      "type": 20002,
      "internal": "delete_friend",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "删除好友",
      "fields": "searchText",
      "status": "planned",
      "desc": "同上,待真机实现"
    },
    {
      "type": "20007",
      "internal": "delete_oneway_friends",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "删除指定数量单向好友",
      "fields": "type=\"20007\"(字符串), count",
      "status": "planned",
      "desc": "注意与 int 20007 同步通讯录区分:字符串+count 才是删单向好友"
    },
    {
      "type": 20008,
      "internal": "lookup_phone",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "手机号查用户信息",
      "fields": "phone",
      "status": "planned",
      "desc": "callBack.response: {nickName, headImg, phone}"
    },
    {
      "type": 20009,
      "internal": "list_friend_requests",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "近期未通过的好友申请",
      "fields": "-",
      "status": "planned",
      "desc": "callBack.response: [{nickName, corpName, applyText, status}]"
    },
    {
      "type": 30000,
      "internal": "publish_moments",
      "platform": "wecom",
      "channels": [
        "wechat",
        "wecom"
      ],
      "name": "发布客户朋友圈",
      "fields": "mood, imageList[](≤9), commitList[](忽略), dryRun(可选,只走到发表前)",
      "status": "stable",
      "desc": "企微通道真机通过(Agent 0.8.1):工作台→客户朋友圈→发表方块→文案+相册勾选图片(≤9)→发表;callBack.response {published, imagesAttached, caption};commitList 暂忽略;个微通道同样接受此 FlowBot 个微文档形态(mood/imageList/commitList→内部 publish_moments,commitList 忽略),浅浅机 dryRun 通过"
    },
    {
      "type": 50001,
      "internal": "create_group",
      "platform": "wecom",
      "channels": [
        "wechat",
        "wecom"
      ],
      "name": "创建外部群",
      "fields": "groupName, groupUsers[], groupNotice",
      "status": "limited",
      "desc": ";个微通道不支持:0.8.2 起直接 fail=UNSUPPORTED_ON_WECHAT_AGENT(旧 Agent 的假成功由服务端改判);个微 0.8.2 起实现(+→发起群聊→搜索勾人→完成→聊天信息改群名/群公告);浅浅号实测被微信风控拦在「须完成安全验证」页,返回 WECHAT_SECURITY_VERIFY_REQUIRED,需在手机上人工验证后再用"
    },
    {
      "type": 50008,
      "internal": "dissolve_group",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "解散外部群(群主)",
      "fields": "searchText",
      "status": "planned",
      "desc": ";个微通道不支持(50001 除外):0.8.2 起直接 fail=UNSUPPORTED_ON_WECHAT_AGENT(旧 Agent 的假成功由服务端改判)"
    },
    {
      "type": 50010,
      "internal": "list_groups",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "查询全部群列表",
      "fields": "-",
      "status": "stable",
      "desc": "真机通过:工作台→客户群→我的客户群;callBack.response: [{groupName, count}];个微通道不支持(50001 除外):0.8.2 起直接 fail=UNSUPPORTED_ON_WECHAT_AGENT(旧 Agent 的假成功由服务端改判)"
    },
    {
      "type": 50012,
      "internal": "group_member_remark",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "改群成员备注",
      "fields": "groupName, nickName, markName",
      "status": "planned",
      "desc": ""
    },
    {
      "type": 50013,
      "internal": "group_remark",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "改群名备注",
      "fields": "groupName, markName",
      "status": "planned",
      "desc": ""
    },
    {
      "type": 50014,
      "internal": "group_qrcode",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "获取外部群二维码",
      "fields": "searchText",
      "status": "planned",
      "desc": ""
    },
    {
      "type": 50015,
      "internal": "group_add_members",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "拉人进外部群",
      "fields": "searchText, addGroupUsers[]",
      "status": "planned",
      "desc": ""
    },
    {
      "type": 50016,
      "internal": "group_remove_members",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "移出外部群成员",
      "fields": "searchText, deleteGroupUsers[]",
      "status": "planned",
      "desc": ""
    },
    {
      "type": 50017,
      "internal": "group_join_by_qrcode",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "扫群二维码进群",
      "fields": "qrcodeUrl",
      "status": "planned",
      "desc": ""
    },
    {
      "type": 50018,
      "internal": "group_notice",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "改群公告(群管理员)",
      "fields": "groupName, groupNotice",
      "status": "planned",
      "desc": ""
    },
    {
      "type": 100003,
      "internal": "account_info",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "查询当前企微账号信息",
      "fields": "-",
      "status": "stable",
      "desc": "真机通过:callBack.response {nickName, name, corporation}(sex/phone/wechat 企微资料页未暴露为空);个微通道不支持(50001 除外):0.8.2 起直接 fail=UNSUPPORTED_ON_WECHAT_AGENT(旧 Agent 的假成功由服务端改判)"
    },
    {
      "type": 100004,
      "internal": "switch_corporation",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "切换企微主体",
      "fields": "corporation",
      "status": "planned",
      "desc": ""
    },
    {
      "type": 100006,
      "internal": "wecom_login_qrcode",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "获取 Pad 登录二维码【定制】",
      "fields": "-",
      "status": "planned",
      "desc": "callBack.response: {loginQrcode: dataURL}"
    },
    {
      "type": 100007,
      "internal": "wecom_login_code",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "提交登录验证码【定制】",
      "fields": "loginCode",
      "status": "planned",
      "desc": ""
    },
    {
      "type": 100008,
      "internal": "wecom_login_status",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "查询企微登录状态【定制】",
      "fields": "-",
      "status": "planned",
      "desc": "callBack.response: {loginStatus, loginMessage}"
    },
    {
      "type": 100009,
      "internal": "wecom_logout",
      "platform": "wecom",
      "channels": [
        "wecom"
      ],
      "name": "退出企微当前账号【定制】",
      "fields": "-",
      "status": "planned",
      "desc": ""
    }
  ],
  "callbacks": [
    {
      "mode": "init / online",
      "when": "手机注册 / 重新上线",
      "payload": "data[] 含 deviceId、status、agentVersion;企微通道 online/offline 只带 robotId+mode(+data)",
      "consumer": "业务后台点亮在线状态"
    },
    {
      "mode": "receipt",
      "when": "sendTask 入库",
      "payload": "data[] 含 taskId、type、message=指令已接收;企微通道 data 为对象 {type,status:'success',message,taskId,taskCount}",
      "consumer": "业务后台记账"
    },
    {
      "mode": "callBack",
      "when": "任务终态",
      "payload": "data[] 含 taskId、type、success、status、errorCode;企微通道 data 为对象 {type,status:'success'|'fail',message,taskId,response,request}",
      "consumer": "业务后台更新发送状态"
    },
    {
      "mode": "logs",
      "when": "客户入站消息(文本 / 语音转写 / 图片识别 / 文件 / 链接卡片 / 小程序卡片 / 合并转发的聊天记录)",
      "payload": "data[] · role=user、type=text|image、data.message、data.messageType(text|image|voice|file|link|miniprogram|chat_record)、data.senderName(群聊=发言人的群昵称;私聊=对方的名字,即会话名。2026-11-20 起私聊不再为空;企业微信 5.0 的群昵称需 Agent 0.9.30)、data.recognizedText(图片/语音识别)、data.fileUrl+data.fileName(文件,业务端据此拉取解析)、data.url+data.cardTitle+data.cardDesc+data.cardSource(链接卡片/小程序卡片,Agent 0.9.22 起;url 仅在会话已加入 /api/cardLinkConfig 名单且取成功时非空,小程序卡片的截图在 data.imageUrl)、data.quoteType(text|image)+data.quoteSender+data.quoteText+data.quoteImageUrl+data.quoteRecognizedText(对方引用某条消息再回复时才有,Agent 0.9.26 起、个人微信通道;同时 data.message 末尾多一行「[引用 发送者：原文]」或「[引用 发送者 的图片：描述]」)、data.chatRecord{title,dateRange,count,total,truncated,items[{senderName,time,messageType,text}]}(对方发来合并转发的「聊天记录」时才有,Agent 0.9.32 起、目前只有企业微信通道 4.1.x:手机点开卡片逐条读出;data.messageType=chat_record,type 仍为 text,data.message 为「[聊天记录] 标题(日期范围)」加每条一行「发言人 时间:内容」,最多 200 条、正文最长约 8000 字;记录里的图片只报成「[图片]」不取原图;卡片没点开成功时没有 chatRecord,message 只有标题和预览)、data.clientMessageKey;企微通道 type 直接为消息类型(text/image/voice/file/video/url/miniapp…),群聊 data.groupNickname/corpsName,语音 message=识别文本 extra=时长",
      "consumer": "业务后台的 AI 据此自动回复",
      "desc": "群聊消息 data 增加 atMe(本条 @ 了机器人,由会话列表「[有人@我]」+正文含 @ 判定)与 mentions[](正文被 @ 的昵称,含「所有人」),业务端「只回复 @我 的消息」直接按 atMe 过滤"
    },
    {
      "mode": "offline",
      "when": "手机心跳丢失(约 30 秒无心跳)或 FORCE_OFFLINE / forceLogout;Agent 0.9.21 起手机上被点了「停止运行」同样按离线处理(约 30 秒内),恢复运行后重新发 online",
      "payload": "{robotId, mode:'offline', data:[{deviceId,status,reason}]}",
      "consumer": "业务后台熄灭在线灯(企微文档「机器人离线回调」)"
    },
    {
      "mode": "friendRequest",
      "when": "手机看到一条好友申请,或自动通过 / 跳过了它(需先用 /wx/api/friendRequestConfig 开启;个人微信通道)",
      "payload": "{robotId, mode:\"friendRequest\", searchText:<申请人昵称>, data:[{event(received|accepted|skipped|failed), nickName, verifyMessage(验证语), source(来源,如 phone), reason(skipped / failed 时:no_code=验证语里没有暗号 | rate_limited=超过每小时 / 每天上限 | ui_changed), clientEventKey, occurredAt}]}",
      "action": "按 clientEventKey + event 去重(平台侧已做 7 天去重);accepted 之后即可按 nickName 给对方发消息"
    }
  ],
  "errors": [
    {
      "code": "401 robotId无效",
      "meaning": "授权码不存在、被禁用、格式错",
      "action": "核对授权码;仍不对找平台"
    },
    {
      "code": "400 taskList[i].xxx不能为空",
      "meaning": "参数缺失或格式错",
      "action": "按 message 修参数,不要重试"
    },
    {
      "code": "404 任务不存在",
      "meaning": "getTaskStatus 查不到,或任务不属于这个 robotId",
      "action": "核对 taskId 与 robotId 配对"
    },
    {
      "code": "status=timeout",
      "meaning": "手机在 timeoutSeconds 内没领到任务(离线)",
      "action": "确认在线后带同一 idempotencyKey 重发"
    },
    {
      "code": "SEARCH_VISUAL_NOT_FOUND / FIRST_RESULT_NOT_CONVERSATION",
      "meaning": "微信搜索没找到 searchText 对应的会话",
      "action": "名字必须与微信显示名一字不差(备注名优先)"
    },
    {
      "code": "CHAT_MESSAGE_CONTENT_MISMATCH",
      "meaning": "手机上没看到出站气泡(弱网/微信弹窗)",
      "action": "带同一 idempotencyKey 重试一次"
    },
    {
      "code": "IMAGE_URL_INVALID / VIDEO_TOO_LARGE / VIDEO_DOWNLOAD_HTTP_*",
      "meaning": "素材 URL 手机下载不了",
      "action": "用公网 https 地址;图片 < 5MB,视频 < 100MB"
    },
    {
      "code": "AUTH_CODE_ALREADY_BOUND",
      "meaning": "授权码已绑定其他手机(含重装后旧绑定残留)",
      "action": "管理后台解绑后重新激活"
    },
    {
      "code": "UNSUPPORTED_ON_WECOM_AGENT",
      "meaning": "企微 Agent 当前版本未实现该指令(服务端已入队,执行时回调 fail)",
      "action": "看任务类型表 status=planned 的项;需要时联系平台排期"
    },
    {
      "code": "WECOM_SEARCH_NOT_FOUND / WECOM_CHAT_TITLE_MISMATCH",
      "meaning": "企微搜索没找到 searchText 对应的客户/群,或进错会话",
      "action": "名字必须与企微显示名一字不差(备注名优先);同名需业务侧自行规避"
    },
    {
      "code": "WECOM_SEND_NOT_CONFIRMED / WECOM_SHARE_NOT_CONFIRMED",
      "meaning": "发送后没看到自己的气泡 / 分享确认框没点到",
      "action": "查任务截图(服务端 task_screenshots),带同一 idempotencyKey 重试一次"
    },
    {
      "code": "UNSUPPORTED_ON_WECHAT_AGENT:<内部类型>",
      "meaning": "个微通道收到企微专属指令(50001/50008/100003/50010 等群管理/账号信息)",
      "action": "个微没有这些能力,别下发;FlowBot 个微文档里的 50001/50008 在 xiyebot 个微侧也未实现"
    },
    {
      "code": "WECHAT_SECURITY_VERIFY_REQUIRED",
      "meaning": "微信对该账号弹出「为了保障你的账号安全,须完成安全验证后才能继续使用当前功能」(建群等敏感操作)",
      "action": "到手机上点「去验证」完成验证后重试;频繁触发说明账号风控等级高,降低操作频率"
    },
    {
      "code": "WECHAT_SUSPENDED(HTTP 423)",
      "meaning": "该个微授权码处于风控养号模式,拒绝会唤起微信的任务",
      "action": "等业务侧解除养号;只有 10022~10026(抖音/小红书)与字符串控制指令可下发"
    },
    {
      "code": "FILE_TOO_LARGE",
      "meaning": "send_file 文件超过 200MB(Agent 0.8.6 起;0.8.5 及之前 50MB)",
      "action": "压缩/转码到 200MB 以内重发;task_logs 的 file_too_large 有实际大小"
    },
    {
      "code": "FORWARD_NO_MESSAGES",
      "meaning": "10014 在种子会话里没勾到可转发的消息(自己发的消息不足,或多选菜单没出来)",
      "action": "确认种子会话里最近 limit 条是机器人自己发的;看 task_screenshots 的 forward_* 截图"
    },
    {
      "code": "FORWARD_RECEIVER_NOT_FOUND",
      "meaning": "10014 选聊天页一个 receiver 都没勾上(名字不匹配/搜索无结果)",
      "action": "receivers 用微信里显示的精确群名/备注名;部分找不到时任务仍 succeeded,看 result.failed"
    },
    {
      "code": "AGENT_PAUSED",
      "meaning": "Agent 0.9.5 起:任务执行中,操作员在手机上点了「停止运行」(App 内按钮或微信上方的悬浮按钮),任务一步之内中止并按 failed 回传",
      "action": "等操作员点「启动」恢复后重发;发送类任务重发前先在微信里核对是否已发出,避免重复;Agent 0.9.21 起暂停期间手机仍向平台报平安,管理员可在管理后台对该设备「远程恢复」,无需到手机上点「启动」"
    },
    {
      "code": "FORWARD_NOT_CONFIRMED",
      "meaning": "10014 点了「完成/发送」但没回到种子会话,或确认框没出现",
      "action": "看 forward_confirm_* / forward_not_back_in_chat 截图;可能是微信弹了安全提示"
    },
    {
      "code": "CHAT_TITLE_MISMATCH",
      "meaning": "读消息(read_chat)进入的会话标题与目标对不上(Agent 0.8.8 起),这屏消息一条都不上报;已回首页重试一次仍不符",
      "action": "查任务截图 read_chat_title_mismatch 看进错了哪个会话;群名需与微信显示名一致"
    },
    {
      "code": "IMAGE_SEND_NOT_CONFIRMED / IMAGE_SEND_WRONG_CHAT / IMAGE_ALBUM_PICKER_LOST / IMAGE_ALBUM_SELECTED_COUNT_MISMATCH",
      "meaning": "发图核验失败(Agent 0.8.8 起):没看到新的出站图片气泡 / 发完所在会话不是目标 / 勾图时离开了相册(常见:横幅通知盖住首格被点中)/ 「发送(N)」数字与要发张数不符",
      "action": "查任务截图;前两种可能已部分发出,先看群里再决定是否重发,后两种此时还没发送可直接重试"
    },
    {
      "code": "AGENT_NO_RESULT",
      "meaning": "手机开始执行后没有上报结果:超过任务的 timeoutSeconds(没传按 300 秒)再加 60 秒,且手机已停止写执行日志,网关把这条任务回收为 failed 并照常回调(2026-11-18 起;以前这种任务会永远停在 running)。read_chat 巡检不回收",
      "action": "多为手机端进程被系统杀掉、崩溃,或状态上报失败;看该任务的 task_logs 最后一步,确认手机在线后重发。重发前先核对会话里是否已经发出,避免重复"
    },
    {
      "code": "STORAGE_PERMISSION_DENIED",
      "meaning": "手机往系统相册写图片被拒绝:Android 9 及以下发图 / 发朋友圈需要存储权限。Agent 0.9.28 起会在打开 App 时申请;更低版本的 Agent 在 Android 9 上无法发图",
      "action": "手机升到 Agent 0.9.28 及以上,打开一次 Xiyebot Agent 并在弹窗里允许「存储」权限;或换 Android 10 及以上的手机"
    },
    {
      "code": "ANDROID_VERSION_UNSUPPORTED",
      "meaning": "该任务需要 Android 10 及以上:发文件(10006 / send_file)把文件交给微信/企微用的是 Android 10 才有的公共下载目录接口,Android 9 及以下不支持",
      "action": "换 Android 10 及以上的手机;文字、图片(Agent 0.9.28 起)在 Android 9 上可用"
    },
    {
      "code": "WECOM_AT_MEMBER_NOT_FOUND",
      "meaning": "企微群内 @(50009):atList 里的人在群成员选择列表里一个都没找到(Agent 0.9.28 起;更早的版本会报成 WECOM_CHAT_INPUT_NOT_FOUND)。手机是按群里显示的名字找人,不认 userid",
      "action": "atList 传该成员在群里显示的昵称(和群成员列表里看到的一字不差);@所有人 传「所有人」"
    },
    {
      "code": "WECOM_MOMENTS_NO_ELIGIBLE_CUSTOMER",
      "meaning": "企微客户朋友圈(10020):点发表后企业微信弹出「当前没有满足发表条件的客户」并拒绝发表(Agent 0.9.29 起;更早的版本会误报成 succeeded)。通常是可见客户当天能收到的朋友圈条数已用完",
      "action": "这条没有发出去,不要立刻重试;减少当天发表条数,或第二天再发"
    },
    {
      "code": "WECOM_MOMENTS_PUBLISH_REJECTED",
      "meaning": "企微客户朋友圈(10020):点发表后企业微信弹出其它提示并拒绝发表(Agent 0.9.29 起),提示原文见任务截图",
      "action": "带 taskId 联系平台排查"
    },
    {
      "code": "AGENT_EXCEPTION",
      "meaning": "手机端执行时出现未归类的异常;异常原文在 errorMessage 里。网关 2026-11-18 起会把过长或非规范的错误码规整成短码(以前这类失败上报会丢失,任务停在 running)",
      "action": "把 taskId 和 errorMessage 发给平台排查"
    }
  ],
  "channels": {
    "summary": "每个授权码(robotId)有一个通道:wechat 个人微信(默认)或 wecom 企业微信,由管理后台生成授权码时选择。同一套接口、同一个 robotId 配置方式;手机端 Agent 按通道驱动 微信 或 企业微信 App。",
    "items": [
      {
        "channel": "wechat",
        "label": "个人微信",
        "app": "com.tencent.mm",
        "callbackShape": "{robotId, mode, searchText, data:[...]}(既有形态)"
      },
      {
        "channel": "wecom",
        "label": "企业微信",
        "app": "com.tencent.wework",
        "callbackShape": "按 FlowBot 企微文档(flowbot.apifox.cn):receipt/callBack 的 data 是对象 {type,status:success|fail,message,taskId,response,request,taskCount};logs 的 type 直接是消息类型(text/image/voice/file/video…),群聊带 data.groupNickname;online/offline 只带 robotId+mode"
      }
    ],
    "switching": "业务系统(如希也家 SaaS 的 小天)原本接 FlowBot 企微通道的,把 base URL 换成 https://flowbot.efguc.com、robotId 换成企微通道授权码即可,请求/回调报文不用改。"
  }
}
