Skip to content

feat(workbuddy): 接管控制、一键安装模拟器与执行体验优化 - #114

Merged
VicarDa merged 2 commits into
mainfrom
feat/workbuddy-takeover-emulator
Oct 5, 2026
Merged

VicarDa merged 2 commits into
mainfrom
feat/workbuddy-takeover-emulator

Conversation

@VicarDa

@VicarDa VicarDa commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

概述

在 #112(WorkBuddy 功能优化)基础上,补充接管控制、一键安装 Android 模拟器和执行过程体验优化。本 PR 是叠加在 #112 分支上的 stacked PR,差异只包含本次新增内容;#112 合并后会自动改为合并到 main。只涉及 workbuddy-plugin/。

主要改动

  • 接管后用电脑操作手机:
    • 点「接管设备」后,工作台的手机画面可以直接用鼠标、滚轮和键盘操作:点击、拖动、滚动,右键返回,支持中文输入法和粘贴,下方有「返回 / 主页 / 多任务」快捷按钮。
    • 输入经 scrcpy 控制通道,和视频共用同一连接。
    • 服务端对每个事件都重新检查是否仍在接管、是否为当前绑定的设备;「恢复控制」后输入立即失效。
  • 一键安装 Android 模拟器:
    • 没有 Android 设备时,确认页和「选择设备」弹窗会出现模拟器入口:已有 Android Studio 模拟器时可直接启动;否则在用户勾选同意 Android SDK 许可协议后,安装官方模拟器和 Android 14 系统镜像。
    • 下载来源为 Google 官方或腾讯云公共镜像,先各下载 1 MB 测速;文件大小和 SHA-1 固定为 Google 公布的值,用 curl 下载并支持续传。
    • 全部安装在插件私有目录,不改动已有 SDK 和 ~/.android。
    • 模拟器在后台无窗口启动;启动失败时立即显示模拟器日志中的原因。
    • Windows 会检查硬件虚拟化,不可用时给出开启提示。
  • 聊天不再反复查询:opengui_viewer_status 和 opengui_execute 一次最长等待 10 分钟,在以下情况立即返回,取代每 30 秒一次的轮询:
    • 有步骤完成;
    • 需要用户处理;
    • 任务结束。
  • 运行记录有意义:opengui_act 新增可选的 target 字段(如「搜索框」),运行记录和报告显示「点击「搜索框」」「在「用户名」输入文本(7 字)」;不记录输入的文字。
  • 报告按执行步骤整理:
    • Markdown 结构:
      • 开头一句结论加概要表(状态、时间、用时、设备、模型、步骤完成数、操作次数);
      • 按任务清单逐步列出操作明细,并附该步最后的截图;
      • 附录为完整执行记录表和截图证据。
    • PDF 和 Word 支持表格、列表、结论和内嵌截图。
  • 执行时的鼠标动画:参考 CoreMateDesktop2 画布,在工作台手机画面上显示:
    • 点击:指针移动加扩散波纹;
    • 滑动:轨迹与箭头;
    • 按键和输入:标签提示。
  • 打开控制台:
    • 任务结束时,对话末尾附「打开控制台」链接。链接带由本地私有密钥签名的口令,工作台使用固定端口,被占用时自动退回随机端口。
    • 关闭侧边栏或后台进程重启后,仍可从归档恢复只读的任务页。
  • 发布包清理:构建前清空 lib/,避免旧编译产物打进安装包;测试中的模型名改为中性名称。

验证

  • npm run check:58 个测试文件、459 个用例,构建和发布校验均通过。
  • npm run pack:release、scripts/test-publish.mjs、npm run test:native:通过。
  • npm audit --omit=dev --audit-level=moderate:0 个漏洞。
  • 在 Android 13 模拟器上端到端走通:
    • 接管控制:点击计数从 0 变为 2,输入「qa_demo你好」、退格、右键返回均正常,恢复控制后输入被拒绝。
    • 模拟器:私有目录启动 21 秒就绪,页面上启动后约 12 秒出现在设备列表;本地服务上实测下载、续传、校验和解压。
    • 鼠标动画:点击波纹和滑动轨迹正常显示。
    • 报告与控制台链接:生成报告的 Markdown 和 PDF 格式正确,控制台链接在后台重启后可从归档恢复。
  • 已扫描发布包和本 PR 改动,未发现个人路径、邮箱、密钥或内网地址。

🤖 Generated with Claude Code

VicarDa and others added 2 commits October 4, 2026 23:59
- Takeover control: while the person has taken over (接管设备), the live
  workbench picture takes mouse, wheel and keyboard input (Chinese IME,
  paste, Back/Home/AppSwitch) through scrcpy's control socket on the same
  stream; every event is re-checked server-side for takeover and the
  bound device.
- One-click Android emulator from the device pickers: start an existing
  Android Studio AVD, or install the official emulator and an Android 14
  Google APIs image after explicit license acceptance. Archives come from
  Google or the public Tencent Cloud mirror, pinned to Google's sizes and
  SHA-1s, with resumable curl downloads into the plugin's private state;
  boots headless and fails fast with the emulator's own reason.
- Event-driven waits: opengui_viewer_status and opengui_execute wait up
  to 10 minutes but return at the next settled step or when the person
  must act, replacing 30-second polling in chat.
- Run log: optional opengui_act `target` (e.g. 搜索框) gives labels such
  as 点击「搜索框」 for a few tokens; never typed text.
- Report: organized by TODO steps with a summary table, per-step actions
  and last screenshot, and appendix tables; PDF/DOCX render tables,
  bullets, the conclusion and inline screenshots.
- Device action cursor: tap ripple, swipe trail and key labels on the
  workbench phone, ported from CoreMate's canvas.
- 打开控制台: chat ends with a signed console link that reopens the task's
  workbench, restoring a read-only view from the archive after the side
  panel was closed or the broker restarted.
- Release hygiene: the build clears lib/ first so stale outputs cannot
  ship; test fixtures use neutral model names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the current local execution loop, the investigation of CoreMate's
cloud phone execution (test-only, desktop-coupled), and the backend and
plugin work needed before CoreMate models can run in the cloud.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VicarDa
VicarDa deleted the branch main October 5, 2026 14:54
@VicarDa VicarDa closed this Oct 5, 2026
@VicarDa VicarDa reopened this Oct 5, 2026
@VicarDa
VicarDa changed the base branch from feat/workbuddy-feature-optimization to main October 5, 2026 14:57
@VicarDa
VicarDa merged commit 9d6c4cf into main Oct 5, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant