dsh-builtin-browser 0.5.6 → 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.
- package/CHANGELOG.md +82 -0
- package/README.en.md +67 -99
- package/README.md +67 -100
- package/client.js +381 -322
- package/desktop-bridge/install.mjs +122 -33
- package/desktop-bridge/plugin-browser-bridge.js +9 -4
- package/docs/tool-reference.md +20 -1
- package/lib/browser/runtime.d.ts +3 -1
- package/lib/browser/runtime.js +9 -0
- package/lib/browser/types.d.ts +42 -0
- package/lib/browser-electron/authenticated-route.d.ts +27 -0
- package/lib/browser-electron/authenticated-route.js +39 -0
- package/lib/browser-electron/bridge-endpoint.js +7 -0
- package/lib/browser-electron/bridge-install.d.ts +48 -0
- package/lib/browser-electron/bridge-install.js +98 -0
- package/lib/browser-electron/bridge-status.js +21 -2
- package/lib/browser-electron/desktop-bridge-host.d.ts +7 -4
- package/lib/browser-electron/desktop-bridge-host.js +36 -15
- package/lib/browser-electron/electron-provision.d.ts +1 -1
- package/lib/browser-electron/electron-provision.js +31 -11
- package/lib/browser-electron/entry.js +84 -8
- package/lib/browser-electron/host-main.js +48 -27
- package/lib/browser-electron/provider.d.ts +9 -2
- package/lib/browser-electron/provider.js +76 -6
- package/lib/browser-electron/remote-host.js +4 -4
- package/lib/browser-electron/runtime-route.d.ts +3 -5
- package/lib/browser-electron/runtime-status.js +4 -2
- package/lib/browser-electron/settings-route.d.ts +5 -18
- package/lib/browser-electron/settings-route.js +4 -14
- package/lib/browser-electron/settings-store.d.ts +17 -0
- package/lib/browser-electron/settings-store.js +24 -0
- package/lib/browser-electron/system-browser.d.ts +5 -2
- package/lib/browser-electron/system-browser.js +12 -4
- package/lib/tool-browser/index.js +1041 -4
- package/lib/tool-browser/page-probe.d.ts +86 -0
- package/lib/tool-browser/page-probe.js +460 -0
- package/package.json +4 -2
- package/scripts/verify-runtime-status.mjs +14 -0
- package/skills/dsh-builtin-browser/SKILL.md +64 -0
- package/skills/dsh-builtin-browser/references/batch.md +23 -0
- package/skills/dsh-builtin-browser/references/deliver.md +31 -0
- package/skills/dsh-builtin-browser/references/locate.md +11 -0
- package/skills/dsh-builtin-browser/references/recover.md +11 -0
- package/skills/dsh-builtin-browser/references/verify.md +13 -0
- package/src/browser/runtime.ts +11 -0
- package/src/browser/types.ts +19 -0
- package/src/browser-electron/authenticated-route.ts +56 -0
- package/src/browser-electron/bridge-endpoint.ts +7 -0
- package/src/browser-electron/bridge-install.ts +122 -0
- package/src/browser-electron/bridge-status.ts +22 -2
- package/src/browser-electron/desktop-bridge-host.ts +33 -15
- package/src/browser-electron/electron-provision.ts +30 -12
- package/src/browser-electron/entry.ts +76 -8
- package/src/browser-electron/host-main.ts +41 -22
- package/src/browser-electron/provider.ts +90 -6
- package/src/browser-electron/remote-host.ts +4 -4
- package/src/browser-electron/runtime-route.ts +3 -5
- package/src/browser-electron/runtime-status.ts +4 -2
- package/src/browser-electron/settings-route.ts +9 -32
- package/src/browser-electron/settings-store.ts +39 -0
- package/src/browser-electron/system-browser.ts +9 -3
- package/src/tool-browser/index.ts +991 -7
- package/src/tool-browser/page-probe.ts +474 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,88 @@
|
|
|
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
|
+
|
|
5
87
|
## 0.5.6(2026-11-03)
|
|
6
88
|
|
|
7
89
|
> 主题:**"装好即可用"变得可见、可修**。0.5.3 把 Electron 运行时下载从安装里搬到了首次需要时,这是对的(否则默认 pnpm 的 profile 直接装不上);代价是**新装后的头一分钟里,第一个浏览器调用可能撞上仍在进行的下载而失败,而这件事在界面上没有任何痕迹**——只有一行日志。这个版本把"现在能不能用"变成一个可读的状态,并给了唯一的那个修复按钮。
|
package/README.en.md
CHANGED
|
@@ -8,136 +8,104 @@
|
|
|
8
8
|
|
|
9
9
|
<p align="center"><sub><a href="README.md">中文</a> · English</sub></p>
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
# Browser plugin for DeepSeek Harness
|
|
12
12
|
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.6
|
|
31
|
-
```
|
|
19
|
+
Desktop and Web use separate plugin profiles. Run the command for the profile you use.
|
|
32
20
|
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
|
|
28
|
+
After installation, try this task in DSH.
|
|
57
29
|
|
|
58
|
-
|
|
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
|
-
##
|
|
34
|
+
## Choose a browser
|
|
65
35
|
|
|
66
|
-
|
|
|
36
|
+
| Option | How it works |
|
|
67
37
|
| --- | --- |
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
49
|
+
## Browser settings
|
|
87
50
|
|
|
88
|
-
|
|
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
|
-
|
|
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
|
-
|
|
59
|
+
## Download delivery
|
|
93
60
|
|
|
94
|
-
|
|
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
|
-
|
|
63
|
+
The official Baidu Netdisk stdio MCP upload tool accepts this argument template:
|
|
97
64
|
|
|
98
|
-
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"local_file_path": "{path}",
|
|
68
|
+
"remote_path": "/来自:mcp_server/DSH下载"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
99
71
|
|
|
100
|
-
|
|
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
|
-
|
|
74
|
+
For Feishu, configure an MCP tool that provides file uploads and use the argument fields it declares.
|
|
103
75
|
|
|
104
|
-
|
|
76
|
+
## Browser tools
|
|
105
77
|
|
|
106
|
-
|
|
78
|
+
The current source registers 48 tools. The table lists their names after the `dsh_browser_` prefix.
|
|
107
79
|
|
|
108
|
-
|
|
|
80
|
+
| Purpose | Tools |
|
|
109
81
|
| --- | --- |
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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) |
|
|
130
|
-
|
|
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_*`.
|
|
132
|
-
|
|
133
|
-
## Credits
|
|
134
|
-
|
|
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.
|
|
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.
|
|
136
99
|
|
|
137
|
-
##
|
|
100
|
+
## Documentation
|
|
138
101
|
|
|
139
|
-
|
|
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)
|
|
140
108
|
|
|
141
|
-
|
|
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.
|
|
142
110
|
|
|
143
|
-
[MIT](LICENSE)
|
|
111
|
+
Author on WeChat **hui13866591135** · [MIT License](LICENSE)
|
package/README.md
CHANGED
|
@@ -8,137 +8,104 @@
|
|
|
8
8
|
|
|
9
9
|
<p align="center"><sub>中文 · <a href="README.en.md">English</a></sub></p>
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
# DeepSeek Harness 浏览器插件
|
|
12
12
|
|
|
13
|
-
|
|
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.6
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### 桌面端
|
|
19
|
+
桌面端和 Web 端使用各自的插件配置。按你使用的端执行对应命令。
|
|
34
20
|
|
|
35
|
-
|
|
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
|
-
|
|
26
|
+
更新时,先在对应配置下执行 `dsh plugin --profile <profile> remove dsh-builtin-browser`,再执行该端的安装命令。将 `<profile>` 替换为 `desktop` 或 `web`。
|
|
55
27
|
|
|
56
|
-
|
|
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
|
-
|
|
|
69
|
-
|
|
|
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
|
-
|
|
43
|
+
使用 **DSH 侧栏** 时,在插件目录运行下面的命令。安装器校验 DSH 安装目录,安装桥接组件后重启桌面端。桌面端升级后,可展开 **设置 → 浏览器 → 诊断** 查看桥接状态,并用同一条命令修复。
|
|
75
44
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
49
|
+
## 浏览器设置
|
|
87
50
|
|
|
88
|
-
|
|
51
|
+
- **就绪状态** 显示浏览器是否可用。展开 **诊断** 查看浏览器选项、内置运行时和桌面桥接状态。
|
|
52
|
+
- **安静模式** 保留当前窗口和标签。新启动的 Chrome 和 Edge 在后台运行,最小化的内置浏览器保持最小化。使用桌面侧栏时,先手动打开目标页,再交给 DSH 操作。
|
|
53
|
+
- **展示** 提供侧栏自动展开、随会话关闭浏览器、Agent 光标和远程观看开关。
|
|
54
|
+
- **Agent 权限** 控制页面脚本、文件下载和登录状态的读写。
|
|
55
|
+
- **高级设置** 提供浏览历史、页面定位方式,以及 Chrome 和 Edge 的登录状态保留和窗口模式。交付表单可以设置工具名、参数模板、失败处理和站点规则,校验后一次保存。
|
|
89
56
|
|
|
90
|
-
|
|
57
|
+
在本机或隔离测试环境中打开 **允许远程观看**,通过 DSH 的观看入口查看会话的只读画面。画面以 JPEG 刷新,最高每秒 2 帧。
|
|
91
58
|
|
|
92
|
-
|
|
59
|
+
## 下载交付
|
|
93
60
|
|
|
94
|
-
|
|
61
|
+
在 **高级设置 → 交付** 中填入已接入 DSH 的上传工具名,并根据该工具的参数设置目标目录。自动交付使用 DSH 原生工具执行器,保留当前任务的工具权限。文件先保存到本地,再交给所选工具,结果中包含本地路径和上传工具的完整返回值。
|
|
95
62
|
|
|
96
|
-
|
|
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
|
-
|
|
74
|
+
飞书目标可配置具备文件上传能力的 MCP 工具,参数模板按该工具声明的字段填写。
|
|
103
75
|
|
|
104
|
-
|
|
76
|
+
## 浏览器工具
|
|
105
77
|
|
|
106
|
-
|
|
78
|
+
当前源码注册 48 个工具。表中列出 `dsh_browser_` 后面的名称。
|
|
107
79
|
|
|
108
|
-
|
|
|
80
|
+
| 用途 | 工具 |
|
|
109
81
|
| --- | --- |
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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) |
|
|
131
|
-
|
|
132
|
-
**工具名空间**:0.4.8 起全部工具在 `dsh_browser_*` 下(此前是无前缀的 `browser_*`,与另一个插件相撞,一次重名会让后注册者整套工具消失)。日志里出现 `could not register dsh_browser_xxx` 说明有别的插件占了同名工具——每个工具独立注册,碰撞只影响那一个。自定义提示词里若还写着 `browser_*`,改成 `dsh_browser_*`。
|
|
133
|
-
|
|
134
|
-
## 感谢
|
|
135
|
-
|
|
136
|
-
感谢 [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` 查询各类操作的用法。
|
|
137
99
|
|
|
138
|
-
##
|
|
100
|
+
## 文档
|
|
139
101
|
|
|
140
|
-
|
|
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)
|
|
141
108
|
|
|
142
|
-
|
|
109
|
+
本项目是基于 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 和 [Cordis](https://github.com/cordiverse/cordis) 的社区插件。感谢提交问题、复现步骤和补丁的贡献者。
|
|
143
110
|
|
|
144
|
-
[MIT
|
|
111
|
+
作者微信 **hui13866591135** · [MIT 许可](LICENSE)
|