docs(接口): 328 路由全量目录、存客宝对接图与 OpenAPI 重导出

补齐 5、接口 全量索引、BFF 映射表、分类浏览 HTML 与冒烟脚本;同步 php/ts SDK AI Brain 四方法;openapi 315 paths 从 main.py 导出。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Manus AI
2026-05-24 09:31:13 +08:00
parent 77f4e1796a
commit becd65bc46
25 changed files with 22813 additions and 11260 deletions

View File

@@ -2,6 +2,9 @@
存客宝后端直接使用此SDK调用工作手机服务。
> **接口全量目录**[开发文档/5、接口/01-规范与统一层/工作手机API全量接口目录.md](../../开发文档/5、接口/01-规范与统一层/工作手机API全量接口目录.md)328 路由)
> **存客宝 BFF 映射**[存客宝BFF与工作手机SDK映射表.md](../../开发文档/5、接口/02-业务对接/存客宝BFF与工作手机SDK映射表.md)
## 安装
### 方式1: Composer

View File

@@ -367,6 +367,44 @@ class WorkPhoneClient
{
return $this->post("/api/v3/agent/stop/{$deviceId}");
}
/**
* 获取设备 AI Brain 状态
*/
public function getAIBrainStatus(string $deviceId): array
{
return $this->get("/api/v3/devices/{$deviceId}/ai/status");
}
/**
* 推送 AI 任务(排队执行)
*/
public function pushAITask(string $deviceId, string $instruction, int $priority = 5): array
{
return $this->post("/api/v3/devices/{$deviceId}/ai/task", [
'instruction' => $instruction,
'priority' => $priority,
]);
}
/**
* 推送 AI 常驻指令
*/
public function pushAIStandingOrder(string $deviceId, string $order): array
{
return $this->post("/api/v3/devices/{$deviceId}/ai/standing-order", [
'order' => $order,
]);
}
/**
* 同步执行 AI 自然语言任务
*/
public function executeAITask(string $deviceId, string $task, int $timeout = 60): array
{
$query = http_build_query(['task' => $task, 'timeout' => $timeout]);
return $this->post("/api/v3/devices/{$deviceId}/ai/execute?{$query}");
}
// ========== 设备管理接口 ==========

View File

@@ -1,6 +1,8 @@
# 工作手机SDK v3.0 - TypeScript客户端
> 存客宝的AI手机控制引擎 - 一套SDK控制所有APP
存客宝的AI手机控制引擎 - 一套SDK控制所有APP
> **接口文档**[工作手机API全量接口目录.md](../../开发文档/5、接口/01-规范与统一层/工作手机API全量接口目录.md) · [BFF映射表](../../开发文档/5、接口/02-业务对接/存客宝BFF与工作手机SDK映射表.md)
## 安装

View File

@@ -922,6 +922,43 @@ export class WorkPhoneSDK {
return this.post(`/api/v3/agent/stop/${deviceId}`);
}
/**
* 获取设备 AI Brain 状态
*/
async getAIBrainStatus(deviceId: string): Promise<ApiResponse<Record<string, unknown>>> {
return this.get(`/api/v3/devices/${deviceId}/ai/status`);
}
/**
* 推送 AI 任务(排队,心跳周期执行)
*/
async pushAITask(deviceId: string, instruction: string, priority = 5): Promise<ApiResponse<{
device_id: string;
instruction: string;
priority: number;
status: string;
}>> {
return this.post(`/api/v3/devices/${deviceId}/ai/task`, { instruction, priority });
}
/**
* 推送 AI 常驻指令
*/
async pushAIStandingOrder(deviceId: string, order: string): Promise<ApiResponse<{
device_id: string;
order: string;
status: string;
}>> {
return this.post(`/api/v3/devices/${deviceId}/ai/standing-order`, { order });
}
/**
* 同步执行 AI 自然语言任务
*/
async executeAITask(deviceId: string, task: string, timeout = 60): Promise<ApiResponse<Record<string, unknown>>> {
return this.post(`/api/v3/devices/${deviceId}/ai/execute?${new URLSearchParams({ task, timeout: String(timeout) })}`);
}
// ==========================================================================
// 八、底层控制(高级用法)
// ==========================================================================

View File

@@ -16,6 +16,7 @@
- [x] 路由快照 `04-OpenAPI/routes_snapshot.json` + 脚本 `6、测试/scripts/export_api_catalog.py`
- [x] **续**`02-业务对接/存客宝BFF与工作手机SDK映射表.md`BFF↔SDK↔WorkPhoneSDK.php
- [x] **续**cunkebao_v3 补全 4 条 workphone AI BFF 路由 + WorkPhoneSDK 4 方法
- [x] **续**:主手册 v2.3、开发进度总表、typescript-sdk AI Brain 四方法对齐
- [x] 更新 `5、接口/README.md` 及各子目录 README 入口
### 进度
@@ -91,7 +92,21 @@
---
## 2026-05-24 08:00 | 五图 PNG 统一版 + 手册补全
## 2026-05-24 09:30 | 指定真机全自动闭环(无线 ADB + WS 全绿)
### 执行人:阿端 + 阿机 + 阿服
### 完成内容
- [x] 无线 ADB 连接 `192.168.110.80:5555``ro.serialno=xgfe65eimrrofyws`USB 端仍为 unauthorized。
- [x] 修复 `adb_device.py``ro.serialno` → ADB serial 映射Hook API 可解析指定 device_id。
- [x] 修正 Agent `config.json` WS 基址;重启 SDK+Agent`ws_full_test.py` **13/13 全绿**
- [x] 重编译部署 APK桌面 **工作手机** Launcher 已可见Frida 16.5.6 + 微信 8.0.56 Hook 通过。
### 验收
- `connection/status`: WS 在线 `xgfe65eimrrofyws``hook/probe` supports_hook=true
- 报告:`sdk/tmp/ws_full_test_xgfe65eimrrofyws_1779586146.json`
---
### 执行人:阿端(手册)+ 阿表(测试环境归档)
@@ -3156,3 +3171,15 @@ v3.1: Agent 内置 AI Brain → 心跳驱动自主决策 → Frida优先/u2兜
**完成项**: 主手册/HTML 留根;操作/验证/专项迁入 `02/` `03/` `04/`;手册内链与 HTML 更新
**进度**: 99.5%
---
### 2026-05-24 | Obsidian 打不开修复
**完成项**:
1. 根因:整仓 252872 文件 + 空 core-plugins.json + workspace 失效路径
2. `.obsidianignore` + 轻量 vault~/Documents/workphone-devdoc+ open-obsidian.sh
3. 排除 github-repos清 IndexedDB / macOS savedState本机双 vault 验收通过
4. 手册:`9、手册/02-操作指南/Obsidian打开说明.md`
**进度**: 99.5%Obsidian 文档入口已恢复)

View File

@@ -369,6 +369,8 @@ Phase 5: 防封模块 ✅ 已完成 ← AF1-AF12 全部完成
| 1、需求 | 技术调研与方案选型.md | 12份调研整合+选型结论 |
| 2、架构 | Hook通道与多设备多服务器架构.md | 双通道+多设备架构设计 |
| 4、前端 | 管理端前端开发规范(毛玻璃风格).md | 苹果毛玻璃UI设计规范 |
| 5、接口 | **工作手机API全量接口目录.md** | **328 路由索引 + 存客宝重点 + 公共参数** |
| 5、接口 | 存客宝BFF与工作手机SDK映射表.md | 触客宝 BFF ↔ SDK ↔ WorkPhoneSDK.php |
| 5、接口 | Hook模块管理接口.md | 模块管理+脚本+事件API |
| 5、接口 | 外部对接网关接口说明.md | REST/OpenAI/MCP 三协议 + D6 注册 API |
| 8、部署 | 上线与运维操作手册.md | D8 上线检查、设备在线说明、D6/D7 |

View File

@@ -6,5 +6,6 @@ obsidian-color: "#0277BD"
| 文档 | 说明 |
|------|------|
| [**工作手机API全量接口目录.md**](工作手机API全量接口目录.md) | **328 条** HTTP 路由全量索引 + 公共参数 + 存客宝重点 |
| [接口规范.md](接口规范.md) | 统一 API消息/好友/群/设备/脚本)+ §1.5 联调契约 |
| [通用服务交互层.md](通用服务交互层.md) | Facade + ChannelRouter + 三通道 |

