dsh-builtin-browser 0.5.6 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/README.en.md +75 -81
  3. package/README.md +75 -82
  4. package/client.js +831 -384
  5. package/desktop-bridge/install-and-start.cmd +4 -5
  6. package/desktop-bridge/install.mjs +322 -141
  7. package/desktop-bridge/maintenance-progress.ps1 +166 -0
  8. package/desktop-bridge/plugin-browser-bridge.js +157 -19
  9. package/desktop-bridge/request-desktop-quit.ps1 +170 -0
  10. package/docs/tool-reference.md +20 -1
  11. package/docs/user-guide.md +28 -4
  12. package/lib/browser/runtime.d.ts +3 -1
  13. package/lib/browser/runtime.js +9 -0
  14. package/lib/browser/types.d.ts +42 -0
  15. package/lib/browser-electron/authenticated-route.d.ts +27 -0
  16. package/lib/browser-electron/authenticated-route.js +39 -0
  17. package/lib/browser-electron/automatic-maintenance.d.ts +41 -0
  18. package/lib/browser-electron/automatic-maintenance.js +426 -0
  19. package/lib/browser-electron/bridge-auto.d.ts +93 -0
  20. package/lib/browser-electron/bridge-auto.js +113 -0
  21. package/lib/browser-electron/bridge-connection.d.ts +0 -2
  22. package/lib/browser-electron/bridge-connection.js +2 -4
  23. package/lib/browser-electron/bridge-endpoint.js +8 -19
  24. package/lib/browser-electron/bridge-install.d.ts +85 -0
  25. package/lib/browser-electron/bridge-install.js +211 -0
  26. package/lib/browser-electron/bridge-maintenance.d.ts +24 -0
  27. package/lib/browser-electron/bridge-maintenance.js +125 -0
  28. package/lib/browser-electron/bridge-status.d.ts +10 -3
  29. package/lib/browser-electron/bridge-status.js +74 -24
  30. package/lib/browser-electron/desktop-bridge-host.d.ts +11 -5
  31. package/lib/browser-electron/desktop-bridge-host.js +67 -25
  32. package/lib/browser-electron/desktop-identity.js +21 -9
  33. package/lib/browser-electron/electron-provision.d.ts +1 -1
  34. package/lib/browser-electron/electron-provision.js +36 -13
  35. package/lib/browser-electron/entry.js +173 -67
  36. package/lib/browser-electron/ephemeral-profile.js +67 -26
  37. package/lib/browser-electron/history-store.js +2 -2
  38. package/lib/browser-electron/host-main.js +48 -38
  39. package/lib/browser-electron/http-body.d.ts +24 -0
  40. package/lib/browser-electron/http-body.js +33 -0
  41. package/lib/browser-electron/json-reply.d.ts +13 -1
  42. package/lib/browser-electron/json-reply.js +16 -2
  43. package/lib/browser-electron/maintenance-broker.d.ts +35 -0
  44. package/lib/browser-electron/maintenance-broker.js +114 -0
  45. package/lib/browser-electron/maintenance-lifecycle.d.ts +32 -0
  46. package/lib/browser-electron/maintenance-lifecycle.js +67 -0
  47. package/lib/browser-electron/maintenance-route.d.ts +18 -0
  48. package/lib/browser-electron/maintenance-route.js +75 -0
  49. package/lib/browser-electron/paths.d.ts +4 -0
  50. package/lib/browser-electron/paths.js +19 -0
  51. package/lib/browser-electron/process.d.ts +14 -0
  52. package/lib/browser-electron/process.js +24 -0
  53. package/lib/browser-electron/provider.d.ts +16 -9
  54. package/lib/browser-electron/provider.js +87 -18
  55. package/lib/browser-electron/remote-host.js +22 -20
  56. package/lib/browser-electron/runtime-route.d.ts +3 -5
  57. package/lib/browser-electron/runtime-status.d.ts +27 -13
  58. package/lib/browser-electron/runtime-status.js +28 -6
  59. package/lib/browser-electron/settings-route.d.ts +5 -18
  60. package/lib/browser-electron/settings-route.js +4 -14
  61. package/lib/browser-electron/settings-store.d.ts +28 -0
  62. package/lib/browser-electron/settings-store.js +32 -2
  63. package/lib/browser-electron/sidebar-only-host.d.ts +36 -0
  64. package/lib/browser-electron/sidebar-only-host.js +192 -0
  65. package/lib/browser-electron/system-browser.d.ts +6 -11
  66. package/lib/browser-electron/system-browser.js +29 -24
  67. package/lib/browser-electron/timing.d.ts +8 -0
  68. package/lib/browser-electron/timing.js +13 -0
  69. package/lib/browser-electron/windows-system.d.ts +3 -0
  70. package/lib/browser-electron/windows-system.js +19 -0
  71. package/lib/tool-browser/index.js +1045 -7
  72. package/lib/tool-browser/page-probe.d.ts +86 -0
  73. package/lib/tool-browser/page-probe.js +460 -0
  74. package/package.json +5 -3
  75. package/scripts/run-tests.mjs +32 -0
  76. package/scripts/verify-preview-route.mjs +19 -1
  77. package/scripts/verify-runtime-status.mjs +14 -0
  78. package/skills/dsh-builtin-browser/SKILL.md +64 -0
  79. package/skills/dsh-builtin-browser/references/batch.md +23 -0
  80. package/skills/dsh-builtin-browser/references/deliver.md +31 -0
  81. package/skills/dsh-builtin-browser/references/locate.md +11 -0
  82. package/skills/dsh-builtin-browser/references/recover.md +11 -0
  83. package/skills/dsh-builtin-browser/references/verify.md +13 -0
  84. package/src/browser/runtime.ts +11 -0
  85. package/src/browser/types.ts +19 -0
  86. package/src/browser-electron/authenticated-route.ts +56 -0
  87. package/src/browser-electron/automatic-maintenance.ts +414 -0
  88. package/src/browser-electron/bridge-auto.ts +158 -0
  89. package/src/browser-electron/bridge-connection.ts +2 -4
  90. package/src/browser-electron/bridge-endpoint.ts +8 -18
  91. package/src/browser-electron/bridge-install.ts +253 -0
  92. package/src/browser-electron/bridge-maintenance.ts +161 -0
  93. package/src/browser-electron/bridge-status.ts +76 -26
  94. package/src/browser-electron/desktop-bridge-host.ts +60 -26
  95. package/src/browser-electron/desktop-identity.ts +18 -9
  96. package/src/browser-electron/electron-provision.ts +35 -14
  97. package/src/browser-electron/entry.ts +152 -62
  98. package/src/browser-electron/ephemeral-profile.ts +65 -28
  99. package/src/browser-electron/history-store.ts +2 -2
  100. package/src/browser-electron/host-main.ts +40 -34
  101. package/src/browser-electron/http-body.ts +42 -0
  102. package/src/browser-electron/json-reply.ts +18 -3
  103. package/src/browser-electron/maintenance-broker.ts +142 -0
  104. package/src/browser-electron/maintenance-lifecycle.ts +86 -0
  105. package/src/browser-electron/maintenance-route.ts +64 -0
  106. package/src/browser-electron/paths.ts +21 -0
  107. package/src/browser-electron/process.ts +23 -0
  108. package/src/browser-electron/provider.ts +106 -22
  109. package/src/browser-electron/remote-host.ts +23 -23
  110. package/src/browser-electron/runtime-route.ts +3 -5
  111. package/src/browser-electron/runtime-status.ts +56 -19
  112. package/src/browser-electron/settings-route.ts +9 -32
  113. package/src/browser-electron/settings-store.ts +59 -3
  114. package/src/browser-electron/sidebar-only-host.ts +199 -0
  115. package/src/browser-electron/system-browser.ts +26 -23
  116. package/src/browser-electron/timing.ts +16 -0
  117. package/src/browser-electron/windows-system.ts +23 -0
  118. package/src/tool-browser/index.ts +995 -10
  119. package/src/tool-browser/page-probe.ts +474 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,154 @@
2
2
 
