dsh-browser-cdp 1.14.1 → 1.14.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 +25 -0
- package/bin/cdp-render-worker.mjs +8 -0
- package/dsh-plugin.json +207 -207
- package/lib/index.js +22 -23
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
## 1.14.3 (2026-11-22)
|
|
2
|
+
|
|
3
|
+
**img-in-link 点击误报收口(#17):`nodeContains` 先请求 document,祖先/后代容错从死代码变回活防护。**
|
|
4
|
+
|
|
5
|
+
上游 issue [#17](https://github.com/drscrewdriver/dsh-browser-cdp/issues/17)(同 #16 报告者,-32000 行号级定位)。worker 的 `nodeContains()` 调 `DOM.pushNodesByBackendIdsToFrontend` 前从未 `DOM.getDocument`(`grep -c getDocument` = 0),Chrome 一律回 `-32000 Document needs to be requested first`,被 try/catch 吞掉后恒返回 false —— 「命中点可能是目标的后代」这层容错整段失效。裸目标的点击不受影响(`hitBackendId === targetBackendId` 有短路),只有**目标中心点最顶层是其后代元素**时才走死路:`<a><img></a>`、svg-in-button 等嵌套结构在 pre-check 就被判 `click-missed`,**点击根本没派发**。
|
|
6
|
+
|
|
7
|
+
- **修复**:`nodeContains` 内、push 之前补 `await call('DOM.getDocument', {})`(worker 免构建产物,改文件即生效)。不缓存是刻意的:同进程导航会使映射失效,而本路径每次点击至多两次(pre/post 各一),depth=1 的 getDocument 开销可忽略 —— 缓存反而要为 worker 不处理事件的消循环引入 `DOM.documentUpdated` 监听。
|
|
8
|
+
- **实测转绿**(Chrome 158 headless,issue 复现法):修复前 `ok=False code=click-missed`("candidate measured to 40,20 but that point resolves to backendNodeId 8");修复后同一锚点 `ok=True code=ok`,点击真实派发并带 recorded 忠实记录。
|
|
9
|
+
- **契约测试**:worker-dispatch 套件新增序数断言(getDocument 先于 push),防回归方式与既有 reload-before-guard 用例一致。
|
|
10
|
+
- **边界**:跨文档导航后 post-check 的降级路径(afterHref 导航判定)零改动;backendNodeId 跨文档复用的理论边角在 effects 契约层两种路径都产出 `ok:true`(`navigated` 标志 src 侧无消费方),无回归。
|
|
11
|
+
|
|
12
|
+
门禁:`npm run typecheck` 干净;`npm test` **1337 passed / 13 skipped**(+1 契约用例);worker 为直维护 .mjs 无构建面,lib 未动。
|
|
13
|
+
|
|
14
|
+
## 1.14.2 (2026-11-22)
|
|
15
|
+
|
|
16
|
+
**jev_* 捕获必失败修复(#16):`linkId` 与 `targetId` 语义分离 + 不再丢弃已产出的捕获。**
|
|
17
|
+
|
|
18
|
+
上游 issue [#16](https://github.com/drscrewdriver/dsh-browser-cdp/issues/16)(三断链根因 + 行号级定位 + 修复建议)。病根是 `AttachState.targetId` 被双重复用:`attachMatchesLink` 与 cdp runtime 的 `sameTarget` 拿它当**缓存行归属键**(与 link.id 比较),jev 转发链(`effectsOf` / 第二处 `makeJudgeEffects`)又把它当 **CDP 页面 target id** 送进 worker 的 `attachPage` 严格匹配 —— 配置 link id(如 `cdp-local-chrome`)匹配 32-hex 必败,`connect` 必挂,宿主再在 `connected === null` 时把 worker 惰性 attach 已成功产出的截图整帧丢弃。
|
|
19
|
+
|
|
20
|
+
- **归属键分离**:`AttachState` 新增 `linkId` 字段(缓存行归属键 = 配置 link id);`targetId` 语义收紧为「真实 CDP 页面 target id,探针期未知为 `''`」。四个 runtime probe 写点改写 `linkId`,cdp runtime 的 `sameTarget` 同步改字段;`attachMatchesLink` 只比 `linkId`,`targetId` 不再参与归属判定。空 `targetId` 在 worker 侧本来就有回退(优先 http(s) 页面),所以 worker 零改动 —— 这正是修复成立的机制。
|
|
21
|
+
- **丢弃防御**:`src/jev/effects.ts` 的 capture / navigate 两处改为「step.ok 优先采用」——worker 的步骤自带惰性 attach,「connect 败、step 成」是真实可达态(#16 的 Proof 即此态);步骤本身失败时错误信息优先 `step.error`,旧错误文案逐分支兼容。
|
|
22
|
+
- **显示面**:`/bcdp` TUI status 的 `target=` 与 status JSON 均补 `linkId`(显示优先 `linkId`,`targetId` 键保留兼容形状)。注意:`/bcdp_status` JSON 与 gateway 暴露的 attach 里 `targetId` 值语义变化(配置 id → `''`/真实 id),外部读取方请改读 `linkId`。
|
|
23
|
+
|
|
24
|
+
门禁:`npm run typecheck` 干净;`npm test` **1336 passed / 13 skipped**(新增 5 用例:attachMatchesLink 的 linkId 判定与 targetId 不参与、probe 后 `linkId===link.id` 且 `targetId===''`、connect 败 step 成的 capture/navigate 不丢弃、step.error 优先与缺 reply 物化错误);`lib/` rebuild 并随提交。
|
|
25
|
+
|
|
1
26
|
## 1.14.0 (2026-11-18)
|
|
2
27
|
|
|
3
28
|
**观察窗多会话路由(#15):两个会话并行操作浏览器时,各自的观察窗各自显示自己的页面。**
|
|
@@ -330,6 +330,14 @@ async function nodeContains(targetBackendId, hitBackendId) {
|
|
|
330
330
|
if (!Number.isFinite(hitBackendId) || hitBackendId <= 0) return false
|
|
331
331
|
if (hitBackendId === targetBackendId) return true
|
|
332
332
|
try {
|
|
333
|
+
// `pushNodesByBackendIdsToFrontend` refuses until a document has been
|
|
334
|
+
// requested (-32000 "Document needs to be requested first"). Nothing else
|
|
335
|
+
// in this worker ever asks for one, so every call here used to throw and
|
|
336
|
+
// the ancestor/descendant tolerance was dead code — an <a> wrapping an
|
|
337
|
+
// <img> was misreported as click-missed (issue #17). Uncached on purpose:
|
|
338
|
+
// a navigation inside this process invalidates the mapping, and this path
|
|
339
|
+
// runs at most twice per click.
|
|
340
|
+
await call('DOM.getDocument', {})
|
|
333
341
|
const pushed = await call('DOM.pushNodesByBackendIdsToFrontend', { backendNodeIds: [targetBackendId, hitBackendId] })
|
|
334
342
|
const [targetNodeId, hitNodeId] = pushed?.nodeIds ?? []
|
|
335
343
|
if (!targetNodeId || !hitNodeId) return false
|
package/dsh-plugin.json
CHANGED
|
@@ -1,208 +1,208 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
|
|
3
|
-
"id": "dsh-browser-cdp",
|
|
4
|
-
"name": "dsh-browser-cdp",
|
|
5
|
-
"version": "1.14.
|
|
6
|
-
"manifestVersion": "0.15",
|
|
7
|
-
"facets": {
|
|
8
|
-
"host": {
|
|
9
|
-
"entry": "lib/index.js",
|
|
10
|
-
"apiVersion": "v1alpha1"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"requires": {
|
|
14
|
-
"contracts": [
|
|
15
|
-
{
|
|
16
|
-
"apiVersion": "presentation.dsh/v1alpha1",
|
|
17
|
-
"kind": "OpenExternal",
|
|
18
|
-
"optional": true,
|
|
19
|
-
"fallback": "report the URL as text instead of opening it"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"apiVersion": "presentation.dsh/v1alpha1",
|
|
23
|
-
"kind": "Notification",
|
|
24
|
-
"optional": true,
|
|
25
|
-
"fallback": "log the notice to the browser-status scene"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
"permissions": [],
|
|
30
|
-
"contributes": {
|
|
31
|
-
"commands": [],
|
|
32
|
-
"x-dsh-tui": [
|
|
33
|
-
{
|
|
34
|
-
"apiVersion": "tui.dsh/v1alpha1",
|
|
35
|
-
"kind": "Scene",
|
|
36
|
-
"id": "dsh-browser-cdp.watch",
|
|
37
|
-
"name": "agent_browser",
|
|
38
|
-
"spec": {
|
|
39
|
-
"title": "Agent 浏览器",
|
|
40
|
-
"titles": {
|
|
41
|
-
"en": "Agent Browser",
|
|
42
|
-
"zh": "Agent 浏览器",
|
|
43
|
-
"pt": "Navegador do agente"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"apiVersion": "tui.dsh/v1alpha1",
|
|
49
|
-
"kind": "SettingsSection",
|
|
50
|
-
"id": "dsh-browser-cdp.settings",
|
|
51
|
-
"name": "dsh_browser_cdp_settings",
|
|
52
|
-
"spec": {
|
|
53
|
-
"namespace": "dsh-browser-cdp",
|
|
54
|
-
"title": "Agent 浏览器",
|
|
55
|
-
"titles": {
|
|
56
|
-
"en": "Agent Browser",
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
|
|
3
|
+
"id": "dsh-browser-cdp",
|
|
4
|
+
"name": "dsh-browser-cdp",
|
|
5
|
+
"version": "1.14.3",
|
|
6
|
+
"manifestVersion": "0.15",
|
|
7
|
+
"facets": {
|
|
8
|
+
"host": {
|
|
9
|
+
"entry": "lib/index.js",
|
|
10
|
+
"apiVersion": "v1alpha1"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"requires": {
|
|
14
|
+
"contracts": [
|
|
15
|
+
{
|
|
16
|
+
"apiVersion": "presentation.dsh/v1alpha1",
|
|
17
|
+
"kind": "OpenExternal",
|
|
18
|
+
"optional": true,
|
|
19
|
+
"fallback": "report the URL as text instead of opening it"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"apiVersion": "presentation.dsh/v1alpha1",
|
|
23
|
+
"kind": "Notification",
|
|
24
|
+
"optional": true,
|
|
25
|
+
"fallback": "log the notice to the browser-status scene"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"permissions": [],
|
|
30
|
+
"contributes": {
|
|
31
|
+
"commands": [],
|
|
32
|
+
"x-dsh-tui": [
|
|
33
|
+
{
|
|
34
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
35
|
+
"kind": "Scene",
|
|
36
|
+
"id": "dsh-browser-cdp.watch",
|
|
37
|
+
"name": "agent_browser",
|
|
38
|
+
"spec": {
|
|
39
|
+
"title": "Agent 浏览器",
|
|
40
|
+
"titles": {
|
|
41
|
+
"en": "Agent Browser",
|
|
57
42
|
"zh": "Agent 浏览器",
|
|
58
|
-
"pt": "Navegador do agente"
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
43
|
+
"pt": "Navegador do agente"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
49
|
+
"kind": "SettingsSection",
|
|
50
|
+
"id": "dsh-browser-cdp.settings",
|
|
51
|
+
"name": "dsh_browser_cdp_settings",
|
|
52
|
+
"spec": {
|
|
53
|
+
"namespace": "dsh-browser-cdp",
|
|
54
|
+
"title": "Agent 浏览器",
|
|
55
|
+
"titles": {
|
|
56
|
+
"en": "Agent Browser",
|
|
57
|
+
"zh": "Agent 浏览器",
|
|
58
|
+
"pt": "Navegador do agente"
|
|
59
|
+
},
|
|
60
|
+
"fields": [
|
|
61
|
+
{
|
|
62
|
+
"path": [
|
|
63
|
+
"toolInjection"
|
|
64
|
+
],
|
|
65
|
+
"label": "工具注入模式 (Tool injection mode)",
|
|
66
|
+
"kind": "select",
|
|
67
|
+
"options": [
|
|
68
|
+
{
|
|
69
|
+
"value": "lazy",
|
|
70
|
+
"label": "lazy"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"value": "always",
|
|
74
|
+
"label": "always"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"hint": "lazy(默认)= 只常驻 1 个(bcdp_help,兼作解锁入口与运行态查询),其余首次 bcdp_* 调用后按下方开关注入,闲置回收时收回;always = 挂载即注册全部 35 个(历史行为)。"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"path": [
|
|
81
|
+
"toolBrowse"
|
|
82
|
+
],
|
|
83
|
+
"label": "基础操作工具(19 个)",
|
|
84
|
+
"kind": "boolean",
|
|
85
|
+
"hint": "开(默认)= 浏览器活动后按 act → observe → wait 三波放行;关 = 19 个工具从模型工具列表移除(空间/导航/点击/填写/键鼠/拖拽/截图/读取/指南/预检/等待…)。"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"path": [
|
|
89
|
+
"toolExtended"
|
|
90
|
+
],
|
|
91
|
+
"label": "扩展能力工具(8 个)",
|
|
92
|
+
"kind": "boolean",
|
|
93
|
+
"hint": "开(默认)= 浏览器活动后注册;关 = 8 个工具移除(裸 CDP/HTTP/上传/下载/对话框/验证码/登录落盘/登录导入)。"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"path": [
|
|
97
|
+
"toolEscape"
|
|
98
|
+
],
|
|
99
|
+
"label": "逃生舱 script(1 个)",
|
|
100
|
+
"kind": "boolean",
|
|
101
|
+
"hint": "与其它非 core 档一样等浏览器活动(1.7.0 起不再有「始终可达」豁免):先调 bcdp_status 即可拿到它,一个 heredoc 能做到其余大多数工具的事。关 = 封印。"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"path": [
|
|
105
|
+
"toolJudge"
|
|
106
|
+
],
|
|
107
|
+
"label": "评审工具 bcdp_jev_*(5 个)",
|
|
108
|
+
"kind": "boolean",
|
|
109
|
+
"hint": "开仍需配了 JEV 或 Laya Key:没 Key 的评审工具只能回答「未配置」,依旧不注入。关 = 任何情况下都不注入。"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"path": [
|
|
113
|
+
"sessionScopedPulse"
|
|
114
|
+
],
|
|
115
|
+
"label": "按会话隔离解锁 (Per-session unlock)",
|
|
116
|
+
"kind": "boolean",
|
|
117
|
+
"hint": "开(默认)= 每个会话各自调 bcdp_status 解锁,不会影响到其他会话;关 = 进程级共享(任一会话解锁对所有会话生效,历史行为)。宿主不支持时自动降级为关。"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"path": [
|
|
121
|
+
"isolateSpaces"
|
|
122
|
+
],
|
|
123
|
+
"label": "任务空间沙盒隔离 (Space isolation)",
|
|
124
|
+
"kind": "boolean",
|
|
125
|
+
"hint": "默认关闭:使用磁盘持久化 Profile,任务中登录的账号跨电脑重启永久保留;开启后使用内存临时沙盒隔离,任务结束不落盘。"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"path": [
|
|
129
|
+
"idleTimeoutMin"
|
|
130
|
+
],
|
|
131
|
+
"label": "空闲自动回收 (Idle auto-stop, minutes)",
|
|
132
|
+
"kind": "number",
|
|
133
|
+
"hint": "N 分钟没有任何 bcdp_* 调用后自动关闭后台浏览器进程(0 = 关闭此功能)。下次调用会自动冷启动(约 2-4 秒)。观察窗正在观看不算活动。"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"path": [
|
|
137
|
+
"chromePath"
|
|
138
|
+
],
|
|
139
|
+
"label": "Browser binary path",
|
|
140
|
+
"kind": "text",
|
|
141
|
+
"hint": "Path to the Chrome/Chromium/Edge binary. Empty = auto-detect."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"path": [
|
|
145
|
+
"captureBackend"
|
|
146
|
+
],
|
|
147
|
+
"label": "Capture backend",
|
|
148
|
+
"kind": "select",
|
|
149
|
+
"options": [
|
|
150
|
+
{
|
|
151
|
+
"value": "auto",
|
|
152
|
+
"label": "Auto"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"value": "cdp",
|
|
156
|
+
"label": "CDP"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"value": "ffmpeg",
|
|
160
|
+
"label": "FFmpeg"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"path": [
|
|
166
|
+
"streamProfile"
|
|
167
|
+
],
|
|
168
|
+
"label": "Quality profile",
|
|
169
|
+
"kind": "select",
|
|
170
|
+
"options": [
|
|
171
|
+
{
|
|
172
|
+
"value": "balanced",
|
|
173
|
+
"label": "Balanced"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"value": "quality",
|
|
177
|
+
"label": "Quality"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"value": "speed",
|
|
181
|
+
"label": "Speed"
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"path": [
|
|
187
|
+
"ffmpegPath"
|
|
188
|
+
],
|
|
189
|
+
"label": "FFmpeg binary path",
|
|
190
|
+
"kind": "text",
|
|
191
|
+
"hint": "Path to ffmpeg. Empty = auto-detect / on-demand install."
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"subscriptions": [],
|
|
199
|
+
"license": "MIT",
|
|
200
|
+
"source": {
|
|
201
|
+
"repository": "https://github.com/drscrewdriver/dsh-browser-cdp"
|
|
202
|
+
},
|
|
203
|
+
"compat": {
|
|
204
|
+
"hosts": [
|
|
205
|
+
"dsh-tui"
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -907,10 +907,11 @@ async function probe$3({ input, cache, suggested, link, now }) {
|
|
|
907
907
|
resolvedAt: now()
|
|
908
908
|
});
|
|
909
909
|
const previous = cache.get();
|
|
910
|
-
const sameTarget = previous.
|
|
910
|
+
const sameTarget = previous.linkId === link.id && previous.endpoint === link.endpoint;
|
|
911
911
|
const suggestedProbe = {
|
|
912
912
|
...suggested,
|
|
913
|
-
|
|
913
|
+
linkId: link.id,
|
|
914
|
+
targetId: "",
|
|
914
915
|
endpoint: link.endpoint,
|
|
915
916
|
status: "probing",
|
|
916
917
|
code: "",
|
|
@@ -1337,7 +1338,7 @@ async function probe$2({ input, cache, suggested, link, now }) {
|
|
|
1337
1338
|
});
|
|
1338
1339
|
const base = {
|
|
1339
1340
|
...suggested,
|
|
1340
|
-
|
|
1341
|
+
linkId: link.id,
|
|
1341
1342
|
endpoint: "",
|
|
1342
1343
|
wsUrl: "",
|
|
1343
1344
|
linkKind: "ego-cli",
|
|
@@ -1410,7 +1411,7 @@ async function probe$1({ input, cache, suggested, link, now }) {
|
|
|
1410
1411
|
});
|
|
1411
1412
|
const base = {
|
|
1412
1413
|
...suggested,
|
|
1413
|
-
|
|
1414
|
+
linkId: link.id,
|
|
1414
1415
|
endpoint: "",
|
|
1415
1416
|
wsUrl: "",
|
|
1416
1417
|
linkKind: "lightpanda",
|
|
@@ -1477,7 +1478,7 @@ async function probe({ input, cache, suggested, link, now }) {
|
|
|
1477
1478
|
});
|
|
1478
1479
|
const base = {
|
|
1479
1480
|
...suggested,
|
|
1480
|
-
|
|
1481
|
+
linkId: link.id,
|
|
1481
1482
|
linkKind: "tabbit-cli",
|
|
1482
1483
|
ownsBrowser: true
|
|
1483
1484
|
};
|
|
@@ -1729,7 +1730,7 @@ function resolveEffectiveLink(links, activeTargetId) {
|
|
|
1729
1730
|
* that leak is how a deactivated ego-cli kept driving every bcdp_* call.
|
|
1730
1731
|
*/
|
|
1731
1732
|
function attachMatchesLink(attach, link) {
|
|
1732
|
-
if (attach.
|
|
1733
|
+
if ((attach.linkId ?? "") !== link.id) return false;
|
|
1733
1734
|
return link.kind !== "cdp" || attach.endpoint === link.endpoint;
|
|
1734
1735
|
}
|
|
1735
1736
|
/**
|
|
@@ -1765,6 +1766,7 @@ function emptyAttachState() {
|
|
|
1765
1766
|
return {
|
|
1766
1767
|
status: "idle",
|
|
1767
1768
|
mode: "auto",
|
|
1769
|
+
linkId: "",
|
|
1768
1770
|
targetId: "",
|
|
1769
1771
|
endpoint: "",
|
|
1770
1772
|
wsUrl: "",
|
|
@@ -6323,7 +6325,7 @@ function statusCommand(deps) {
|
|
|
6323
6325
|
const status = attach.status || "unknown";
|
|
6324
6326
|
const lines = [
|
|
6325
6327
|
`bcdp status — ${status}${attach.message ? `: ${clip(attach.message, 48)}` : ""}`,
|
|
6326
|
-
` channel mode=${attach.mode || "—"} backend=${link?.kind ?? "none"} target=${attach.targetId || "—"}`,
|
|
6328
|
+
` channel mode=${attach.mode || "—"} backend=${link?.kind ?? "none"} target=${attach.linkId || attach.targetId || "—"}`,
|
|
6327
6329
|
` endpoint ${attach.endpoint || "—"}${attach.endpointSource ? ` (${attach.endpointSource})` : ""}`,
|
|
6328
6330
|
` cli ${attach.cliPath || cfg.egoBin || "—"}${attach.latencyMs ? ` ${attach.latencyMs}ms` : ""}`,
|
|
6329
6331
|
` tools live ${face.live.length} / sealed ${face.sealed.length} injection=${cfg.toolInjection}`,
|
|
@@ -6578,6 +6580,7 @@ async function runBcdpCommand(rawInput, deps) {
|
|
|
6578
6580
|
attach: {
|
|
6579
6581
|
status: attach.status,
|
|
6580
6582
|
mode: attach.mode,
|
|
6583
|
+
linkId: attach.linkId ?? "",
|
|
6581
6584
|
targetId: attach.targetId,
|
|
6582
6585
|
code: attach.code,
|
|
6583
6586
|
message: attach.message
|
|
@@ -9470,13 +9473,9 @@ function makeJudgeEffects(deps) {
|
|
|
9470
9473
|
}
|
|
9471
9474
|
}]
|
|
9472
9475
|
});
|
|
9473
|
-
if (call.connected === null) {
|
|
9474
|
-
error = call.steps[0]?.error ?? "the render worker could not attach to the page";
|
|
9475
|
-
throw new Error(error);
|
|
9476
|
-
}
|
|
9477
9476
|
const step$1 = call.steps[0];
|
|
9478
9477
|
if (step$1 === void 0 || !step$1.ok) {
|
|
9479
|
-
error = step$1?.error ?? "the render worker returned no capture";
|
|
9478
|
+
error = step$1?.error ?? (call.connected === null ? "the render worker could not attach to the page" : "the render worker returned no capture");
|
|
9480
9479
|
throw new Error(error);
|
|
9481
9480
|
}
|
|
9482
9481
|
const reply = step$1.result;
|
|
@@ -9538,21 +9537,21 @@ function makeJudgeEffects(deps) {
|
|
|
9538
9537
|
}]
|
|
9539
9538
|
});
|
|
9540
9539
|
const step$1 = call.steps[0];
|
|
9541
|
-
if (
|
|
9542
|
-
const
|
|
9543
|
-
error = why;
|
|
9540
|
+
if (step$1 !== void 0 && step$1.ok) {
|
|
9541
|
+
const reply = step$1.result;
|
|
9544
9542
|
return {
|
|
9545
|
-
ok:
|
|
9546
|
-
url:
|
|
9547
|
-
loaded:
|
|
9548
|
-
error: why
|
|
9543
|
+
ok: true,
|
|
9544
|
+
url: reply.url,
|
|
9545
|
+
loaded: reply.loaded
|
|
9549
9546
|
};
|
|
9550
9547
|
}
|
|
9551
|
-
const
|
|
9548
|
+
const why = step$1?.error ?? (call.connected === null ? "the render worker could not attach to the page" : "the render worker returned no result");
|
|
9549
|
+
error = why;
|
|
9552
9550
|
return {
|
|
9553
|
-
ok:
|
|
9554
|
-
url:
|
|
9555
|
-
loaded:
|
|
9551
|
+
ok: false,
|
|
9552
|
+
url: "",
|
|
9553
|
+
loaded: false,
|
|
9554
|
+
error: why
|
|
9556
9555
|
};
|
|
9557
9556
|
},
|
|
9558
9557
|
async capture() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-browser-cdp",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.3",
|
|
4
4
|
"description": "dsh-browser-cdp: visible agent browser for DSH — drives the vendored ego-compatible Chromium over CDP, and can also attach to a running Chrome/Edge/Brave or route through egolite, Tabbit and Lightpanda backends. 35 structured bcdp_* tools; only bcdp_status stays resident by default (lazy injection, −91.9% schema per turn for non-browser sessions). Realtime watch panel with direct click/scroll/IME input, element picks quoted into the composer, human-verification notices; non-CDP channels sync frames by 3s polling. Web shell: floating watch ball without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.0-rc.2 ~ 0.2.2-rc.1: declarative settings via Config .volatile() fields on 0.1.7+; imperative installSection / module-level registration + describe/mutate bridge on 0.1.0 ~ 0.1.5 (experimental, pending farm). Client peers stay optional so gen-1 hosts without dsh-client-store still load; for a production install on the current line use the 0.17.x line]",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -151,4 +151,4 @@
|
|
|
151
151
|
"registry": "https://registry.npmjs.org",
|
|
152
152
|
"tag": "latest"
|
|
153
153
|
}
|
|
154
|
-
}
|
|
154
|
+
}
|