View File

@@ -0,0 +1,588 @@
---
obsidian-color: "#0277BD"
cssclasses:
- devdoc-api-index
---
# 工作手机 API 全量接口目录
> **版本**: v3.0 | **更新**: 2026-05-24 | **负责人**: @阿桥
> **真源**: 从 `sdk/app/main.py` 自动扫描,共 **328** 条 HTTP 路由
> **Base URL**: `http://{{服务器IP}}:8899` | **前缀**: `/api/v3`(部分系统路由无前缀)
---
## 一、如何使用本文档
| 角色 | 推荐阅读顺序 |
|------|-------------|
| **存客宝后端** | 本文 §二 公共参数 → §三 存客宝 → [存客宝对接规范](02-业务对接/存客宝对接规范.md) → [对接架构图](05-交互图/存客宝对接架构图.html) → [分类浏览](05-交互图/接口全量分类浏览.html) |
| **触客宝/第三方** | §二 → [外部对接网关](02-业务对接/外部对接网关接口说明.md) → OpenAI/MCP 网关 |
| **设备/Hook 开发** | §四 Hook → [Hook模块管理接口](03-Hook与微信/Hook模块管理接口.md) |
| **全量 Schema** | [openapi_v3.0.json](04-OpenAPI/openapi_v3.0.json) · Swagger `/docs` |
![存客宝与工作手机对接架构](./images/02-业务对接/存客宝与工作手机对接架构.png)
---
## 二、公共参数与响应
### 2.1 鉴权
```http
Authorization: Bearer {api_key}
Content-Type: application/json
```
### 2.2 业务公共字段(多数 POST 接口)
| 字段 | 类型 | 必填 | 说明 |
|------|------|:----:|------|
| `device_id` | string | ✅ | ADB 序列号或 WebSocket 注册 ID |
| `platform` | enum | ✅ | `wechat` / `douyin` / `xhs` / `xianyu` / `soul` |
| `channel` | string | ❌ | 强制通道:`hook` / `sdk_control` / `ai_agent` / `official_api` |
| `timeout_seconds` | int | ❌ | 单次操作超时(秒) |
### 2.3 统一响应
```json
{ "code": 200, "message": "success", "data": {}, "channel_used": "hook", "timestamp": 1704931200 }
```
### 2.4 错误码速查
| code | 含义 |
|------|------|
| 200 | 成功 |
| 400 | 参数错误 |
| 401 | 未授权 |
| 404 | 设备/资源不存在 |
| 408 | 设备响应超时 |
| 503 | 设备离线 |
---
## 三、存客宝重点接口8 条)
> 代码:`sdk/app/routers/cunke_bao.py` · 详细签名见 [存客宝对接规范](02-业务对接/存客宝对接规范.md)
| 方法 | 路径 | 说明 | 核心参数 |
|------|------|------|----------|
| `POST` | `/api/v3/cunke-bao/batch-contacts` | 批量联系人上报 | device_id*, contacts[]*, source |
| `GET` | `/api/v3/cunke-bao/config` | 查询 CKB 配置(脱敏) | api_key*, base_url, timeout, enabled |
| `POST` | `/api/v3/cunke-bao/config` | 设置/更新 CKB 配置 | api_key*, base_url, timeout, enabled |
| `POST` | `/api/v3/cunke-bao/hook/batch-events` | Hook 批量事件 | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/cunke-bao/hook/friend-add` | Hook 新好友 → 自动线索 | device_id*, wechat_id*, nickname, source |
| `POST` | `/api/v3/cunke-bao/hook/group-change` | Hook 群变动 | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/cunke-bao/report-lead` | 手动线索上报 | phone/wechat_id, name, source, tags[], device_id |
| `GET` | `/api/v3/cunke-bao/stats` | 上报统计 | 见 openapi_v3.0.json 或子文档 |
### 3.1 存客宝调用链
```text
存客宝后端 ──REST──► 工作手机 /api/v3/* ──WebSocket/Hook──► 设备 Agent ──► 微信
▲ │
└──── 线索回写 /cunke-bao/* ────┘──── 自动上报 ckbapi.quwanzhi.com
```
---
## 四、统一业务
### 微信/多平台 Facade105 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `POST` | `/api/v3/account/appeal-restriction` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/account/change-password` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/account/restrictions` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/account/safety-center` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/account/status` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/account/unblock` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/account/unblock-appeal` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/account/unblock-self` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/account/unblock-sms` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/anti-ban/dashboard` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/anti-ban/device/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/auto-register/check-state` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/auto-register/full` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/auto-register/get-sim-phone` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/call/video` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/call/voice` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/chat/clear-history` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/chat/set-mute` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/chat/set-top` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/comment/reply` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/contacts` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/contacts/search` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/discover/top-stories` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/emoji/send` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/emoji/stickers` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/favorites/add` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/favorites/list` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/file/download` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/file/send` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/friend/accept` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/friend/add` | device_id*, platform*, wechat_id/search_key, verify_msg, tags |
| `POST` | `/api/v3/friend/batch-add` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/friend/delete` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/friend/info` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/friend/set-remark` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/group/create` | device_id*, platform*, member_ids*, group_name |
| `POST` | `/api/v3/group/invite` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/group/list` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/group/members` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/group/quit` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/group/remove` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/group/send-message` | device_id*, platform*, group_id*, content*, at_list |
| `POST` | `/api/v3/group/set-name` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/group/set-notice` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/group/set-welcome` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/hook/actions` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/hook/data/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/hook/execute` | device_id*, action*, params{}, channel=hook |
| `GET` | `/api/v3/hook/probe/{device_id}` | path: device_id — 探测 Hook 可用性 |
| `POST` | `/api/v3/location/send` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/location/share-realtime` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/mass-send` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/message/batch-send` | device_id*, platform*, to_ids*, content*, interval |
| `POST` | `/api/v3/message/forward` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/message/list` | device_id*, platform*, conversation_id, limit, since_time |
| `POST` | `/api/v3/message/recall` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/message/send` | device_id*, platform*, to_id*, content*, msg_type, media_url, channel, hook_config |
| `POST` | `/api/v3/message/send-card` | device_id*, platform*, to_id*, content*, msg_type, media_url, channel, hook_config |
| `POST` | `/api/v3/message/voice` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/miniprogram/open` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/moments/comment` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/moments/delete` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/moments/like` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/moments/list` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/moments/post` | device_id*, platform*, content, images[], visibility |
| `POST` | `/api/v3/moments/set-cover` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/moments/set-privacy` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/moments/share-link` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/official-account/follow` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/payment/code` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/payment/receive` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/payment/receive-red-packet` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/payment/red-packet` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/payment/transactions` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/payment/transfer` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/payment/wallet` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/profile/get` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/profile/set-avatar` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/profile/set-gender` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/profile/set-nickname` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/profile/set-region` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/profile/set-signature` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/scan/add-friend` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/scan/extract-qr` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/scan/my-qr` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/scan/qr-code` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/search/wechat` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/settings/check-update` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/settings/clear-cache` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/settings/do-not-disturb` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/settings/logout` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/settings/switch-account` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/tag/add` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/tag/create` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/tag/delete` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/tag/list` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/tag/remove` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/tag/users` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/video-channel/comment` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/video-channel/follow` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/video-channel/like` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/video-channel/list` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/video-channel/share` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/wechat-sport/like-steps` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/wechat-sport/steps` | 见 openapi_v3.0.json 或子文档 |
---
## 五、业务对接
### 存客宝重点8 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `POST` | `/api/v3/cunke-bao/batch-contacts` | device_id*, contacts[]*, source |
| `GET` | `/api/v3/cunke-bao/config` | api_key*, base_url, timeout, enabled |
| `POST` | `/api/v3/cunke-bao/config` | api_key*, base_url, timeout, enabled |
| `POST` | `/api/v3/cunke-bao/hook/batch-events` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/cunke-bao/hook/friend-add` | device_id*, wechat_id*, nickname, source |
| `POST` | `/api/v3/cunke-bao/hook/group-change` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/cunke-bao/report-lead` | phone/wechat_id, name, source, tags[], device_id |
| `GET` | `/api/v3/cunke-bao/stats` | 见 openapi_v3.0.json 或子文档 |
### 网关/OpenAI/MCP11 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `POST` | `/api/v3/gateway/fleet/broadcast` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/gateway/fleet/group` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/gateway/fleet/groups` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/gateway/fleet/status` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/gateway/info` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/gateway/journey` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/gateway/journey/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/gateway/mcp/call` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/gateway/mcp/tools` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/gateway/v1/chat/completions` | model, messages[], device_id? |
| `GET` | `/api/v3/gateway/v1/models` | 见 openapi_v3.0.json 或子文档 |
---
## 六、设备与连接
### WebSocket 协议7 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/connection/modes` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/connection/modes/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/connection/protocol` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/connection/simulate/heartbeat` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/connection/simulate/hook-event` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/connection/simulate/register` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/connection/status` | 见 openapi_v3.0.json 或子文档 |
### 局域网发现6 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `POST` | `/api/v3/discovery/beacon/start` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/discovery/beacon/stop` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/discovery/last-scan` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/discovery/listen-beacon` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/discovery/scan-lan` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/discovery/server-info` | 见 openapi_v3.0.json 或子文档 |
### 设备/心跳/守护23 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/devices` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/devices/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/ai/execute` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/ai/queue-task` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/ai/standing-order` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/devices/{device_id}/ai/status` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/ai/task` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/click` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/click-text` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/execute` | script*, action*, params{} |
| `GET` | `/api/v3/devices/{device_id}/guard-events` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/guard-events` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/devices/{device_id}/health` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/devices/{device_id}/health/events` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/devices/{device_id}/heartbeat` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/heartbeat/config` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/input` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/screenshot` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/swipe` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/devices/{device_id}/ui-tree` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/guard-events/all` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/heartbeat/dashboard` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/heartbeat/events` | 见 openapi_v3.0.json 或子文档 |
---
## 七、Hook与Frida
### 无线 Frida13 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/frida/actions` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/frida/connect` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/frida/deploy/install-script` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/frida/deploy/script` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/frida/device/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/frida/devices` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/frida/disconnect/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/frida/discover` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/frida/execute` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/frida/execute/batch` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/frida/register` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/frida/status` | 见 openapi_v3.0.json 或子文档 |
| `DELETE` | `/api/v3/frida/unregister/{device_id}` | path: device_id/serial + body 见 OpenAPI |
### 模块/脚本/事件17 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/devices/{device_id}/modules` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/devices/{device_id}/modules/reload` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/devices/{device_id}/modules/{module_id}/logs` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/hook/events` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/hook/events` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/modules` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/modules` | 见 openapi_v3.0.json 或子文档 |
| `DELETE` | `/api/v3/modules/{module_id}` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/modules/{module_id}` | 见 openapi_v3.0.json 或子文档 |
| `PUT` | `/api/v3/modules/{module_id}` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/modules/{module_id}/disable` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/modules/{module_id}/enable` | 见 openapi_v3.0.json 或子文档 |
| `PUT` | `/api/v3/modules/{module_id}/scope` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/scripts` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/scripts` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/scripts/{script_id}` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/scripts/{script_id}/deploy` | 见 openapi_v3.0.json 或子文档 |
---
## 八、微信扩展
### Hook 直连 62 接口62 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/wechat/account/status` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/actions` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/channels/browse` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/channels/comment` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/channels/follow` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/channels/like` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/channels/share` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/channels/unfollow` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/device-info` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/emoji/add-custom` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/emoji/send-custom` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/execute` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/favorites` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/favorites/add` | device_id* + 业务 params见 wechat_full 路由) |
| `DELETE` | `/api/v3/wechat/favorites/{local_id}` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/float/add` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/float/remove` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/hook/process-info` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/hook/status` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/hook/wechat-version` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/mini-program/open` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/mini-program/recent` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/mini-program/share` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/network-info` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/official-accounts` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/official-accounts/follow` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/official-accounts/unfollow` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/official-accounts/{account_id}/articles` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/pay/balance` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/pay/red-packet` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/pay/red-packet/receive` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/pay/transactions` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/pay/transfer` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/pay/transfer/receive` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/profile` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/profile/avatar` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/profile/nickname` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/profile/region` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/profile/sex` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/profile/signature` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/profile/status` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/qr/group/{group_id}` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/qr/my` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/qr/scan` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/search` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/security/account-protection` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/security/bind-phone` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/security/change-password` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/security/fingerprint` | device_id* + 业务 params见 wechat_full 路由) |
| `DELETE` | `/api/v3/wechat/security/login-device` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/security/login-devices` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/security/unbind-phone` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/security/unblock` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/settings/chat-background` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/settings/clear-history` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/settings/dnd` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/settings/notification` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/settings/pin-chat` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/settings/privacy` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/storage-info` | device_id* + 业务 params见 wechat_full 路由) |
| `GET` | `/api/v3/wechat/tag/contacts/{label_id}` | device_id* + 业务 params见 wechat_full 路由) |
| `POST` | `/api/v3/wechat/tag/set-contact` | device_id* + 业务 params见 wechat_full 路由) |
---
## 九、ADB与自动化
### ADB 底层15 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/adb/devices` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/adb/devices/{serial}` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/adb/devices/{serial}/app/current` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/adb/devices/{serial}/app/list` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/adb/devices/{serial}/app/start` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/adb/devices/{serial}/app/stop` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/adb/devices/{serial}/click` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/adb/devices/{serial}/click-text` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/adb/devices/{serial}/input` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/adb/devices/{serial}/key` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/adb/devices/{serial}/screenshot` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/adb/devices/{serial}/swipe` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/adb/devices/{serial}/ui-tree` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/adb/scan` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/adb/scan` | 见 openapi_v3.0.json 或子文档 |
---
## 十、AI与智能
### Agent/Brain10 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `POST` | `/api/v3/agent/execute` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/agent/status/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/agent/stop/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/ai/brain/batch-execute` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/ai/brain/dashboard` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/ai/brain/execute-script` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/ai/brain/skill-registry` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/ai/chat` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/ai/status` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/v1/chat/completions` | 见 openapi_v3.0.json 或子文档 |
### 坐标/快捷操作12 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/experience/average-duration` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/experience/elements` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/experience/elements/{app}` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/experience/operations` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/experience/operations/record` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/experience/shortcuts` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/experience/shortcuts` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/experience/shortcuts/{name}` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/experience/shortcuts/{name}/execute/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `GET` | `/api/v3/experience/statistics` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/experience/success-rate` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/experience/suggest/coordinates` | 见 openapi_v3.0.json 或子文档 |
### 语音指令3 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/voice/apps` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/voice/command` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/voice/parse` | 见 openapi_v3.0.json 或子文档 |
---
## 十一、运维工具
### 多项目编排6 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/projects` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/projects/{project_id}` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/projects/{project_id}/broadcast` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/projects/{project_id}/devices` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/projects/{project_id}/devices/{device_id}/execute` | script*, action*, params{} |
| `POST` | `/api/v3/projects/{project_id}/execute` | 见 openapi_v3.0.json 或子文档 |
### 抓包4 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/capture/data/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/capture/start` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/capture/status/{device_id}` | path: device_id/serial + body 见 OpenAPI |
| `POST` | `/api/v3/capture/stop` | 见 openapi_v3.0.json 或子文档 |
### 集群注册6 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/registry/fleet/aggregate` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/registry/info` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/registry/nodes` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/registry/nodes/heartbeat` | 见 openapi_v3.0.json 或子文档 |
| `POST` | `/api/v3/registry/nodes/register` | 见 openapi_v3.0.json 或子文档 |
| `DELETE` | `/api/v3/registry/nodes/{node_id}` | 见 openapi_v3.0.json 或子文档 |
### 项目二维码3 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `POST` | `/api/v3/qrcode/generate` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/qrcode/html/{project_id}` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/qrcode/image/{project_id}` | 见 openapi_v3.0.json 或子文档 |
---
## 十二、系统入口
### 系统/运维12 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/control` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/docs` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/docs/oauth2-redirect` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/health` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/hub` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/install.sh` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/openapi.json` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/ready` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/redoc` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/voice` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/wechat` | 见 openapi_v3.0.json 或子文档 |
---
## 13、其他
### 系统/未分类5 条)
| 方法 | 路径 | 核心参数/说明 |
|------|------|---------------|
| `GET` | `/api/v3/agent/download` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/workbench/docs` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/workbench/docs/{doc_id}` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/api/v3/workbench/overview` | 见 openapi_v3.0.json 或子文档 |
| `GET` | `/pages/{page_key}` | 见 openapi_v3.0.json 或子文档 |
---
## 附录 A · 模块统计
| 大类 | 子模块 | 接口数 |
|------|--------|--------|
| 统一业务 | 微信/多平台 Facade | 105 |
| 业务对接 | 存客宝重点 | 8 |
| 业务对接 | 网关/OpenAI/MCP | 11 |
| 设备与连接 | WebSocket 协议 | 7 |
| 设备与连接 | 局域网发现 | 6 |
| 设备与连接 | 设备/心跳/守护 | 23 |
| Hook与Frida | 无线 Frida | 13 |
| Hook与Frida | 模块/脚本/事件 | 17 |
| 微信扩展 | Hook 直连 62 接口 | 62 |
| ADB与自动化 | ADB 底层 | 15 |
| AI与智能 | Agent/Brain | 10 |
| AI与智能 | 坐标/快捷操作 | 12 |
| AI与智能 | 语音指令 | 3 |
| 运维工具 | 多项目编排 | 6 |
| 运维工具 | 抓包 | 4 |
| 运维工具 | 集群注册 | 6 |
| 运维工具 | 项目二维码 | 3 |
| 系统入口 | 系统/运维 | 12 |
| 其他 | 系统/未分类 | 5 |
| **合计** | | **328** |
## 附录 B · 相关文档
- [接口规范](01-规范与统一层/接口规范.md)
- [通用服务交互层](01-规范与统一层/通用服务交互层.md)
- [存客宝BFF与工作手机SDK映射表](02-业务对接/存客宝BFF与工作手机SDK映射表.md)
- [外部对接网关](02-业务对接/外部对接网关接口说明.md)
- [Hook模块管理接口](03-Hook与微信/Hook模块管理接口.md)
- [API架构与交互流程图](05-交互图/API架构与交互流程图.html)
- [存客宝对接架构图](05-交互图/存客宝对接架构图.html)
**维护**:接口变更后重新运行 `开发文档/6、测试/scripts/export_api_catalog.py`(或让 @阿桥 从 main.py 扫描更新)。

View File

@@ -1,6 +1,7 @@
# 工作手机SDK v3.0 - 接口规范统一API
> 版本v3.0 | 更新2026-02-07 | 合并自《统一API规范》+ 接口定义要点
> 版本v3.0 | 更新2026-05-24 | 合并自《统一API规范》+ 接口定义要点
> **全量索引328 路由)**[工作手机API全量接口目录.md](工作手机API全量接口目录.md) · [浏览器分类浏览](../05-交互图/接口全量分类浏览.html)
> 存客宝前端/后端直接调用此 API 即可控制手机。
---

View File

@@ -6,5 +6,6 @@ obsidian-color: "#0277BD"
| 文档 | 说明 |
|------|------|
| [存客宝对接规范.md](存客宝对接规范.md) | 客宝/触客宝调用机擎 |
| [外部对接网关接口说明.md](外部对接网关接口说明.md) | 外部系统三种对接方式 |
| [存客宝BFF与工作手机SDK映射表.md](存客宝BFF与工作手机SDK映射表.md) | 客宝 `/v1/workphone/*` ↔ SDK `/api/v3/*` + WorkPhoneSDK.php |
| [存客宝对接规范.md](存客宝对接规范.md) | 存客宝线索 API 签名与上报 |
| [外部对接网关接口说明.md](外部对接网关接口说明.md) | OpenAI / MCP / Fleet 网关 |

View File

@@ -243,4 +243,4 @@ GET /api/v3/gateway/info
| 注销节点 | DELETE | `/api/v3/registry/nodes/{node_id}?token=...` |
| **聚合全集群设备** | GET | `/api/v3/registry/fleet/aggregate` |
环境变量:`WORKPHONE_SERVER_ID``WORKPHONE_PUBLIC_BASE_URL``WORKPHONE_REGISTRY_TOKEN`(可选)、`WORKPHONE_REGISTRY_PEERS`(静态 peer 列表)。详见 `开发文档/8、部署/上线与运维操作手册.md`
环境变量:`WORKPHONE_SERVER_ID``WORKPHONE_PUBLIC_BASE_URL``WORKPHONE_REGISTRY_TOKEN`(可选)、`WORKPHONE_REGISTRY_PEERS`(静态 peer 列表)。详见 `开发文档/8、部署/03-运维同步/上线与运维操作手册.md`

View File

@@ -0,0 +1,289 @@
# 存客宝 BFF 与工作手机 SDK 映射表
> **版本**: v1.0 | **更新**: 2026-05-24 | **负责人**: @阿桥
> **存客宝代码**: `cunkebao_v3/Server/application/common/util/WorkPhoneSDK.php`
> **工作手机真源**: [工作手机API全量接口目录.md](../01-规范与统一层/工作手机API全量接口目录.md)
---
## 一、三层调用关系
```text
触客宝前端 (React)
│ /v1/workphone/*
存客宝 BFF (ThinkPHP · GetWorkPhoneStatusController 等)
│ WorkPhoneSDK.php
工作手机 SDK (:8899)
│ /api/v3/*
设备 Agent / Frida / ADB
```
![存客宝与工作手机对接架构](../images/02-业务对接/存客宝与工作手机对接架构.png)
---
## 二、环境变量(存客宝侧)
| 变量 | 配置键 | 默认值 | 说明 |
|------|--------|--------|------|
| `WORKPHONE_SDK_URL` | `workphone.sdk_url` | `http://localhost:8899` | SDK 服务地址 |
| `WORKPHONE_SDK_KEY` | `workphone.api_key` | `workphone-secret-key` | Bearer Token |
| `WORKPHONE_SDK_TIMEOUT` | `workphone.timeout` | `30` | 请求超时(秒) |
配置文件:`cunkebao_v3/Server/config/workphone.php`
---
## 三、存客宝 BFF 路由 → SDK 路由
| 存客宝 BFF | 方法 | 工作手机 SDK | 说明 |
|------------|------|--------------|------|
| `/v1/workphone/status` | GET | `/health` + `/api/v3/devices` + `/api/v3/connection/status` + `/api/v3/workbench/overview` | 聚合总览;优先 workbench |
| `/v1/workphone/device` | GET | `GET /api/v3/devices/{device_id}` | 参数:`device_id` |
| `/v1/workphone/screenshot` | POST | `POST /api/v3/devices/{device_id}/screenshot` | 参数:`device_id` |
| `/v1/workphone/ai/status` | GET | `GET /api/v3/devices/{device_id}/ai/status` | ✅ 已注册 |
| `/v1/workphone/ai/task` | POST | `POST /api/v3/devices/{device_id}/ai/task` | ✅ 已注册 |
| `/v1/workphone/ai/standing-order` | POST | `POST /api/v3/devices/{device_id}/ai/standing-order` | ✅ 已注册 |
| `/v1/workphone/ai/execute` | POST | `POST /api/v3/devices/{device_id}/ai/execute` | ✅ 已注册 |
前端定义见:`cunkebao_v3/Cunkebao/src/pages/mobile/mine/workphone/api.ts`
---
## 四、WorkPhoneSDK.php 方法 → SDK 接口(已封装 40+
### 4.1 消息
| PHP 方法 | SDK 路径 | 核心参数 |
|----------|----------|----------|
| `sendMessage()` | `POST /api/v3/message/send` | device_id, platform, to_id, content, msg_type |
| `getMessages()` | `POST /api/v3/message/list` | device_id, platform, conversation_id, limit |
| `batchSendMessage()` | `POST /api/v3/message/batch-send` | device_id, platform, to_ids[], content, interval |
| `replyComment()` | `POST /api/v3/comment/reply` | device_id, platform, comment_id, content |
### 4.2 好友 / 通讯录
| PHP 方法 | SDK 路径 | 核心参数 |
|----------|----------|----------|
| `addFriend()` | `POST /api/v3/friend/add` | device_id, platform, search_key, verify_msg |
| `acceptFriend()` | `POST /api/v3/friend/accept` | device_id, platform, user_id |
| `setFriendRemark()` | `POST /api/v3/friend/set-remark` | device_id, platform, user_id, remark |
| `deleteFriend()` | `POST /api/v3/friend/delete` | device_id, platform, user_id |
| `batchAddFriend()` | `POST /api/v3/friend/batch-add` | device_id, platform, targets[] |
| `getContacts()` | `GET /api/v3/contacts` | device_id, platform, limit |
### 4.3 群聊
| PHP 方法 | SDK 路径 |
|----------|----------|
| `createGroup()` | `POST /api/v3/group/create` |
| `inviteToGroup()` | `POST /api/v3/group/invite` |
| `removeFromGroup()` | `POST /api/v3/group/remove` |
| `setGroupNotice()` | `POST /api/v3/group/set-notice` |
| `setGroupName()` | `POST /api/v3/group/set-name` |
| `sendGroupMessage()` | `POST /api/v3/group/send-message` |
| `setGroupWelcome()` | `POST /api/v3/group/set-welcome` |
| `getGroups()` | `GET /api/v3/group/list` |
| `getGroupMembers()` | `GET /api/v3/group/members` |
### 4.4 标签
| PHP 方法 | SDK 路径 |
|----------|----------|
| `addTag()` / `removeTag()` / `createTag()` / `deleteTag()` | `/api/v3/tag/*` |
| `getTags()` | `GET /api/v3/tag/list` |
| `getUsersByTag()` | `POST /api/v3/tag/users` |
### 4.5 朋友圈
| PHP 方法 | SDK 路径 |
|----------|----------|
| `postMoments()` | `POST /api/v3/moments/post` |
| `likeMoments()` | `POST /api/v3/moments/like` |
| `commentMoments()` | `POST /api/v3/moments/comment` |
| `getMoments()` | `POST /api/v3/moments/list` |
### 4.6 设备 / Agent / UI
| PHP 方法 | SDK 路径 |
|----------|----------|
| `getDevices()` | `GET /api/v3/devices` |
| `getDevice()` | `GET /api/v3/devices/{id}` |
| `screenshot()` | `POST /api/v3/devices/{id}/screenshot` |
| `getUiTree()` | `GET /api/v3/devices/{id}/ui-tree` |
| `click()` / `clickText()` / `input()` / `swipe()` | `POST /api/v3/devices/{id}/click*` |
| `executeTask()` | `POST /api/v3/agent/execute` |
| `getAgentStatus()` | `GET /api/v3/agent/status/{id}` |
| `stopAgent()` | `POST /api/v3/agent/stop/{id}` |
| `getAIBrainStatus()` | `GET /api/v3/devices/{id}/ai/status` |
| `pushAITask()` | `POST /api/v3/devices/{id}/ai/task` |
| `pushAIStandingOrder()` | `POST /api/v3/devices/{id}/ai/standing-order` |
| `executeAITask()` | `POST /api/v3/devices/{id}/ai/execute` |
| `healthCheck()` | `GET /health` |
### 4.7 平台快捷方法
| PHP 方法 | 等价于 |
|----------|--------|
| `wechatSend()` | `sendMessage(..., 'wechat', ...)` |
| `douyinSend()` | platform=`douyin` |
| `xhsSend()` | platform=`xhs` |
| `xianyuSend()` | platform=`xianyu` |
| `soulSend()` | platform=`soul` |
---
## 五、线索闭环(存客宝专用 SDK 路由)
| 场景 | SDK 路径 | 触发方 |
|------|----------|--------|
| 配置 CKB | `POST/GET /api/v3/cunke-bao/config` | 运维 / 存客宝后台 |
| 手动线索 | `POST /api/v3/cunke-bao/report-lead` | 场景计划 / 测试 |
| 通讯录同步 | `POST /api/v3/cunke-bao/batch-contacts` | Hook / 定时任务 |
| 新好友 | `POST /api/v3/cunke-bao/hook/friend-add` | Frida Agent |
| 群变动 | `POST /api/v3/cunke-bao/hook/group-change` | Frida Agent |
签名与字段详见 [存客宝对接规范.md](存客宝对接规范.md)。
---
## 六、BFF 路由清单7 条,已全部注册)
| 前端 api.ts | BFF 路由 | SDK 目标 | 状态 |
|-------------|----------|----------|------|
| `fetchWorkPhoneStatus` | `GET /v1/workphone/status` | workbench + devices | ✅ |
| `fetchWorkPhoneDevice` | `GET /v1/workphone/device` | `GET /api/v3/devices/{id}` | ✅ |
| `fetchWorkPhoneScreenshot` | `POST /v1/workphone/screenshot` | screenshot | ✅ |
| `fetchAIBrainStatus` | `GET /v1/workphone/ai/status` | `GET /api/v3/devices/{id}/ai/status` | ✅ |
| `pushAITask` | `POST /v1/workphone/ai/task` | `POST .../ai/task` | ✅ |
| `pushAIStandingOrder` | `POST /v1/workphone/ai/standing-order` | standing-order | ✅ |
| `executeAITask` | `POST /v1/workphone/ai/execute` | ai/execute | ✅ |
代码:`cunkebao_v3/Server/application/cunkebao/config/route.php` · `GetWorkPhoneStatusController.php` · `WorkPhoneSDK.php`
---
## 七、场景计划常用 SDK 接口速查
| 存客宝业务 | 推荐 SDK 接口 |
|------------|---------------|
| 场景群发消息 | `POST /api/v3/message/batch-send` |
| 加好友计划 | `POST /api/v3/friend/batch-add` |
| 群欢迎语 | `POST /api/v3/group/set-welcome` |
| 朋友圈营销 | `POST /api/v3/moments/post` |
| 标签分流 | `POST /api/v3/tag/add` + `GET /api/v3/tag/users` |
| 新好友进流量池 | Hook → `/api/v3/cunke-bao/hook/friend-add` |
---
## 八、相关文档
- [工作手机API全量接口目录.md](../01-规范与统一层/工作手机API全量接口目录.md)
- [存客宝对接规范.md](存客宝对接规范.md)
- [外部对接网关接口说明.md](外部对接网关接口说明.md)
- [存客宝对接架构图.html](../05-交互图/存客宝对接架构图.html)
---
## 九、联调验收curl 快测)
**SDK 直连**(本机 SDK 已启动时):
```bash
# 健康检查
curl -s http://127.0.0.1:8899/health
# 工作台总览BFF status 优先拉此接口)
curl -s http://127.0.0.1:8899/api/v3/workbench/overview
# AI Brain 状态(替换 {device_id}
curl -s http://127.0.0.1:8899/api/v3/devices/{device_id}/ai/status
# 推送 AI 任务
curl -s -X POST http://127.0.0.1:8899/api/v3/devices/{device_id}/ai/task \
-H 'Content-Type: application/json' \
-d '{"instruction":"检查微信未读","priority":5}'
```
**一键冒烟脚本**`开发文档/6、测试/scripts/workphone_bff_smoke.sh`
**2026-05-24 实测**SDK healthy2 台 WS 在线;`/ai/status``/ai/task` 返回 200。
---
## 十、场景联调示例curl
`{device_id}``{to_id}` 替换为真机值。Base`http://127.0.0.1:8899`
### 10.1 场景群发消息
```bash
curl -s -X POST http://127.0.0.1:8899/api/v3/message/batch-send \
-H 'Content-Type: application/json' \
-d '{
"device_id": "{device_id}",
"platform": "wechat",
"to_ids": ["好友A", "好友B"],
"content": "【存客宝】活动通知:今晚 8 点直播",
"interval": 3
}'
```
### 10.2 批量加好友
```bash
curl -s -X POST http://127.0.0.1:8899/api/v3/friend/batch-add \
-H 'Content-Type: application/json' \
-d '{
"device_id": "{device_id}",
"platform": "wechat",
"user_ids": ["wxid_aaa", "wxid_bbb"],
"message": "你好,通过一下",
"interval": 8
}'
```
### 10.3 群欢迎语
```bash
curl -s -X POST http://127.0.0.1:8899/api/v3/group/set-welcome \
-H 'Content-Type: application/json' \
-d '{
"device_id": "{device_id}",
"platform": "wechat",
"group_id": "{group_id}",
"welcome_text": "欢迎加入回复「1」领资料"
}'
```
### 10.4 新好友 → 存客宝线索
```bash
curl -s -X POST http://127.0.0.1:8899/api/v3/cunke-bao/hook/friend-add \
-H 'Content-Type: application/json' \
-d '{
"device_id": "{device_id}",
"wechat_id": "wxid_newfriend",
"nickname": "张三",
"source": "微信添加"
}'
```
### 10.5 PHP / TS 调用
```php
// cunkebao_v3 WorkPhoneSDK.php 或 sdk/php-sdk/WorkPhoneClient.php
$sdk->sendMessage($deviceId, 'wechat', $toId, '你好');
$sdk->pushAITask($deviceId, '检查未读并汇总', 5);
```
```typescript
// sdk/typescript-sdk
await sdk.batchSendMessage({ deviceId, platform: 'wechat', toIds: ['A','B'], content: '...' });
await sdk.pushAITask(deviceId, '检查微信未读', 5);
```
**接口真源**[工作手机API全量接口目录.md](../01-规范与统一层/工作手机API全量接口目录.md)

View File

@@ -6,4 +6,5 @@ obsidian-color: "#455A64"
| 文件 | 说明 |
|------|------|
| [openapi_v3.0.json](openapi_v3.0.json) | v3.0 机器可读契约Hub `/docs` 同步 |
| [openapi_v3.0.json](openapi_v3.0.json) | v3.0 机器可读契约**315 paths**2026-05-24 从 main.py 重新导出) |
| [routes_snapshot.json](routes_snapshot.json) | 328 条 HTTP 路由扁平快照(含系统页) |

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -6,4 +6,6 @@ obsidian-color: "#00838F"
| 文件 | 说明 |
|------|------|
| [API架构与交互流程图.html](API架构与交互流程图.html) | 浏览器打开的 API 架构交互图 |
| [接口全量分类浏览.html](接口全量分类浏览.html) | **328 路由** 可搜索分类浏览 |
| [存客宝对接架构图.html](存客宝对接架构图.html) | 存客宝 ↔ 工作手机 SDK ↔ 设备 对接总览 |
| [API架构与交互流程图.html](API架构与交互流程图.html) | 全站 API 架构与交互流程 |

View File

@@ -0,0 +1,142 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>工作手机 SDK · 存客宝对接架构</title>
<style>
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{--bg:#0a1628;--card:#0f1f38;--cyan:#00d4ff;--green:#00ff88;--orange:#ff6b35;--gold:#ffd700;--text:#e2e8f0;--muted:#94a3b8;--border:rgba(0,212,255,.15)}
body{font-family:"Noto Sans SC",system-ui,sans-serif;background:var(--bg);color:var(--text);line-height:1.6;padding:32px 20px 64px}
.wrap{max-width:1200px;margin:0 auto}
h1{font-size:clamp(22px,4vw,36px);background:linear-gradient(90deg,var(--cyan),var(--green));-webkit-background-clip:text;-webkit-text-fill-color:transparent;margin-bottom:8px}
.sub{color:var(--muted);font-size:14px;margin-bottom:32px}
.section{margin-top:40px}
.section h2{color:var(--cyan);font-size:18px;margin-bottom:16px;border-left:4px solid var(--green);padding-left:12px}
.diagram{display:grid;grid-template-columns:1fr 80px 1.2fr 80px 1fr;gap:0;align-items:stretch;margin:24px 0}
.box{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:20px;position:relative}
.box h3{font-size:15px;color:var(--gold);margin-bottom:12px}
.box ul{list-style:none;font-size:13px;color:var(--muted)}
.box li{padding:4px 0;border-bottom:1px dashed rgba(255,255,255,.06)}
.box li strong{color:var(--text)}
.arrow{display:flex;align-items:center;justify-content:center;color:var(--cyan);font-size:28px;font-weight:700}
.layer{margin:8px 0;padding:8px 10px;border-radius:8px;background:rgba(0,212,255,.08);border:1px solid rgba(0,212,255,.2);font-size:12px}
.flow{display:flex;flex-wrap:wrap;gap:12px;margin-top:16px}
.chip{padding:6px 12px;border-radius:999px;border:1px solid var(--border);font-size:12px;color:var(--muted)}
.chip b{color:var(--green)}
table{width:100%;border-collapse:collapse;font-size:13px;margin-top:12px}
th,td{border:1px solid var(--border);padding:10px 12px;text-align:left}
th{background:rgba(0,212,255,.1);color:var(--cyan)}
code{background:rgba(0,0,0,.3);padding:2px 6px;border-radius:4px;font-size:12px}
.img-wrap{margin:24px 0;text-align:center}
.img-wrap img{max-width:100%;border-radius:12px;border:1px solid var(--border)}
@media(max-width:900px){.diagram{grid-template-columns:1fr;gap:12px}.arrow{transform:rotate(90deg);padding:8px 0}}
</style>
</head>
<body>
<div class="wrap">
<h1>工作手机 SDK v3.0 · 存客宝对接架构</h1>
<p class="sub">机擎 · 接口文档 05-交互图 | 更新 2026-05-24 | @阿桥</p>
<div class="section">
<h2>架构总览</h2>
<div class="diagram">
<div class="box">
<h3>存客宝 Cunkebao</h3>
<ul>
<li><strong>场景获客</strong> · 计划编排</li>
<li><strong>流量池</strong> · 用户画像</li>
<li><strong>触客宝</strong> · 移动端</li>
<li><strong>工作手机页</strong> · 设备管理</li>
</ul>
<div class="flow">
<span class="chip">PHP/TS SDK</span>
<span class="chip">Bearer Token</span>
</div>
</div>
<div class="arrow"></div>
<div class="box">
<h3>工作手机 SDK :8899</h3>
<div class="layer"><b>REST</b> /api/v3/* · 328 路由</div>
<div class="layer"><b>统一 Facade</b> message/friend/group/moments…</div>
<div class="layer"><b>存客宝</b> /cunke-bao/* · 线索回写</div>
<div class="layer"><b>Hook</b> /hook/execute · Frida 110 actions</div>
<div class="layer"><b>网关</b> OpenAI / MCP / Fleet</div>
<div class="layer"><b>Hub</b> WebSocket 设备长连接</div>
</div>
<div class="arrow"></div>
<div class="box">
<h3>Android 工作手机</h3>
<ul>
<li><strong>Agent</strong> WebSocket 客户端</li>
<li><strong>Frida</strong> wechat_hook_v2.js</li>
<li><strong>ADB</strong> UI 自动化兜底</li>
<li><strong>微信</strong> 8.0.56+</li>
</ul>
</div>
</div>
<div class="img-wrap">
<img src="../images/02-业务对接/存客宝与工作手机对接架构.png" alt="存客宝与工作手机对接架构图">
</div>
</div>
<div class="section">
<h2>三条对接路径</h2>
<table>
<thead><tr><th>路径</th><th>适用方</th><th>入口</th><th>典型场景</th></tr></thead>
<tbody>
<tr><td><b>① 统一 REST</b></td><td>存客宝后端</td><td><code>POST /api/v3/message/send</code></td><td>发消息、加好友、群发、朋友圈</td></tr>
<tr><td><b>② 存客宝专用</b></td><td>Hook / 线索闭环</td><td><code>/api/v3/cunke-bao/*</code></td><td>新好友→线索、通讯录批量、配置 CKB</td></tr>
<tr><td><b>③ AI 网关</b></td><td>Agent / Cursor</td><td><code>/api/v3/gateway/v1/chat/completions</code></td><td>自然语言控机、MCP 工具调用</td></tr>
</tbody>
</table>
</div>
<div class="section">
<h2>存客宝线索闭环</h2>
<pre style="background:var(--card);padding:16px;border-radius:12px;border:1px solid var(--border);overflow:auto;font-size:13px;color:var(--muted)">
微信新好友/群变动
│ Frida Hook 捕获
设备 Agent ──POST──► /api/v3/cunke-bao/hook/friend-add
│ /api/v3/cunke-bao/hook/group-change
工作手机 cunke_bao_service签名 MD5×2
存客宝 API ──► https://ckbapi.quwanzhi.com/v1/api/scenarios
流量池 / 场景计划 / 触客宝展示
</pre>
</div>
<div class="section">
<h2>存客宝专用接口8 条)</h2>
<table>
<thead><tr><th>方法</th><th>路径</th><th>说明</th></tr></thead>
<tbody>
<tr><td>POST</td><td><code>/api/v3/cunke-bao/config</code></td><td>设置 api_key、base_url、限流</td></tr>
<tr><td>GET</td><td><code>/api/v3/cunke-bao/config</code></td><td>查询配置(脱敏)</td></tr>
<tr><td>GET</td><td><code>/api/v3/cunke-bao/stats</code></td><td>上报统计</td></tr>
<tr><td>POST</td><td><code>/api/v3/cunke-bao/report-lead</code></td><td>手动线索上报</td></tr>
<tr><td>POST</td><td><code>/api/v3/cunke-bao/batch-contacts</code></td><td>批量联系人≤500</td></tr>
<tr><td>POST</td><td><code>/api/v3/cunke-bao/hook/friend-add</code></td><td>Hook 新好友事件</td></tr>
<tr><td>POST</td><td><code>/api/v3/cunke-bao/hook/group-change</code></td><td>Hook 群变动</td></tr>
<tr><td>POST</td><td><code>/api/v3/cunke-bao/hook/batch-events</code></td><td>Hook 批量事件</td></tr>
</tbody>
</table>
</div>
<div class="section">
<h2>相关文档</h2>
<ul style="color:var(--muted);font-size:14px;line-height:2">
<li><a href="../01-规范与统一层/工作手机API全量接口目录.md" style="color:var(--cyan)">工作手机API全量接口目录.md</a>328 条)</li>
<li><a href="../02-业务对接/存客宝对接规范.md" style="color:var(--cyan)">存客宝对接规范.md</a></li>
<li><a href="../02-业务对接/外部对接网关接口说明.md" style="color:var(--cyan)">外部对接网关接口说明.md</a></li>
<li><a href="API架构与交互流程图.html" style="color:var(--cyan)">API架构与交互流程图.html</a></li>
</ul>
</div>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -16,7 +16,7 @@ cssclasses:
```text
5、接口/
├── README.md
├── images/ ← 接口类配图(暂无则留空
├── images/ ← 接口类配图(含存客宝对接架构 PNG
├── 01-规范与统一层/ ← 接口规范 + Facade/ChannelRouter
├── 02-业务对接/ ← 存客宝 + 外部网关
├── 03-Hook与微信/ ← Hook 模块 API + 微信矩阵 + Frida 跳转
@@ -30,11 +30,11 @@ cssclasses:
| 大类 | 入口 |
|------|------|
| **01 规范与统一层** | [接口规范.md](01-规范与统一层/接口规范.md) · [通用服务交互层.md](01-规范与统一层/通用服务交互层.md) |
| **02 业务对接** | [存客宝对接规范.md](02-业务对接/存客宝对接规范.md) · [外部对接网关接口说明.md](02-业务对接/外部对接网关接口说明.md) |
| **01 规范与统一层** | [**工作手机API全量接口目录.md**](01-规范与统一层/工作手机API全量接口目录.md)328 条) · [接口规范.md](01-规范与统一层/接口规范.md) · [通用服务交互层.md](01-规范与统一层/通用服务交互层.md) |
| **02 业务对接** | [存客宝BFF映射表](02-业务对接/存客宝BFF与工作手机SDK映射表.md) · [存客宝对接规范.md](02-业务对接/存客宝对接规范.md) · [外部对接网关接口说明.md](02-业务对接/外部对接网关接口说明.md) |
| **03 Hook与微信** | [Hook模块管理接口.md](03-Hook与微信/Hook模块管理接口.md) · [微信全功能矩阵](03-Hook与微信/微信全功能矩阵_v8.0.56.md) |
| **04 OpenAPI** | [openapi_v3.0.json](04-OpenAPI/openapi_v3.0.json) |
| **05 交互图** | [API架构与交互流程图.html](05-交互图/API架构与交互流程图.html) |
| **05 交互图** | [接口全量分类浏览.html](05-交互图/接口全量分类浏览.html) · [存客宝对接架构图.html](05-交互图/存客宝对接架构图.html) · [API架构与交互流程图.html](05-交互图/API架构与交互流程图.html) |
**维护规范**[机擎/阿表/开发文档结构规范/SKILL.md](../../机擎/阿表/开发文档结构规范/SKILL.md)
@@ -43,3 +43,4 @@ cssclasses:
## 合并记录
- 2026-05-24根目录 8+ 文件分层迁入 `0105` 子目录
- 2026-05-24**接口全量目录** 328 路由 + OpenAPI 315 paths + 存客宝架构图 + 分类浏览 HTML + BFF 映射表

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@@ -1,3 +1,9 @@
# images
接口类 PNG/SVG 放此目录;按 `01-子类/` 分子文件夹(与 `2、架构/images` 规则一致)。
| 路径 | 说明 |
|------|------|
| [02-业务对接/存客宝与工作手机对接架构.png](02-业务对接/存客宝与工作手机对接架构.png) | 存客宝 ↔ SDK ↔ 设备 对接总览图 |
HTML 交互版见 [05-交互图/存客宝对接架构图.html](../05-交互图/存客宝对接架构图.html)。

View File

@@ -0,0 +1,160 @@
#!/usr/bin/env python3
"""从 sdk/app/main.py 扫描 FastAPI 路由,更新 routes_snapshot、OpenAPI、分类浏览 HTML。"""
from __future__ import annotations
import json
import sys
from collections import defaultdict
from datetime import date
from pathlib import Path
ROOT = Path(__file__).resolve().parents[3]
SDK_APP = ROOT / "sdk" / "app"
IFACE = ROOT / "开发文档" / "5、接口"
OUT_JSON = IFACE / "04-OpenAPI" / "routes_snapshot.json"
OUT_OPENAPI = IFACE / "04-OpenAPI" / "openapi_v3.0.json"
OUT_HTML = IFACE / "05-交互图" / "接口全量分类浏览.html"
SYSTEM_PATHS = {
"/",
"/health",
"/ready",
"/docs",
"/redoc",
"/openapi.json",
"/docs/oauth2-redirect",
"/install.sh",
"/voice",
"/wechat",
"/control",
"/hub",
}
def collect_routes():
sys.path.insert(0, str(SDK_APP))
from main import app # noqa: WPS433
routes = []
for r in app.routes:
if not hasattr(r, "methods") or not hasattr(r, "path"):
continue
for m in sorted(r.methods - {"HEAD", "OPTIONS"}):
routes.append(
{
"method": m,
"path": r.path,
"tags": getattr(r, "tags", None) or [],
"name": getattr(r, "name", ""),
}
)
seen = set()
unique = []
for item in sorted(routes, key=lambda x: (x["path"], x["method"])):
key = (item["method"], item["path"])
if key in seen:
continue
seen.add(key)
unique.append(item)
return unique
def export_openapi():
sys.path.insert(0, str(SDK_APP))
from main import app # noqa: WPS433
spec = app.openapi()
OUT_OPENAPI.write_text(json.dumps(spec, ensure_ascii=False, indent=2), encoding="utf-8")
return len(spec.get("paths", {}))
def render_browse_html(routes: list[dict]) -> str:
groups: dict[str, list] = defaultdict(list)
for r in routes:
if r["path"] in SYSTEM_PATHS:
groups["系统入口"].append(r)
continue
tag = (r["tags"] or ["未分类"])[0]
groups[tag].append(r)
sections = []
for tag in sorted(groups.keys(), key=lambda t: (-len(groups[t]), t)):
items = sorted(set((x["method"], x["path"]) for x in groups[tag]))
rows = "".join(
f"<tr><td><code>{m}</code></td><td><code>{p}</code></td></tr>" for m, p in items
)
sections.append(
f'<section class="cat" data-tag="{tag.lower()}">'
f"<h2>{tag} <span class=\"count\">{len(items)}</span></h2>"
f"<table><thead><tr><th>方法</th><th>路径</th></tr></thead><tbody>{rows}</tbody></table>"
f"</section>"
)
today = date.today().isoformat()
count = len(routes)
return f"""<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>工作手机 SDK · 接口全量分类浏览 ({count})</title>
<style>
:root{{--bg:#0a1628;--card:#0f1f38;--cyan:#00d4ff;--green:#00ff88;--text:#e2e8f0;--muted:#94a3b8;--border:rgba(0,212,255,.12)}}
*{{box-sizing:border-box;margin:0;padding:0}}
body{{font-family:"Noto Sans SC",system-ui,sans-serif;background:var(--bg);color:var(--text);padding:24px;line-height:1.5}}
.wrap{{max-width:1100px;margin:0 auto}}
h1{{font-size:28px;background:linear-gradient(90deg,var(--cyan),var(--green));-webkit-background-clip:text;-webkit-text-fill-color:transparent}}
.meta{{color:var(--muted);font-size:13px;margin:8px 0 20px}}
#q{{width:100%;padding:12px 16px;border-radius:10px;border:1px solid var(--border);background:var(--card);color:var(--text);font-size:15px;margin-bottom:20px}}
.chips{{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:24px}}
.chip{{padding:4px 12px;border-radius:999px;border:1px solid var(--border);font-size:12px;color:var(--muted);cursor:pointer;background:transparent}}
.chip:hover,.chip.active{{border-color:var(--cyan);color:var(--cyan)}}
.cat{{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:16px;margin-bottom:16px}}
.cat h2{{font-size:16px;color:var(--cyan);margin-bottom:10px;display:flex;align-items:center;gap:8px}}
.count{{font-size:12px;color:var(--green);border:1px solid var(--green);padding:1px 8px;border-radius:999px}}
table{{width:100%;border-collapse:collapse;font-size:13px}}
th,td{{border-bottom:1px solid var(--border);padding:8px;text-align:left;vertical-align:top}}
th{{color:var(--muted);font-weight:500}}
code{{font-size:12px;color:#a5d6ff}}
.links{{margin-top:24px;font-size:13px;color:var(--muted)}}
.links a{{color:var(--cyan)}}
</style></head><body><div class="wrap">
<h1>工作手机 SDK · 接口全量分类浏览</h1>
<p class="meta">共 {count} 条 HTTP 路由 · {today} 自动生成 · export_api_catalog.py</p>
<input id="q" type="search" placeholder="搜索路径或分类,如 message / cunke-bao / hook">
<div class="chips" id="chips"></div>
{''.join(sections)}
<div class="links">
<a href="../01-规范与统一层/工作手机API全量接口目录.md">全量目录 MD</a> ·
<a href="存客宝对接架构图.html">存客宝架构图</a> ·
<a href="API架构与交互流程图.html">API 架构图</a>
</div></div>
<script>
const q=document.getElementById('q'), chips=document.getElementById('chips'), cats=[...document.querySelectorAll('.cat')];
const tags=['全部',...new Set(cats.map(c=>c.dataset.tag))];
let active='全部';
tags.forEach(t=>{{const b=document.createElement('button');b.className='chip'+(t==='全部'?' active':'');b.textContent=t;b.onclick=()=>{{active=t;document.querySelectorAll('.chip').forEach(x=>x.classList.remove('active'));b.classList.add('active');filter()}};chips.appendChild(b)}});
function filter(){{
const v=(q.value||'').toLowerCase();
cats.forEach(c=>{{
const text=c.innerText.toLowerCase();
const okTag=active==='全部'||c.dataset.tag===active;
const okSearch=!v||text.includes(v);
c.style.display=(okTag&&okSearch)?'':'none';
}});
}}
q.oninput=filter;
</script></body></html>"""
def main():
routes = collect_routes()
payload = {"count": len(routes), "routes": routes}
OUT_JSON.parent.mkdir(parents=True, exist_ok=True)
OUT_JSON.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8")
path_count = export_openapi()
OUT_HTML.write_text(render_browse_html(routes), encoding="utf-8")
print(f"routes_snapshot: {len(routes)} -> {OUT_JSON}")
print(f"openapi paths: {path_count} -> {OUT_OPENAPI}")
print(f"browse html -> {OUT_HTML}")
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# 工作手机 SDK + 存客宝 BFF 联调冒烟(本地)
# 用法WORKPHONE_SDK_URL=http://127.0.0.1:8899 ./workphone_bff_smoke.sh [device_id]
set -euo pipefail
SDK_URL="${WORKPHONE_SDK_URL:-http://127.0.0.1:8899}"
DEVICE_ID="${1:-}"
echo "SDK: $SDK_URL"
health=$(curl -s -m 5 "${SDK_URL}/health")
echo "health: $health"
if [[ -z "$DEVICE_ID" ]]; then
DEVICE_ID=$(python3 -c "import json,sys; d=json.loads(sys.argv[1]); print((d.get('device_ids') or [''])[0])" "$health")
fi
if [[ -z "$DEVICE_ID" ]]; then
echo "无在线设备,跳过 device 级测试"
exit 0
fi
echo "device_id: $DEVICE_ID"
curl -s -m 5 "${SDK_URL}/api/v3/workbench/overview" | python3 -m json.tool | head -15
curl -s -m 5 "${SDK_URL}/api/v3/devices/${DEVICE_ID}/ai/status" | python3 -m json.tool
curl -s -m 5 -X POST "${SDK_URL}/api/v3/devices/${DEVICE_ID}/ai/task" \
-H 'Content-Type: application/json' \
-d '{"instruction":"冒烟测试:检查微信是否在前台","priority":9}' | python3 -m json.tool
echo "OK — SDK 联调冒烟通过"

View File

@@ -1,7 +1,9 @@
# 工作手机 · 一键接入与存客宝对接操作手册
> **总览请先读**[工作手机·五图总览与使用手册.md](工作手机·五图总览与使用手册.md)v2.1 · 补全包已并入
> **版本**v4.0 (Frida 主控通道版)
> **总览请先读**[工作手机·五图总览与使用手册.md](../工作手机·五图总览与使用手册.md)v2.3
> **接口全量目录**[5、接口/01-规范与统一层/工作手机API全量接口目录.md](../../5、接口/01-规范与统一层/工作手机API全量接口目录.md)328 路由)
> **BFF 映射**[5、接口/02-业务对接/存客宝BFF与工作手机SDK映射表.md](../../5、接口/02-业务对接/存客宝BFF与工作手机SDK映射表.md)
> **版本**v4.1 (Frida 主控 + 接口文档闭环)
> **目标**:实现从“手机插上 Type-C”到“存客宝代码直接控制手机”的端到端闭环主控通道强制走 **Frida Hook**(稳定、快速、无 UI 干扰),失败自动降级到 ADB/无障碍。
> **文档位置**`开发文档/9、手册/工作手机·一键接入与存客宝对接操作手册.md`

View File

@@ -296,12 +296,14 @@ python3 开发文档/6、测试/scripts/wireless_frida_wechat_batch_verify.py
| 命令速查 | [SDK操作手册.md](02-操作指南/SDK操作手册.md) |
| E2E 验收 | [微信消息E2E验证指南.md](03-验证/微信消息E2E验证指南.md) |
| 存客宝对接 | [工作手机·一键接入与存客宝对接操作手册.md](02-操作指南/工作手机·一键接入与存客宝对接操作手册.md) |
| **接口全量目录** | [5、接口/01-规范与统一层/工作手机API全量接口目录.md](../5、接口/01-规范与统一层/工作手机API全量接口目录.md)328 路由) |
| **存客宝 BFF 映射** | [5、接口/02-业务对接/存客宝BFF与工作手机SDK映射表.md](../5、接口/02-业务对接/存客宝BFF与工作手机SDK映射表.md) |
| 接口 OpenAPI | [5、接口/04-OpenAPI/openapi_v3.0.json](../5、接口/04-OpenAPI/openapi_v3.0.json) |
| 进度 | [开发进度总表.md](../10、项目管理/开发进度总表.md) |
以下文档 **已并入本章**,保留文件仅为旧链接锚点,勿再扩写:
- [微信Frida_API契约.md](../5、接口/微信Frida_API契约.md) → 见 §3.1
- [微信Frida_API契约.md](../5、接口/03-Hook与微信/微信Frida_API契约.md) → 见 §3.1
- [微信Frida无线部署与验证说明.md](../8、部署/02-设备Hook/微信Frida无线部署与验证说明.md) → 见 §八
---
@@ -310,7 +312,7 @@ python3 开发文档/6、测试/scripts/wireless_frida_wechat_batch_verify.py
| 日期 | 版本 | 说明 |
|------|------|------|
| 2026-05-24 | **v2.2** | **根目录补全包目录移除**`wechat_hook_bridge.js` 收编 `sdk/agent/hook/`CodeGraph 索引初始化 |
| 2026-05-24 | **v2.3** | **接口全量目录 328 条** + 存客宝 BFF 映射 + 对接架构图OpenAPI 315 paths 重导出 |
| 2026-05-24 | **v2.1** | 附图本地化 fig0609机擎/开发文档总入口对齐 |
| 2026-05-24 | **v2.0** | **补全包 + 微信Frida 补全包全文并入**;九模块路径对齐 `sdk/`RPC 兼容 §七;无线部署 §八;架构/真机附图;去重原型 API |
| 2026-05-24 | v1.2 | 五图为主、正文只补 API/命令/数字 |