3
3
  本文件记录各轮功能开发与问题修复(由仓库外独立文档迁入,随仓库管理)。
4
4
 
5
+ ## 0.5.8(2026-11-07)
6
+
7
+ ### 五项已确认基线问题的修复与集成验收
8
+
9
+ - Chrome/Edge 安静模式不再覆盖有界面设置:由 `browser.headless` 单独决定窗口是否存在,安静模式继续只控制激活、展示与标签选择。
10
+ - 桥接卸载不再假成功:当 Electron 实际加载的入口仍含桥接片段时,返回 `INCOMPLETE` 与非零退出码;其它插件的补丁和原始备份仍逐字节保留。
11
+ - 远程观看在存在多个会话时提供简洁的会话选择,默认观看最近创建的会话,不再固定取会话列表第一项。
12
+ - 观看循环按代次隔离并中止在途请求:停止、切换会话、停止后重开与重复点击都只保留一条截图循环,旧帧不再被绘制。
13
+ - 临时浏览器配置清理改以整棵目录树内最近一次写入为判据:根目录时间很旧但嵌套文件仍在写入时保留配置;遍历不可证实也一律保留。
14
+ - 新增 8 项对应以上缺陷的行为回归测试;全套检查 789 项、788 通过、0 失败、1 跳过。
15
+ - 集成链路以单一总控按序跑通 10 个阶段:真实桥接安装 → 重装 → 其它插件补丁下的卸载(如实报未完成)→ 人工修复后干净卸载 → 安装并自动重启 → 重启后再次卸载 → 真实 Edge 安静模式窗口 → 真实 Electron 侧栏 17/17 → 真实渲染进程中的远程观看切换/停止/重开 → 活跃写入的临时配置清理;跨阶段一致性检查全部通过。
16
+
17
+ 验收边界:以上结论只覆盖本次已验证的场景(隔离安装树、项目内置 Electron、本机 Edge/Chromium、受控会话与帧服务)。未覆盖真实 DSH 安装目录的一键维护、真实 LAN/隧道远程观看、全部浏览器与宿主版本组合,以及其它操作系统。
18
+
19
+ ### 侧栏首次打开与标签绑定
20
+
21
+ - 选择 DSH 侧栏后,打开网址会显示目标会话、展开侧栏并初始化真实浏览器页面;连接丢失后继续重连侧栏。
22
+ - 安静模式保留系统前台窗口和鼠标位置,同时支持显式打开网址与切换侧栏标签。
23
+ - 桥接协议按逻辑页面绑定原生标签,支持同网址的多个独立页面,缓存页面再次导航时展开折叠的侧栏。
24
+ - 被动预览只读取已绑定页面,导航前的文档探测只使用已有 guest;销毁后的延迟初始化响应保留销毁状态。
25
+ - 侧栏文字和按键通过目标 guest 的原生输入接口发送,修复新增标签输入丢失及误投邻页;保持系统焦点和鼠标位置。
26
+ - 侧栏下载使用目标页面的浏览器会话,将数据分段写入临时文件并排他提交到用户指定位置,支持登录 Cookie、大小限制和失败清理。
27
+
28
+ ### 桥接维护期间的独立进度提示
29
+
30
+ - 点击维护按钮立即显示准备状态,握手期间按钮显示忙碌状态。
31
+ - 独立进度窗跨桌面退出和重启显示当前阶段与总用时,完成后自动收起,失败或取消时保留结果。
32
+ - 进度窗跟随界面语言,保持后台显示,关闭后维护继续运行。
33
+
34
+ ### 修复 Electron Node 模式安装桥接时的归档自锁
35
+
36
+ - 安装器统一使用原始文件接口完成目录探测、归档校验、解包与重命名,修复普通 Electron 文件探测缓存归档句柄后导致的 `EBUSY`。
37
+ - 桥接状态读取使用原始归档存在检查,读取状态后继续允许维护进程移动归档。
38
+ - 维护诊断合并重复的错误和安装输出,保留额外的恢复错误信息。
39
+ - 在 Electron 44.7 / Node 24.21 下完成官方完整归档的安装与还原验证,22,102 个文件解包后成功切换归档,恢复后的哈希一致。
40
+
41
+ ### Windows 桌面端一键维护与环境检测
42
+
43
+ - 安装、修复、重装和卸载按钮由独立 Windows 维护进程协调正常退出、文件维护与自动重启,安装成功通过新进程的鉴权桥接连接确认。
44
+ - 正常退出使用原生菜单的无障碍调用;进行中的任务继续使用 DSH 原有的退出确认,取消退出会取消维护。阶段和结果跨宿主重启保存。
45
+ - 环境检查直接报告已找到的 Chrome / Edge、内置运行时与侧栏桥状态,自动模式显示选中的载体。
46
+ - 浏览器下拉菜单按内容设置宽度,选项保持单行;静态状态行保持普通背景。
47
+
48
+ ### 桥接维护保留当前宿主会话(2026-11-06)
49
+
50
+ - 退出后维护取代此前的宿主内关闭、强制终止和 detached 交接重启方案。安装器在写入前检查目标桌面端已退出,并拒绝来自目标 GUI 祖先进程的调用。
51
+ - 插件启动时的自动安装路径已移除,`bridge.autoInstall` 默认关闭,旧配置中的开启值也保留当前运行会话。
52
+ - 安装器的文件维护接口保留最终结果和错误原因;上方显式维护流程负责桌面端的退出和重新启动。
53
+ - 手动维护按钮继续显示,诊断始终提供外部终端命令,包括已安装状态。
54
+ - Windows 进程枚举使用 UTF-8,并隐藏子进程窗口;归档读取和解包在成功与失败路径均释放文件句柄。
55
+ - 桥接状态核对部署模块的存在和内容,旧副本及缺失副本显示修复入口,安装目录按 DSH 身份核验。
56
+
57
+ ### 设置入口完整性与坐标操作命名
58
+
59
+ - 自动浏览器模式恢复登录状态保留和窗口模式入口,这两项在自动选择 Chrome / Edge 时继续使用原有配置。
60
+ - 页面定位更名为坐标点击与拖拽,选项改为允许和禁止,保留 `auto` / `nonVisual` 配置值。
61
+ - 登录状态保留选项补充重启后生效提示。
62
+
63
+ ### 恢复设置面板的桥接管理入口
64
+
65
+ - 就绪状态下方显示安装、修复或重新安装桥接按钮,已安装时在诊断中提供卸载入口。
66
+ - 点击后调用安装接口,在目标桌面端退出后校验并执行文件维护;操作期间锁定按钮,完成后刷新状态。
67
+ - 显示安装器返回的失败原因,并覆盖 HTTP 成功但安装失败的结果。
68
+
69
+ ## 0.5.7(2026-11-05)
70
+
71
+ ### 适配 DSH 0.2.2-alpha.3:插件路由改用宿主会话鉴权
72
+
73
+ 新版本把插件 HTTP 路由收进了宿主的浏览器会话鉴权:没有有效会话的请求一律拒绝。本版把所有插件路由(预览帧、预览会话列表、桥状态、桥动作、就绪状态、就绪准备、设置)统一包进 `authenticatedRoute`,由宿主 `connection.authorizeIndex` 决定放行;拿不到该服务时返回 `503 browser-auth-unavailable`,而不是悄悄放行。原有的同源检查保留在 handler 里,作为第二道边界。
74
+
75
+ 两个探针同步更新:`verify-runtime-status.mjs` 现在注册一个 `connection` 桩再发请求(它验的是我们的 handler,不是宿主的 cookie);`install.mjs` 新增 `--preflight`,身份核验不再需要动归档。
76
+
77
+ ### 侧栏首次导航与延迟初始化(#47)
78
+
79
+ - 导航前的文档探测只读取当前 handle 已附着的 guest,首次导航直接使用带 URL 的初始化预算。
80
+ - guest 在预算内尚未出现时返回 `panel-initializing`,保留连接、会话和原始错误;guest 稍后出现后可重试。旧 bridge 的 `produced no page` 回复也按此方式处理。
81
+ - 创建浏览器标签后记录对应的标签 ID,展开、选中和后续 guest 轮询均定位到该标签。等待期间复用同一标签。
82
+ - 显式 `panel-unusable` 继续触发载体切换。
83
+
84
+ 验证包含真实 Electron、真实 webview 与最小侧栏服务的隔离对照:原版 0.5.6 复现 `bridge closed`,修复版在 guest 延迟 5.5 秒附着后完成导航,guest 延迟 22 秒时仍可在首次预算耗尽后重试恢复。完整自动检查 578 项,577 通过、1 项因环境跳过。
85
+
86
+ > 主题:**把工具面补齐**。读完 DSH 市场里 174 个 browser 类插件的代码后(`dsh-browser/04-`),缺的不是驱动能力,是**批量、观测、断言**这三类"用起来省"的工具。
87
+
88
+ ### 九个新工具,全部建立在一个页面探针上
89
+
90
+ 探针用 `execute` 注入页面(幂等、按版本覆盖),因此**三种载体行为一致**:自托管窗口、驱动中的 Chrome/Edge、桌面侧栏。没有改宿主、没有改桥协议——走 CDP 事件捕获要同时改三个载体和桥,而探针当天就能在所有载体上工作。
91
+
92
+ | 新工具 | 解决什么 |
93
+ | --- | --- |
94
+ | `dsh_browser_do` | 一次调用跑一串步骤(open/tap/field/type/key/scroll/sleep_ms/wait_text/wait_gone/wait_url/wait_idle/eval/check),失败即停并指出第几步;等待基于条件;`tap` 被 cookie 横幅盖住时先关掉它 |
95
+ | `dsh_browser_console` | 页面控制台最新若干行(按 level、可过滤、可清空) |
96
+ | `dsh_browser_network` | fetch/XHR/资源计时行:方法、状态、地址、耗时;`onlyFailures` |
97
+ | `dsh_browser_wait_for_response` | 等**本次调用之后**到达的响应——"提交到底有没有到服务器",截图答不了 |
98
+ | `dsh_browser_assert` | 一次断言 selector/text/url/js,逐条给证据 |
99
+ | `dsh_browser_dialog` | alert/confirm/prompt 记录 + 自动应答(默认 dismiss),`confirm()` 不再冻住一次调用 |
100
+ | `dsh_browser_drag` | 视口内拖拽(pointer+mouse 合成事件) |
101
+ | `dsh_browser_doctor` | 自检:URL、在飞请求、静默时长、探针状态、本任务被限制掉哪些工具 |
102
+ | `dsh_browser_help` | 主题索引(locate/wait/batch/dialogs/network/verify/recovery/limits) |
103
+
104
+ 命名踩到一次真实碰撞:断言工具最初叫 `dsh_browser_check`,与**表单勾选**的 `dsh_browser_check` 重名——宿主拒绝重复名,那条注册被静默跳过。改名 `dsh_browser_assert`,并把全部新名字补进 `restrict-policy` 的注册清单。
105
+
106
+ ### 边界写清楚
107
+
108
+ - 探针看到的是**页面能看到的东西**:fetch/XHR 有状态码,资源计时行没有(记 0);浏览器自己的弹窗(`beforeunload`、HTTP 认证、权限提示)不在覆盖范围
109
+ - `drag` 是页面内合成手势,只认 `isTrusted` 的 canvas 页面仍用 `click_sequence` 的坐标点击
110
+ - `do` 的 `eval` 步骤仍然过 `execute` 的设置门控(模型打不开)
111
+
112
+ ### 测试
113
+
114
+ `tests/page-probe.test.mjs`(10 条,真跑探针):二次安装保留缓冲、fetch 状态与拒绝透传、弹窗按策略应答、settle/clear、find 命中与未命中、overlayAt 的"挡路者 + 关闭键"、无探针时返回错误、拖拽事件顺序。全量 510 → 520,`tsc` 干净。
115
+
116
+ ### 桥:从"给你一条命令"改成"面板里一个按钮"
117
+
118
+ 本节记录当时的实现。当前维护策略见上方 2026-11-06 的宿主会话保护修复,原有 `--restart --yes` 宿主内重启流程已被替代。
119
+
120
+ 原来面板只把修复命令印出来,让用户自己去终端跑。这一步会**关闭并重启桌面端**,手工跑半个(cwd 不对、node 不对、路径带空格引号掉了)就会把外壳留在更难诊断的状态。
121
+
122
+ - 新端点 `POST /dsh-builtin-browser/bridge-action`(`{action:"install"|"uninstall"}`),**按写操作准入**(`sameOrigin(request, true)`):它会停掉外壳,不该和读取同一把尺子
123
+ - 新模块 `bridge-install.ts`:只负责拼 `install.mjs <root> [--revert] --restart --yes` 并回收退出码,所有打补丁/备份/身份校验仍然在安装器里,和人工跑的是**同一个文件**
124
+ - 就绪区按钮:`安装 / 修复桥`、`卸载桥`(已安装时出现),处理中提示"桌面端会自动关闭再打开",完成后重读状态
125
+ - 失败不吞:退出码与输出尾部一起回给面板,并附上可复现的完整命令行
126
+
127
+ 真机验证(未触发安装,避免关掉桌面端):无浏览器头 POST → **403**;非法 action → **400** `action must be "install" or "uninstall"`;坏 JSON → **400** 带解析原因。测试 `tests/bridge-install.test.mjs` **6/6**:两种 argv、成功/失败/起不来的映射、超长输出只留尾部。
128
+
129
+ ### 交付:下载之后交给 MCP 工具(设置里由人决定)
130
+
131
+ 下载先落本地,再由用户在设置里指定的 MCP 工具接手(飞书 `lark_drive_upload`、百度网盘自己的上传工具)。**留空 = 与之前逐字相同**,行为零漂移。
132
+
133
+ - 设置文档新增 `delivery`:`tool`(工具名,空=只存本地)、`args`(`{path}`/`{name}`/`{size}` 模板)、`onFail`(`keep-local` / `stop`)、`sites`(按 host 覆盖)
134
+ - 面板新增「交付」一节:工具名、参数模板、失败策略、站点覆盖,中英文案随语言切换
135
+ - 失败语义写死:远程失败时**本地路径与远程错误同时报**;`stop` 则整体报错并写明"已存到哪";工具名写错不会静默降级
136
+ - 工具名走 `/^[A-Za-z0-9_.-]+$/` 校验,`args`/`sites` 只收字符串映射——手改配置写坏不会把整份文档顶掉
137
+
138
+ 测试 `tests/delivery.test.mjs`(5 条):留空零漂移、填了就交且两边都报、远程失败保留本地并说明、`stop` 报错带本地路径、站点覆盖优先于默认。全量 **520 → 525**。
139
+
140
+ ### 再补四个工具 + 一个 skill 层
141
+
142
+ | 新工具 | 说明 |
143
+ | --- | --- |
144
+ | `dsh_browser_upload` | 把**工作区内**的本地文件塞进 `input[type=file]`:Node 侧读字节 → base64 → 页面里重建 `File` + `DataTransfer` → 触发 input/change。20 MB 上限,超限直接拒(不截断);工作区外的路径一律拒绝 |
145
+ | `dsh_browser_hover` | 悬停让菜单/tooltip 出现(JS 驱动的菜单会开;纯 CSS `:hover` 需要真实指针) |
146
+ | `dsh_browser_find` | 页内查找(Ctrl+F 等价),返回片段与视口坐标 |
147
+ | `dsh_browser_state` | 一次调用回答"现在屏幕上是什么":URL/标题/加载态/在飞请求/静默时长/输入框·按钮·链接数量/滚动/选区/前 400 字 |
148
+
149
+ **skill 层**:`skills/dsh-builtin-browser/SKILL.md` + `references/{locate,batch,verify,recover}.md`——对标 BrowserSkill 那类"只带文档也值钱"的形态,把"什么时候用哪个工具、失败怎么退"写进按需加载的 skill,而不是只放在给人看的 docs 里。`package.json` 的 `files` 已带上 `skills`。
150
+
151
+ `pdf` **没有做**:它需要 `Page.printToPDF` → 经过 provider 和三种载体,还要接上保存路径准入;工具层绕不过去。留作下一批的第一件。
152
+
5
153
  ## 0.5.6(2026-11-03)
