dsh-builtin-browser 0.5.5 → 0.5.7

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 (77) hide show
  1. package/CHANGELOG.md +143 -1
  2. package/README.en.md +67 -97
  3. package/README.md +67 -98
  4. package/client.js +618 -263
  5. package/desktop-bridge/install.mjs +122 -33
  6. package/desktop-bridge/plugin-browser-bridge.js +9 -4
  7. package/docs/development.md +10 -0
  8. package/docs/tool-reference.md +20 -1
  9. package/docs/user-guide.md +16 -4
  10. package/lib/browser/runtime.d.ts +3 -1
  11. package/lib/browser/runtime.js +9 -0
  12. package/lib/browser/types.d.ts +42 -0
  13. package/lib/browser-electron/authenticated-route.d.ts +27 -0
  14. package/lib/browser-electron/authenticated-route.js +39 -0
  15. package/lib/browser-electron/bridge-connection.d.ts +8 -0
  16. package/lib/browser-electron/bridge-connection.js +8 -0
  17. package/lib/browser-electron/bridge-endpoint.d.ts +30 -0
  18. package/lib/browser-electron/bridge-endpoint.js +130 -0
  19. package/lib/browser-electron/bridge-install.d.ts +48 -0
  20. package/lib/browser-electron/bridge-install.js +98 -0
  21. package/lib/browser-electron/bridge-status.js +21 -2
  22. package/lib/browser-electron/desktop-bridge-host.d.ts +30 -27
  23. package/lib/browser-electron/desktop-bridge-host.js +71 -50
  24. package/lib/browser-electron/electron-provision.d.ts +35 -2
  25. package/lib/browser-electron/electron-provision.js +83 -20
  26. package/lib/browser-electron/entry.js +144 -7
  27. package/lib/browser-electron/host-main.js +48 -27
  28. package/lib/browser-electron/json-reply.d.ts +21 -0
  29. package/lib/browser-electron/json-reply.js +17 -0
  30. package/lib/browser-electron/preview-route.js +1 -12
  31. package/lib/browser-electron/provider.d.ts +9 -2
  32. package/lib/browser-electron/provider.js +76 -6
  33. package/lib/browser-electron/remote-host.js +10 -9
  34. package/lib/browser-electron/runtime-route.d.ts +55 -0
  35. package/lib/browser-electron/runtime-route.js +66 -0
  36. package/lib/browser-electron/runtime-status.d.ts +102 -0
  37. package/lib/browser-electron/runtime-status.js +88 -0
  38. package/lib/browser-electron/settings-route.d.ts +5 -18
  39. package/lib/browser-electron/settings-route.js +4 -14
  40. package/lib/browser-electron/settings-store.d.ts +17 -0
  41. package/lib/browser-electron/settings-store.js +24 -0
  42. package/lib/browser-electron/system-browser.d.ts +5 -2
  43. package/lib/browser-electron/system-browser.js +12 -4
  44. package/lib/tool-browser/index.js +1041 -4
  45. package/lib/tool-browser/page-probe.d.ts +86 -0
  46. package/lib/tool-browser/page-probe.js +460 -0
  47. package/package.json +5 -3
  48. package/scripts/consumer-install-check.mjs +72 -0
  49. package/scripts/verify-runtime-status.mjs +179 -0
  50. package/skills/dsh-builtin-browser/SKILL.md +64 -0
  51. package/skills/dsh-builtin-browser/references/batch.md +23 -0
  52. package/skills/dsh-builtin-browser/references/deliver.md +31 -0
  53. package/skills/dsh-builtin-browser/references/locate.md +11 -0
  54. package/skills/dsh-builtin-browser/references/recover.md +11 -0
  55. package/skills/dsh-builtin-browser/references/verify.md +13 -0
  56. package/src/browser/runtime.ts +11 -0
  57. package/src/browser/types.ts +19 -0
  58. package/src/browser-electron/authenticated-route.ts +56 -0
  59. package/src/browser-electron/bridge-connection.ts +9 -0
  60. package/src/browser-electron/bridge-endpoint.ts +146 -0
  61. package/src/browser-electron/bridge-install.ts +122 -0
  62. package/src/browser-electron/bridge-status.ts +22 -2
  63. package/src/browser-electron/desktop-bridge-host.ts +68 -50
  64. package/src/browser-electron/electron-provision.ts +103 -20
  65. package/src/browser-electron/entry.ts +141 -7
  66. package/src/browser-electron/host-main.ts +41 -22
  67. package/src/browser-electron/json-reply.ts +32 -0
  68. package/src/browser-electron/preview-route.ts +1 -12
  69. package/src/browser-electron/provider.ts +90 -6
  70. package/src/browser-electron/remote-host.ts +10 -9
  71. package/src/browser-electron/runtime-route.ts +104 -0
  72. package/src/browser-electron/runtime-status.ts +188 -0
  73. package/src/browser-electron/settings-route.ts +9 -32
  74. package/src/browser-electron/settings-store.ts +39 -0
  75. package/src/browser-electron/system-browser.ts +9 -3
  76. package/src/tool-browser/index.ts +991 -7
  77. package/src/tool-browser/page-probe.ts +474 -0
package/CHANGELOG.md CHANGED
@@ -2,9 +2,151 @@
2
2
 
3
3
  本文件记录各轮功能开发与问题修复(由仓库外独立文档迁入,随仓库管理)。
4
4
 
