dsh-builtin-browser 0.5.2 → 0.5.4
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 +145 -0
- package/README.en.md +77 -68
- package/README.md +69 -89
- package/client.js +147 -15
- package/desktop-bridge/desktop-identity.json +9 -0
- package/desktop-bridge/install.mjs +220 -1
- package/desktop-bridge/plugin-browser-bridge.js +5 -0
- 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 +53 -9
- package/lib/browser-electron/desktop-bridge-host.d.ts +25 -25
- package/lib/browser-electron/desktop-bridge-host.js +67 -40
- 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 +176 -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 +53 -3
- package/lib/browser-electron/provider.js +26 -5
- 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 +56 -10
- package/src/browser-electron/desktop-bridge-host.ts +70 -41
- package/src/browser-electron/desktop-identity.ts +260 -0
- package/src/browser-electron/electron-provision.ts +208 -0
- package/src/browser-electron/entry.ts +12 -0
- package/src/browser-electron/host-main.ts +62 -12
- package/src/browser-electron/provider.ts +73 -8
- 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,106 @@
|
|
|
2
2
|
|
|
3
3
|
本文件记录各轮功能开发与问题修复(由仓库外独立文档迁入,随仓库管理)。
|
|
4
4
|
|
|
5
|
+
## 0.5.4(2026-11-03)
|
|
6
|
+
|
|
7
|
+
### 预览是只读动作,不该改动读者的布局
|
|
8
|
+
|
|
9
|
+
报告:点上浮动观看按钮之后,该会话的侧栏浏览器面板自己弹出来、会话被切过去;没装 bridge(走自托管窗口)时不出现。
|
|
10
|
+
|
|
11
|
+
链路是真实的:**取帧走 `sendCommand` → 载体的取页 → 桥的 `ensureSidebar`**,而这个 op 的职责就是"让这一页出现"——对工具调用是刻意设计,对预览是副作用。旧版桥更直接:它像人一样按侧栏快捷键、点卡片、往地址栏打字。
|
|
12
|
+
|
|
13
|
+
改法不是给预览加一个"别动"的提示,而是**根本不让它走到那一步**:
|
|
14
|
+
|
|
15
|
+
- `sendCommand` 增加 `CommandOptions.present`;`capturePassive` 明确以 `{ present: false }` 调用。默认行为不变——工具调用照旧把页面带到人眼前(有测试钉住这条区别)。
|
|
16
|
+
- host 的非呈现分支**只调 `list`**,不调 `ensureSidebar`。`list` 在任何桥版本上都是纯读,所以即使装的是 issue #37 之前的旧桥,预览也推不动侧栏。这一点很关键:报告者的症状正是"装上 bridge 才出现"。
|
|
17
|
+
- 取不到页时抛 `BrowserPanelNotDisplayedError`,路由已有逻辑把它变成面板的 `paused`;**没有重试循环**,预览不会为了取一帧而反复催显示。
|
|
18
|
+
|
|
19
|
+
### 浮标几何、关闭入口与层级
|
|
20
|
+
|
|
21
|
+
- 面板从 `bottom: 40px` 改为 `bottom: calc(100% + 8px)`:按钮占距底 16–46px,原来 40px 的面板底边正好压住它 6px,而不透明的背景把唯一的出口盖掉了。用 `100%`(按钮自身高度)而不是第二个魔法数字,字号或内边距变了也不会重现。
|
|
22
|
+
- 关闭键从"16px 字形、70% 不透明度、无边框"改成有边框、有底、悬停变色的控件——原来它与标题同色,用户点开后找不到关闭入口,只能刷新。
|
|
23
|
+
- 层级从 `z-index: 2147483000`(压在页面一切之上,包括宿主自己的对话框)降到 `1000`:浮动辅助层是客人,不是主人。
|
|
24
|
+
|
|
25
|
+
### `img.hidden` 无效
|
|
26
|
+
|
|
27
|
+
`.dsh-bw-watch-img { display: block }` 是作者样式,而 `hidden` 属性靠 UA 样式表的 `[hidden]{display:none}` 生效——作者样式恒胜,与特异性无关。所以脚本里的 `img.hidden = true` 什么也没隐藏,空态图片仍占布局。补 `.dsh-bw-watch-img[hidden] { display: none; }`。
|
|
28
|
+
|
|
29
|
+
测试 +7(4 条预览只读:标记为非呈现、工具调用仍呈现、只发 `list` 不发 `ensureSidebar`、无页时抛显示状态;**3 条 CSS**:面板在按钮之上、关闭键可见且层级受控、`[hidden]` 规则存在),`tsc` 干净。
|
|
30
|
+
|
|
31
|
+
### 远程观看改为设置里的一个开关,立即生效
|
|
32
|
+
|
|
33
|
+
报告的补充意见很实在:**手机上没有快捷键**,不能指望用户按 Ctrl+R 刷新页面来让入口出现。
|
|
34
|
+
|
|
35
|
+
- 设置页新增「远程观看」分组与开关(`remoteView.enabled`),写入走既有的设置文档;
|
|
36
|
+
- 客户端在写入涉及 `remoteView` 后**立刻重估入口**:开则挂载并问一次桥状态,关则卸载并停止正在拉取的画面 —— 不需要刷新、不需要重启;
|
|
37
|
+
- 与"默认安静"不冲突:关闭时仍然不挂载入口、不发任何请求。
|
|
38
|
+
|
|
39
|
+
### 顺带:CI 抓到的超时定时器缺陷(0.5.3 引入)
|
|
40
|
+
|
|
41
|
+
`electron-provision` 的 `Promise.race` 超时定时器被 `unref()` 了——意思是"不要为了一个下载挂住进程"。方向错了:当事件循环上没有别的句柄时,这个定时器**永远不会触发**,于是"永不返回的下载"既不超时也不返回,等待它的调用方永远等下去(实测:node 直接以 `Detected unsettled top-level await` 退出,exit 13)。
|
|
42
|
+
|
|
43
|
+
CI 在 0.5.3 tag 上抓到了它(`Promise resolution is still pending but the event loop has already resolved`,并连带取消了其后 3 条用例)。修法:定时器保持被引用,并在 `Promise.race` 结束后 `clearTimeout`,这样成功时也不会留下 180 秒的句柄。新增一条**子进程**回归用例:单一下载 + 没有其他句柄,断言进程在预算内退出且返回 `failed`——这正是本地进程内测试跑不出来、CI 才暴露的形态。
|
|
44
|
+
|
|
45
|
+
**注意**:预览这一条不依赖桥重装;但桥本身若仍是 issue #37 之前的版本,`bridge-status` 会报 `stale`,重装仍建议(它还有别的修复)。
|
|
46
|
+
|
|
47
|
+
## 0.5.3(2026-11-03)
|
|
48
|
+
|
|
49
|
+
> 这是一个**修复安装**的版本。0.5.2 在市场里装不上(见下),而绕法不该是用户要做的事——`0.5.3` 把下载从安装里彻底移除了,装完即用,不需要任何环境变量、不需要批准构建脚本、不需要重试。
|
|
50
|
+
|
|
51
|
+
### 安装不再依赖网络:去掉 `postinstall`(issue #41 / #42)
|
|
52
|
+
|
|
53
|
+
插件市场的一次真实安装失败暴露了两个缺陷,根源是同一个:**下载被放在了安装里**。
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
[ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: dsh-builtin-browser@0.5.2
|
|
57
|
+
# 放行构建脚本之后:
|
|
58
|
+
postinstall: Preparing Electron 44.10.1 … TypeError: fetch failed
|
|
59
|
+
postinstall: Electron installation failed (exit 1) … [ELIFECYCLE] Command failed with exit code 1
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- 默认 pnpm 11(`strict-dep-builds`)会拦下安装期脚本,**插件因此装不上**——而需要 Electron 的只是四种载体之一,桌面侧栏根本不需要。
|
|
63
|
+
- 放行后,下载失败会把**整个安装**判死:一个网络抖动被报成"插件是坏的"。
|
|
64
|
+
|
|
65
|
+
改动:
|
|
66
|
+
|
|
67
|
+
- **`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,所以拦截名单里只有我们那一条)。
|
|
68
|
+
- 新增 `electron-provision.ts`:**首次需要时才准备运行时**,且**永不失败安装、永不写死在请求路径上**——失败只返回状态并记一行日志,附上"侧栏 / Chrome / Edge 仍然可用"和重试命令。
|
|
69
|
+
- 触发条件只对 `bundled` 与 `auto` 两种通道(显式选了 chrome/edge 就不必下载);每进程最多一次,两个并发调用共享同一次尝试;有 180s 上限,超时即放弃(它可能正与一次工具调用并行)。
|
|
70
|
+
- 解析失败的错误文案改指 `npx --no dsh-browser-install-electron`,并说明运行时现在由插件自动准备。
|
|
71
|
+
|
|
72
|
+
测试 +10(`tests/electron-provision.test.mjs`):包内**没有**任何安装期生命周期脚本、bin 与依赖仍在、已存在运行时不下载、`ELECTRON_SKIP_BINARY_DOWNLOAD` 生效、下载失败/抛错/超时都只返回状态(含 `fetch failed` 这条真实形态)、并发共享一次尝试。
|
|
73
|
+
|
|
74
|
+
### 安装器先验身份,再动手
|
|
75
|
+
|
|
76
|
+
issue #40 的复核把这条排在第一位,因为后果最重:**形状不是身份**。旧判据是"有 `resources/app/lib/main.js` 或 `resources/app.asar`"——而这是每个 Electron 应用都有的形状。实测:一份自建样例(其 `package.json` 明写 `unrelated-meeting-app`)被认成 DSH Desktop,拿到一条指向它的安装命令;执行后它的入口文件被改、bridge 被复制进来。另一份样例在 archive 校验失败**之前**就被删掉了 `resources/app`。
|
|
77
|
+
|
|
78
|
+
- 身份规则收敛成一份数据 `desktop-bridge/desktop-identity.json`(接受的包名 + 主入口),**安装器与 `bridge-status` 同读这一份**;测试断言两边没有第二份硬编码的名字表,且 `FALLBACK_RULE` 与 JSON 逐字段相等。
|
|
79
|
+
- 判据换成应用**自己的 `package.json`**:`name` 必须是 `@deepseek-ai/dsh-desktop`(`dsh-desktop`),且声明的 `lib/main.js` 必须存在。泛型 Electron 布局不再算证据。
|
|
80
|
+
- **archive 存在时只读 archive**。Electron 优先加载 `app.asar`,桌面更新又会把旧解包目录留在原地,所以身份与主入口都从 archive 的 package.json / header 里读;旁边的目录不参与判断。
|
|
81
|
+
- **顺序**:身份校验放在任何停止、删除、解包、重命名、备份、写入之前——包括 `--restart` 关程序之前。拒绝时的输出明说"未停止、未删除、未解包、未写入"。
|
|
82
|
+
- **校验先于删除**:packed 布局先用只读方式验证 archive(header 可解析、主入口存在、每个 `unpacked` 条目存在且大小与 header 一致、内容偏移在文件内),通过后才允许 `rmSync(resources/app)`。archive 不可用时不删任何东西。
|
|
83
|
+
- `readBridgeStatus` 对非 DSH 目标返回 `present: false` 且**不再附带安装命令**;`findDesktopInstall` 也按同一规则发现(bridge 诊断请求与"让它跑安装器"不再指向一个没验过身份的应用)。
|
|
84
|
+
|
|
85
|
+
测试:+11 条(`tests/desktop-identity.test.mjs`),含"另一款 Electron 应用被拒且安装器**字节零改动**""身份检查位置早于 `stopShell`/`rmSync`/写入""packed 布局下 foreign 包名被拒、archive 与目录都未被触碰""不可用 archive 不解包目录"。原先把形状当证据的两条测试(`found by shape` / `default install is found by shape`)按新规则改写,并新增"目录名对但清单是别人"的负例。
|
|
86
|
+
|
|
87
|
+
### 观看入口按需挂载
|
|
88
|
+
|
|
89
|
+
- `remoteView` 关闭时**不挂载入口、不发 `bridge-status` 请求**。原来入口在每次 `apply()` 都无条件 `appendChild`,并在启动时立刻请求桥状态:一个没人打开的功能因此常驻一个按钮、常驻一次诊断调用。
|
|
90
|
+
- 探针(`/browser-view/sessions`)回答 `enabled: false` 或不可用时,`unmount()`;开启时才挂载,挂载后才问桥状态。
|
|
91
|
+
- 面板静态标签(标题、只读说明、停止、入口文案)改在挂载时**重新取一次**文案。
|
|
92
|
+
|
|
93
|
+
### 翻译时序
|
|
94
|
+
|
|
95
|
+
- `apply()` 里把字典注册与 `ctx.locale.bind` 提到 `installWatchPanel` **之前**;面板再在挂载时 `relabel()`。此前标签在 `apply()` 里只写一次、且写在 `locale.register` 之前,发布的包里标题一直是字面量 `watch.title`。测试用"懒解析"的 locale 桩断言标题是译文而非 key。
|
|
96
|
+
|
|
97
|
+
### 配色
|
|
98
|
+
|
|
99
|
+
- 面板改用 `--dsw-alias-bg-layer-2`。原用的 `--dsw-alias-bg-elevated` 在 rc.5 主题里**0 次出现**(`bg-layer-2` 5 次),所以看到的永远是写死的深色 fallback,浅色主题下就是一张黑卡。
|
|
100
|
+
|
|
101
|
+
测试 432 → 443(新增 11 条身份守卫 + 4 条入口/翻译/令牌),`tsc` 干净。
|
|
102
|
+
|
|
103
|
+
**未做**:复核第 5、6 条里"桥诊断只在真的用侧栏时才提示"与"由用户主动唤起观看面板"是产品决定,本轮不改;按当前原则(默认安静、按需展示)入口已经不常驻,再进一步需要先定交互。
|
|
104
|
+
|
|
5
105
|
## 0.5.2(2026-11-01)
|
|
6
106
|
|
|
7
107
|
### 侧栏页面不再需要人先把侧栏打开、或先切到那个会话
|
|
@@ -76,6 +176,51 @@
|
|
|
76
176
|
|
|
77
177
|
---
|
|
78
178
|
|
|
179
|
+
# 第五十三轮(2026-10-30,安静模式:Agent 操作不再还原窗口、不抢焦点)
|
|
180
|
+
|
|
181
|
+
用户报告(issue #35):把浏览器窗口最小化后,agent 下一次截图或点击会把它重新弹出来并抢走键盘焦点 —— 正在别处打字的内容就丢了。要求不是改默认行为,而是**新增一个配置项「安静模式」**,由用户决定要不要"agent 在后台干活"。
|
|
182
|
+
|
|
183
|
+
## 根因
|
|
184
|
+
|
|
185
|
+
不是某一条路径忘了判断,而是两个既有设计假设:
|
|
186
|
+
|
|
187
|
+
- **截图必须看得见**:自托管截图先 `show()` / `restore()` / `focus()` 再 `capturePage()`,因为 `capturePage` 对隐藏/最小化视图返回空图。CDP `Page.captureScreenshot` 本来就不需要显示表面,但它被放在 `capturePage` 失败后的兜底里,还带一轮 detach/restore 兄弟视图的重活;
|
|
188
|
+
- **输入必须有表面**:Chromium 对没有显示表面的视图静默丢弃 `Input.*`,于是 `presentView()` 在每次点击/输入前把窗口 `show()` + `moveTop()`。这条屏障本身是对的,错的是它默认"呈现 = 接管屏幕"。
|
|
189
|
+
|
|
190
|
+
## 改法
|
|
191
|
+
|
|
192
|
+
新增 `ui.quiet`(默认 `false`),沿用既有设置文档与设置面板;不开启时行为与改动前完全一致(0.5.2 的默认路径不变)。打开后由 provider 把决定随每次 `showView` / `presentView` / `capture` 传给载体,`host-main` 按它分叉:
|
|
193
|
+
|
|
194
|
+
| 路径 | `ui.quiet: false`(默认) | `ui.quiet: true` |
|
|
195
|
+
| --- | --- | --- |
|
|
196
|
+
| 截图 | `show()` / `restore()` / `focus()` → `capturePage` | 不碰窗口;`capturePage` 拿到空图时走 CDP 兜底 |
|
|
197
|
+
| `showView` | `show()` + `moveTop()` | 导航/切标签:只换窗口内可见标签;输入屏障:最小化则 `restore()`、不可见则 `showInactive()`,不 `moveTop()` |
|
|
198
|
+
| 工具栏/用户操作 | 不变 | 不变(本来就发生在该窗口内) |
|
|
199
|
+
|
|
200
|
+
三个关键决定:
|
|
201
|
+
|
|
202
|
+
1. **默认关闭**。共享同一个窗口是这个插件的立身之本,quiet 必须是用户显式选择;设置面板新增「安静模式」开关与说明。
|
|
203
|
+
2. **输入仍然呈现,只是不抢焦点**。`showInactive()` 让窗口可见但不成为 key window,这是在不破坏 Chromium 输入前提下的最小让步 —— 文档里写明了"点击/输入仍可能让窗口出现"。
|
|
204
|
+
3. **截图与导航彻底不动窗口**。用户抱怨最直接的是截图(纯观察却把窗口弹出来);导航同理,没有任何理由为此把最小化的窗口拉回来。两者都只做窗口内的标签切换,截图在 `capturePage` 空图后直接走 CDP 兜底,不再 restore。真正的输入屏障是唯一例外 —— 没有显示表面就没有输入。
|
|
205
|
+
|
|
206
|
+
## 改动文件
|
|
207
|
+
|
|
208
|
+
- `settings-store.ts`:`ui.quiet` 字段、默认值、解析(类型不对按默认关,不会因为一个手滑的 `"true"` 打开);
|
|
209
|
+
- `provider.ts`:`isQuiet()` 实时读设置,`showView` / `presentView` / `capture` 携带 `quiet`;截图在 quiet 下不再调用 `showActive`;
|
|
210
|
+
- `remote-host.ts`:RPC 透传(只在 true 时携带,旧子进程不受影响);
|
|
211
|
+
- `host-main.ts`:抽出 `revealViewInWindow`(只换窗口内可见标签),`showViewInWindow(…, quiet, needSurface)` 按"是否需要表面"分叉,`capture` 跳过还原/聚焦;
|
|
212
|
+
- `client.js`:设置页新增「安静模式」开关(中英文案);
|
|
213
|
+
- `docs/limitations.md`:quiet 的边界(只作用自托管载体、输入仍需要可见表面);
|
|
214
|
+
- `tests/quiet-mode.test.mjs`(新增)+ `tests/settings-store.test.mjs`:4 条断言开关贯通,2 条断言默认值与手滑值。
|
|
215
|
+
|
|
216
|
+
## 验证
|
|
217
|
+
|
|
218
|
+
rebase 到 0.5.2(5442a00)后 `tsc` 干净(完整 peer 依赖,0 error);全量 **419** 条,通过 **414**。5 条失败都是既有问题,与改动无关:4 条本机沙箱/权限检查(未修改的 HEAD 同样失败),1 条 `electron-install` 在 macOS 上把 `/var` 与 `/private/var` 当成不同路径(upstream/master 上同样失败)。
|
|
219
|
+
|
|
220
|
+
**未验证**:真实 Electron 窗口上的最小化/焦点行为没有自动化覆盖。`host-main` 只能跑在 Electron 子进程里,现有测试套件从不启动它;`showInactive` 的行为(可见但不成为 key window)与 macOS/Windows 的窗口管理器相关,建议合入前在真机上各点一次。这一点会写进 PR。
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
79
224
|
# 第五十二轮(2026-10-19,两个启动缺陷:hand-off 只认一次、启动参数白送一个空标签)
|
|
80
225
|
|
|
81
226
|
报告者在 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,91 @@ node desktop-bridge/install.mjs "<dir>" --restart # any platform
|
|
|
56
51
|
dsh plugin --profile web add dsh-builtin-browser
|
|
57
52
|
```
|
|
58
53
|
|
|
59
|
-
|
|
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.
|
|
60
55
|
|
|
61
|
-
>
|
|
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).
|
|
62
57
|
|
|
63
|
-
###
|
|
64
|
-
|
|
65
|
-
Once installation and any required build script approval are complete, ask the agent:
|
|
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 |
|
|
74
71
|
|
|
75
|
-
|
|
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).
|
|
73
|
+
|
|
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
|
+
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).
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
Three same-origin endpoints: `GET /dsh-builtin-browser/browser-view/sessions`, `GET …/browser-view/frame?session=…`, `GET /dsh-builtin-browser/bridge-status`.
|
|
96
97
|
|
|
97
|
-
|
|
98
|
+
The frames can contain CAPTCHAs, account details or logged-in content — confirm it is the page you mean to watch.
|
|
98
99
|
|
|
99
|
-
##
|
|
100
|
+
## Related projects
|
|
100
101
|
|
|
101
|
-
|
|
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.
|
|
103
|
+
|
|
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.
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
| To learn | Read |
|
|
109
|
+
| --- | --- |
|
|
110
|
+
| Install, configure, use, troubleshoot | [User guide](docs/user-guide.md) |
|
|
111
|
+
| Parameters and outputs of all 35 tools | [Tool reference](docs/tool-reference.md) |
|
|
112
|
+
| Why a shared real browser | [Why this exists](docs/why-browser.md) |
|
|
113
|
+
| The seam / provider / tool layers | [Architecture](docs/architecture.md) |
|
|
114
|
+
| What it cannot do, and why | [Limitations](docs/limitations.md) |
|
|
115
|
+
| Build, test, re-verify host compatibility | [Development](docs/development.md) |
|
|
116
|
+
|
|
117
|
+
## Changelog
|
|
118
|
+
|
|
119
|
+
Full detail, round by round, with the reasoning and evidence behind each fix: [CHANGELOG.md](CHANGELOG.md).
|
|
102
120
|
|
|
103
121
|
| Version | Date | Theme |
|
|
104
122
|
| --- | --- | --- |
|
|
105
|
-
| **0.5.
|
|
106
|
-
| **0.5.
|
|
107
|
-
| **0.5.
|
|
108
|
-
| **0.
|
|
109
|
-
|
|
|
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 |
|
|
123
|
+
| **0.5.4** | 2026-11-03 | **The preview is read-only**: a frame no longer goes through `ensureSidebar` (older bridges pressed keys and typed into the address bar) but through `list`, so the sidebar panel is no longer pulled to the front; overlay geometry, close control, stacking and `img[hidden]` fixed (#46); **remote viewing is a settings switch that applies immediately** (a phone has no shortcut); the bridge repair command names the copy inside the installed package (#40, fourth item) |
|
|
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) |
|
|
115
128
|
|
|
116
|
-
|
|
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_*`.
|
|
117
130
|
|
|
118
|
-
|
|
131
|
+
## Credits
|
|
119
132
|
|
|
120
|
-
|
|
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.
|
|
121
134
|
|
|
122
135
|
## Author
|
|
123
136
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
**wx: `hui13866591135`** (please say what it is about when you add me)
|
|
137
|
+
Questions, or ideas for other plugins: WeChat **`hui13866591135`** (say what it is about when adding).
|
|
127
138
|
|
|
128
139
|
## License
|
|
129
140
|
|
|
130
|
-
[MIT
|
|
131
|
-
|
|
132
|
-
> A community plugin for DeepSeek Harness, not an official DeepSeek product.
|
|
141
|
+
[MIT](LICENSE). A community plugin for DeepSeek Harness; not an official DeepSeek product.
|