6
154
 
7
155
  > 主题:**"装好即可用"变得可见、可修**。0.5.3 把 Electron 运行时下载从安装里搬到了首次需要时,这是对的(否则默认 pnpm 的 profile 直接装不上);代价是**新装后的头一分钟里,第一个浏览器调用可能撞上仍在进行的下载而失败,而这件事在界面上没有任何痕迹**——只有一行日志。这个版本把"现在能不能用"变成一个可读的状态,并给了唯一的那个修复按钮。
package/README.en.md CHANGED
@@ -8,42 +8,37 @@
8
8
 
9
9
  <p align="center"><sub><a href="README.md">中文</a> · English</sub></p>
10
10
 
11
- <h3 align="center">A <b>shared real browser</b> plugin for DeepSeek Harness</h3>
11
+ # Browser plugin for DeepSeek Harness
12
12
 
13
- <h4 align="center">The agent drives a real, visible browser you can take over at any moment — <b>one page</b>, not a casting of it.</h4>
13
+ Use DSH to open pages, read content, fill forms, and download files in the bundled browser, the desktop sidebar, or a local installation of Chrome or Edge. Each task has its own tabs and action history. In a visible window or the desktop sidebar, you can take over the page the agent is using.
14
14
 
15
- ## What it is
15
+ This feature list matches **0.5.8** (compatible with DSH 0.2.2-alpha.3: plugin routes go through the host session auth). [Changelog](CHANGELOG.md)
16
16
 