5
+ ## 0.5.7(2026-11-05)
6
+
7
+ ### 适配 DSH 0.2.2-alpha.3:插件路由改用宿主会话鉴权
8
+
9
+ 新版本把插件 HTTP 路由收进了宿主的浏览器会话鉴权:没有有效会话的请求一律拒绝。本版把所有插件路由(预览帧、预览会话列表、桥状态、桥动作、就绪状态、就绪准备、设置)统一包进 `authenticatedRoute`,由宿主 `connection.authorizeIndex` 决定放行;拿不到该服务时返回 `503 browser-auth-unavailable`,而不是悄悄放行。原有的同源检查保留在 handler 里,作为第二道边界。
10
+
11
+ 两个探针同步更新:`verify-runtime-status.mjs` 现在注册一个 `connection` 桩再发请求(它验的是我们的 handler,不是宿主的 cookie);`install.mjs` 新增 `--preflight`,身份核验不再需要动归档。
12
+
13
+ ### 侧栏首次导航与延迟初始化(#47)
14
+
15
+ - 导航前的文档探测只读取当前 handle 已附着的 guest,首次导航直接使用带 URL 的初始化预算。
16
+ - guest 在预算内尚未出现时返回 `panel-initializing`,保留连接、会话和原始错误;guest 稍后出现后可重试。旧 bridge 的 `produced no page` 回复也按此方式处理。
17
+ - 创建浏览器标签后记录对应的标签 ID,展开、选中和后续 guest 轮询均定位到该标签。等待期间复用同一标签。
18
+ - 显式 `panel-unusable` 继续触发载体切换。
19
+
20
+ 验证包含真实 Electron、真实 webview 与最小侧栏服务的隔离对照:原版 0.5.6 复现 `bridge closed`,修复版在 guest 延迟 5.5 秒附着后完成导航,guest 延迟 22 秒时仍可在首次预算耗尽后重试恢复。完整自动检查 578 项,577 通过、1 项因环境跳过。
21
+
22
+ > 主题:**把工具面补齐**。读完 DSH 市场里 174 个 browser 类插件的代码后(`dsh-browser/04-`),缺的不是驱动能力,是**批量、观测、断言**这三类"用起来省"的工具。
23
+
24
+ ### 九个新工具,全部建立在一个页面探针上
25
+
26
+ 探针用 `execute` 注入页面(幂等、按版本覆盖),因此**三种载体行为一致**:自托管窗口、驱动中的 Chrome/Edge、桌面侧栏。没有改宿主、没有改桥协议——走 CDP 事件捕获要同时改三个载体和桥,而探针当天就能在所有载体上工作。
27
+
28
+ | 新工具 | 解决什么 |
29
+ | --- | --- |
30
+ | `dsh_browser_do` | 一次调用跑一串步骤(open/tap/field/type/key/scroll/sleep_ms/wait_text/wait_gone/wait_url/wait_idle/eval/check),失败即停并指出第几步;等待基于条件;`tap` 被 cookie 横幅盖住时先关掉它 |
31
+ | `dsh_browser_console` | 页面控制台最新若干行(按 level、可过滤、可清空) |
32
+ | `dsh_browser_network` | fetch/XHR/资源计时行:方法、状态、地址、耗时;`onlyFailures` |
33
+ | `dsh_browser_wait_for_response` | 等**本次调用之后**到达的响应——"提交到底有没有到服务器",截图答不了 |
34
+ | `dsh_browser_assert` | 一次断言 selector/text/url/js,逐条给证据 |
35
+ | `dsh_browser_dialog` | alert/confirm/prompt 记录 + 自动应答(默认 dismiss),`confirm()` 不再冻住一次调用 |
36
+ | `dsh_browser_drag` | 视口内拖拽(pointer+mouse 合成事件) |
37
+ | `dsh_browser_doctor` | 自检:URL、在飞请求、静默时长、探针状态、本任务被限制掉哪些工具 |
38
+ | `dsh_browser_help` | 主题索引(locate/wait/batch/dialogs/network/verify/recovery/limits) |
39
+
40
+ 命名踩到一次真实碰撞:断言工具最初叫 `dsh_browser_check`,与**表单勾选**的 `dsh_browser_check` 重名——宿主拒绝重复名,那条注册被静默跳过。改名 `dsh_browser_assert`,并把全部新名字补进 `restrict-policy` 的注册清单。
41
+
42
+ ### 边界写清楚
43
+
44
+ - 探针看到的是**页面能看到的东西**:fetch/XHR 有状态码,资源计时行没有(记 0);浏览器自己的弹窗(`beforeunload`、HTTP 认证、权限提示)不在覆盖范围
45
+ - `drag` 是页面内合成手势,只认 `isTrusted` 的 canvas 页面仍用 `click_sequence` 的坐标点击
46
+ - `do` 的 `eval` 步骤仍然过 `execute` 的设置门控(模型打不开)
47
+
48
+ ### 测试
49
+
50
+ `tests/page-probe.test.mjs`(10 条,真跑探针):二次安装保留缓冲、fetch 状态与拒绝透传、弹窗按策略应答、settle/clear、find 命中与未命中、overlayAt 的"挡路者 + 关闭键"、无探针时返回错误、拖拽事件顺序。全量 510 → 520,`tsc` 干净。
51
+
52
+ ### 桥:从"给你一条命令"改成"面板里一个按钮"
53
+
54
+ 原来面板只把修复命令印出来,让用户自己去终端跑。这一步会**关闭并重启桌面端**,手工跑半个(cwd 不对、node 不对、路径带空格引号掉了)就会把外壳留在更难诊断的状态。
55
+
56
+ - 新端点 `POST /dsh-builtin-browser/bridge-action`(`{action:"install"|"uninstall"}`),**按写操作准入**(`sameOrigin(request, true)`):它会停掉外壳,不该和读取同一把尺子
57
+ - 新模块 `bridge-install.ts`:只负责拼 `install.mjs <root> [--revert] --restart --yes` 并回收退出码,所有打补丁/备份/身份校验仍然在安装器里,和人工跑的是**同一个文件**
58
+ - 就绪区按钮:`安装 / 修复桥`、`卸载桥`(已安装时出现),处理中提示"桌面端会自动关闭再打开",完成后重读状态
59
+ - 失败不吞:退出码与输出尾部一起回给面板,并附上可复现的完整命令行
60
+
61
+ 真机验证(未触发安装,避免关掉桌面端):无浏览器头 POST → **403**;非法 action → **400** `action must be "install" or "uninstall"`;坏 JSON → **400** 带解析原因。测试 `tests/bridge-install.test.mjs` **6/6**:两种 argv、成功/失败/起不来的映射、超长输出只留尾部。
62
+
63
+ ### 交付:下载之后交给 MCP 工具(设置里由人决定)
64
+
65
+ 下载先落本地,再由用户在设置里指定的 MCP 工具接手(飞书 `lark_drive_upload`、百度网盘自己的上传工具)。**留空 = 与之前逐字相同**,行为零漂移。
66
+
67
+ - 设置文档新增 `delivery`:`tool`(工具名,空=只存本地)、`args`(`{path}`/`{name}`/`{size}` 模板)、`onFail`(`keep-local` / `stop`)、`sites`(按 host 覆盖)
68
+ - 面板新增「交付」一节:工具名、参数模板、失败策略、站点覆盖,中英文案随语言切换
69
+ - 失败语义写死:远程失败时**本地路径与远程错误同时报**;`stop` 则整体报错并写明"已存到哪";工具名写错不会静默降级
70
+ - 工具名走 `/^[A-Za-z0-9_.-]+$/` 校验,`args`/`sites` 只收字符串映射——手改配置写坏不会把整份文档顶掉
71
+
72
+ 测试 `tests/delivery.test.mjs`(5 条):留空零漂移、填了就交且两边都报、远程失败保留本地并说明、`stop` 报错带本地路径、站点覆盖优先于默认。全量 **520 → 525**。
73
+
74
+ ### 再补四个工具 + 一个 skill 层
75
+
76
+ | 新工具 | 说明 |
77
+ | --- | --- |
78
+ | `dsh_browser_upload` | 把**工作区内**的本地文件塞进 `input[type=file]`:Node 侧读字节 → base64 → 页面里重建 `File` + `DataTransfer` → 触发 input/change。20 MB 上限,超限直接拒(不截断);工作区外的路径一律拒绝 |
79
+ | `dsh_browser_hover` | 悬停让菜单/tooltip 出现(JS 驱动的菜单会开;纯 CSS `:hover` 需要真实指针) |
80
+ | `dsh_browser_find` | 页内查找(Ctrl+F 等价),返回片段与视口坐标 |
81
+ | `dsh_browser_state` | 一次调用回答"现在屏幕上是什么":URL/标题/加载态/在飞请求/静默时长/输入框·按钮·链接数量/滚动/选区/前 400 字 |
82
+
83
+ **skill 层**:`skills/dsh-builtin-browser/SKILL.md` + `references/{locate,batch,verify,recover}.md`——对标 BrowserSkill 那类"只带文档也值钱"的形态,把"什么时候用哪个工具、失败怎么退"写进按需加载的 skill,而不是只放在给人看的 docs 里。`package.json` 的 `files` 已带上 `skills`。
84
+
85
+ `pdf` **没有做**:它需要 `Page.printToPDF` → 经过 provider 和三种载体,还要接上保存路径准入;工具层绕不过去。留作下一批的第一件。
86
+
87
+ ## 0.5.6(2026-11-03)
88
+
89
+ > 主题:**"装好即可用"变得可见、可修**。0.5.3 把 Electron 运行时下载从安装里搬到了首次需要时,这是对的(否则默认 pnpm 的 profile 直接装不上);代价是**新装后的头一分钟里,第一个浏览器调用可能撞上仍在进行的下载而失败,而这件事在界面上没有任何痕迹**——只有一行日志。这个版本把"现在能不能用"变成一个可读的状态,并给了唯一的那个修复按钮。
90
+
91
+ ### 设置页顶部新增「就绪状态」
92
+
93
+ - 一条结论 + 三行事实:**当前载体**(channel 解析成什么)、**内置浏览器运行时**(`present` / `preparing` / `idle` / `skipped` / `failed`,附原因)、**桌面侧栏 bridge**(`installed` / `missing` / `stale` / `absent`,并且**已安装还要分在不在跑**)。
94
+ - 判定按**载体**给,不按插件给:`bundled` 看运行时,`sidebar` 看 bridge,`auto` 二者其一即可。把"插件就绪"当成一个统一状态,正是面板会显示绿色而浏览器打不开的原因。
95
+ - 只有 `failed` / `skipped` 才把编排模块自己的那句话显示出来(它带原因),其余状态只给标签 —— 状态标签已经说完了,再复制一遍是噪音。
96
+ - 轮询**只在 `preparing` 时发生**:那是唯一会自己变化的状态;其他状态下每两秒发一次请求是白烧。
97
+
98
+ ### 「已安装」不等于「在运行」
99
+
100
+ 这是同一个绿色的另一半,而且是最常被踩的那一半:**桌面端没开**。
101
+
102
+ `bridge-status` 读的是**安装树**(shell 的 main 里有没有我们的 marker、`app.asar` 有没有让位),它在重启之后依然成立,却完全不知道进程;真正说明"现在有人应答"的是 shell 运行时发布的**端点文件**(port / token / pid / 刷新时间戳)。两者都看,才叫就绪:
103
+
104
+ - 刷新戳超过 60 s(与 `bridge-connection` 的 `ENDPOINT_STALE_AFTER_MS` 同一个常量,不复制第二份)⇒ 那是墓碑,不是慢 shell;
105
+ - `pid` 用 signal 0 探活(什么也不发,`EPERM` 也算活着);
106
+ - **没有时间戳不算过期**:老桥从不写它,那种 shell 该按 pid 判,而不是被判死。
107
+
108
+ 于是面板那一行有三种说法:`已安装(桌面端正在运行)` / `已安装,但桌面端没在运行` / `未安装`。第二种下面跟一句说清是哪个 pid 不在了,**不给修复命令** —— 没有东西需要修,需要的是把桌面端打开。
109
+
110
+ 真机复核时抓到的缺陷:初版报告**只按安装树判定**,因此在桌面端已经关掉的情况下仍会说 `ready` —— 那条路径是代码事实,不是推断。现在 `installed + 未运行 ⇒ blocked` 由测试守着。
111
+
112
+ ### 两个新端点,读与写分开
113
+
114
+ - `GET /dsh-builtin-browser/runtime-status`:与设置文档同级(读开放给普通客户端),返回整份报告。**每个响应都是完整替换**,所以一次迟到的轮询不会在屏幕上留下过期状态。
115
+ - `POST /dsh-builtin-browser/runtime-provision`:**按写操作准入**(`sameOrigin(request, true)`)。它启动的是约 100 MB 的网络下载,不该和一次读取同一把尺子。
116
+ - POST **立即返回** `preparing`,不等待下载:等待会在慢网络下先让浏览器超时,而面板本来就能轮询。
117
+
118
+ ### 「准备内置浏览器」按钮真的能重试
119
+
120
+ 编排的尝试是每进程记忆化的(`attempt ??=`)。只加重试按钮等于给用户一个摆设:**失败一次之后,按钮的答案永远是那次失败**。`provisionElectronInBackground` 新增 `force`,只作废**已结算**的尝试;**在飞的那次永远被加入**(往同目录放两个下载是唯一必须拒绝的结果)。这条有测试,含"在飞时 force 不重启"。
121
+
122
+ ### 设置页的文案跟随运行时切换语言
123
+
124
+ `translate` 是模块级绑定,`apply()` 在每次 locale 快照时重新绑定它 —— 但 React 不知道这件事,已经渲染的标签会一直停在旧语言。`666cbff` 修的是浮标(原生 DOM,自己改写文本),这一版补上 React 侧:locale 订阅同时**递增版本号并通知订阅者**,设置分区与就绪区因此重新渲染。两种受众一次通知。
125
+
126
+ ### 顺手修掉的用户可见乱码
127
+
128
+ - `package.json` 的 `description`(npm 页与市场列表上就是这一行)里,破折号曾经过一次有损 GBK 往返,变成 `閳?`;现在恢复为 `—`。
129
+ - 桌面桥里 37 处 `鈥?` 同类乱码(其中一处是**运行时会打印给人看的消息**,其余是注释)。
130
+
131
+ 两处都是同一个成因:`—`(E2 80 94)被按 GBK 解码成"一个汉字 + `?`",而那个 `?` 吃掉了后面的空格 —— 所以修复是 `— `(破折号 + 空格),不是 `—`。
132
+
133
+ ### 测试
134
+
135
+ 全量从 **469 → 510**(509 过 / 1 跳过 / 0 失败,62.9 s,`tsc` 干净),新增 41 条落在五个文件:
136
+
137
+ - `runtime-status.test.mjs`(13,新):就绪报告按载体逐条 —— bundled 看运行时、sidebar 看 bridge、auto 二者其一、显式 Chrome/Edge 一律 `unknown`;`installed + 未运行 ⇒ blocked`;「已安装但端点过期/pid 已死」两种墓碑;以及 `present` 时那句说明必须与状态一致。
138
+ - `bridge-endpoint.test.mjs`(8,新):缺文件 / 目录冒充文件 / 坏 JSON / 新鲜戳 + 活 pid / 超 60 s 墓碑 / 窗口内慢刷新 / 活戳死 pid / 无戳老桥按 pid 判。
139
+ - `runtime-route.test.mjs`(8,新):读开放给普通客户端、跨站读 403、**无浏览器头的 POST 403 且不启动任何东西**、面板式 POST 200 拿到 `preparing`、失败是 200 带原因、`provision` 抛错仍给报告、两条路由互相拒绝错误动词。
140
+ - `electron-provision.test.mjs`(+4):`idle` 初值、下载中可见 `preparing`、结算后可重试而**在飞时不可重启**、失败信息同时指向面板与命令行。
141
+ - `client-panel.test.mjs`(+8):真跑 React 分区 —— 三行事实与徽标、`failed` 时才出现的「准备内置浏览器」、下载中不提供第二个、点按钮确实 POST 到 `runtime-provision`、**老宿主 404 时整段不渲染**(版本错配不该报成用户的错)、语言切换重绘已挂载标签、「已安装未运行」与「已安装运行中」两种说法。
142
+
143
+ 两条是**防漂移**的:面板本地化的状态词表必须与宿主导出的联合类型一致;每个状态/载体/两种 bridge 说法在 zh 与 en 两张表里都要有标签 —— 模板字符串拼出来的键,`client-locale` 那条按 `t("…")` 扫描的用例看不见。
144
+
5
145
  ## 0.5.5(2026-11-03)
