dsh-browser-firefox 0.5.1 → 0.5.2
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/README.md +13 -3
- package/icon.svg +10 -0
- package/lib/index.js +613 -69
- package/lib/protocol.js +60 -4
- package/lib/types/approvals.d.ts +7 -0
- package/lib/types/discovery-beacon.d.ts +31 -0
- package/lib/types/extension-sessions.d.ts +88 -6
- package/lib/types/index.d.ts +6 -0
- package/lib/types/protocol.d.ts +53 -0
- package/lib/types/questions.d.ts +37 -2
- package/lib/types/server.d.ts +47 -9
- package/lib/types/untrusted.d.ts +31 -0
- package/lib/types/waterfall.d.ts +4 -0
- package/package.json +7 -4
- package/src/approvals.ts +65 -4
- package/src/discovery-beacon.ts +77 -0
- package/src/extension-sessions.ts +147 -7
- package/src/index.ts +144 -3
- package/src/protocol.ts +68 -1
- package/src/questions.ts +128 -8
- package/src/server.ts +123 -31
- package/src/session-workspace.ts +18 -4
- package/src/tools.ts +20 -4
- package/src/untrusted.ts +50 -0
- package/src/waterfall.ts +24 -1
package/README.md
CHANGED
|
@@ -17,15 +17,25 @@ dsh plugin --profile web add dsh-browser-firefox@latest
|
|
|
17
17
|
## 配套扩展与 token
|
|
18
18
|
|
|
19
19
|
1. 从 AMO 安装 Firefox 扩展:[DSH 浏览器助手](https://addons.mozilla.org/zh-CN/firefox/addon/dsh-%E6%B5%8F%E8%A7%88%E5%99%A8%E5%8A%A9%E6%89%8B/)。
|
|
20
|
-
2. 打开扩展侧边栏 → 设置 → 把 `~/.dsh/ext-bridge-token` 的内容粘贴到 Token 一栏 →
|
|
20
|
+
2. 打开扩展侧边栏 → 设置 → 把 `~/.dsh/ext-bridge-token` 的内容粘贴到 Token 一栏 → 保存并连接(桥地址留空即可自动探测 3080/3081/3090 与发现信标段 43189–43198)。
|
|
21
21
|
|
|
22
22
|
> Firefox 的 `moz-extension://` Origin 是每次安装随机生成的 UUID,不构成身份边界,因此 0.3.1 起 Firefox 客户端必须出示 token(与上游 [Lum1104/dsh-browser](https://github.com/Lum1104/dsh-browser) 同步的安全收紧)。
|
|
23
23
|
|
|
24
24
|
## 提供的工具
|
|
25
25
|
|
|
26
|
-
`browser_snapshot
|
|
26
|
+
`browser_snapshot`(结构化文本快照,支持 `delta` / `region` / iframe 聚合)、`browser_click`、`browser_type`、`browser_press`、`browser_scroll`、`browser_navigate`(后台新标签页)、`browser_back` / `browser_forward` / `browser_reload`、`browser_get_text`、`browser_wait`、`browser_evaluate`(受限预编译 DOM 操作,非任意 JS)、`browser_screenshot`(视觉兜底,图像作为原生图像块进模型上下文)、`browser_list_tabs`、`browser_open_tab`、`browser_follow_tab`、`browser_close_tab`。
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
共 17 个工具。页面渲染为带编号交互元素清单的文本;截图存入宿主附件库并以**原生图像块**返回给模型,不产生本地临时文件。
|
|
29
|
+
|
|
30
|
+
## 交互卡片
|
|
31
|
+
|
|
32
|
+
宿主发起的 `ask_user_question` 与权限审批,卡片会推给扩展侧边栏——但**只在侧边栏是你最近操作的那一侧时**。插件按「本会话最后一条消息从哪发出」判断归属:侧边栏发的经过桥(插件直接看到),dsh web 发的只留在宿主日志里,通过消息的 `rpcId` 归因区分。侧边栏未打开时一律交给 dsh web。
|
|
33
|
+
|
|
34
|
+
`answerTimeoutMs`(默认 10 分钟)保底:无人应答的卡片会被结算,不会永久占用回合。
|
|
35
|
+
|
|
36
|
+
## 安全
|
|
37
|
+
|
|
38
|
+
桥以宿主 owner 身份访问网关,因此非回环客户端被限制在命名空间白名单内(`session` / `workspace` / `userQuestions`),`terminal/*`、`dynamicCordisRunner/*`、`pluginManager/*` 等可执行端点默认拒绝。页面派生文本在送入模型前包裹在带随机 nonce 的不可信边界中。
|
|
29
39
|
|
|
30
40
|
## 许可
|
|
31
41
|
|
package/icon.svg
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36' fill='none'>
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id='w' x1='0' y1='0' x2='1' y2='1'><stop stop-color='#7E90A3'/><stop offset='1' stop-color='#566B80'/></linearGradient>
|
|
4
|
+
<linearGradient id='p' x1='0' y1='0' x2='1' y2='1'><stop stop-color='#8FC0B2'/><stop offset='1' stop-color='#5F8F86'/></linearGradient>
|
|
5
|
+
</defs>
|
|
6
|
+
<rect x='9' y='9.5' width='18' height='17' rx='3.8' fill='url(#w)'/>
|
|
7
|
+
<rect x='13' y='14' width='10' height='2.3' rx='1.15' fill='#fff' fill-opacity='.92'/>
|
|
8
|
+
<rect x='13' y='18.9' width='6.3' height='2.3' rx='1.15' fill='#fff' fill-opacity='.62'/>
|
|
9
|
+
<circle cx='28' cy='10.5' r='4.2' fill='url(#p)'/>
|
|
10
|
+
</svg>
|