17
- - **A real browser, not a remote view.** On the desktop it drives the official sidebar panel; when that is unavailable it uses the plugin's own window; you can also point it at your installed **Chrome / Edge**.
18
- - **Same page for both sides.** What the agent sees and acts on is what is on your screen, so you can take over mid-task.
19
- - **Works once installed.** **35 tools** under `dsh_browser_*`: open, read, click, fill, screenshot, download, credentials. No extra wiring.
20
- - **Isolated per task.** Each task gets its own tabs and history.
17
+ ## Quick start
21
18
 
22
- ## Install
19
+ **First, which side are you on** — these are two separate installs; updating one does not update the other, and they host the browser differently.
23
20
 
24
- The two surfaces are separate installs: **updating one does not update the other**.
21
+ > **Updating an installed plugin takes two steps** (since DSH 0.2.1-alpha.2, installing over an installed package fails outright with `already-installed`): run `dsh plugin --profile <profile> remove dsh-builtin-browser` first, then `add` the target version. See the [user guide](docs/user-guide.md) (Chinese).
25
22
 
26
- Updating an installed plugin takes two steps (since DSH 0.2.1-alpha.2 a second `add` reports `already-installed`):
23
+ ### DSH Desktop
27
24
 
28
25
  ```sh
29
- dsh plugin --profile <profile> remove dsh-builtin-browser
30
- dsh plugin --profile <profile> add dsh-builtin-browser@0.5.6
26
+ dsh plugin --profile desktop add dsh-builtin-browser
31
27
  ```
32
28
 
33
- ### Desktop
29
+ When the desktop shell provides a controllable `<webview>` and the bridge is installed, the plugin drives the **official side panel**: the agent operates the very page you see. Otherwise it falls back to the plugin's own Electron window.
34
30
 
35
- ```sh
36
- dsh plugin --profile desktop add dsh-builtin-browser
37
- ```
31
+ The sidebar bridge is installed into **the desktop app's own install directory**. On Windows Desktop, open **Settings → Browser** and select **Install and restart**. The action exits Desktop normally, installs the bridge, reopens Desktop, and verifies the new bridge connection. DSH retains its own confirmation for running tasks.
38
32
 
39
- Driving the **official sidebar** panel additionally needs a bridge inside the desktop app's own install directory (optional; without it the plugin opens its own window):
33
+ For terminal installation, save your task and exit DSH Desktop completely, including its tray process, then run this from the plugin directory:
40
34
 
41
35
  ```sh
42
- node desktop-bridge/install.mjs "<DSH Desktop install dir>" --restart
43
- # or double-click desktop-bridge/install-and-start.cmd
36
+ node desktop-bridge/install.mjs "<DSH Desktop install directory>"
44
37
  ```
45
38
 
46
- Do not install while the desktop app is running: the archive is in use and `rename` fails with `EBUSY`. A desktop upgrade invalidates the bridge (`bridge-status` reports `stale`); re-running the same command repairs it.
39
+ Start DSH Desktop after installation. On Windows, `desktop-bridge/install-and-start.cmd` installs and starts the app after Desktop has exited. The settings action uses an independent maintenance process; the installer verifies the closed target, its identity, and backups before writing files.
40
+
41
+ > **The bridge is optional**: without it, the plugin uses a standalone window. **Reinstall the bridge with the new script after plugin or desktop shell upgrades** — a desktop update restores `app.asar`, the bridge goes stale, and `bridge-status` reports `stale`. The state is visible at the top of the panel. See [carrier limitations](docs/limitations.md) (Chinese).
47
42
 
48
43
  ### Web (`dsh web`)
49
44
 
@@ -51,93 +46,92 @@ Do not install while the desktop app is running: the archive is in use and `rena
51
46
  dsh plugin --profile web add dsh-builtin-browser
52
47
  ```
53
48
 
54
- The web surface has no sidebar and no bridge: the plugin hosts its own window (titled `dsh-browser`) with an address bar, back/forward/reload and a tab strip — usable as an ordinary browser.
49
+ There is **no side panel and no bridge** on the web side: the shared browser is **self-hosted** in a standalone window (titled `dsh-browser`) with a full toolbar (address bar, back/forward/reload, tab strip) you can use like any browser.
55
50
 