6
146
 
7
- > 与 `0.5.4` **内容相同**。`0.5.4` 这个版本号被 npm 侧一条 staged 记录占住:首次发布返回"正在处理"但从未出现在 registry,随后每次发布都被 `E409 Cannot publish over previously staged version "0.5.4"` 拒绝,而 `npm stage list` 为空、`npm unpublish --force` 也清不掉。与其等一条看不见的记录过期,换号发布。
147
+ > 与 `0.5.4` **内容相同**。当时 `0.5.4` 这个版本号发布返回"正在处理"却迟迟不出现,随后报 `E409 Cannot publish over previously staged version "0.5.4"`,而 `npm stage list` 为空、`npm unpublish --force` 也清不掉,于是换了号。
148
+ >
149
+ > **更正(0.5.6 复核)**:`0.5.4` **最终在 registry 上成立了**(`2026-11-03T14:43:09Z`,tarball 可下载,解开后 `version=0.5.4`),只是本仓库没有为它建 GitHub release。E409 当场报错并不等于版本号被永久占住 —— 下一次先查 `registry.npmjs.org/<pkg>/<version>` 与 tarball `HEAD`,再决定换不换号。
8
150
 
9
151
  ### 预览是只读动作,不该改动读者的布局
10
152
 
package/README.en.md CHANGED
@@ -8,134 +8,104 @@
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
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.
15
+ This feature list matches **0.5.7** (compatible with DSH 0.2.2-alpha.3: plugin routes go through the host session auth). [Changelog](CHANGELOG.md)
21
16
 
