Desktop Agent 适配器
wesgine 的 Desktop Agent 适配器提供桌面自动化能力,是三层浏览器/桌面架构的第三层。
定位
Desktop Agent 运行在客户端物理设备上(AX-5 物理边界公理),提供截屏、剪贴板、应用启动等原生桌面操作能力。
CellSpec 声明
CellSpec{
Desktop: &DesktopConfig{
Command: "/path/to/device-agent",
Transport: "stdio", // stdio 或 sse
},
}
传输协议
| 传输 | 场景 |
|---|---|
stdio | 本地桌面(wesclaw / wescode) |
sse | 远程桌面(teleclaw:员工 PC 装 device-agent 监听,Cell 拨号) |
API 端点
GET /cells/{id}/desktop/status Desktop Agent 连接状态
Cell Handle
cell.Desktop() → DesktopHandle
代码共享
wesgine 提供 adapter/desktop/ 的 adapter 代码(共享维护),但 Desktop 二进制运行在客户端——运行时隔离。
各产品负责编译和分发 device-agent 二进制:
- wesclaw:
apps/desktop/deviceagent/原生二进制 - wescode:IDE JSON-RPC Device Agent(HostEnvironment hook)
- wescraft:
internal/deviceagent/Electron device agent
能力范围
典型 MCP tools:
- 截屏(screenshot)
- 剪贴板读写(clipboard_read/write)
- 应用启动(open_app)
- 系统通知(notify)
- 文件定位(show_file)
超出范围
摄像头、USB、SystemTray 等硬件外设不在 wesgine Desktop Agent 范围内。
反模式
| 禁止 | 正确做法 |
|---|---|
| 在服务端运行 Desktop Agent | 客户端运行(AX-5) |
| 手写 MCP Upsert 注册 device-agent | CellSpec.Desktop 声明式 |
| 跨 Cell 共享 Desktop Agent | Per-Cell 连接 |
| Desktop Agent 绕过治理链 | 通过 MCP 协议走 Cell 治理 |