56
- > **Nothing has to be prepared by hand.** Since 0.5.3 the package carries no install-time script: the Electron runtime is fetched the first time it is actually needed, and a failed fetch only affects the bundled carrier — the desktop sidebar and an installed Chrome / Edge keep working. Since 0.5.6 the settings page opens with a **Readiness** section that says which carrier is in use, whether the runtime is ready / downloading / failed (with the reason), and what state the desktop bridge is in; when preparation failed, the **Prepare the bundled browser** button there retries it — no terminal needed. `npx --no dsh-browser-install-electron` (inside the profile directory) is for pre-provisioning an offline image or CI. See the [user guide](docs/user-guide.md).
51
+ > Since 0.5.3 nothing is downloaded at install time and there is no `postinstall`: the runtime is prepared in the background on first need. Progress and retry live in **Settings → Browser** (use **Prepare the bundled browser** after a failure). To prepare it ahead of time (offline images, CI), run `npx --no dsh-browser-install-electron` from that profile directory (network required). See the [setup guide](docs/user-guide.md#准备-electron-二进制) (Chinese).
57
52
 
58
- ### Then
53
+ ### Both sides
54
+
55
+ Once installation is complete, ask the agent:
59
56
 
60
57
  ```
61
- Open https://example.com and summarise the main content.
58
+ Open https://example.com and summarise the main content for me.
62
59
  ```
63
60
 
64
- ## Carriers: chosen automatically, or pinned
65
-
66
- | Carrier | When |
67
- | --- | --- |
68
- | Desktop sidebar | The shell exposes a drivable `<webview>` and the bridge is installed (preferred) |
69
- | Self-hosted window | Sidebar unavailable, no bridge, or always on the web surface |
70
- | Installed Chrome / Edge | Pinned in settings |
71
-
72
- Two sidebar cases used to require a human first — the column not being open, and the conversation not being the displayed one. Since 0.5.2 the plugin handles both: it opens the column when it was never opened, and asks the shell to display a conversation requested from the background. Trade-offs are in [limitations](docs/limitations.md).
61
+ The browser window appears with the first call, and you can operate in it yourself at any point. **Either side can be pointed at your own installed Chrome / Edge** in settings — that option behaves identically on both.
73
62
 
74
- ## Tools (`dsh_browser_*`, 35)
63
+ ## Choose a browser
75
64
 
76
- | Group | Tools |
65
+ | Option | How it works |
77
66
  | --- | --- |
78
- | Open and navigate | `open` `back` `forward` `refresh` `list_tabs` `switch_tab` `close_tab` |
79
- | Read the page | `snapshot` `a11y` `content` `scrape` `screenshot` `challenge` |
80
- | Interact | `click` `click_sequence` `type` `key` `scroll` `execute` |
81
- | Forms | `fill` `set_value` `clear` `check` `select` `get_value` |
82
- | Session | `session` `reset` `reset_session` `restrict` `auth` |
83
- | Record | `history` `visited` `replay` |
84
- | Other | `wait` `download` |
85
-
86
- Parameters, outputs and examples: [tool reference](docs/tool-reference.md).
67
+ | Bundled browser | Opens pages in a separate window with an address bar, navigation controls, and tabs. |
68
+ | DSH sidebar | With the bridge installed on a Desktop build that exposes Electron `webview`, opening a URL expands the target conversation's sidebar browser. Lost connections reconnect to the selected sidebar. |
69
+ | Local Chrome / Edge | Launches the installed browser with a dedicated plugin profile. |
70
+ | Automatic | Chooses based on the available local browsers and desktop sidebar. |
87
71
 
88
- `click_sequence` (new in 0.5.2) sends a run of coordinate clicks in one call, for canvas pages — those ignore script-dispatched `MouseEvent`s and only accept real input.
72
+ Windows Desktop **Settings → Browser** provides installation, repair, and reinstallation with automatic restart. **Diagnostics** includes uninstall and restart, plus an external-terminal command. Progress and results survive the restart, and successful installation requires a verified connection to the new process. For terminal maintenance, exit Desktop normally and run this from the plugin directory:
89
73
 
90
- ## Remote viewing (off by default)
74
+ ~~~sh
75
+ node desktop-bridge/install.mjs "<DSH Desktop install directory>"
76
+ ~~~
91
77
 
92
- When DSH runs on a machine you are not sitting at, the browser is on that machine's screen. With `remoteView.enabled` turned on, the panel offers a **read-only** view: 2 fps, JPEG quality 70, scaled into 1280×720, one frame per request (slow links degrade instead of queueing), never written to disk, never entering the chat or model context. It does not forward clicks, keys or wheel events.
78
+ Preparation feedback appears immediately. While Desktop is closed, a separate progress window shows installation, startup, connection checks, and elapsed time, then closes after completion. The window stays in the background; closing it leaves maintenance running.
93
79
 
94
- While it is off there is **no floating entry and no diagnostic request**; the "Remote viewing" switch in settings brings the entry up **immediately** — no page reload, and no keyboard shortcut (a phone has none).
80
+ ## Browser settings
95
81
 
96
- Three same-origin endpoints: `GET /dsh-builtin-browser/browser-view/sessions`, `GET …/browser-view/frame?session=…`, `GET /dsh-builtin-browser/bridge-status`.
82
+ - **Environment check** reports detected Chrome / Edge, the bundled runtime, and sidebar bridge availability. Automatic mode identifies the selected carrier; **Diagnostics** includes the executable path.
83
+ - **Quiet mode** preserves the operating system's foreground window and pointer position. New browser windows appear in the background, and minimized bundled browser windows stay minimized. With DSH sidebar selected, opening a URL reveals the target conversation's sidebar page; explicit tab switching selects the corresponding native tab.
84
+ - **Presentation** controls sidebar expansion, closing the browser with the session, the agent cursor, and remote viewing.
85
+ - **Agent permissions** controls page scripts, downloads, and reading or writing sign-in state.
86
+ - **Advanced settings** covers browsing history, permission for coordinate clicks and drags, and sign-in persistence and window mode for Chrome, Edge, and Automatic mode. The delivery form validates and saves the tool name, argument template, failure policy, and per-site rules together.
97
87
 
98
- The frames can contain CAPTCHAs, account details or logged-in content — confirm it is the page you mean to watch.
88
+ On the local machine or in an isolated test environment, turn on **Allow remote viewing** and open the DSH viewer for a read-only view of the browser session. The viewer refreshes JPEG frames up to twice per second.
99
89
 
100
- ## Related projects
90
+ ## Download delivery
101
91
 
102
- **[yeuxuan/dsh-builtin-browser](https://github.com/yeuxuan/dsh-builtin-browser)** — a community **sidebar-only derivative** of this project at 0.4.14 (MIT, LICENSE and attribution kept). It keeps only the desktop shell's right-sidebar `<webview>` carrier and drops the self-hosted Electron child, the installed Chrome/Edge carriers and the iframe path; element snapshots carry refs, actions target `target.by: "ref"` with a hit test before clicking, every CDP command has a timeout, and popups, HTTP auth and downloads surface in a status bar above the page.
92
+ In **Advanced settings → Delivery**, enter an upload tool registered in DSH and configure its destination arguments. Automatic delivery uses the DSH native tool executor and retains the current task's tool permissions. The result includes the local download path and the upload tool's complete return value.
103
93
 
104
- If your setup is **only the desktop sidebar** and you do not want the carrier fallbacks, it is smaller and more focused than this project. It is third-party and independently maintained — send its bugs and changes to that repository, not here.
94
+ DSH sidebar downloads use the target page's authenticated browser session, stream to a temporary file, and commit the completed file while preserving existing destinations.
105
95
 
106
- ## Documentation
107
-
108
- | To learn | Read |
109
- | --- | --- |
110
- | Install, configure, use, troubleshoot | [User guide](docs/user-guide.md) |
111
- | Parameters and outputs of all 35 tools | [Tool reference](docs/tool-reference.md) |
112
- | Why a shared real browser | [Why this exists](docs/why-browser.md) |
113
- | The seam / provider / tool layers | [Architecture](docs/architecture.md) |
114
- | What it cannot do, and why | [Limitations](docs/limitations.md) |
115
- | Build, test, re-verify host compatibility | [Development](docs/development.md) |
96
+ The official Baidu Netdisk stdio MCP upload tool accepts this argument template:
116
97
 
117
- ## Changelog
98
+ ```json
99
+ {
100
+ "local_file_path": "{path}",
101
+ "remote_path": "/来自:mcp_server/DSH下载"
102
+ }
103
+ ```
118
104
 
119
- Full detail, round by round, with the reasoning and evidence behind each fix: [CHANGELOG.md](CHANGELOG.md).
105
+ `{path}` becomes the downloaded file's absolute path. `remote_path` names the destination folder. Use the tool name actually registered in DSH, following `mcp__<serverName>__upload_file`. [Baidu Netdisk MCP parameters](https://github.com/baidu-netdisk/mcp)
120
106
 
121
- | Version | Date | Theme |
122
- | --- | --- | --- |
123
- | **0.5.6** | 2026-11-03 | **"It works once you install it", made visible and repairable**: a **Readiness** section at the top of the settings page (current carrier / bundled runtime / desktop bridge, judged per carrier, with **installed kept separate from running** — a closed desktop app is the most common broken state); when preparation failed, a **Prepare the bundled browser** button that can actually retry (the memoised attempt used to make one failure final); new `runtime-status` (read) and `runtime-provision` (admitted as a write, answers immediately, the panel polls); the settings page follows a runtime language switch; the `description` and 38 mojibake characters in the desktop bridge repaired |
124
- | **0.5.5** | 2026-11-03 | **The preview is read-only**: a frame no longer goes through `ensureSidebar` (older bridges pressed keys and typed into the address bar) but through `list`, so the sidebar panel is no longer pulled to the front; overlay geometry, close control, stacking and `img[hidden]` fixed (#46); **remote viewing is a settings switch that applies immediately** (a phone has no shortcut); the bridge repair command names the copy inside the installed package (#40, fourth item). Same content as 0.5.4 |
125
- | **0.5.4** | 2026-11-03 | A second publication of the same content as 0.5.5 (published to npm; no GitHub release was cut for it) |
126
- | **0.5.3** | 2026-11-03 | **Installation no longer needs the network**: the `postinstall` is gone and the Electron runtime is prepared the first time it is actually needed, never failing an install (fixes the market install failures in #41/#42); the installer proves the app's identity before touching anything and validates before deleting (#40); the live-view entry mounts on demand, with its labels translated and a theme token that exists |
127
- | **0.5.2** | 2026-11-01 | A sidebar page no longer waits for a human: the column is opened when it was never opened, and the shell is asked to display a conversation requested from the background, with a bounded retry. Adds `click_sequence`. Recognises the pre-#37 bridge refusal that carries no code |
128
- | **0.5.1** | 2026-10-31 | Adopt the page the browser already shows: `switch_tab` and `open` land on it; canvas detection no longer requires an empty element list; a blank page is judged by its own URL |
129
- | Earlier | — | See [CHANGELOG.md](CHANGELOG.md) (`0.5.0` was tagged but never published to npm) |
107
+ For Feishu, configure an MCP tool that provides file uploads and use the argument fields it declares.
130
108
 
131
- **Tool namespace:** since 0.4.8 every tool lives under `dsh_browser_*` (before that it was the bare `browser_*`, which collided with another plugin — one duplicate name unregistered the later plugin's entire toolset). `could not register dsh_browser_xxx` in the log means another plugin holds that one name; each tool registers independently, so the collision costs only that tool. Custom prompts that still say `browser_*` need `dsh_browser_*`.
109
+ ## Browser tools
132
110
 
133
- ## Credits
111
+ The current source registers 48 tools. The table lists their names after the `dsh_browser_` prefix.
134
112
 
135
- Built on [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) — the seam, the tool runtime and the plugin system are that project's. Plugin foundations by [Cordis](https://github.com/cordiverse/cordis). And thanks to the reporters who arrived with reproductions and local patches: these fixes did not have to be guesses.
113
+ | Purpose | Tools |
114
+ | --- | --- |
115
+ | Open and navigate | `open` `back` `forward` `refresh` `list_tabs` `switch_tab` `close_tab` |
116
+ | Read pages | `snapshot` `a11y` `content` `scrape` `screenshot` `challenge` |
117
+ | Click and type | `click` `click_sequence` `type` `key` `scroll` `drag` `hover` `execute` |
118
+ | Fill forms | `fill` `set_value` `clear` `check` `select` `get_value` |
119
+ | Select and save files | `upload` `download` |
120
+ | Run and verify steps | `do` `assert` `wait` `wait_for_response` |
121
+ | Inspect page activity | `state` `find` `console` `network` `dialog` |
122
+ | Manage sessions | `session` `reset` `reset_session` `restrict` `auth` |
123
+ | Review records | `history` `visited` `replay` |
124
+ | Diagnose issues and find help | `doctor` `help` |
136
125
 
137
- ## Author
126
+ ## Documentation
138
127
 
139
- Questions, or ideas for other plugins: WeChat **`hui13866591135`** (say what it is about when adding).
128
+ - [User guide](docs/user-guide.md)
129
+ - [Tool parameters and examples](docs/tool-reference.md)
130
+ - [Choosing tools, locating elements, and running steps](skills/dsh-builtin-browser/SKILL.md)
131
+ - [Architecture](docs/architecture.md)
132
+ - [Compatibility and operating conditions](docs/limitations.md)
133
+ - [Build and test](docs/development.md)
140
134
 
141
- ## License
135
+ A community plugin built on [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) and [Cordis](https://github.com/cordiverse/cordis). Thanks to everyone who contributed issue reports, reproduction steps, and patches.
142
136
 
143
- [MIT](LICENSE). A community plugin for DeepSeek Harness; not an official DeepSeek product.
137
+ Author on WeChat **hui13866591135** · [MIT License](LICENSE)
package/README.md CHANGED
@@ -8,42 +8,37 @@
8
8
 
9
9
  <p align="center"><sub>中文 · <a href="README.en.md">English</a></sub></p>
10
10
 
11
- <h3 align="center">为 DeepSeek Harness 打造的<b>共享真实浏览器</b>插件</h3>
11
+ # DeepSeek Harness 浏览器插件
12
12
 
13
- <h4 align="center">agent 驱动一个真实、可见、可随时接管的浏览器——人与 agent 操作的是<b>同一个页面</b>。</h4>
13
+ 让 DSH 在内置浏览器、桌面侧栏或本机 Chrome、Edge 中打开网页、读取内容、填写表单和下载文件。每个任务有自己的标签页和操作记录。使用可见窗口或桌面侧栏时,你可以接手 Agent 正在操作的页面。
14
14
 
15
- ## 这是什么
15
+ 本页功能清单对应 **0.5.8**(适配 DSH 0.2.2-alpha.3:插件路由走宿主会话鉴权)。[更新记录](CHANGELOG.md)
16
16
 
17
- - **真实浏览器,不是转播**:桌面端优先驱动官方侧栏;侧栏不可用时用插件自托管的窗口;也可以在设置里换成你本机的 **Chrome / Edge**。
18
- - **人机同页**:agent 看到和操作的,与你屏幕上是同一个页面,随时可以接手。
19
- - **装完即用**:`dsh_browser_*` 下 **35 个工具**——打开、读取、点击、填表、截图、下载、登录态,不需要额外配置。
20
- - **按任务隔离**:每个任务自己的标签与历史,互不串扰。
17
+ ## 快速开始
21
18
 
22
- ## 安装
19
+ **先确认你在哪一端** —— 两端是两份独立安装,**更新其中一端不会带上另一端**,浏览器的承载方式也不同。
23
20
 
24
- 两端是两份独立安装,**更新一端不会带上另一端**。
21
+ > **更新已安装的插件是两步**(DSH 0.2.1-alpha.2 起,对已装包再装会直接报 `already-installed`):先 `dsh plugin --profile <profile> remove dsh-builtin-browser`,再 `add` 目标版本。详见[用户指南](docs/user-guide.md#先移除再安装)。
25
22
 
26
- 更新已装版本要两步(DSH 0.2.1-alpha.2 起对已装包再 `add` 会报 `already-installed`):
23
+ ### DSH Desktop(桌面端)
27
24
 
28
25
  ```sh
29
- dsh plugin --profile <profile> remove dsh-builtin-browser
30
- dsh plugin --profile <profile> add dsh-builtin-browser@0.5.6
26
+ dsh plugin --profile desktop add dsh-builtin-browser
31
27
  ```
32
28
 
33
- ### 桌面端
29
+ 桌面端在外壳支持可驱动的 `<webview>` 且已安装 bridge 时,驱动**官方侧栏**里那个浏览器面板,agent 操作的就是你在界面上看到的同一页面。侧栏不可驱动时自动使用插件自己的 Electron 窗口。
34
30
 
35
- ```sh
36
- dsh plugin --profile desktop add dsh-builtin-browser
37
- ```
31
+ 侧栏 bridge 安装在**桌面端自己的安装目录**中。Windows 桌面端打开 **设置 → 浏览器**,点击 **安装并重启**,即可完成正常退出、安装、重新启动和桥接连接验证。进行中的任务触发 DSH 自身的退出确认时,由用户决定是否退出。
38
32
 
39
- 要让插件驱动**官方侧栏**里那个浏览器面板,还需在桌面端**自己的安装目录**里装一条 bridge(可选;不装则用自托管窗口):
33
+ 终端安装方式:保存任务并正常退出 DSH Desktop,包括托盘中的进程,再从插件目录运行:
40
34
 
41
35
  ```sh
42
- node desktop-bridge/install.mjs "<DSH Desktop 安装目录>" --restart
43
- # 或双击 desktop-bridge/install-and-start.cmd
36
+ node desktop-bridge/install.mjs "<DSH Desktop 安装目录>"
44
37
  ```
45
38
 
46
- 不要在桌面端运行中手工安装:归档被占用,`rename` 会以 `EBUSY` 失败。桌面端升级后 bridge 会失效(`bridge-status` 报 `stale`),重跑同一条命令即可修复。
39
+ 完成后启动 DSH Desktop。Windows 用户也可在桌面端退出后运行 `desktop-bridge/install-and-start.cmd`,由它完成安装并启动桌面端。设置按钮由独立维护进程协调,安装器在桌面端退出后校验身份、备份和写入文件。
40
+
41
+ > **bridge 是可选项**:不装时自动退回自托管,多出一个独立窗口。**插件或桌面外壳升级后,重跑同一条命令即可修复** —— 桌面端升级会恢复 `app.asar`,桥随之失效,此时 `bridge-status` 报 `stale`。设置在面板顶部可见。载体差异见[已知限制](docs/limitations.md)。
47
42
 
48
43
  ### Web 端(`dsh web`)
49
44
 
@@ -51,94 +46,92 @@ node desktop-bridge/install.mjs "<DSH Desktop 安装目录>" --restart
51
46
  dsh plugin --profile web add dsh-builtin-browser
52
47
  ```
53
48
 
54
- Web 端没有侧栏也没有 bridge:插件自托管一个独立窗口(标题 `dsh-browser`),自带地址栏、前进后退刷新与标签条,可以直接当浏览器用。
49
+ Web 端**没有侧栏,也没有 bridge**:共享浏览器由插件**自托管**拉起一个独立窗口(标题 `dsh-browser`),自带完整工具栏(地址栏 / 后退前进刷新 / 标签条),你可以像用普通浏览器一样直接用它。
55
50
 
56
- > Electron 二进制通常由安装脚本准备。宿主使用 `strict-dep-builds` 时需先批准本插件的构建脚本;跳过了可在 profile 目录执行 `npx --no dsh-browser-install-electron` 手动准备。详见[用户指南](docs/user-guide.md)。
51
+ > 0.5.3 起安装期不下载 Electron、也不带 `postinstall`:运行时要**首次需要时**在后台准备。查看进度和重试都在 **设置 → 浏览器**:准备失败时点「准备内置浏览器」;要在安装阶段提前备好(离线部署 / CI),在该 profile 目录执行 `npx --no dsh-browser-install-electron`(需网络)。详见[用户指南](docs/user-guide.md#准备-electron-二进制)。
57
52
 
58
- ### 装好之后
53
+ ### 两端通用
54
+
55
+ 完成安装后,直接让 agent 用它:
59
56
 
60
57
  ```
61
- 帮我打开 https://example.com,把主要内容用中文总结一下。
58
+ 帮我打开 https://example.com,把页面上的主要内容用中文总结一下。
62
59
  ```
63
60
 
64
- ## 载体:自动选择,也可指定
65
-
66
- | 载体 | 何时使用 |
67
- | --- | --- |
68
- | 桌面侧栏 | 外壳支持可驱动的 `<webview>` 且已装 bridge(默认优先) |
69
- | 自托管窗口 | 侧栏不可用或未装 bridge;Web 端总是这一种 |
70
- | 本机 Chrome / Edge | 设置里显式指定 |
71
-
72
- 侧栏原本有两种"要人先动手"的情况——列没打开、会话不在前台。0.5.2 起都由插件自己处理:没有展开就展开,会话不在前台就请求外壳显示它。取舍与边界见[已知限制](docs/limitations.md)。
61
+ 浏览器窗口会随第一次调用出现;你可以随时在那个窗口里自己操作,agent 会接着往下走。**两端都可以在设置里改用你本机已安装的 Chrome / Edge**,那是行为完全一致的选项。
73
62
 
74
- ## 工具(`dsh_browser_*`,35 个)
63
+ ## 选择浏览器
75
64
 
76
- | 组 | 工具 |
65
+ | 选项 | 使用方式 |
77
66
  | --- | --- |
78
- | 打开与导航 | `open` `back` `forward` `refresh` `list_tabs` `switch_tab` `close_tab` |
79
- | 读页面 | `snapshot` `a11y` `content` `scrape` `screenshot` `challenge` |
80
- | 操作 | `click` `click_sequence` `type` `key` `scroll` `execute` |
81
- | 表单 | `fill` `set_value` `clear` `check` `select` `get_value` |
82
- | 会话 | `session` `reset` `reset_session` `restrict` `auth` |
83
- | 记录 | `history` `visited` `replay` |
84
- | 其它 | `wait` `download` |
85
-
86
- 参数、输出与示例见[工具参考](docs/tool-reference.md)。
67
+ | 内置浏览器 | 在独立窗口中打开页面,提供地址栏、前进、后退、刷新和标签栏。 |
68
+ | DSH 侧栏 | 在支持 Electron `webview` 的桌面端安装桥接组件后,打开网址会自动展开目标会话的侧栏浏览器。连接中断后继续重连所选侧栏。 |
69
+ | 本机 Chrome / Edge | 使用插件专用的浏览器配置启动本机 Chrome 或 Edge。 |
70
+ | 自动 | 根据本机浏览器和桌面侧栏的可用情况选择。 |
87
71
 
88
- `click_sequence`(0.5.2 新增)一次调用打一串坐标点击,用于 canvas 页面:那些页面不采信脚本派发的 `MouseEvent`,只认真实输入。
72
+ Windows 桌面端 **设置 → 浏览器** 提供安装、修复和重新安装并重启入口,**诊断** 中提供卸载并重启和外部终端命令。界面展示维护阶段,重启后读取持久化结果;安装成功以新进程的桥接连接验证为准。从终端维护时,在桌面端正常退出后从插件目录运行:
89
73
 
90
- ## 远程观看(默认关闭)
74
+ ~~~sh
75
+ node desktop-bridge/install.mjs "<DSH Desktop 安装目录>"
76
+ ~~~
91
77
 
92
- 从另一台设备用 DSH 时,浏览器在主机屏幕上。主机在设置里打开 `remoteView.enabled` 后,面板给出一个**只读**画面:2 fps、JPEG 质量 70、等比缩放到 1280×720 内、一帧一请求(慢网络自然降速)、不落盘、不进入聊天或模型上下文。不转发点击/键盘/滚轮。
78
+ 点击后立即显示准备状态。桌面端退出期间,独立进度窗继续显示安装、启动和连接检查阶段及用时;完成后自动收起。进度窗保持后台显示,关闭它时维护继续运行。
93
79
 
94
- 关闭时**不出现浮动入口、也不发任何诊断请求**;在设置页打开「远程观看」开关后,入口**立刻**出现——不需要刷新页面,也不需要快捷键(手机上没有)。
80
+ ## 浏览器设置
95
81
 
96
- 三个端点,仅同源:`GET /dsh-builtin-browser/browser-view/sessions`、`GET …/browser-view/frame?session=…`、`GET /dsh-builtin-browser/bridge-status`。
82
+ - **环境检查** 显示已找到的 Chrome / Edge、内置运行环境和侧栏桥接状态。自动模式显示实际选择的载体,**诊断** 提供可执行文件路径。
83
+ - **安静模式** 保留操作系统的前台窗口和鼠标位置。新启动的浏览器窗口在后台显示,最小化的内置浏览器保持最小化。选择 DSH 侧栏后,打开网址会展示目标会话的侧栏页面,显式切换标签会选择对应的原生标签。
84
+ - **展示** 提供侧栏自动展开、随会话关闭浏览器、Agent 光标和远程观看开关。
85
+ - **Agent 权限** 控制页面脚本、文件下载和登录状态的读写。
86
+ - **高级设置** 提供浏览历史、坐标点击与拖拽许可,以及 Chrome、Edge 和自动模式的登录状态保留和窗口模式。交付表单可以设置工具名、参数模板、失败处理和站点规则,校验后一次保存。
97
87
 
98
- 画面可能包含验证码、账户信息或登录后内容——打开前请确认这是你要看的页面。
88
+ 在本机或隔离测试环境中打开 **允许远程观看**,通过 DSH 的观看入口查看会话的只读画面。画面以 JPEG 刷新,最高每秒 2 帧。
99
89
 
100
- ## 相关项目
90
+ ## 下载交付
101
91
 
102
- **[yeuxuan/dsh-builtin-browser](https://github.com/yeuxuan/dsh-builtin-browser)** —— 社区基于本项目 0.4.14(MIT,保留原 LICENSE 与署名)做的**侧栏专用衍生版**:只用桌面外壳右侧栏的 `<webview>` 载体,去掉自托管 Electron 子进程、本机 Chrome/Edge 与 iframe 载体;元素快照带编号、动作用 `target.by: "ref"` 定位并在点击前做命中测试;每条 CDP 命令带超时;弹窗、HTTP 认证、下载汇总到页面顶部状态栏。
92
+ 在 **高级设置 → 交付** 中填入已接入 DSH 的上传工具名,并根据该工具的参数设置目标目录。自动交付使用 DSH 原生工具执行器,保留当前任务的工具权限。文件先保存到本地,再交给所选工具,结果中包含本地路径和上传工具的完整返回值。
103
93
 
104
- 如果你的场景**只有桌面侧栏**、不需要多载体回退,它比本项目更小更专注。它是第三方项目,由作者独立维护——问题与改动请提到它的仓库,不要记在这里。
94
+ DSH 侧栏下载使用目标页面所属浏览器会话的登录状态,分段保存文件并在完成后提交到目标位置,保留已有的同名文件。
105
95
 
106
- ## 文档
107
-
108
- | 想知道 | 去哪 |
109
- | --- | --- |
110
- | 安装、配置、日常使用、常见问题 | [用户指南](docs/user-guide.md) |
111
- | 35 个工具的参数、输出与示例 | [工具参考](docs/tool-reference.md) |
112
- | 为什么做成共享真实浏览器 | [为什么做共享真实浏览器](docs/why-browser.md) |
113
- | seam / provider / 工具三层与自托管实现 | [架构说明](docs/architecture.md) |
114
- | 哪些事做不到,以及为什么 | [已知限制](docs/limitations.md) |
115
- | 构建、测试、复验宿主兼容性 | [开发](docs/development.md) |
116
- | 全部文档的分工 | [文档索引](docs/README.md) |
96
+ 例如,百度网盘官方 stdio MCP 的上传工具使用下面的参数模板:
117
97
 
118
- ## 更新记录
98
+ ```json
99
+ {
100
+ "local_file_path": "{path}",
101
+ "remote_path": "/来自:mcp_server/DSH下载"
102
+ }
103
+ ```
119
104
 
120
- 完整明细(按轮次,含每处修复的原因与证据)见 [CHANGELOG.md](CHANGELOG.md)。
105
+ `{path}` 会替换为已下载文件的完整路径。`remote_path` 是网盘目标文件夹。工具名采用 DSH 中实际注册的名称,格式为 `mcp__<serverName>__upload_file`。[百度网盘 MCP 参数](https://github.com/baidu-netdisk/mcp)
121
106
 
122
- | 版本 | 日期 | 主题 |
123
- | --- | --- | --- |
124
- | **0.5.6** | 2026-11-03 | **「装好即可用」可见、可修**:设置页顶部新增**就绪状态**(当前载体 / 内置运行时 / 桌面桥,按载体给结论,且**已安装与在运行分开**——桌面端没开是最常见的坏状态),`failed` 时给「准备内置浏览器」按钮且**真能重试**(此前的记忆化尝试让失败一次就成了终局);新端点 `runtime-status`(读)与 `runtime-provision`(按写操作准入,立即返回,面板轮询);设置页文案跟随运行时切换语言;修掉 `description` 与桌面桥里 38 处 `閳?`/`鈥?` 乱码 |
125
- | **0.5.5** | 2026-11-03 | **预览是只读的**:取帧不再经 `ensureSidebar`(旧桥会按键+打字),只读 `list`,面板不再被顶到前台;浮标几何、关闭键、层级与 `img[hidden]` 修正(修 #46);**远程观看改为设置里的开关,点了立刻生效**(手机没有快捷键);bridge 修复命令指向包内真实路径(修 #40 第四项)。内容与 0.5.4 相同 |
126
- | **0.5.4** | 2026-11-03 | 与 0.5.5 同内容的另一份发布(npm 上可取到;本仓库没有为它建 release) |
127
- | **0.5.3** | 2026-11-03 | **安装不再依赖网络**:去掉 `postinstall`,Electron 运行时改为首次需要时才准备且永不失败安装(修 #41/#42 的市场安装失败);安装器先验应用身份再动手,校验先于删除(修 #40);观看入口按需挂载、翻译与主题令牌修正 |
128
- | **0.5.2** | 2026-11-01 | 侧栏页面不再需要人先动手:列没打开就展开,会话不在前台就请求外壳显示它并做有界重试;新增批量坐标点击 `click_sequence`;旧 bridge 的无 code 拒绝也按显示状态处理 |
129
- | **0.5.1** | 2026-10-31 | 接管浏览器自己打开的页面:`switch_tab` 与 `open` 落到你正在看的那一页;canvas 检测不再要求元素列表为空;空白页由页面自身 URL 判定 |
130
- | 更早 | — | 见 [CHANGELOG.md](CHANGELOG.md)(`0.5.0` 只打过 tag,未发布到 npm) |
107
+ 飞书目标可配置具备文件上传能力的 MCP 工具,参数模板按该工具声明的字段填写。
131
108
 
132
- **工具名空间**:0.4.8 起全部工具在 `dsh_browser_*` 下(此前是无前缀的 `browser_*`,与另一个插件相撞,一次重名会让后注册者整套工具消失)。日志里出现 `could not register dsh_browser_xxx` 说明有别的插件占了同名工具——每个工具独立注册,碰撞只影响那一个。自定义提示词里若还写着 `browser_*`,改成 `dsh_browser_*`。
109
+ ## 浏览器工具
133
110
 
134
- ## 感谢
111
+ 当前源码注册 48 个工具。表中列出 `dsh_browser_` 后面的名称。
135
112
 
136
- 感谢 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 与 DeepSeek AI 团队——本插件的 seam、工具运行时与插件体系都构建在这个项目之上;感谢 [Cordis](https://github.com/cordiverse/cordis) 提供的插件化基础;以及所有带着完整复现与本地补丁来的报告者,这些修复因此不必靠猜。
113
+ | 用途 | 工具 |
114
+ | --- | --- |
115
+ | 打开与导航 | `open` `back` `forward` `refresh` `list_tabs` `switch_tab` `close_tab` |
116
+ | 读取页面 | `snapshot` `a11y` `content` `scrape` `screenshot` `challenge` |
117
+ | 点击与输入 | `click` `click_sequence` `type` `key` `scroll` `drag` `hover` `execute` |
118
+ | 填写表单 | `fill` `set_value` `clear` `check` `select` `get_value` |
119
+ | 选择与保存文件 | `upload` `download` |
120
+ | 执行步骤与核对结果 | `do` `assert` `wait` `wait_for_response` |
121
+ | 查看页面状态 | `state` `find` `console` `network` `dialog` |
122
+ | 管理会话 | `session` `reset` `reset_session` `restrict` `auth` |
123
+ | 查看记录 | `history` `visited` `replay` |
124
+ | 排查问题与查用法 | `doctor` `help` |
137
125
 
138
- ## 作者
126
+ ## 文档
139
127
 
140
- 对插件有意见、或想聊别的插件,欢迎加微信:**`hui13866591135`**(申请时请注明)。
128
+ - [用户指南](docs/user-guide.md)
129
+ - [工具参数与示例](docs/tool-reference.md)
130
+ - [工具选择、页面定位与操作步骤](skills/dsh-builtin-browser/SKILL.md)
131
+ - [架构说明](docs/architecture.md)
132
+ - [兼容性与使用条件](docs/limitations.md)
133
+ - [构建和测试](docs/development.md)
141
134
 
142
- ## License
135
+ 本项目是基于 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 和 [Cordis](https://github.com/cordiverse/cordis) 的社区插件。感谢提交问题、复现步骤和补丁的贡献者。
143
136
 
144
- [MIT License](LICENSE)。本项目是 DeepSeek Harness 的社区插件,并非 DeepSeek 官方产品。
137
+ 作者微信 **hui13866591135** · [MIT 许可](LICENSE)