22
17
  ## Install
23
18
 
24
- The two surfaces are separate installs: **updating one does not update the other**.
25
-
26
- Updating an installed plugin takes two steps (since DSH 0.2.1-alpha.2 a second `add` reports `already-installed`):
27
-
28
- ```sh
29
- dsh plugin --profile <profile> remove dsh-builtin-browser
30
- dsh plugin --profile <profile> add dsh-builtin-browser@0.5.2
31
- ```
19
+ Desktop and Web use separate plugin profiles. Run the command for the profile you use.
32
20
 
33
- ### Desktop
34
-
35
- ```sh
21
+ ~~~sh
36
22
  dsh plugin --profile desktop add dsh-builtin-browser
37
- ```
38
-
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):
40
-
41
- ```sh
42
- node desktop-bridge/install.mjs "<DSH Desktop install dir>" --restart
43
- # or double-click desktop-bridge/install-and-start.cmd
44
- ```
45
-
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.
47
-
48
- ### Web (`dsh web`)
49
-
50
- ```sh
51
23
  dsh plugin --profile web add dsh-builtin-browser
52
- ```
24
+ ~~~
53
25
 
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.
26
+ To update, run `dsh plugin --profile <profile> remove dsh-builtin-browser`, then run the install command for the same profile. Replace `<profile>` with `desktop` or `web`.
55
27
 
