dsh-builtin-browser 0.5.2 → 0.5.3
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 +103 -0
- package/README.en.md +68 -68
- package/README.md +63 -92
- package/client.js +79 -10
- package/desktop-bridge/desktop-identity.json +9 -0
- package/desktop-bridge/install.mjs +220 -1
- package/docs/README.md +1 -1
- package/docs/architecture.md +1 -1
- package/docs/limitations.md +19 -1
- package/docs/tool-reference.md +2 -1
- package/lib/browser-electron/bridge-status.d.ts +5 -3
- package/lib/browser-electron/bridge-status.js +25 -8
- package/lib/browser-electron/desktop-identity.d.ts +58 -0
- package/lib/browser-electron/desktop-identity.js +236 -0
- package/lib/browser-electron/electron-provision.d.ts +59 -0
- package/lib/browser-electron/electron-provision.js +164 -0
- package/lib/browser-electron/entry.js +12 -0
- package/lib/browser-electron/host-main.js +68 -14
- package/lib/browser-electron/provider.d.ts +35 -2
- package/lib/browser-electron/provider.js +19 -4
- package/lib/browser-electron/remote-host.d.ts +3 -3
- package/lib/browser-electron/remote-host.js +25 -11
- package/lib/browser-electron/settings-store.d.ts +19 -0
- package/lib/browser-electron/settings-store.js +5 -1
- package/package.json +2 -3
- package/src/browser-electron/bridge-status.ts +28 -9
- package/src/browser-electron/desktop-identity.ts +260 -0
- package/src/browser-electron/electron-provision.ts +195 -0
- package/src/browser-electron/entry.ts +12 -0
- package/src/browser-electron/host-main.ts +62 -12
- package/src/browser-electron/provider.ts +47 -6
- package/src/browser-electron/remote-host.ts +26 -12
- package/src/browser-electron/settings-store.ts +24 -1
- package/src/types/electron-shim.d.ts +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
本文件记录各轮功能开发与问题修复(由仓库外独立文档迁入,随仓库管理)。
|
|
4
4
|
|
|
5
|
+
## 0.5.3(2026-11-03)
|
|
6
|
+
|
|
7
|
+
> 这是一个**修复安装**的版本。0.5.2 在市场里装不上(见下),而绕法不该是用户要做的事——`0.5.3` 把下载从安装里彻底移除了,装完即用,不需要任何环境变量、不需要批准构建脚本、不需要重试。
|
|
8
|
+
|
|
9
|
+
### 安装不再依赖网络:去掉 `postinstall`(issue #41 / #42)
|
|
10
|
+
|
|
11
|
+
插件市场的一次真实安装失败暴露了两个缺陷,根源是同一个:**下载被放在了安装里**。
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
[ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: dsh-builtin-browser@0.5.2
|
|
15
|
+
# 放行构建脚本之后:
|
|
16
|
+
postinstall: Preparing Electron 44.10.1 … TypeError: fetch failed
|
|
17
|
+
postinstall: Electron installation failed (exit 1) … [ELIFECYCLE] Command failed with exit code 1
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- 默认 pnpm 11(`strict-dep-builds`)会拦下安装期脚本,**插件因此装不上**——而需要 Electron 的只是四种载体之一,桌面侧栏根本不需要。
|
|
21
|
+
- 放行后,下载失败会把**整个安装**判死:一个网络抖动被报成"插件是坏的"。
|
|
22
|
+
|
|
23
|
+
改动:
|
|
24
|
+
|
|
25
|
+
- **`package.json` 去掉 `postinstall`**;`bin.dsh-browser-install-electron` 保留,随时可手工补。经本机 pnpm 11.7.0 实测:打包后 `pnpm add <tarball>` 退出 0,不再出现 `ERR_PNPM_IGNORED_BUILDS`(electron 44 的 package.json 自身已无 scripts,所以拦截名单里只有我们那一条)。
|
|
26
|
+
- 新增 `electron-provision.ts`:**首次需要时才准备运行时**,且**永不失败安装、永不写死在请求路径上**——失败只返回状态并记一行日志,附上"侧栏 / Chrome / Edge 仍然可用"和重试命令。
|
|
27
|
+
- 触发条件只对 `bundled` 与 `auto` 两种通道(显式选了 chrome/edge 就不必下载);每进程最多一次,两个并发调用共享同一次尝试;有 180s 上限,超时即放弃(它可能正与一次工具调用并行)。
|
|
28
|
+
- 解析失败的错误文案改指 `npx --no dsh-browser-install-electron`,并说明运行时现在由插件自动准备。
|
|
29
|
+
|
|
30
|
+
测试 +10(`tests/electron-provision.test.mjs`):包内**没有**任何安装期生命周期脚本、bin 与依赖仍在、已存在运行时不下载、`ELECTRON_SKIP_BINARY_DOWNLOAD` 生效、下载失败/抛错/超时都只返回状态(含 `fetch failed` 这条真实形态)、并发共享一次尝试。
|
|
31
|
+
|
|
32
|
+
### 安装器先验身份,再动手
|
|
33
|
+
|
|
34
|
+
issue #40 的复核把这条排在第一位,因为后果最重:**形状不是身份**。旧判据是"有 `resources/app/lib/main.js` 或 `resources/app.asar`"——而这是每个 Electron 应用都有的形状。实测:一份自建样例(其 `package.json` 明写 `unrelated-meeting-app`)被认成 DSH Desktop,拿到一条指向它的安装命令;执行后它的入口文件被改、bridge 被复制进来。另一份样例在 archive 校验失败**之前**就被删掉了 `resources/app`。
|
|
35
|
+
|
|
36
|
+
- 身份规则收敛成一份数据 `desktop-bridge/desktop-identity.json`(接受的包名 + 主入口),**安装器与 `bridge-status` 同读这一份**;测试断言两边没有第二份硬编码的名字表,且 `FALLBACK_RULE` 与 JSON 逐字段相等。
|
|
37
|
+
- 判据换成应用**自己的 `package.json`**:`name` 必须是 `@deepseek-ai/dsh-desktop`(`dsh-desktop`),且声明的 `lib/main.js` 必须存在。泛型 Electron 布局不再算证据。
|
|
38
|
+
- **archive 存在时只读 archive**。Electron 优先加载 `app.asar`,桌面更新又会把旧解包目录留在原地,所以身份与主入口都从 archive 的 package.json / header 里读;旁边的目录不参与判断。
|
|
39
|
+
- **顺序**:身份校验放在任何停止、删除、解包、重命名、备份、写入之前——包括 `--restart` 关程序之前。拒绝时的输出明说"未停止、未删除、未解包、未写入"。
|
|
40
|
+
- **校验先于删除**:packed 布局先用只读方式验证 archive(header 可解析、主入口存在、每个 `unpacked` 条目存在且大小与 header 一致、内容偏移在文件内),通过后才允许 `rmSync(resources/app)`。archive 不可用时不删任何东西。
|
|
41
|
+
- `readBridgeStatus` 对非 DSH 目标返回 `present: false` 且**不再附带安装命令**;`findDesktopInstall` 也按同一规则发现(bridge 诊断请求与"让它跑安装器"不再指向一个没验过身份的应用)。
|
|
42
|
+
|
|
43
|
+
测试:+11 条(`tests/desktop-identity.test.mjs`),含"另一款 Electron 应用被拒且安装器**字节零改动**""身份检查位置早于 `stopShell`/`rmSync`/写入""packed 布局下 foreign 包名被拒、archive 与目录都未被触碰""不可用 archive 不解包目录"。原先把形状当证据的两条测试(`found by shape` / `default install is found by shape`)按新规则改写,并新增"目录名对但清单是别人"的负例。
|
|
44
|
+
|
|
45
|
+
### 观看入口按需挂载
|
|
46
|
+
|
|
47
|
+
- `remoteView` 关闭时**不挂载入口、不发 `bridge-status` 请求**。原来入口在每次 `apply()` 都无条件 `appendChild`,并在启动时立刻请求桥状态:一个没人打开的功能因此常驻一个按钮、常驻一次诊断调用。
|
|
48
|
+
- 探针(`/browser-view/sessions`)回答 `enabled: false` 或不可用时,`unmount()`;开启时才挂载,挂载后才问桥状态。
|
|
49
|
+
- 面板静态标签(标题、只读说明、停止、入口文案)改在挂载时**重新取一次**文案。
|
|
50
|
+
|
|
51
|
+
### 翻译时序
|
|
52
|
+
|
|
53
|
+
- `apply()` 里把字典注册与 `ctx.locale.bind` 提到 `installWatchPanel` **之前**;面板再在挂载时 `relabel()`。此前标签在 `apply()` 里只写一次、且写在 `locale.register` 之前,发布的包里标题一直是字面量 `watch.title`。测试用"懒解析"的 locale 桩断言标题是译文而非 key。
|
|
54
|
+
|
|
55
|
+
### 配色
|
|
56
|
+
|
|
57
|
+
- 面板改用 `--dsw-alias-bg-layer-2`。原用的 `--dsw-alias-bg-elevated` 在 rc.5 主题里**0 次出现**(`bg-layer-2` 5 次),所以看到的永远是写死的深色 fallback,浅色主题下就是一张黑卡。
|
|
58
|
+
|
|
59
|
+
测试 432 → 443(新增 11 条身份守卫 + 4 条入口/翻译/令牌),`tsc` 干净。
|
|
60
|
+
|
|
61
|
+
**未做**:复核第 5、6 条里"桥诊断只在真的用侧栏时才提示"与"由用户主动唤起观看面板"是产品决定,本轮不改;按当前原则(默认安静、按需展示)入口已经不常驻,再进一步需要先定交互。
|
|
62
|
+
|
|
5
63
|
## 0.5.2(2026-11-01)
|
|
6
64
|
|
|
7
65
|
### 侧栏页面不再需要人先把侧栏打开、或先切到那个会话
|
|
@@ -76,6 +134,51 @@
|
|
|
76
134
|
|
|
77
135
|
---
|
|
78
136
|
|
|
137
|
+
# 第五十三轮(2026-10-30,安静模式:Agent 操作不再还原窗口、不抢焦点)
|
|
138
|
+
|
|
139
|
+
用户报告(issue #35):把浏览器窗口最小化后,agent 下一次截图或点击会把它重新弹出来并抢走键盘焦点 —— 正在别处打字的内容就丢了。要求不是改默认行为,而是**新增一个配置项「安静模式」**,由用户决定要不要"agent 在后台干活"。
|
|
140
|
+
|
|
141
|
+
## 根因
|
|
142
|
+
|
|
143
|
+
不是某一条路径忘了判断,而是两个既有设计假设:
|
|
144
|
+
|
|
145
|
+
- **截图必须看得见**:自托管截图先 `show()` / `restore()` / `focus()` 再 `capturePage()`,因为 `capturePage` 对隐藏/最小化视图返回空图。CDP `Page.captureScreenshot` 本来就不需要显示表面,但它被放在 `capturePage` 失败后的兜底里,还带一轮 detach/restore 兄弟视图的重活;
|
|
146
|
+
- **输入必须有表面**:Chromium 对没有显示表面的视图静默丢弃 `Input.*`,于是 `presentView()` 在每次点击/输入前把窗口 `show()` + `moveTop()`。这条屏障本身是对的,错的是它默认"呈现 = 接管屏幕"。
|
|
147
|
+
|
|
148
|
+
## 改法
|
|
149
|
+
|
|
150
|
+
新增 `ui.quiet`(默认 `false`),沿用既有设置文档与设置面板;不开启时行为与改动前完全一致(0.5.2 的默认路径不变)。打开后由 provider 把决定随每次 `showView` / `presentView` / `capture` 传给载体,`host-main` 按它分叉:
|
|
151
|
+
|
|
152
|
+
| 路径 | `ui.quiet: false`(默认) | `ui.quiet: true` |
|
|
153
|
+
| --- | --- | --- |
|
|
154
|
+
| 截图 | `show()` / `restore()` / `focus()` → `capturePage` | 不碰窗口;`capturePage` 拿到空图时走 CDP 兜底 |
|
|
155
|
+
| `showView` | `show()` + `moveTop()` | 导航/切标签:只换窗口内可见标签;输入屏障:最小化则 `restore()`、不可见则 `showInactive()`,不 `moveTop()` |
|
|
156
|
+
| 工具栏/用户操作 | 不变 | 不变(本来就发生在该窗口内) |
|
|
157
|
+
|
|
158
|
+
三个关键决定:
|
|
159
|
+
|
|
160
|
+
1. **默认关闭**。共享同一个窗口是这个插件的立身之本,quiet 必须是用户显式选择;设置面板新增「安静模式」开关与说明。
|
|
161
|
+
2. **输入仍然呈现,只是不抢焦点**。`showInactive()` 让窗口可见但不成为 key window,这是在不破坏 Chromium 输入前提下的最小让步 —— 文档里写明了"点击/输入仍可能让窗口出现"。
|
|
162
|
+
3. **截图与导航彻底不动窗口**。用户抱怨最直接的是截图(纯观察却把窗口弹出来);导航同理,没有任何理由为此把最小化的窗口拉回来。两者都只做窗口内的标签切换,截图在 `capturePage` 空图后直接走 CDP 兜底,不再 restore。真正的输入屏障是唯一例外 —— 没有显示表面就没有输入。
|
|
163
|
+
|
|
164
|
+
## 改动文件
|
|
165
|
+
|
|
166
|
+
- `settings-store.ts`:`ui.quiet` 字段、默认值、解析(类型不对按默认关,不会因为一个手滑的 `"true"` 打开);
|
|
167
|
+
- `provider.ts`:`isQuiet()` 实时读设置,`showView` / `presentView` / `capture` 携带 `quiet`;截图在 quiet 下不再调用 `showActive`;
|
|
168
|
+
- `remote-host.ts`:RPC 透传(只在 true 时携带,旧子进程不受影响);
|
|
169
|
+
- `host-main.ts`:抽出 `revealViewInWindow`(只换窗口内可见标签),`showViewInWindow(…, quiet, needSurface)` 按"是否需要表面"分叉,`capture` 跳过还原/聚焦;
|
|
170
|
+
- `client.js`:设置页新增「安静模式」开关(中英文案);
|
|
171
|
+
- `docs/limitations.md`:quiet 的边界(只作用自托管载体、输入仍需要可见表面);
|
|
172
|
+
- `tests/quiet-mode.test.mjs`(新增)+ `tests/settings-store.test.mjs`:4 条断言开关贯通,2 条断言默认值与手滑值。
|
|
173
|
+
|
|
174
|
+
## 验证
|
|
175
|
+
|
|
176
|
+
rebase 到 0.5.2(5442a00)后 `tsc` 干净(完整 peer 依赖,0 error);全量 **419** 条,通过 **414**。5 条失败都是既有问题,与改动无关:4 条本机沙箱/权限检查(未修改的 HEAD 同样失败),1 条 `electron-install` 在 macOS 上把 `/var` 与 `/private/var` 当成不同路径(upstream/master 上同样失败)。
|
|
177
|
+
|
|
178
|
+
**未验证**:真实 Electron 窗口上的最小化/焦点行为没有自动化覆盖。`host-main` 只能跑在 Electron 子进程里,现有测试套件从不启动它;`showInactive` 的行为(可见但不成为 key window)与 macOS/Windows 的窗口管理器相关,建议合入前在真机上各点一次。这一点会写进 PR。
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
79
182
|
# 第五十二轮(2026-10-19,两个启动缺陷:hand-off 只认一次、启动参数白送一个空标签)
|
|
80
183
|
|
|
81
184
|
报告者在 Windows 11 + Chrome 156 上报了两个,并自己定位了位置。他先报在 0.4.7 上,**升到 0.4.14 复测后两个都仍在** —— 我核实确认。
|
package/README.en.md
CHANGED
|
@@ -8,47 +8,42 @@
|
|
|
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> for
|
|
11
|
+
<h3 align="center">A <b>shared real browser</b> plugin for DeepSeek Harness</h3>
|
|
12
12
|
|
|
13
|
-
<h4 align="center">The agent drives a real, visible browser you can take over at any moment —
|
|
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>
|
|
14
14
|
|
|
15
|
-
## What is
|
|
15
|
+
## What it is
|
|
16
16
|
|
|
17
|
-
|
|
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.
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
- **Human and agent on the same page** (desktop): the page the agent drives is the *same* page the human sees — no more acting inside a window you cannot watch;
|
|
21
|
-
- **Automatic carrier selection**: the desktop side panel is preferred when available, otherwise the plugin self-hosts. When the host allows installation scripts and the download is available, the plugin prepares the Electron binary during installation;
|
|
22
|
-
- **One plugin, one toolset**: installing it gives the agent 34 `dsh_browser_*` tools (open, read, accessibility tree, wait, semantic/coordinate actions, scroll, history navigation, batch and single-control form filling, keys, structured extraction, screenshots, downloads, login-state management).
|
|
22
|
+
## Install
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
The two surfaces are separate installs: **updating one does not update the other**.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Updating an installed plugin takes two steps (since DSH 0.2.1-alpha.2 a second `add` reports `already-installed`):
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
> **0.4.16 is being prepared for release**, with security, stability and desktop rc.5 sidebar fixes. Existing users should update once it is published. Updating the plugin does not update the DSH desktop shell, refresh its bridge, or change an existing `ELECTRON_PATH` override. Back up first and follow the [0.4.16 upgrade notes](docs/user-guide.md#升级到-0416) (Chinese).
|
|
28
|
+
```sh
|
|
29
|
+
dsh plugin --profile <profile> remove dsh-builtin-browser
|
|
30
|
+
dsh plugin --profile <profile> add dsh-builtin-browser@0.5.2
|
|
31
|
+
```
|
|
33
32
|
|
|
34
|
-
###
|
|
33
|
+
### Desktop
|
|
35
34
|
|
|
36
35
|
```sh
|
|
37
36
|
dsh plugin --profile desktop add dsh-builtin-browser
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Driving that panel also needs a bridge, installed into **the desktop app's own install directory** rather than the profile:
|
|
43
|
-
|
|
44
|
-
**Since 0.5.0 this is one step.** The script closes DSH itself — installing while it runs fails with EBUSY on the archive, and a process that waits for the exit is carried away with it:
|
|
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):
|
|
45
40
|
|
|
46
41
|
```sh
|
|
47
|
-
desktop-bridge/install
|
|
48
|
-
|
|
42
|
+
node desktop-bridge/install.mjs "<DSH Desktop install dir>" --restart
|
|
43
|
+
# or double-click desktop-bridge/install-and-start.cmd
|
|
49
44
|
```
|
|
50
45
|
|
|
51
|
-
|
|
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.
|
|
52
47
|
|
|
53
48
|
### Web (`dsh web`)
|
|
54
49
|
|
|
@@ -56,77 +51,82 @@ node desktop-bridge/install.mjs "<dir>" --restart # any platform
|
|
|
56
51
|
dsh plugin --profile web add dsh-builtin-browser
|
|
57
52
|
```
|
|
58
53
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
> 0.4.16 normally prepares the Electron binary through its installation script. DSH rc.5 uses pnpm 11.7 with `strict-dep-builds`, so first installation may require approval of this plugin's build script in the host's native plugin manager; the plugin does not change `allowBuilds`. After `--ignore-scripts` or an explicit download skip, run `npx --no dsh-browser-install-electron` from the correct profile directory to prepare it manually (network required). The command also respects `ELECTRON_SKIP_BINARY_DOWNLOAD`. See the [setup guide](docs/user-guide.md#准备-electron-二进制) (Chinese).
|
|
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.
|
|
62
55
|
|
|
63
|
-
|
|
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).
|
|
64
57
|
|
|
65
|
-
|
|
58
|
+
### Then
|
|
66
59
|
|
|
67
60
|
```
|
|
68
|
-
Open https://example.com and summarise the main content
|
|
61
|
+
Open https://example.com and summarise the main content.
|
|
69
62
|
```
|
|
70
63
|
|
|
71
|
-
|
|
64
|
+
## Carriers: chosen automatically, or pinned
|
|
72
65
|
|
|
73
|
-
|
|
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).
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
## Tools (`dsh_browser_*`, 35)
|
|
75
|
+
|
|
76
|
+
| Group | Tools |
|
|
76
77
|
| --- | --- |
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
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` |
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
Parameters, outputs and examples: [tool reference](docs/tool-reference.md).
|
|
86
87
|
|
|
87
|
-
|
|
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.
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
## Remote viewing (off by default)
|
|
90
91
|
|
|
91
|
-
|
|
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.
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
Three same-origin endpoints: `GET /dsh-builtin-browser/browser-view/sessions`, `GET …/browser-view/frame?session=…`, `GET /dsh-builtin-browser/bridge-status`.
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
The frames can contain CAPTCHAs, account details or logged-in content — confirm it is the page you mean to watch.
|
|
96
97
|
|
|
97
|
-
|
|
98
|
+
## Documentation
|
|
99
|
+
|
|
100
|
+
| To learn | Read |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| Install, configure, use, troubleshoot | [User guide](docs/user-guide.md) |
|
|
103
|
+
| Parameters and outputs of all 35 tools | [Tool reference](docs/tool-reference.md) |
|
|
104
|
+
| Why a shared real browser | [Why this exists](docs/why-browser.md) |
|
|
105
|
+
| The seam / provider / tool layers | [Architecture](docs/architecture.md) |
|
|
106
|
+
| What it cannot do, and why | [Limitations](docs/limitations.md) |
|
|
107
|
+
| Build, test, re-verify host compatibility | [Development](docs/development.md) |
|
|
98
108
|
|
|
99
|
-
##
|
|
109
|
+
## Changelog
|
|
100
110
|
|
|
101
|
-
|
|
111
|
+
Full detail, round by round, with the reasoning and evidence behind each fix: [CHANGELOG.md](CHANGELOG.md).
|
|
102
112
|
|
|
103
113
|
| Version | Date | Theme |
|
|
104
114
|
| --- | --- | --- |
|
|
105
|
-
| **0.5.
|
|
106
|
-
| **0.5.
|
|
107
|
-
| **0.5.
|
|
108
|
-
|
|
|
109
|
-
| **0.4.9**–**0.4.15** | 2026-10-15–19 | Sidebar capability detection and fallback, host contract alignment, headless Chrome/Edge and startup hand-off fixes; see CHANGELOG |
|
|
110
|
-
| **0.4.8** | 2026-10-14 | **Tool namespace**: 34 tools move to `dsh_browser_*`; one taken name can no longer cost the whole toolset |
|
|
111
|
-
| **0.4.7** | 2026-10-12 | Three defects of one shape: a hardcoded carrier, a dead host never replaced, a setting read once; takes the four suggestions from #26 |
|
|
112
|
-
| **0.4.6** | 2026-10-08 | Reading another conversation's sidebar, blank pages spawned while waiting, sign-outs on upgrade |
|
|
113
|
-
| **0.4.5** | 2026-10-06 | The real cause of cross-conversation bleed: panel placement keyed by conversation id, not by what the shell displays |
|
|
114
|
-
| **0.4.0**–**0.4.4** | 2026-10-02 | Splitting "limitations" into real ones and implementation ones: `dsh_browser_auth` works on all three carriers, JPEG works on an installed Chrome/Edge, downscaling everywhere; plus fixes for defects that crashed the host, silently did the wrong thing, or hung forever |
|
|
115
|
+
| **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 |
|
|
116
|
+
| **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 |
|
|
117
|
+
| **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 |
|
|
118
|
+
| Earlier | — | See [CHANGELOG.md](CHANGELOG.md) (`0.5.0` was tagged but never published to npm) |
|
|
115
119
|
|
|
116
|
-
|
|
120
|
+
**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_*`.
|
|
117
121
|
|
|
118
|
-
|
|
122
|
+
## Credits
|
|
119
123
|
|
|
120
|
-
|
|
124
|
+
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.
|
|
121
125
|
|
|
122
126
|
## Author
|
|
123
127
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
**wx: `hui13866591135`** (please say what it is about when you add me)
|
|
128
|
+
Questions, or ideas for other plugins: WeChat **`hui13866591135`** (say what it is about when adding).
|
|
127
129
|
|
|
128
130
|
## License
|
|
129
131
|
|
|
130
|
-
[MIT
|
|
131
|
-
|
|
132
|
-
> A community plugin for DeepSeek Harness, not an official DeepSeek product.
|
|
132
|
+
[MIT](LICENSE). A community plugin for DeepSeek Harness; not an official DeepSeek product.
|
package/README.md
CHANGED
|
@@ -8,50 +8,42 @@
|
|
|
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
|
|
11
|
+
<h3 align="center">为 DeepSeek Harness 打造的<b>共享真实浏览器</b>插件</h3>
|
|
12
12
|
|
|
13
|
-
<h4 align="center">agent
|
|
13
|
+
<h4 align="center">agent 驱动一个真实、可见、可随时接管的浏览器——人与 agent 操作的是<b>同一个页面</b>。</h4>
|
|
14
14
|
|
|
15
15
|
## 这是什么
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
- **真实浏览器,不是转播**:桌面端优先驱动官方侧栏;侧栏不可用时用插件自托管的窗口;也可以在设置里换成你本机的 **Chrome / Edge**。
|
|
18
|
+
- **人机同页**:agent 看到和操作的,与你屏幕上是同一个页面,随时可以接手。
|
|
19
|
+
- **装完即用**:`dsh_browser_*` 下 **35 个工具**——打开、读取、点击、填表、截图、下载、登录态,不需要额外配置。
|
|
20
|
+
- **按任务隔离**:每个任务自己的标签与历史,互不串扰。
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
- **人机同页**(桌面端):agent 操作的页面与人看到的是**同一个**页面 —— 不再是一个你看不见的窗口;
|
|
21
|
-
- **自动选择载体**:桌面侧栏可用时优先侧栏,否则自托管;宿主允许安装脚本且下载可用时,插件会在安装阶段准备 Electron 二进制;
|
|
22
|
-
- **一插件即一套工具**:安装后 agent 自动获得 34 个 `dsh_browser_*` 工具(打开、查看、无障碍树、等待、语义/坐标操作、滚动、回退、批量/单控件填表、按键、结构化提取、截图、下载、登录态管理……)。
|
|
22
|
+
## 安装
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
两端是两份独立安装,**更新一端不会带上另一端**。
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
更新已装版本要两步(DSH 0.2.1-alpha.2 起对已装包再 `add` 会报 `already-installed`):
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
> **0.4.16 正在准备发布**,包含安全、稳定性与桌面 rc.5 侧栏适配修复;现有用户建议在版本发布后更新。插件更新不会更新 DSH 桌面外壳,也不会自动刷新外壳内的 bridge 或已有 `ELECTRON_PATH` 覆盖。先备份,再按[0.4.16 升级说明](docs/user-guide.md#升级到-0416)处理。
|
|
28
|
+
```sh
|
|
29
|
+
dsh plugin --profile <profile> remove dsh-builtin-browser
|
|
30
|
+
dsh plugin --profile <profile> add dsh-builtin-browser@0.5.2
|
|
31
|
+
```
|
|
33
32
|
|
|
34
|
-
###
|
|
33
|
+
### 桌面端
|
|
35
34
|
|
|
36
35
|
```sh
|
|
37
36
|
dsh plugin --profile desktop add dsh-builtin-browser
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
要让插件驱动侧栏,还需要一条 bridge(它装在**桌面端自己的安装目录**里,不在 profile 中)。**0.5.0 起可以一步完成**:
|
|
39
|
+
要让插件驱动**官方侧栏**里那个浏览器面板,还需在桌面端**自己的安装目录**里装一条 bridge(可选;不装则用自托管窗口):
|
|
43
40
|
|
|
44
41
|
```sh
|
|
45
|
-
# Windows:双击即用,或
|
|
46
|
-
desktop-bridge/install-and-start.cmd
|
|
47
|
-
|
|
48
|
-
# 任意平台:脚本自己关闭 DSH、安装、再启动
|
|
49
42
|
node desktop-bridge/install.mjs "<DSH Desktop 安装目录>" --restart
|
|
43
|
+
# 或双击 desktop-bridge/install-and-start.cmd
|
|
50
44
|
```
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
> **bridge 是可选项**:不装时自动退回自托管,多出一个独立窗口。**插件或桌面外壳升级后,重跑同一条命令即可修复** —— 桌面端升级会恢复 `app.asar`,桥随之失效,此时 `bridge-status` 报 `stale`。设置在面板顶部可见。载体差异见[已知限制](docs/limitations.md)。
|
|
46
|
+
不要在桌面端运行中手工安装:归档被占用,`rename` 会以 `EBUSY` 失败。桌面端升级后 bridge 会失效(`bridge-status` 报 `stale`),重跑同一条命令即可修复。
|
|
55
47
|
|
|
56
48
|
### Web 端(`dsh web`)
|
|
57
49
|
|
|
@@ -59,104 +51,83 @@ node desktop-bridge/install.mjs "<DSH Desktop 安装目录>" --restart
|
|
|
59
51
|
dsh plugin --profile web add dsh-builtin-browser
|
|
60
52
|
```
|
|
61
53
|
|
|
62
|
-
Web
|
|
63
|
-
|
|
64
|
-
> 0.4.16 通常会通过安装脚本准备 Electron 二进制。DSH rc.5 的 pnpm 11.7 使用 `strict-dep-builds`,首次安装可能需在宿主原生插件管理器中批准本插件的构建脚本;插件不会自行修改 `allowBuilds`。使用 `--ignore-scripts` 或明确跳过下载后,可在正确的 profile 目录执行 `npx --no dsh-browser-install-electron` 手动准备(需网络)。若设置了 `ELECTRON_SKIP_BINARY_DOWNLOAD`,该命令也会遵守跳过选择。详见[用户指南](docs/user-guide.md#准备-electron-二进制)。
|
|
54
|
+
Web 端没有侧栏也没有 bridge:插件自托管一个独立窗口(标题 `dsh-browser`),自带地址栏、前进后退刷新与标签条,可以直接当浏览器用。
|
|
65
55
|
|
|
66
|
-
|
|
56
|
+
> Electron 二进制通常由安装脚本准备。宿主使用 `strict-dep-builds` 时需先批准本插件的构建脚本;跳过了可在 profile 目录执行 `npx --no dsh-browser-install-electron` 手动准备。详见[用户指南](docs/user-guide.md)。
|
|
67
57
|
|
|
68
|
-
|
|
58
|
+
### 装好之后
|
|
69
59
|
|
|
70
60
|
```
|
|
71
|
-
帮我打开 https://example.com
|
|
61
|
+
帮我打开 https://example.com,把主要内容用中文总结一下。
|
|
72
62
|
```
|
|
73
63
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
## 远程观看浏览器(0.5.0 新增)
|
|
77
|
-
|
|
78
|
-
通过 LAN 或隧道从另一台设备操作 DSH 时,浏览器窗口在主机显示器上,远程看不到 agent 在做什么。0.5.0 补上了只读画面:
|
|
79
|
-
|
|
80
|
-
**默认关闭。** 主机在设置里打开 `remoteView.enabled` 之后,页面才会提供画面;关闭状态下端点不返回图像、不透露目标信息。**不需要安装或改动其他插件** —— LAN 场景走宿主自己的 web server。
|
|
64
|
+
## 载体:自动选择,也可指定
|
|
81
65
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
| 项目 | 默认值 |
|
|
66
|
+
| 载体 | 何时使用 |
|
|
85
67
|
| --- | --- |
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
| 存储 | 不落盘、不进入聊天或模型上下文 |
|
|
68
|
+
| 桌面侧栏 | 外壳支持可驱动的 `<webview>` 且已装 bridge(默认优先) |
|
|
69
|
+
| 自托管窗口 | 侧栏不可用或未装 bridge;Web 端总是这一种 |
|
|
70
|
+
| 本机 Chrome / Edge | 设置里显式指定 |
|
|
90
71
|
|
|
91
|
-
|
|
72
|
+
侧栏原本有两种"要人先动手"的情况——列没打开、会话不在前台。0.5.2 起都由插件自己处理:没有展开就展开,会话不在前台就请求外壳显示它。取舍与边界见[已知限制](docs/limitations.md)。
|
|
92
73
|
|
|
93
|
-
|
|
74
|
+
## 工具(`dsh_browser_*`,35 个)
|
|
94
75
|
|
|
95
|
-
|
|
|
76
|
+
| 组 | 工具 |
|
|
96
77
|
| --- | --- |
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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` |
|
|
104
85
|
|
|
105
|
-
|
|
106
|
-
| --- | --- |
|
|
107
|
-
| 了解插件为什么存在、与无头方案的区别 | [为什么做共享真实浏览器](docs/why-browser.md) |
|
|
108
|
-
| 安装、配置、日常使用与常见问题 | [用户指南](docs/user-guide.md) |
|
|
109
|
-
| 全部 34 个工具的参数、输出与示例 | [工具参考](docs/tool-reference.md) |
|
|
110
|
-
| 了解 seam / provider / 工具三层与自托管实现 | [架构说明](docs/architecture.md) |
|
|
111
|
-
| 知道哪些事**做不到**、以及为什么 | [已知限制](docs/limitations.md) |
|
|
112
|
-
| 构建、测试、复验宿主兼容性 | [开发](docs/development.md) |
|
|
113
|
-
| 查看全部文档与 README 分工 | [文档索引](docs/README.md) |
|
|
86
|
+
参数、输出与示例见[工具参考](docs/tool-reference.md)。
|
|
114
87
|
|
|
115
|
-
|
|
88
|
+
`click_sequence`(0.5.2 新增)一次调用打一串坐标点击,用于 canvas 页面:那些页面不采信脚本派发的 `MouseEvent`,只认真实输入。
|
|
116
89
|
|
|
117
|
-
##
|
|
90
|
+
## 远程观看(默认关闭)
|
|
118
91
|
|
|
119
|
-
|
|
92
|
+
从另一台设备用 DSH 时,浏览器在主机屏幕上。主机在设置里打开 `remoteView.enabled` 后,面板给出一个**只读**画面:2 fps、JPEG 质量 70、等比缩放到 1280×720 内、一帧一请求(慢网络自然降速)、不落盘、不进入聊天或模型上下文。不转发点击/键盘/滚轮。
|
|
120
93
|
|
|
121
|
-
|
|
94
|
+
三个端点,仅同源:`GET /dsh-builtin-browser/browser-view/sessions`、`GET …/browser-view/frame?session=…`、`GET /dsh-builtin-browser/bridge-status`。
|
|
122
95
|
|
|
123
|
-
|
|
96
|
+
画面可能包含验证码、账户信息或登录后内容——打开前请确认这是你要看的页面。
|
|
124
97
|
|
|
125
|
-
|
|
98
|
+
## 文档
|
|
126
99
|
|
|
127
|
-
|
|
100
|
+
| 想知道 | 去哪 |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| 安装、配置、日常使用、常见问题 | [用户指南](docs/user-guide.md) |
|
|
103
|
+
| 35 个工具的参数、输出与示例 | [工具参考](docs/tool-reference.md) |
|
|
104
|
+
| 为什么做成共享真实浏览器 | [为什么做共享真实浏览器](docs/why-browser.md) |
|
|
105
|
+
| seam / provider / 工具三层与自托管实现 | [架构说明](docs/architecture.md) |
|
|
106
|
+
| 哪些事做不到,以及为什么 | [已知限制](docs/limitations.md) |
|
|
107
|
+
| 构建、测试、复验宿主兼容性 | [开发](docs/development.md) |
|
|
108
|
+
| 全部文档的分工 | [文档索引](docs/README.md) |
|
|
128
109
|
|
|
129
110
|
## 更新记录
|
|
130
111
|
|
|
131
|
-
完整明细(按轮次,含每处修复的原因与证据)见 [CHANGELOG.md](CHANGELOG.md)
|
|
112
|
+
完整明细(按轮次,含每处修复的原因与证据)见 [CHANGELOG.md](CHANGELOG.md)。
|
|
132
113
|
|
|
133
114
|
| 版本 | 日期 | 主题 |
|
|
134
115
|
| --- | --- | --- |
|
|
135
|
-
| **0.5.
|
|
136
|
-
| **0.5.
|
|
137
|
-
| **0.5.
|
|
138
|
-
|
|
|
139
|
-
| **0.4.9**–**0.4.15** | 2026-10-15–19 | 侧栏能力探测与回退、宿主契约对齐、本机 Chrome/Edge 无显示启动与启动移交修复;详见 CHANGELOG |
|
|
140
|
-
| **0.4.8** | 2026-10-14 | **工具名空间**:34 个工具移入 `dsh_browser_*`,一个名字被占不再毁掉整套工具 |
|
|
141
|
-
| **0.4.7** | 2026-10-12 | 三个"同形"缺陷:载体被写死、宿主死了不换、设置读了不生效;收 #26 的四条建议 |
|
|
142
|
-
| **0.4.6** | 2026-10-08 | 跨会话读错侧栏、等待期间误建空白页、升级把浏览器登出 |
|
|
143
|
-
| **0.4.5** | 2026-10-06 | 会话串扰的真正根因:面板放置改按会话 id,而非"外壳当前显示谁" |
|
|
144
|
-
| **0.4.0**–**0.4.4** | 2026-10-02 | 把"限制"分成真限制与实现限制:`dsh_browser_auth` 三种载体全可用、本机 Chrome/Edge 支持 JPEG、降采样全载体可用;修掉会崩宿主、会静默做错事、会永久挂住的缺陷 |
|
|
116
|
+
| **0.5.3** | 2026-11-03 | **安装不再依赖网络**:去掉 `postinstall`,Electron 运行时改为首次需要时才准备且永不失败安装(修 #41/#42 的市场安装失败);安装器先验应用身份再动手,校验先于删除(修 #40);观看入口按需挂载、翻译与主题令牌修正 |
|
|
117
|
+
| **0.5.2** | 2026-11-01 | 侧栏页面不再需要人先动手:列没打开就展开,会话不在前台就请求外壳显示它并做有界重试;新增批量坐标点击 `click_sequence`;旧 bridge 的无 code 拒绝也按显示状态处理 |
|
|
118
|
+
| **0.5.1** | 2026-10-31 | 接管浏览器自己打开的页面:`switch_tab` 与 `open` 落到你正在看的那一页;canvas 检测不再要求元素列表为空;空白页由页面自身 URL 判定 |
|
|
119
|
+
| 更早 | — | 见 [CHANGELOG.md](CHANGELOG.md)(`0.5.0` 只打过 tag,未发布到 npm) |
|
|
145
120
|
|
|
146
|
-
|
|
121
|
+
**工具名空间**:0.4.8 起全部工具在 `dsh_browser_*` 下(此前是无前缀的 `browser_*`,与另一个插件相撞,一次重名会让后注册者整套工具消失)。日志里出现 `could not register dsh_browser_xxx` 说明有别的插件占了同名工具——每个工具独立注册,碰撞只影响那一个。自定义提示词里若还写着 `browser_*`,改成 `dsh_browser_*`。
|
|
147
122
|
|
|
148
|
-
|
|
123
|
+
## 感谢
|
|
149
124
|
|
|
150
|
-
|
|
125
|
+
感谢 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 与 DeepSeek AI 团队——本插件的 seam、工具运行时与插件体系都构建在这个项目之上;感谢 [Cordis](https://github.com/cordiverse/cordis) 提供的插件化基础;以及所有带着完整复现与本地补丁来的报告者,这些修复因此不必靠猜。
|
|
151
126
|
|
|
152
|
-
##
|
|
127
|
+
## 作者
|
|
153
128
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
**wx:`hui13866591135`**(请在申请好友时注明)
|
|
129
|
+
对插件有意见、或想聊别的插件,欢迎加微信:**`hui13866591135`**(申请时请注明)。
|
|
157
130
|
|
|
158
131
|
## License
|
|
159
132
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
> 本项目是 DeepSeek Harness 的社区插件,并非 DeepSeek 官方产品。
|
|
133
|
+
[MIT License](LICENSE)。本项目是 DeepSeek Harness 的社区插件,并非 DeepSeek 官方产品。
|