56
- > The Electron binary is normally prepared by the install script. A host using `strict-dep-builds` needs the build script approved first; otherwise run `npx --no dsh-browser-install-electron` inside the profile directory. See the [user guide](docs/user-guide.md).
28
+ After installation, try this task in DSH.
57
29
 
58
- ### Then
30
+ > Open https://example.com and extract the page title and main content.
59
31
 
60
- ```
61
- Open https://example.com and summarise the main content.
62
- ```
32
+ DSH prepares the Electron runtime for the bundled browser. Open **Settings → Browser** to check progress and use **Prepare the bundled browser** to retry a failed setup. To prepare Electron ahead of time, run `npx --no dsh-browser-install-electron` from the plugin profile directory. [User guide](docs/user-guide.md)
63
33
 
64
- ## Carriers: chosen automatically, or pinned
34
+ ## Choose a browser
65
35
 
66
- | Carrier | When |
36
+ | Option | How it works |
67
37
  | --- | --- |
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).
38
+ | Bundled browser | Opens pages in a separate window with an address bar, navigation controls, and tabs. |
39
+ | DSH sidebar | Drives the sidebar on DSH Desktop builds that expose an Electron `webview`, with the bridge installed. |
40
+ | Local Chrome / Edge | Launches the installed browser with a dedicated plugin profile. |
41
+ | Automatic | Chooses based on the available local browsers and desktop sidebar. |
73
42
 
74
- ## Tools (`dsh_browser_*`, 35)
43
+ To use the **DSH sidebar**, run the following from the plugin directory. The installer verifies the DSH Desktop installation, installs the bridge, and restarts the desktop app. After a desktop update, check **Settings → Browser → Diagnostics** and use the same command to repair the bridge.
75
44
 
76
- | Group | Tools |
77
- | --- | --- |
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` |
45
+ ~~~sh
46
+ node desktop-bridge/install.mjs "<DSH Desktop install directory>" --restart
47
+ ~~~
85
48
 
86
- Parameters, outputs and examples: [tool reference](docs/tool-reference.md).
49
+ ## Browser settings
87
50
 
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.
51
+ - **Readiness** reports browser availability. Expand **Diagnostics** to see the browser selection, bundled runtime, and desktop bridge status.
52
+ - **Quiet mode** keeps your current window and tab in place. New Chrome and Edge instances run in the background, and minimized bundled browser windows stay minimized. For the desktop sidebar, open the target page by hand before handing it to DSH.
53
+ - **Presentation** controls sidebar expansion, closing the browser with the session, the agent cursor, and remote viewing.
54
+ - **Agent permissions** controls page scripts, downloads, and reading or writing sign-in state.
55
+ - **Advanced settings** covers browsing history, page targeting, and sign-in persistence and window mode for Chrome and Edge. The delivery form validates and saves the tool name, argument template, failure policy, and per-site rules together.
89
56
 
90
- ## Remote viewing (off by default)
57
+ 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.
91
58
 
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.
59
+ ## Download delivery
93
60
 
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).
61
+ 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.
95
62
 
96
- Three same-origin endpoints: `GET /dsh-builtin-browser/browser-view/sessions`, `GET …/browser-view/frame?session=…`, `GET /dsh-builtin-browser/bridge-status`.
63
+ The official Baidu Netdisk stdio MCP upload tool accepts this argument template:
97
64
 
98
- The frames can contain CAPTCHAs, account details or logged-in content — confirm it is the page you mean to watch.
65
+ ```json
66
+ {
67
+ "local_file_path": "{path}",
68
+ "remote_path": "/来自:mcp_server/DSH下载"
69
+ }
70
+ ```
99
71
 
100
- ## Related projects
72
+ `{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)
101
73
 
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.
74
+ For Feishu, configure an MCP tool that provides file uploads and use the argument fields it declares.
103
75
 
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.
76
+ ## Browser tools
105
77
 
106
- ## Documentation
78
+ The current source registers 48 tools. The table lists their names after the `dsh_browser_` prefix.
107
79
 
108
- | To learn | Read |
80
+ | Purpose | Tools |
109
81
  | --- | --- |
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) |
116
-
117
- ## Changelog
118
-
119
- Full detail, round by round, with the reasoning and evidence behind each fix: [CHANGELOG.md](CHANGELOG.md).
120
-
121
- | Version | Date | Theme |
122
- | --- | --- | --- |
123
- | **0.5.5** | 2026-11-03 | Same content as 0.5.4 (the 0.5.4 version number is held by a staged record on npm's side). **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) |
124
- | **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 |
125
- | **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 |
126
- | **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 |
127
- | Earlier | — | See [CHANGELOG.md](CHANGELOG.md) (`0.5.0` was tagged but never published to npm) |
128
-
129
- **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_*`.
130
-
131
- ## Credits
132
-
133
- 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.
82
+ | Open and navigate | `open` `back` `forward` `refresh` `list_tabs` `switch_tab` `close_tab` |
83
+ | Read pages | `snapshot` `a11y` `content` `scrape` `screenshot` `challenge` |
84
+ | Click and type | `click` `click_sequence` `type` `key` `scroll` `drag` `hover` `execute` |
85
+ | Fill forms | `fill` `set_value` `clear` `check` `select` `get_value` |
86
+ | Select and save files | `upload` `download` |
87
+ | Run and verify steps | `do` `assert` `wait` `wait_for_response` |
88
+ | Inspect page activity | `state` `find` `console` `network` `dialog` |
89
+ | Manage sessions | `session` `reset` `reset_session` `restrict` `auth` |
90
+ | Review records | `history` `visited` `replay` |
91
+ | Diagnose issues and find help | `doctor` `help` |
92
+
93
+ ### Use the new tools
94
+
95
+ - Use `do` to open a page, fill fields, click, and wait in one call. It reports the step where execution stopped on failure. Use `assert` to verify page text, elements, the URL, or a script condition.
96
+ - Use `state` to read the URL, title, load state, and visible text, and `find` to locate text. Use `console` and `network` to inspect messages and requests, and `wait_for_response` to match a response by URL.
97
+ - Use `upload` to fill a file input, `hover` to open hover menus, and `drag` to operate sliders, sortable lists, drop targets, and canvases. Hover and drag use the browser's input channel. The bundled browser can use the current session's cookies to save a file with `download`.
98
+ - Use `dialog` to inspect page-script dialogs and select how to answer them, `doctor` for the current page and tool status, and `help` for usage by topic.
134
99
 
135
- ## Author
100
+ ## Documentation
136
101
 
137
- Questions, or ideas for other plugins: WeChat **`hui13866591135`** (say what it is about when adding).
102
+ - [User guide](docs/user-guide.md)
103
+ - [Tool parameters and examples](docs/tool-reference.md)
104
+ - [Choosing tools, locating elements, and running steps](skills/dsh-builtin-browser/SKILL.md)
105
+ - [Architecture](docs/architecture.md)
106
+ - [Compatibility and operating conditions](docs/limitations.md)
107
+ - [Build and test](docs/development.md)
138
108
 
139
- ## License
109
+ 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.
140
110
 
141
- [MIT](LICENSE). A community plugin for DeepSeek Harness; not an official DeepSeek product.
111
+ Author on WeChat **hui13866591135** · [MIT License](LICENSE)
package/README.md CHANGED
@@ -8,135 +8,104 @@
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
- ## 这是什么
16
-
17
- - **真实浏览器,不是转播**:桌面端优先驱动官方侧栏;侧栏不可用时用插件自托管的窗口;也可以在设置里换成你本机的 **Chrome / Edge**。
18
- - **人机同页**:agent 看到和操作的,与你屏幕上是同一个页面,随时可以接手。
19
- - **装完即用**:`dsh_browser_*` 下 **35 个工具**——打开、读取、点击、填表、截图、下载、登录态,不需要额外配置。
20
- - **按任务隔离**:每个任务自己的标签与历史,互不串扰。
15
+ 本页功能清单对应 **0.5.7**(适配 DSH 0.2.2-alpha.3:插件路由走宿主会话鉴权)。[更新记录](CHANGELOG.md)
21
16
 
22
17
  ## 安装
23
18
 
24
- 两端是两份独立安装,**更新一端不会带上另一端**。
25
-
26
- 更新已装版本要两步(DSH 0.2.1-alpha.2 起对已装包再 `add` 会报 `already-installed`):
27
-
28
- ```sh
29
- dsh plugin --profile <profile> remove dsh-builtin-browser
30
- dsh plugin --profile <profile> add dsh-builtin-browser@0.5.2
31
- ```
32
-
33
- ### 桌面端
19
+ 桌面端和 Web 端使用各自的插件配置。按你使用的端执行对应命令。
34
20
 
35
- ```sh
21
+ ~~~sh
36
22
  dsh plugin --profile desktop add dsh-builtin-browser
37
- ```
38
-
39
- 要让插件驱动**官方侧栏**里那个浏览器面板,还需在桌面端**自己的安装目录**里装一条 bridge(可选;不装则用自托管窗口):
40
-
41
- ```sh
42
- node desktop-bridge/install.mjs "<DSH Desktop 安装目录>" --restart
43
- # 或双击 desktop-bridge/install-and-start.cmd
44
- ```
45
-
46
- 不要在桌面端运行中手工安装:归档被占用,`rename` 会以 `EBUSY` 失败。桌面端升级后 bridge 会失效(`bridge-status` 报 `stale`),重跑同一条命令即可修复。
47
-
48
- ### Web 端(`dsh web`)
49
-
50
- ```sh
51
23
  dsh plugin --profile web add dsh-builtin-browser
52
- ```
24
+ ~~~
53
25
 
54
- Web 端没有侧栏也没有 bridge:插件自托管一个独立窗口(标题 `dsh-browser`),自带地址栏、前进后退刷新与标签条,可以直接当浏览器用。
26
+ 更新时,先在对应配置下执行 `dsh plugin --profile <profile> remove dsh-builtin-browser`,再执行该端的安装命令。将 `<profile>` 替换为 `desktop` 或 `web`。
55
27
 
56
- > Electron 二进制通常由安装脚本准备。宿主使用 `strict-dep-builds` 时需先批准本插件的构建脚本;跳过了可在 profile 目录执行 `npx --no dsh-browser-install-electron` 手动准备。详见[用户指南](docs/user-guide.md)。
28
+ 安装后,可以在 DSH 会话里试用下面的任务。
57
29
 
58
- ### 装好之后
30
+ > 帮我打开 https://example.com,提取页面标题和主要内容。
59
31
 
60
- ```
61
- 帮我打开 https://example.com,把主要内容用中文总结一下。
62
- ```
32
+ DSH 会准备内置浏览器所需的 Electron。打开 **设置 → 浏览器** 查看进度,准备失败时点击 **准备内置浏览器** 重试。需要提前准备时,可在对应的插件配置目录执行 `npx --no dsh-browser-install-electron`。[用户指南](docs/user-guide.md)
63
33
 
64
- ## 载体:自动选择,也可指定
34
+ ## 选择浏览器
65
35
 
66
- | 载体 | 何时使用 |
36
+ | 选项 | 使用方式 |
67
37
  | --- | --- |
68
- | 桌面侧栏 | 外壳支持可驱动的 `<webview>` 且已装 bridge(默认优先) |
69
- | 自托管窗口 | 侧栏不可用或未装 bridge;Web 端总是这一种 |
70
- | 本机 Chrome / Edge | 设置里显式指定 |
71
-
72
- 侧栏原本有两种"要人先动手"的情况——列没打开、会话不在前台。0.5.2 起都由插件自己处理:没有展开就展开,会话不在前台就请求外壳显示它。取舍与边界见[已知限制](docs/limitations.md)。
38
+ | 内置浏览器 | 在独立窗口中打开页面,提供地址栏、前进、后退、刷新和标签栏。 |
39
+ | DSH 侧栏 | 在支持 Electron `webview` 的桌面端安装桥接组件后使用。 |
40
+ | 本机 Chrome / Edge | 使用插件专用的浏览器配置启动本机 Chrome 或 Edge。 |
41
+ | 自动 | 根据本机浏览器和桌面侧栏的可用情况选择。 |
73
42
 
74
- ## 工具(`dsh_browser_*`,35 个)
43
+ 使用 **DSH 侧栏** 时,在插件目录运行下面的命令。安装器校验 DSH 安装目录,安装桥接组件后重启桌面端。桌面端升级后,可展开 **设置 → 浏览器 → 诊断** 查看桥接状态,并用同一条命令修复。
75
44
 
76
- | 组 | 工具 |
77
- | --- | --- |
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` |
45
+ ~~~sh
46
+ node desktop-bridge/install.mjs "<DSH Desktop 安装目录>" --restart
47
+ ~~~
85
48
 
86
- 参数、输出与示例见[工具参考](docs/tool-reference.md)。
49
+ ## 浏览器设置
87
50
 
88
- `click_sequence`(0.5.2 新增)一次调用打一串坐标点击,用于 canvas 页面:那些页面不采信脚本派发的 `MouseEvent`,只认真实输入。
51
+ - **就绪状态** 显示浏览器是否可用。展开 **诊断** 查看浏览器选项、内置运行时和桌面桥接状态。
52
+ - **安静模式** 保留当前窗口和标签。新启动的 Chrome 和 Edge 在后台运行,最小化的内置浏览器保持最小化。使用桌面侧栏时,先手动打开目标页,再交给 DSH 操作。
53
+ - **展示** 提供侧栏自动展开、随会话关闭浏览器、Agent 光标和远程观看开关。
54
+ - **Agent 权限** 控制页面脚本、文件下载和登录状态的读写。
55
+ - **高级设置** 提供浏览历史、页面定位方式,以及 Chrome 和 Edge 的登录状态保留和窗口模式。交付表单可以设置工具名、参数模板、失败处理和站点规则,校验后一次保存。
89
56
 
90
- ## 远程观看(默认关闭)
57
+ 在本机或隔离测试环境中打开 **允许远程观看**,通过 DSH 的观看入口查看会话的只读画面。画面以 JPEG 刷新,最高每秒 2 帧。
91
58
 
92
- 从另一台设备用 DSH 时,浏览器在主机屏幕上。主机在设置里打开 `remoteView.enabled` 后,面板给出一个**只读**画面:2 fps、JPEG 质量 70、等比缩放到 1280×720 内、一帧一请求(慢网络自然降速)、不落盘、不进入聊天或模型上下文。不转发点击/键盘/滚轮。
59
+ ## 下载交付
93
60
 
94
- 关闭时**不出现浮动入口、也不发任何诊断请求**;在设置页打开「远程观看」开关后,入口**立刻**出现——不需要刷新页面,也不需要快捷键(手机上没有)。
61
+ 在 **高级设置 → 交付** 中填入已接入 DSH 的上传工具名,并根据该工具的参数设置目标目录。自动交付使用 DSH 原生工具执行器,保留当前任务的工具权限。文件先保存到本地,再交给所选工具,结果中包含本地路径和上传工具的完整返回值。
95
62
 
96
- 三个端点,仅同源:`GET /dsh-builtin-browser/browser-view/sessions`、`GET …/browser-view/frame?session=…`、`GET /dsh-builtin-browser/bridge-status`。
63
+ 例如,百度网盘官方 stdio MCP 的上传工具使用下面的参数模板:
97
64
 
98
- 画面可能包含验证码、账户信息或登录后内容——打开前请确认这是你要看的页面。
65
+ ```json
66
+ {
67
+ "local_file_path": "{path}",
68
+ "remote_path": "/来自:mcp_server/DSH下载"
69
+ }
70
+ ```
99
71
 
100
- ## 相关项目
72
+ `{path}` 会替换为已下载文件的完整路径。`remote_path` 是网盘目标文件夹。工具名采用 DSH 中实际注册的名称,格式为 `mcp__<serverName>__upload_file`。[百度网盘 MCP 参数](https://github.com/baidu-netdisk/mcp)
101
73
 
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 认证、下载汇总到页面顶部状态栏。
74
+ 飞书目标可配置具备文件上传能力的 MCP 工具,参数模板按该工具声明的字段填写。
103
75
 
104
- 如果你的场景**只有桌面侧栏**、不需要多载体回退,它比本项目更小更专注。它是第三方项目,由作者独立维护——问题与改动请提到它的仓库,不要记在这里。
76
+ ## 浏览器工具
105
77
 
106
- ## 文档
78
+ 当前源码注册 48 个工具。表中列出 `dsh_browser_` 后面的名称。
107
79
 
108
- | 想知道 | 去哪 |
80
+ | 用途 | 工具 |
109
81
  | --- | --- |
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) |
117
-
118
- ## 更新记录
119
-
120
- 完整明细(按轮次,含每处修复的原因与证据)见 [CHANGELOG.md](CHANGELOG.md)。
121
-
122
- | 版本 | 日期 | 主题 |
123
- | --- | --- | --- |
124
- | **0.5.5** | 2026-11-03 | 与 0.5.4 同内容(`0.5.4` 的版本号被 npm 侧 staged 记录占用)。**预览是只读的**:取帧不再经 `ensureSidebar`(旧桥会按键+打字),只读 `list`,面板不再被顶到前台;浮标几何、关闭键、层级与 `img[hidden]` 修正(修 #46);**远程观看改为设置里的开关,点了立刻生效**(手机没有快捷键);bridge 修复命令指向包内真实路径(修 #40 第四项) |
125
- | **0.5.3** | 2026-11-03 | **安装不再依赖网络**:去掉 `postinstall`,Electron 运行时改为首次需要时才准备且永不失败安装(修 #41/#42 的市场安装失败);安装器先验应用身份再动手,校验先于删除(修 #40);观看入口按需挂载、翻译与主题令牌修正 |
126
- | **0.5.2** | 2026-11-01 | 侧栏页面不再需要人先动手:列没打开就展开,会话不在前台就请求外壳显示它并做有界重试;新增批量坐标点击 `click_sequence`;旧 bridge 的无 code 拒绝也按显示状态处理 |
127
- | **0.5.1** | 2026-10-31 | 接管浏览器自己打开的页面:`switch_tab` 与 `open` 落到你正在看的那一页;canvas 检测不再要求元素列表为空;空白页由页面自身 URL 判定 |
128
- | 更早 | — | 见 [CHANGELOG.md](CHANGELOG.md)(`0.5.0` 只打过 tag,未发布到 npm) |
129
-
130
- **工具名空间**:0.4.8 起全部工具在 `dsh_browser_*` 下(此前是无前缀的 `browser_*`,与另一个插件相撞,一次重名会让后注册者整套工具消失)。日志里出现 `could not register dsh_browser_xxx` 说明有别的插件占了同名工具——每个工具独立注册,碰撞只影响那一个。自定义提示词里若还写着 `browser_*`,改成 `dsh_browser_*`。
131
-
132
- ## 感谢
133
-
134
- 感谢 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 与 DeepSeek AI 团队——本插件的 seam、工具运行时与插件体系都构建在这个项目之上;感谢 [Cordis](https://github.com/cordiverse/cordis) 提供的插件化基础;以及所有带着完整复现与本地补丁来的报告者,这些修复因此不必靠猜。
82
+ | 打开与导航 | `open` `back` `forward` `refresh` `list_tabs` `switch_tab` `close_tab` |
83
+ | 读取页面 | `snapshot` `a11y` `content` `scrape` `screenshot` `challenge` |
84
+ | 点击与输入 | `click` `click_sequence` `type` `key` `scroll` `drag` `hover` `execute` |
85
+ | 填写表单 | `fill` `set_value` `clear` `check` `select` `get_value` |
86
+ | 选择与保存文件 | `upload` `download` |
87
+ | 执行步骤与核对结果 | `do` `assert` `wait` `wait_for_response` |
88
+ | 查看页面状态 | `state` `find` `console` `network` `dialog` |
89
+ | 管理会话 | `session` `reset` `reset_session` `restrict` `auth` |
90
+ | 查看记录 | `history` `visited` `replay` |
91
+ | 排查问题与查用法 | `doctor` `help` |
92
+
93
+ ### 新增工具怎么用
94
+
95
+ - 用 `do` 按顺序打开网页、填表、点击和等待。执行失败时返回停止的步骤。用 `assert` 核对页面文本、元素、地址或脚本条件。
96
+ - 用 `state` 查看地址、标题、加载状态和可见文本,用 `find` 找到文字及其位置。用 `console` 和 `network` 查看控制台消息与网络记录,用 `wait_for_response` 匹配指定地址的响应。
97
+ - 用 `upload` 将本地文件填入网页的文件选择框,用 `hover` 展开悬停菜单,用 `drag` 操作滑块、排序列表、拖放区域和画布。悬停和拖拽通过浏览器输入通道发送。内置浏览器的 `download` 可使用当前会话的 Cookie 保存文件。
98
+ - 用 `dialog` 查看页面脚本弹窗并设置应答方式,用 `doctor` 查看当前页面及工具状态,用 `help` 查询各类操作的用法。
135
99
 
136
- ## 作者
100
+ ## 文档
137
101
 
138
- 对插件有意见、或想聊别的插件,欢迎加微信:**`hui13866591135`**(申请时请注明)。
102
+ - [用户指南](docs/user-guide.md)
103
+ - [工具参数与示例](docs/tool-reference.md)
104
+ - [工具选择、页面定位与操作步骤](skills/dsh-builtin-browser/SKILL.md)
105
+ - [架构说明](docs/architecture.md)
106
+ - [兼容性与使用条件](docs/limitations.md)
107
+ - [构建和测试](docs/development.md)
139
108
 
140
- ## License
109
+ 本项目是基于 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 和 [Cordis](https://github.com/cordiverse/cordis) 的社区插件。感谢提交问题、复现步骤和补丁的贡献者。
141
110
 
142
- [MIT License](LICENSE)。本项目是 DeepSeek Harness 的社区插件,并非 DeepSeek 官方产品。
111
+ 作者微信 **hui13866591135** · [MIT 许可](LICENSE)