dsh-browser-cdp 1.4.1 → 1.5.0
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.de.md +3 -3
- package/README.es.md +3 -3
- package/README.fr.md +3 -3
- package/README.it.md +3 -3
- package/README.md +38 -20
- package/README.ru.md +3 -3
- package/dsh-plugin.json +1 -1
- package/lib/index.js +81 -205
- package/package.json +1 -1
package/README.de.md
CHANGED
|
@@ -173,11 +173,11 @@ Beziehungen zu anderen Schaltern:
|
|
|
173
173
|
|
|
174
174
|
| Kategorie | Werkzeuge |
|
|
175
175
|
|---|---|
|
|
176
|
-
| Task-Spaces | `
|
|
176
|
+
| Task-Spaces | `bcdp_space` (open/close/list/handoff/takeover) `bcdp_status` |
|
|
177
177
|
| Seitenlesen | `bcdp_snapshot` (semantischer Baum) `bcdp_page_info` `bcdp_read_element` |
|
|
178
|
-
| Navigation/Warten | `bcdp_navigate` (Tab-Wiederverwendung) `bcdp_wait`
|
|
178
|
+
| Navigation/Warten | `bcdp_navigate` (Tab-Wiederverwendung) `bcdp_wait` (duration/selector/url/response/load/function/request/event) |
|
|
179
179
|
| Interaktion | `bcdp_click` `bcdp_fill` `bcdp_hover` `bcdp_drag` `bcdp_select` `bcdp_check` `bcdp_key` `bcdp_scroll` |
|
|
180
|
-
| Ausführung/Debugging | `bcdp_js` (Seitenauswertung) `bcdp_cdp` (rohes CDP) `
|
|
180
|
+
| Ausführung/Debugging | `bcdp_js` (Seitenauswertung) `bcdp_cdp` (rohes CDP) `bcdp_script` (heredoc; verbatim = raw, no preamble) |
|
|
181
181
|
| Ausgaben | `bcdp_screenshot` `bcdp_download` `bcdp_upload` |
|
|
182
182
|
| Sitzung/Sicherheit | `bcdp_auth_flush` (Login-Persistenz) `bcdp_login_import` (browserübergreifender Login-Import) `bcdp_captcha` `bcdp_dialog` |
|
|
183
183
|
| Meta-Werkzeuge | `bcdp_help` `bcdp_doctor` `bcdp_http` |
|
package/README.es.md
CHANGED
|
@@ -173,11 +173,11 @@ Relación con otros interruptores:
|
|
|
173
173
|
|
|
174
174
|
| Categoría | Herramientas |
|
|
175
175
|
|---|---|
|
|
176
|
-
| Espacios de tareas | `
|
|
176
|
+
| Espacios de tareas | `bcdp_space` (open/close/list/handoff/takeover) `bcdp_status` |
|
|
177
177
|
| Lectura de páginas | `bcdp_snapshot` (árbol semántico) `bcdp_page_info` `bcdp_read_element` |
|
|
178
|
-
| Navegación/espera | `bcdp_navigate` (reutiliza la pestaña) `bcdp_wait`
|
|
178
|
+
| Navegación/espera | `bcdp_navigate` (reutiliza la pestaña) `bcdp_wait` (duration/selector/url/response/load/function/request/event) |
|
|
179
179
|
| Interacción | `bcdp_click` `bcdp_fill` `bcdp_hover` `bcdp_drag` `bcdp_select` `bcdp_check` `bcdp_key` `bcdp_scroll` |
|
|
180
|
-
| Ejecución/depuración | `bcdp_js` (evaluación en la página) `bcdp_cdp` (CDP crudo) `
|
|
180
|
+
| Ejecución/depuración | `bcdp_js` (evaluación en la página) `bcdp_cdp` (CDP crudo) `bcdp_script` (heredoc; verbatim = raw, no preamble) |
|
|
181
181
|
| Salidas | `bcdp_screenshot` `bcdp_download` `bcdp_upload` |
|
|
182
182
|
| Sesión/seguridad | `bcdp_auth_flush` (persistencia de sesión) `bcdp_login_import` (importación de sesión entre navegadores) `bcdp_captcha` `bcdp_dialog` |
|
|
183
183
|
| Metaherramientas | `bcdp_help` `bcdp_doctor` `bcdp_http` |
|
package/README.fr.md
CHANGED
|
@@ -173,11 +173,11 @@ Relations avec les autres commutateurs :
|
|
|
173
173
|
|
|
174
174
|
| Catégorie | Outils |
|
|
175
175
|
|---|---|
|
|
176
|
-
| Espaces de tâches | `
|
|
176
|
+
| Espaces de tâches | `bcdp_space` (open/close/list/handoff/takeover) `bcdp_status` |
|
|
177
177
|
| Lecture de page | `bcdp_snapshot` (arbre sémantique) `bcdp_page_info` `bcdp_read_element` |
|
|
178
|
-
| Navigation/attente | `bcdp_navigate` (réutilise l'onglet) `bcdp_wait`
|
|
178
|
+
| Navigation/attente | `bcdp_navigate` (réutilise l'onglet) `bcdp_wait` (duration/selector/url/response/load/function/request/event) |
|
|
179
179
|
| Interaction | `bcdp_click` `bcdp_fill` `bcdp_hover` `bcdp_drag` `bcdp_select` `bcdp_check` `bcdp_key` `bcdp_scroll` |
|
|
180
|
-
| Exécution/débogage | `bcdp_js` (évaluation dans la page) `bcdp_cdp` (CDP brut) `
|
|
180
|
+
| Exécution/débogage | `bcdp_js` (évaluation dans la page) `bcdp_cdp` (CDP brut) `bcdp_script` (heredoc; verbatim = raw, no preamble) |
|
|
181
181
|
| Sorties | `bcdp_screenshot` `bcdp_download` `bcdp_upload` |
|
|
182
182
|
| Session/sécurité | `bcdp_auth_flush` (persistance de la connexion) `bcdp_login_import` (import inter-navigateurs de l'état de connexion) `bcdp_captcha` `bcdp_dialog` |
|
|
183
183
|
| Méta-outils | `bcdp_help` `bcdp_doctor` `bcdp_http` |
|
package/README.it.md
CHANGED
|
@@ -173,11 +173,11 @@ Relazioni con gli altri interruttori:
|
|
|
173
173
|
|
|
174
174
|
| Categoria | Strumenti |
|
|
175
175
|
|---|---|
|
|
176
|
-
| Spazi di lavoro | `
|
|
176
|
+
| Spazi di lavoro | `bcdp_space` (open/close/list/handoff/takeover) `bcdp_status` |
|
|
177
177
|
| Lettura pagina | `bcdp_snapshot` (albero semantico) `bcdp_page_info` `bcdp_read_element` |
|
|
178
|
-
| Navigazione/attesa | `bcdp_navigate` (riusa la tab) `bcdp_wait`
|
|
178
|
+
| Navigazione/attesa | `bcdp_navigate` (riusa la tab) `bcdp_wait` (duration/selector/url/response/load/function/request/event) |
|
|
179
179
|
| Interazione | `bcdp_click` `bcdp_fill` `bcdp_hover` `bcdp_drag` `bcdp_select` `bcdp_check` `bcdp_key` `bcdp_scroll` |
|
|
180
|
-
| Esecuzione/debug | `bcdp_js` (valutazione nella pagina) `bcdp_cdp` (CDP grezzo) `
|
|
180
|
+
| Esecuzione/debug | `bcdp_js` (valutazione nella pagina) `bcdp_cdp` (CDP grezzo) `bcdp_script` (heredoc; verbatim = raw, no preamble) |
|
|
181
181
|
| Output | `bcdp_screenshot` `bcdp_download` `bcdp_upload` |
|
|
182
182
|
| Sessione/sicurezza | `bcdp_auth_flush` (persistenza dell'accesso) `bcdp_login_import` (import dell'accesso tra browser) `bcdp_captcha` `bcdp_dialog` |
|
|
183
183
|
| Meta-strumenti | `bcdp_help` `bcdp_doctor` `bcdp_http` |
|
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
**登录态导入(v0.8.5 新增)**:工具 `bcdp_login_import`,把你日常 Chrome/Edge/Brave 里的登录 cookie **按域名**复制进 agent 浏览器(真实二进制无头启动 + CDP 透传读取,兼容 Chrome 127+ 的 App-Bound Encryption,不做离线解密;源浏览器运行中可选择优雅关闭后导入,窗口下次启动自动恢复)。cookie 值不出现在任何日志与输出中;导入前自动备份源 cookie 库,异常清空自动还原。配合默认的磁盘持久化 Profile,导入的登录态跨重启永久保留。
|
|
38
38
|
|
|
39
|
-
一款 **CDP 浏览器代理**:把 [CitroLabs/ego-lite](https://github.com/CitroLabs/ego-lite)(给 AI Agent 用的 Chromium)作为内置运行时接入 DeepSeek Harness,以 **
|
|
39
|
+
一款 **CDP 浏览器代理**:把 [CitroLabs/ego-lite](https://github.com/CitroLabs/ego-lite)(给 AI Agent 用的 Chromium)作为内置运行时接入 DeepSeek Harness,以 **34 个结构化 `bcdp_*` 工具**驱动浏览器,并配一套**实时观察前端口**——agent 后台操作网页时,你能像看直播一样看到它正在浏览的每个页面,还能直接操作它。
|
|
40
40
|
|
|
41
41
|
**一点私藏的独特之处(self-observation)**:agent 用的就是这一个 Chromium——连它操作 **DSH 自身**(管理会话、任务看板、调设置)时,观察窗也实时显示、你能随时接手。不只是"看得见 agent 在网页上干活",连 agent 操作 DSH 界面本身都是全程可见、可掌控的。
|
|
42
42
|
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
| 能力 | 本插件(本仓库) | 同类插件(Da1dr1em/dsh-ego-browser) |
|
|
52
52
|
|---|---|---|
|
|
53
|
-
| 结构化工具数 | **
|
|
53
|
+
| 结构化工具数 | **34 个**,职责单一、可确定性调用 | **3 个**(`run`/`help`/`status`) |
|
|
54
54
|
| 实时观察窗(CDP JPEG / FFmpeg H.264 双后端 + 标签条 + 历史抽屉) | ✅ 有 | ❌ 无 |
|
|
55
55
|
| 监控窗鼠标**直接操作**真实浏览器(点击/拖拽/滚动回传 CDP) | ✅ 有 | ❌ 无 |
|
|
56
56
|
| **观察窗点选元素 → 捕获并引用进对话输入框**(`[CDP-PICKS]` 结构化块,人工指认目标) | ✅ 有 | ❌ 无 |
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
- **控得住**:别家只读;我们监控窗**直接驱动**同一个 agent 浏览器,需要时你亲手接管(缩放/拖拽/点击),不必打断 agent 重来。
|
|
65
65
|
- **指得准**:你在观察窗里**点选**页面元素,插件捕获其 `backendNodeId`/`tag`/`id` 与语义描述,以 `[CDP-PICKS]` 结构化块并入对话输入框草稿(同页多元素自动合并编号)——agent 拿到的是精确目标,不用猜"你说的按钮是哪个"。
|
|
66
66
|
|
|
67
|
-
> 以上对比基于公开可见的可核实事实:本仓库代码(`bin/cdp-cast-worker.mjs` 实时推流 + CDP 输入回传、`lib/index.js`
|
|
67
|
+
> 以上对比基于公开可见的可核实事实:本仓库代码(`bin/cdp-cast-worker.mjs` 实时推流 + CDP 输入回传、`lib/index.js` 34 个注册工具、`lib/cast-server.js` host 桥接、`lib/client.js` 的 `deliverPickToConversation` 点选引用)与同类插件的源码/README(其 `src/tools.ts` 仅注册 `ego_browser_run` / `ego_browser_help` / `ego_browser_status`)。此文档不含对任何他人的贬低——我们只陈述自己多实现并验证了哪些能力。
|
|
68
68
|
|
|
69
69
|
**相对 [ego-lite](https://github.com/CitroLabs/ego-lite) 本体,我们多做了这些(都可对照本仓库代码核实):**
|
|
70
70
|
|
|
@@ -205,60 +205,78 @@ dshx list # 应显示:[on] dsh-
|
|
|
205
205
|
|
|
206
206
|
识别失败的端点(`engine: unknown`)保持**全能力**——误判只应"少给",不应"错给"。
|
|
207
207
|
|
|
208
|
-
## 工具清单(
|
|
208
|
+
## 工具清单(34 个,前缀 `bcdp_`,完整索引见 `bcdp_help`)
|
|
209
209
|
|
|
210
210
|
| 类别 | 工具 |
|
|
211
211
|
|---|---|
|
|
212
|
-
| 任务空间 | `
|
|
212
|
+
| 任务空间 | `bcdp_space`(open / close / list / handoff / takeover) `bcdp_status` |
|
|
213
213
|
| 页面读取 | `bcdp_snapshot`(语义树) `bcdp_page_info` `bcdp_read_element` |
|
|
214
|
-
| 导航/标签/等待 | `bcdp_navigate`(复用 tab / reload) `bcdp_tab`(list/current/new/switch/close) `bcdp_wait
|
|
214
|
+
| 导航/标签/等待 | `bcdp_navigate`(复用 tab / reload) `bcdp_tab`(list/current/new/switch/close) `bcdp_wait`(duration / selector / url / response / load / function / request / event) |
|
|
215
215
|
| 交互 | `bcdp_click` `bcdp_fill` `bcdp_hover` `bcdp_drag` `bcdp_select` `bcdp_check` `bcdp_key`(type/insert) `bcdp_scroll` |
|
|
216
|
-
| 执行/调试 | `bcdp_js`(页面求值) `bcdp_cdp`(原始 CDP) `bcdp_cli
|
|
216
|
+
| 执行/调试 | `bcdp_js`(页面求值) `bcdp_cdp`(原始 CDP) `bcdp_script`(多步脚本;`verbatim:true` = 原 `bcdp_cli` 的裸 heredoc) |
|
|
217
217
|
| 输出 | `bcdp_screenshot` `bcdp_download` `bcdp_upload` |
|
|
218
218
|
| 会话/安全 | `bcdp_auth_flush`(登录落盘) `bcdp_login_import`(跨浏览器登录态导入) `bcdp_captcha` `bcdp_dialog` |
|
|
219
219
|
| 元工具 | `bcdp_help` `bcdp_doctor` `bcdp_http` |
|
|
220
220
|
| 评审(JEV/Laya,外接判定服务可选) | `bcdp_jev_status` `bcdp_jev_frame` `bcdp_jev_ask` `bcdp_jev_run` `bcdp_jev_attempt` |
|
|
221
221
|
|
|
222
|
+
|
|
223
|
+
### 1.5.0 迁移表(旧名 → 新调用)
|
|
224
|
+
|
|
225
|
+
wait / space / escape 三族已按 `op` 合并,旧工具名**移除**(不保留别名——别名同样吃 schema 预算,等于没省)。其余工具名不变。
|
|
226
|
+
|
|
227
|
+
| 旧调用 | 新调用 |
|
|
228
|
+
|---|---|
|
|
229
|
+
| `bcdp_wait` `{ms}` | `bcdp_wait` `{op:"duration", ms}` |
|
|
230
|
+
| `bcdp_wait_for_selector` `{selector, state, timeout}` | `bcdp_wait` `{op:"selector", selector, state, timeout}` |
|
|
231
|
+
| `bcdp_wait_for_url` `{pattern, timeout}` | `bcdp_wait` `{op:"url", pattern, timeout}` |
|
|
232
|
+
| `bcdp_wait_for_response` `{url, body, timeout}` | `bcdp_wait` `{op:"response", url, body, timeout}` |
|
|
233
|
+
| `bcdp_wait_page` `{op:"load"\|"function"\|"request"\|"event", …}` | `bcdp_wait` 同名 op(`op` 取值不变,直接搬家) |
|
|
234
|
+
| `bcdp_space_open` `{name}` | `bcdp_space` `{op:"open", name}` |
|
|
235
|
+
| `bcdp_space_close` `{name, keep}` | `bcdp_space` `{op:"close", name, keep}` |
|
|
236
|
+
| `bcdp_cli` `{script}` | `bcdp_script` `{script, verbatim:true}` |
|
|
237
|
+
|
|
238
|
+
> `op` 合并后各 op 的必需参数写在工具描述里;缺参会返回带 op 名的 `reason`(如 `bcdp_wait: selector is required for op=selector`),不会静默降级。
|
|
239
|
+
|
|
222
240
|
## 工具注入分级(懒注册 / 分级 / 锁定)
|
|
223
241
|
|
|
224
|
-
|
|
242
|
+
34 个工具全量注册时,**每个会话每一轮**都要为它们的 schema 付费(挂载级实测 `description` + `parameters` 序列化 = **22,224 字符** ≈ 6.4K token;1.3.2 的 38 工具基线用同一口径实测为 20,951,1.5.0 三族合并后仅高出 **+6.1%**,远低于 ≤+15% 门禁),而不碰浏览器的会话一个也用不上。插件因此把「谁能出现在模型面前」收成一处策略(`src/toolTiers.ts`),分**八批**注入。
|
|
225
243
|
|
|
226
|
-
> **8 批 ≠ 8 个开关**。批次是*注入时机*,开关是*用户面*(§9.3「开关与批次解耦」)。当前 4 个开关管 8 批:`toolBrowse` 管 act+observe+wait 三批并按波次放行,`toolExtended` 管 power+session,`toolEscape`、`toolJudge` 各管一批。所以「`toolBrowse` =
|
|
244
|
+
> **8 批 ≠ 8 个开关**。批次是*注入时机*,开关是*用户面*(§9.3「开关与批次解耦」)。当前 4 个开关管 8 批:`toolBrowse` 管 act+observe+wait 三批并按波次放行,`toolExtended` 管 power+session,`toolEscape`、`toolJudge` 各管一批。所以「`toolBrowse` = 14 个」指的是**并集上限**,实际第一波只放 9 个。
|
|
227
245
|
|
|
228
246
|
| 批次 | 成员 | schema | 何时出现 |
|
|
229
247
|
|---|---|---:|---|
|
|
230
|
-
| **core** 常驻(
|
|
248
|
+
| **core** 常驻(6) | `bcdp_status` `bcdp_doctor` `bcdp_help` `bcdp_space` `bcdp_navigate` `bcdp_snapshot` | 3,589 | 永远在场,不可封印——否则 lazy 模式连解锁入口都没有 |
|
|
231
249
|
| **act** 动手(9) | click / fill / key / hover / scroll / select / check / drag / tab | 5,243 | `lazy` 下首次活动放第一波 |
|
|
232
250
|
| **observe** 观察(4) | screenshot / page_info / read_element / js | 2,037 | 第二次活动 |
|
|
233
|
-
| **wait** 等待(
|
|
251
|
+
| **wait** 等待(1) | `bcdp_wait`(duration / selector / url / response / load / function / request / event) | 1,925 | 第三次活动 |
|
|
234
252
|
| **power** 重量级(5) | raw CDP / http / upload / download / dialog | 3,283 | 首次活动(同 `toolExtended`) |
|
|
235
253
|
| **session** 登录态(3) | captcha / auth_flush / login_import | 1,694 | 首次活动(同 `toolExtended`) |
|
|
236
|
-
| **escape** 逃生舱(
|
|
254
|
+
| **escape** 逃生舱(1) | `bcdp_script`(`verbatim:true` = 原 cli 的裸 heredoc) | 1,389 | **冷启动即在**,不吃活动闸(见下) |
|
|
237
255
|
| **judge** 评审链(5) | `bcdp_jev_*` | 3,064 | 除解锁外,**还要求配了 JEV 或 Laya Key** |
|
|
238
|
-
| **合计** |
|
|
256
|
+
| **合计** | 34 | **22,224** | — |
|
|
239
257
|
|
|
240
258
|
设置项在插件设置页**最上方**的「工具封印」分块(全部 volatile,翻完当场生效,不重启插件)——一个开关管一组批次,形状照 dsh-prime-memory 的「工具封印」:
|
|
241
259
|
|
|
242
260
|
- **`toolInjection`** `lazy`(**默认**:常驻 core + escape,其余首次 `bcdp_*` 调用后按开关注入)/ `always`(挂载即全量,历史行为)。
|
|
243
|
-
- **`toolBrowse`**(act + observe + wait =
|
|
261
|
+
- **`toolBrowse`**(act + observe + wait = 14)/ **`toolExtended`**(power + session = 8)/ **`toolEscape`**(script = 1)/ **`toolJudge`**(5):开 = 开放注册,关 = 该批从模型工具列表移除。四组各自独立,封一组不波及别组;`core` 级不给开关(封了就没了活动入口)。
|
|
244
262
|
|
|
245
|
-
**escape 批为什么单独成组、且不等活动**:`
|
|
263
|
+
**escape 批为什么单独成组、且不等活动**:`bcdp_script` 是唯一能在一次调用里干完任意多步任务的入口(`page` / `browser` / `taskSpaces` / `fetch` / `cdp` 全预置),其余 33 个工具能做的事它都能做。所以它必须始终可达——否则模型遇到「结构化工具没覆盖」的情形时手里没有任何逃生手段。这也让它成为**按需只开逃生舱**的合法姿势:关掉 `toolExtended`、留着 `toolEscape`,只留 1 个工具。
|
|
246
264
|
|
|
247
265
|
行为要点:
|
|
248
266
|
|
|
249
267
|
- **封印 = 反注册**(工具从模型的工具列表里消失),不是执行期拒绝。解锁信号挂在 `bcdp_*` 调用的公共出口上,工具体不知道分级存在;`bcdp_status` / `bcdp_help` / `bcdp_doctor` 自身也算活动信号(读了指南就得有工具可用)。
|
|
250
268
|
- **闲置自动收回**:`lazy` + `idleTimeoutMin > 0` 时,空闲回收把后台浏览器停掉的同一刻收回扩展面;下次活动重新铺开。`always` 模式不受影响。
|
|
251
269
|
- `legacyEgoToolNames` 的 `ego_*` 别名跟随其 `bcdp_*` 本体的级别。
|
|
252
|
-
- 当前注入面写在 `bcdp_doctor` 报告首行(`tool injection: mode=lazy browse=open extended=open escape=open judge=open judgeKey=none active=no → live
|
|
253
|
-
- 默认档下不碰浏览器的会话只有 **
|
|
254
|
-
- **各档实测注入面**(挂载级口径,1.
|
|
270
|
+
- 当前注入面写在 `bcdp_doctor` 报告首行(`tool injection: mode=lazy browse=open extended=open escape=open judge=open judgeKey=none active=no → live 7 / sealed 27`),不用猜。
|
|
271
|
+
- 默认档下不碰浏览器的会话只有 **7** 个工具在场(core 6 + escape 1 = 4,978 字符 ≈ 1,430 token,−77.6%);要回到历史行为把 `toolInjection` 改成 `always`(34 件全在场需再配一个评审 Key)。
|
|
272
|
+
- **各档实测注入面**(挂载级口径,1.5.0;字符为实测,token 按同一比例折算):默认 7 个 / 4,978 字符 ≈1,430 tok → 首次活动 24 个 / 15,198 ≈4,370 tok → 第 2 波(observe)28 个 / 17,235 ≈4,955 tok → 第 3 波(wait)29 个 / 19,160 ≈5,509 tok → 全量 34 个 / 22,224 ≈6,389 tok。
|
|
255
273
|
- 五个字段都带 schema `.default()`:volatile 字段的表单描述符直接拿 schema 默认值,不写默认会出现「面板显示 A、运行时用 B」。
|
|
256
274
|
|
|
257
|
-
>
|
|
275
|
+
> 取舍提醒:窄工具(一个动作一个工具)是模型写对参数、少重试的护栏。1.5.0 只合并了 **wait / space / escape** 三族同源冗余(41 → 34,省 1,869 字符 schema):五个 wait 共用同一 preamble 与 timeout 语义、三个 space 本就是同一个 op 工具的碎片、cli/script 是同一 heredoc 运行时。代价是这三族的旧工具名不再存在(见上方迁移表);交互原子(click/fill/key…)**不合并**,因为它们是模型写对参数的护栏。
|
|
258
276
|
|
|
259
277
|
## 任务空间命名与并发隔离(1.4.1)
|
|
260
278
|
|
|
261
|
-
- **默认空间名统一为 `default`**:代码常量 `DEFAULT_SPACE='default'`、`
|
|
279
|
+
- **默认空间名统一为 `default`**:代码常量 `DEFAULT_SPACE='default'`、`bcdp_space` 的 `op=open` 描述、`Config.defaultSpace` 三者一致。持久化 Profile 模式(默认)下**始终复用这一个具名槽**——登录态、tab、stream 跨会话保留;不要因为"当前在做任务 X"就另开编号空间(`#4`/`#5`),那会丢持久化。
|
|
262
280
|
- **`defaultSpace` 可配(A)**:`Config.defaultSpace` 是 volatile 标量,留空折叠为 `'default'`,热更新不重注册。注意区分两个概念:配置值 `cfg.defaultSpace`(schema 里那个)和运行时的**当前会话活值** `cfg.activeSpace`(命令实际用的 `useSpace(...)` 入参);前者是设置,后者随会话切换。
|
|
263
281
|
- **会话级隔离(B)**:活动空间追踪器按 `sessionId` 键控成一张槽位表(`Map<string,Slot>`,无 session 的调用落 `__global__` 槽保持向后兼容)。每个 `bcdp_*` 调用一进来就 `setCurrentSession(callingSessionId(exec))`,所以**并发多会话各开各的空间互不漂移**——A 会话重启空间不波及 B。
|
|
264
282
|
- **`:auto` 哨兵(C)**:沙箱模式(`isolateSpaces:true`)下默认名派生为 `dsh-agent-<sessionId 前 8 位>`,给每个会话一个独立命名空间;持久模式下 `:auto` 折叠为具名单槽 `default`。`resolveConfig` 把 `:auto` 原样保留,由追踪器据 sessionId + 模式决定真正落点。
|
package/README.ru.md
CHANGED
|
@@ -173,11 +173,11 @@ dshx list # должно пока
|
|
|
173
173
|
|
|
174
174
|
| Категория | Инструменты |
|
|
175
175
|
|---|---|
|
|
176
|
-
| Пространства задач | `
|
|
176
|
+
| Пространства задач | `bcdp_space` (open/close/list/handoff/takeover) `bcdp_status` |
|
|
177
177
|
| Чтение страниц | `bcdp_snapshot` (семантическое дерево) `bcdp_page_info` `bcdp_read_element` |
|
|
178
|
-
| Навигация/ожидание | `bcdp_navigate` (повторно использует вкладку) `bcdp_wait`
|
|
178
|
+
| Навигация/ожидание | `bcdp_navigate` (повторно использует вкладку) `bcdp_wait` (duration/selector/url/response/load/function/request/event) |
|
|
179
179
|
| Взаимодействие | `bcdp_click` `bcdp_fill` `bcdp_hover` `bcdp_drag` `bcdp_select` `bcdp_check` `bcdp_key` `bcdp_scroll` |
|
|
180
|
-
| Выполнение/отладка | `bcdp_js` (вычисление на странице) `bcdp_cdp` (сырой CDP) `
|
|
180
|
+
| Выполнение/отладка | `bcdp_js` (вычисление на странице) `bcdp_cdp` (сырой CDP) `bcdp_script` (heredoc; verbatim = raw, no preamble) |
|
|
181
181
|
| Вывод | `bcdp_screenshot` `bcdp_download` `bcdp_upload` |
|
|
182
182
|
| Сессия/безопасность | `bcdp_auth_flush` (персистентность входа) `bcdp_login_import` (импорт входа между браузерами) `bcdp_captcha` `bcdp_dialog` |
|
|
183
183
|
| Мета-инструменты | `bcdp_help` `bcdp_doctor` `bcdp_http` |
|
package/dsh-plugin.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -3231,22 +3231,22 @@ function envelopeError(code, message) {
|
|
|
3231
3231
|
* add/change a tool, remember to sync an entry here or bcdp_help won't find it.
|
|
3232
3232
|
*/
|
|
3233
3233
|
const EGO_HELP_INDEX = {
|
|
3234
|
-
overview: "CDP 浏览器代理:结构化浏览器工具。导航/交互/观察/表单/网络/等待/键鼠皆有专项工具,另提供 bcdp_help(本索引)、bcdp_doctor(体检)、
|
|
3235
|
-
tools: "工具清单: bcdp_status,
|
|
3234
|
+
overview: "CDP 浏览器代理:结构化浏览器工具。导航/交互/观察/表单/网络/等待/键鼠皆有专项工具,另提供 bcdp_help(本索引)、bcdp_doctor(体检)、bcdp_script(自由脚本逃生舱;verbatim:true 为裸 heredoc)。连接与激活见 topic=links。分类见: tools / navigate / observe / input / keyboard-mouse / form / wait / network / login / script / doctor / lightpanda / injection。用 `topic` 查询,或直接给工具名。",
|
|
3235
|
+
tools: "工具清单: bcdp_status, bcdp_space(+op:open/close/list/handoff/takeover), bcdp_snapshot, bcdp_navigate, bcdp_tab, bcdp_click(+double), bcdp_fill, bcdp_js, bcdp_cdp, bcdp_screenshot(+selector), bcdp_page_info, bcdp_wait(+op:duration/selector/url/response/load/function/request/event), bcdp_key(+text/type/insert), bcdp_hover, bcdp_read_element, bcdp_select, bcdp_drag, bcdp_scroll, bcdp_upload, bcdp_check, bcdp_dialog, bcdp_download, bcdp_http, bcdp_captcha, bcdp_auth_flush, bcdp_login_import, bcdp_help, bcdp_doctor, bcdp_script(+verbatim), bcdp_jev_status, bcdp_jev_frame, bcdp_jev_attempt, bcdp_jev_ask, bcdp_jev_run。",
|
|
3236
3236
|
links: "连接序列(设置面板):有序列表,顺序即优先级,被激活的一项驱动每一次 bcdp_* 调用。两种类型——CDP 端点(注入 EGO_LINUX_CDP_URL,指向已开调试端口的浏览器)与 本机 ego CLI(不注入端点,由本机 ego CLI 直接驱动 ego-lite 浏览器;仅限本机,全局至多一条)。cdpMode: auto=按激活项;remote=仅接受 CDP 端点;local=受管本地启动器。cdpMode=remote 与「本机 ego CLI」组合会显式报 mode-kind-mismatch。remoteEnabled 只管远端 CDP,不影响本机 CLI 连接。",
|
|
3237
|
-
navigate: "bcdp_navigate: 打开URL或切tab(同任务复用当前tab)。
|
|
3237
|
+
navigate: "bcdp_navigate: 打开URL或切tab(同任务复用当前tab)。bcdp_wait op=url: 等跳转(登录/分页)。",
|
|
3238
3238
|
observe: "bcdp_snapshot: 整页语义树(带[ref]/loc供点击); bcdp_page_info: url/标题/视口/滚动/对话框/人机验证; bcdp_read_element: 读单元素文本/HTML/值/属性/可见性/计数; bcdp_screenshot(+selector): 整页或元素截图。",
|
|
3239
3239
|
input: "bcdp_click(selector/坐标, double双击); bcdp_fill(填框); bcdp_key(press组合键 或 text连续键入); bcdp_check(勾选/取消); bcdp_select(下拉); bcdp_upload(文件上传); bcdp_dialog(接受/取消JS对话框)。",
|
|
3240
3240
|
"keyboard-mouse": "bcdp_key: 键盘(press/text); bcdp_hover: 悬停; bcdp_drag: 拖拽(元素或坐标); bcdp_scroll: 滚轮/滚到元素; bcdp_click: 点击/双击。",
|
|
3241
3241
|
form: "bcdp_fill 填输入框; bcdp_select 下拉; bcdp_check checkbox/radio; bcdp_upload 文件; bcdp_key 回车/Tab导航; bcdp_dialog 处理提交弹窗。",
|
|
3242
|
-
wait: "bcdp_wait(固定毫秒);
|
|
3243
|
-
network: "bcdp_http: 发HTTP请求(默认浏览器上下文 fetch.browser, mode=server走Node fetch.server);
|
|
3242
|
+
wait: "bcdp_wait 一个工具八个 op:duration(固定毫秒); selector(等元素出现/消失, 可带 state); url(等跳转); response(等网络响应, body=text|json 可读体); load(等加载状态); function(页内表达式变真); request(等请求); event(等下载)。",
|
|
3243
|
+
network: "bcdp_http: 发HTTP请求(默认浏览器上下文 fetch.browser, mode=server走Node fetch.server); bcdp_wait op=response: 等并读接口响应。",
|
|
3244
3244
|
download: "bcdp_download: 等下载事件并落到指定路径(triggerSelector/triggerScript + 可选 savePath)。",
|
|
3245
3245
|
captcha: "bcdp_captcha: 检测页面人机验证(CAPTCHA)并返回{detected,kind}; 检测到请让用户去 ego 浏览器完成; bcdp_page_info 也附带 humanCheck。",
|
|
3246
3246
|
login: "bcdp_auth_flush: 把登录cookie落盘到ego profile; 观察窗登录引导条+『已登录,保存』按钮触发同一动作。bcdp_login_import: 从系统浏览器(Chrome/Edge/Brave)按域名导入登录cookie(source/domains/dryRun; 先dryRun看可导入项; ego浏览器须已在运行)。",
|
|
3247
|
-
script: "
|
|
3247
|
+
script: "bcdp_script: 原样运行任意内置运行时 heredoc 脚本(page/browser/taskSpaces/site/fetch/cdp预载)。默认加 preamble(选区+激活真实 tab)并额外返回 duration/timedOut; verbatim:true 则完全原样、无 preamble(原 bcdp_cli 行为, 需自行 taskSpaces.useOrCreate)。",
|
|
3248
3248
|
doctor: "bcdp_doctor: 体检环境(浏览器候选、vendored runtime、状态目录、CDP端口、任务空间、引擎与降级清单);首行附工具注入面快照。",
|
|
3249
|
-
injection: "工具分级注入(不是工具,是出现时机):
|
|
3249
|
+
injection: "工具分级注入(不是工具,是出现时机):34 个 bcdp_* 分八批——core(status/doctor/help/space/navigate/snapshot,常驻不可封印)/ act(点击填写键鼠拖拽+tab 标签管理)/ observe(截图页面信息读取js)/ wait(bcdp_wait 全 op)/ power(裸CDP/HTTP/上传/下载/对话框)/ session(验证码/登录落盘/登录导入)/ escape(script 逃生舱)/ judge(bcdp_jev_*)。设置旋钮(全 volatile):toolInjection = lazy(默认,常驻 core + escape,首次 bcdp_* 调用后铺开其余)/ always(挂载即全量,历史行为);toolBrowse(act+observe+wait,内部按 act→observe→wait 三波放行)/ toolExtended(power+session)/ toolEscape(script)/ toolJudge 四把开关——开 = 开放注册,关 = 该批从工具列表移除(core 级不给开关,封了就没解锁入口);judge 级即使开了仍需配 JEV/Laya Key。**escape 批不吃活动闸**:script 是唯一的「一次调用干完任意多步任务」的入口,必须始终可达,不排在首次活动之后。封印 = 从工具列表里反注册,不是执行期报错;lazy 下闲置回收会把扩展面收回。**若某个 bcdp_* 工具不在你的工具列表里**:它被分级封印了——先跑 bcdp_status 或 bcdp_doctor(两者也算浏览器活动,会把面铺开),或让用户在设置页「工具封印」里打开对应档位的开关;别猜测不存在的工具名。",
|
|
3250
3250
|
lightpanda: "Lightpanda 作为后端(无头文本渲染引擎,beta):设置面板「添加 Lightpanda(受管)」——受管 serve 行(本机单例,插件负责拉起/复用/停止;win32 经 WSL2,linux/mac 本机直装),激活后 probe 自动识别 engine 并全链降级;也可用普通 CDP 端点接已自起的 serve(http://127.0.0.1:9222)。**有头/无头与顺序语义**:CDP 端点/本机 Chrome/ego CLI 是有头类型——可人工兜底(手动输账号、过验证码),是兜底主力;Lightpanda 是无头类型——无法人工介入,只适合快速试验。顺序即优先级:把 Lightpanda 排在前面 = 快速场景优先用它;排在有头类型后面 = 有头兜底优先,Lightpanda 实际不会被启用。安装——linux/macOS:`curl -fsSL https://pkg.lightpanda.io/install.sh | bash`(装入 ~/.local/bin,确保 PATH 含它),`lightpanda serve --host 127.0.0.1 --port 9222`;Windows:无原生版,用 WSL2(管理员 `wsl --install`,WSL 内同上;WSL2 自动把端口映射到宿主 localhost)或 Docker(`docker run -d -p 127.0.0.1:9222:9222 lightpanda/browser:nightly`)。可用:navigate/js/click/fill/key/snapshot(AX树)/http/login_import 等;降级:截图=PNG 文本渲染(jev 输出带 engine/rendering 元数据);关闭:观察窗实时画面、面板点选、bcdp_download(调用即结构化报错)、auth_flush(返回 degraded)",
|
|
3251
3251
|
judge: "JEV/Laya 判定(阶段 10):机械采集「截图 + 编号 DOM + 意图 + 操作进度」→ 组装问题 → 取选择 → 执行 → 验证。判定器只能回传编号,绝不给选择器(幻觉选择器在结构上不可能)。四件套:bcdp_jev_status(先跑这个:判定链可用性 + 配置体检,不发任何请求)/ bcdp_jev_frame(采一帧,看判定器会看到什么)/bcdp_jev_ask(组装请求体;dryRun 默认 true,可指定 round=control|chapter|pick|evaluate 逐级看)/ bcdp_jev_run(跑循环,返回逐步 trace)。bcdp_jev_attempt(平的尝试循环):给 url + goal,开页后每轮选项 = DOM 候选 + end 项,判定模型在 maxActions(默认 5)预算内行动或自选 end 结束,回执含每步 anchor;判定上下文只走 DOM 树文本(模型不读截图),完成后你用 bcdp_cdp/bcdp_screenshot 按 targetId 自行核验——回执是报告不是证明。**三级缩小**:control(要不要动手,固定 5 项)→ chapter(哪个章节,按 AX 容器聚簇)→ pick(章节内哪个编号 + 风险度)。分章节不是装饰:阈值按候选数分桶,把 20 选 1 拆成「几选 1 × 几选 1」会让两轮都落在更严的桶里。单章节时不问章节轮。**判定上下文是隔离的**:只允许 INTENT / PROGRESS / FRAME / HISTORY 四段,**绝不带 agent 会话 session 前缀**;多出任何一段都会在组装时直接抛错(不靠约定,靠断言)。PROGRESS 由循环自己机械生成,不让模型写(模型写的进度是第二个人幻觉通道)。**评估开关 jevEvaluate(默认开)**:每步执行后判定器再判进度 inprogress/done/fail;fail 或「未验真的 done」不猜下一步,直接 escalate——带有序 RecoveryOption(reload 排第一,因陈旧渲染会藏住已写入的确认),交回你来恢复或停手。被操作元素会保留 class 等定位特征(只剥离检视器外壳 token)随 escalate 回传,便于恢复。**默认链路是 laya -> rule**:JEV 目前无法注册,所以默认不写它;将来可用时把 jev 加回跳序并填 URL 即可。不可用的跳**跳过不调用**(laya-api 强制鉴权无匿名分支,缺 key 必然 401),每一跳的跳过与失败都记进 trace,绝不静默回落;refuse 是结果不是异常。阈值一律用选中项概率 top(不是 confidence:后者是归一化熵,2 选 1 与 20 选 1 不可比)。设置面板键:layaUrl/layaKey/layaModel(laya 端口 8000,不是 7789)、judgePrefer、jevChunkSize、jevMaxImageBytes、jevHistoryLimit、jevArchiveImage、jevStepBudget、jevWallMs;jevUrl/jevKey/jevModel 留空即可(JEV 未开放注册)。"
|
|
3252
3252
|
};
|
|
@@ -3555,8 +3555,6 @@ const CORE = [
|
|
|
3555
3555
|
"bcdp_status",
|
|
3556
3556
|
"bcdp_doctor",
|
|
3557
3557
|
"bcdp_help",
|
|
3558
|
-
"bcdp_space_open",
|
|
3559
|
-
"bcdp_space_close",
|
|
3560
3558
|
"bcdp_space",
|
|
3561
3559
|
"bcdp_navigate",
|
|
3562
3560
|
"bcdp_snapshot"
|
|
@@ -3578,13 +3576,7 @@ const OBSERVE = [
|
|
|
3578
3576
|
"bcdp_read_element",
|
|
3579
3577
|
"bcdp_js"
|
|
3580
3578
|
];
|
|
3581
|
-
const WAIT = [
|
|
3582
|
-
"bcdp_wait",
|
|
3583
|
-
"bcdp_wait_for_selector",
|
|
3584
|
-
"bcdp_wait_for_url",
|
|
3585
|
-
"bcdp_wait_for_response",
|
|
3586
|
-
"bcdp_wait_page"
|
|
3587
|
-
];
|
|
3579
|
+
const WAIT = ["bcdp_wait"];
|
|
3588
3580
|
const POWER = [
|
|
3589
3581
|
"bcdp_cdp",
|
|
3590
3582
|
"bcdp_http",
|
|
@@ -3597,7 +3589,7 @@ const SESSION = [
|
|
|
3597
3589
|
"bcdp_auth_flush",
|
|
3598
3590
|
"bcdp_login_import"
|
|
3599
3591
|
];
|
|
3600
|
-
const ESCAPE = ["
|
|
3592
|
+
const ESCAPE = ["bcdp_script"];
|
|
3601
3593
|
const JUDGE = [
|
|
3602
3594
|
"bcdp_jev_status",
|
|
3603
3595
|
"bcdp_jev_ask",
|
|
@@ -7558,7 +7550,7 @@ async function runWithTabRevive(ctx, cfg, exec, buildScript, graceOverrideMs) {
|
|
|
7558
7550
|
/**
|
|
7559
7551
|
* Find the last line carrying the sentinel and JSON-parse its payload.
|
|
7560
7552
|
*
|
|
7561
|
-
* Fallback: `bcdp_script`
|
|
7553
|
+
* Fallback: `bcdp_script` (with verbatim:true) runs user-authored heredocs, which
|
|
7562
7554
|
* tool descriptions tell the model to "end with console.log(JSON.stringify(...))"
|
|
7563
7555
|
* �?without the sentinel prefix. A script written to that instruction used to
|
|
7564
7556
|
* succeed and still be reported as a failure ("no @@DSH_RESULT@@ payload"), so
|
|
@@ -7777,7 +7769,7 @@ const useSpace = (name$1) => `const task = await taskSpaces.useOrCreate(${j(name
|
|
|
7777
7769
|
*/
|
|
7778
7770
|
const ensureRealTab = () => "const __tabs = await browser.listTabs()\nconst __real = __tabs.find(t => !t.url.startsWith('about:') && !t.url.startsWith('chrome://')) ?? __tabs[0]\nif (__real) await browser.switchTab(__real.targetId)\n";
|
|
7779
7771
|
/**
|
|
7780
|
-
* G �?a raw heredoc (`
|
|
7772
|
+
* G �?a raw heredoc (`bcdp_script` with verbatim:true) that touches `page.*` without
|
|
7781
7773
|
* first selecting a task space dies with the runtime's "no active tab to attach
|
|
7782
7774
|
* session". Structured bcdp_* tools never hit this because each wraps its body
|
|
7783
7775
|
* in `useSpace(...)` + `ensureRealTab()`; a hand-written heredoc has no such
|
|
@@ -8525,9 +8517,11 @@ function registerActionTools(ctx, cfg, reg) {
|
|
|
8525
8517
|
...opts,
|
|
8526
8518
|
afterExecute: (args, result) => {
|
|
8527
8519
|
if (!result || result.ok === false) return;
|
|
8528
|
-
|
|
8529
|
-
|
|
8530
|
-
|
|
8520
|
+
const a = args;
|
|
8521
|
+
const op = typeof a?.op === "string" ? a.op.trim() : "";
|
|
8522
|
+
if (opts.name === "bcdp_space" && op === "open") cfg.spaceTracker.opened(args, result);
|
|
8523
|
+
else if (opts.name === "bcdp_space" && op === "close") cfg.spaceTracker.closed(a.name, result.done);
|
|
8524
|
+
else if (a && a.space !== void 0 && a.space !== "") cfg.spaceTracker.selected(a.space);
|
|
8531
8525
|
opts.afterExecute?.(args, result);
|
|
8532
8526
|
}
|
|
8533
8527
|
});
|
|
@@ -8535,50 +8529,22 @@ function registerActionTools(ctx, cfg, reg) {
|
|
|
8535
8529
|
type: "string",
|
|
8536
8530
|
description: "Task-space name or numeric id; defaults to the most recently opened or explicitly selected space."
|
|
8537
8531
|
};
|
|
8538
|
-
reg(t({
|
|
8539
|
-
name: "bcdp_space_open",
|
|
8540
|
-
get description() {
|
|
8541
|
-
return cfg.isolateSpaces ? "Open (or reuse) an ego-lite task space in isolated sandbox mode." : "Open (or reuse) the ego-lite task space. In persistent profile mode (default), ALWAYS use or reuse the single 'default' space. Login credentials automatically persist on disk across restarts �?if a page requires login, prompt user to log in manually in the opened window. DO NOT create numbered spaces like #4, #5.";
|
|
8542
|
-
},
|
|
8543
|
-
parameters: { name: {
|
|
8544
|
-
type: "string",
|
|
8545
|
-
required: true,
|
|
8546
|
-
get description() {
|
|
8547
|
-
return cfg.isolateSpaces ? "Task-space name or numeric id." : "Task-space name. In persistent mode, ALWAYS specify 'default'. Reuse this single space for all browsing tasks.";
|
|
8548
|
-
}
|
|
8549
|
-
} },
|
|
8550
|
-
buildScript: (args) => `${useSpace(str(args.name, cfg.activeSpace))}console.log('${SENTINEL}' + JSON.stringify({ ok: true, id: task.id ?? null, name: task.name ?? ${j(str(args.name, cfg.activeSpace))} }))\n`
|
|
8551
|
-
}));
|
|
8552
|
-
reg(t({
|
|
8553
|
-
name: "bcdp_space_close",
|
|
8554
|
-
get description() {
|
|
8555
|
-
return cfg.isolateSpaces ? "Complete (close) an ego-lite task space in sandbox mode." : "Close an ego-lite task space. WARNING: In persistent profile mode, DO NOT call this tool when finishing tasks! Keep the space, tabs, and browser window alive so login sessions and streams remain intact. Conclude tasks by replying to the user directly without closing the space.";
|
|
8556
|
-
},
|
|
8557
|
-
parameters: {
|
|
8558
|
-
name: {
|
|
8559
|
-
type: "string",
|
|
8560
|
-
required: true,
|
|
8561
|
-
description: "Task-space name or numeric id to close."
|
|
8562
|
-
},
|
|
8563
|
-
keep: {
|
|
8564
|
-
type: "boolean",
|
|
8565
|
-
description: "Keep the live page open (default false: close it)."
|
|
8566
|
-
}
|
|
8567
|
-
},
|
|
8568
|
-
buildScript: (args) => `const res = await taskSpaces.complete(${j(str(args.name, cfg.activeSpace))}, { keep: ${bool(args.keep, false)} })\nconsole.log('${SENTINEL}' + JSON.stringify({ ok: true, done: !!res.done, skipped: !!res.skipped, reason: res.skipped ? ${j("target space was not agent-owned")} : null }))\n`
|
|
8569
|
-
}));
|
|
8570
8532
|
reg(t({
|
|
8571
8533
|
name: "bcdp_space",
|
|
8572
|
-
description: "
|
|
8534
|
+
description: "Task space: op=open (or reuse) | close | list | handoff | takeover. In persistent profile mode (default) ALWAYS use or reuse the single 'default' space — credentials persist on disk across restarts, so do NOT create numbered spaces like #4/#5; if a page needs login, prompt the user to log in manually. Omitting `space` targets THIS session's own active slot (persistent: 'default'; isolated mode: dsh-agent-<sessionId8>), so concurrent sessions never drift into each other's spaces. handoff yields control to the human (stop driving until they hand back); takeover resumes agent control.",
|
|
8573
8535
|
parameters: {
|
|
8574
8536
|
op: {
|
|
8575
8537
|
type: "string",
|
|
8576
8538
|
required: true,
|
|
8577
|
-
description: "\"list\" | \"handoff\" | \"takeover\"."
|
|
8539
|
+
description: "\"open\" | \"close\" | \"list\" | \"handoff\" | \"takeover\"."
|
|
8578
8540
|
},
|
|
8579
8541
|
name: {
|
|
8580
8542
|
type: "string",
|
|
8581
|
-
description: "
|
|
8543
|
+
description: "op=open/close: task-space name (persistent mode: ALWAYS specify 'default' and reuse it for all browsing tasks). op=handoff/takeover: default = the configured space."
|
|
8544
|
+
},
|
|
8545
|
+
keep: {
|
|
8546
|
+
type: "boolean",
|
|
8547
|
+
description: "op=close: keep the live page open (default false: close it)."
|
|
8582
8548
|
},
|
|
8583
8549
|
space: spaceParam
|
|
8584
8550
|
},
|
|
@@ -8586,10 +8552,12 @@ function registerActionTools(ctx, cfg, reg) {
|
|
|
8586
8552
|
const send = (expr) => `console.log('${SENTINEL}' + JSON.stringify(${expr}))\n`;
|
|
8587
8553
|
const op = str(args.op, "").trim();
|
|
8588
8554
|
const name$1 = str(args.name, str(args.space, cfg.activeSpace));
|
|
8589
|
-
if (op === "
|
|
8555
|
+
if (op === "open") return `${useSpace(str(args.name, cfg.activeSpace))}` + send(`{ ok: true, op: 'open', id: task.id ?? null, name: task.name ?? ${j(str(args.name, cfg.activeSpace))} }`);
|
|
8556
|
+
if (op === "close") return `const res = await taskSpaces.complete(${j(name$1)}, { keep: ${bool(args.keep, false)} })\n` + send(`{ ok: true, op: 'close', done: !!res.done, skipped: !!res.skipped, reason: res.skipped ? ${j("target space was not agent-owned")} : null }`);
|
|
8557
|
+
if (op === "list") return `const __sp = await taskSpaces.list()\n` + send(`{ ok: true, op: 'list', spaces: __sp.map(s => ({ id: s.id ?? null, name: s.name ?? null, ownership: s.ownership ?? null })) }`);
|
|
8590
8558
|
if (op === "handoff") return `${useSpace(name$1)}const __h = await taskSpaces.handOff(${j(name$1)})\n` + send(`{ ok: true, op: 'handoff', name: ${j(name$1)}, done: !!__h.done, skipped: __h.skipped ?? null, hint: 'user now has control; ask them to confirm before calling op=takeover' }`);
|
|
8591
8559
|
if (op === "takeover") return `await taskSpaces.takeOver(${j(name$1)})\nconst __info = await page.info()\n` + send(`{ ok: true, op: 'takeover', name: ${j(name$1)}, page: __info }`);
|
|
8592
|
-
return send(`{ ok: false, reason: ${j("bcdp_space: op must be one of list|handoff|takeover")} }`);
|
|
8560
|
+
return send(`{ ok: false, reason: ${j("bcdp_space: op must be one of open|close|list|handoff|takeover")} }`);
|
|
8593
8561
|
}
|
|
8594
8562
|
}));
|
|
8595
8563
|
reg(t({
|
|
@@ -8834,131 +8802,88 @@ function registerActionTools(ctx, cfg, reg) {
|
|
|
8834
8802
|
}));
|
|
8835
8803
|
reg(t({
|
|
8836
8804
|
name: "bcdp_wait",
|
|
8837
|
-
description: "
|
|
8838
|
-
parameters: { ms: {
|
|
8839
|
-
type: "number",
|
|
8840
|
-
required: true,
|
|
8841
|
-
description: "Milliseconds to wait."
|
|
8842
|
-
} },
|
|
8843
|
-
buildScript: (args) => `await page.waitForTimeout(${Math.max(0, num(args.ms, 1e3))})\nconsole.log('${SENTINEL}' + JSON.stringify({ ok: true, waitedMs: ${Math.max(0, num(args.ms, 1e3))} }))\n`
|
|
8844
|
-
}));
|
|
8845
|
-
reg(t({
|
|
8846
|
-
name: "bcdp_wait_for_selector",
|
|
8847
|
-
description: "Wait until a CSS selector appears (state=visible, default) or disappears (state=hidden). Use instead of a fixed wait for async pages.",
|
|
8805
|
+
description: "Wait. op=duration (fixed ms) | selector (element appears/disappears) | url (navigation) | response (network reply) | load (page load state) | function (in-page expression becomes truthy) | request (network request) | event (a download). selector takes `selector` + optional `state` (visible|attached|hidden|detached); url takes `pattern`; response takes `url` + optional `body` (none|text|json); load takes `state` (load|domcontentloaded|networkidle); function takes `expression`; request takes `url`. `timeout` in ms (default 10000; page-level ops load/function/request/event default 30000). Every op except duration accepts `space`.",
|
|
8848
8806
|
parameters: {
|
|
8849
|
-
|
|
8807
|
+
op: {
|
|
8850
8808
|
type: "string",
|
|
8851
8809
|
required: true,
|
|
8852
|
-
description: "
|
|
8853
|
-
},
|
|
8854
|
-
state: {
|
|
8855
|
-
type: "string",
|
|
8856
|
-
description: "'visible' (default) | 'attached' | 'hidden' | 'detached'."
|
|
8810
|
+
description: "\"duration\" | \"selector\" | \"url\" | \"response\" | \"load\" | \"function\" | \"request\" | \"event\"."
|
|
8857
8811
|
},
|
|
8858
|
-
|
|
8812
|
+
ms: {
|
|
8859
8813
|
type: "number",
|
|
8860
|
-
description: "
|
|
8814
|
+
description: "op=duration: milliseconds to wait (default 1000)."
|
|
8861
8815
|
},
|
|
8862
|
-
|
|
8863
|
-
},
|
|
8864
|
-
buildScript: (args) => {
|
|
8865
|
-
const sel = str(args.selector, "").trim();
|
|
8866
|
-
if (sel === "") return `console.log('${SENTINEL}' + JSON.stringify({ ok: false, waited: false, reason: 'bcdp_wait_for_selector: selector is required' }))\n`;
|
|
8867
|
-
return `${useSpace(str(args.space, cfg.activeSpace))}${ensureRealTab()}await page.waitForSelector(${j(sel)}, { state: ${j(str(args.state, "visible"))}, timeout: ${num(args.timeout, 1e4)} })\nconsole.log('${SENTINEL}' + JSON.stringify({ ok: true, waited: true, selector: ${j(sel)}, state: ${j(str(args.state, "visible"))} }))\n`;
|
|
8868
|
-
}
|
|
8869
|
-
}));
|
|
8870
|
-
reg(t({
|
|
8871
|
-
name: "bcdp_wait_for_url",
|
|
8872
|
-
description: "Wait until the page navigates to a URL matching a substring / glob / regex. Use to catch login redirects or pagination.",
|
|
8873
|
-
parameters: {
|
|
8874
|
-
pattern: {
|
|
8816
|
+
selector: {
|
|
8875
8817
|
type: "string",
|
|
8876
|
-
|
|
8877
|
-
description: "URL/glob to match (e.g. '/login?done', 'https://*/post/*', or a /regex/)."
|
|
8878
|
-
},
|
|
8879
|
-
timeout: {
|
|
8880
|
-
type: "number",
|
|
8881
|
-
description: "How long to wait in ms (default 10000)."
|
|
8818
|
+
description: "op=selector: CSS selector to wait for, e.g. '.results' or '[data-id=done]'."
|
|
8882
8819
|
},
|
|
8883
|
-
|
|
8884
|
-
},
|
|
8885
|
-
buildScript: (args) => {
|
|
8886
|
-
const p = str(args.pattern, "").trim();
|
|
8887
|
-
if (p === "") return `console.log('${SENTINEL}' + JSON.stringify({ ok: false, reached: false, reason: 'bcdp_wait_for_url: pattern is required' }))\n`;
|
|
8888
|
-
return `${useSpace(str(args.space, cfg.activeSpace))}${ensureRealTab()}const __ok = await page.waitForURL(${j(p)}, { timeout: ${num(args.timeout, 1e4)} }).catch(() => false)\nconst __u = await page.url()\nconsole.log('${SENTINEL}' + JSON.stringify({ ok: !!__ok, reached: !!__ok, url: __u }))\n`;
|
|
8889
|
-
}
|
|
8890
|
-
}));
|
|
8891
|
-
reg(t({
|
|
8892
|
-
name: "bcdp_wait_for_response",
|
|
8893
|
-
description: "Wait for a network response matching a URL/glob/regex and return it; optionally return the body (text or JSON).",
|
|
8894
|
-
parameters: {
|
|
8895
|
-
url: {
|
|
8820
|
+
state: {
|
|
8896
8821
|
type: "string",
|
|
8897
|
-
|
|
8898
|
-
description: "URL/glob/regex, e.g. '/api/search' or 'https://*.com/data'."
|
|
8822
|
+
description: "op=selector: \"visible\" (default) | \"attached\" | \"hidden\" | \"detached\". op=load: \"load\" (default) | \"domcontentloaded\" | \"networkidle\"."
|
|
8899
8823
|
},
|
|
8900
|
-
|
|
8901
|
-
type: "number",
|
|
8902
|
-
description: "Wait in ms (default 10000)."
|
|
8903
|
-
},
|
|
8904
|
-
body: {
|
|
8824
|
+
pattern: {
|
|
8905
8825
|
type: "string",
|
|
8906
|
-
description: "
|
|
8826
|
+
description: "op=url: URL/glob to match (e.g. '/login?done', 'https://*/post/*', or a /regex/)."
|
|
8907
8827
|
},
|
|
8908
|
-
|
|
8909
|
-
},
|
|
8910
|
-
buildScript: (args) => {
|
|
8911
|
-
const u = str(args.url, "").trim();
|
|
8912
|
-
const mode = str(args.body, "none");
|
|
8913
|
-
const wantBody = mode === "text" || mode === "json";
|
|
8914
|
-
return `${useSpace(str(args.space, cfg.activeSpace))}${ensureRealTab()}const __res = await page.waitForResponse(${j(u)}, { timeout: ${num(args.timeout, 1e4)} })\n${wantBody ? `const __body = ${mode === "json" ? "await __res.json().catch(()=>null)" : "await __res.text().catch(()=>null)"}\n` : ""}console.log('${SENTINEL}' + JSON.stringify({ ok: true, url: __res.url(), status: __res.status()${wantBody ? ", body: __body" : ""} }))\n`;
|
|
8915
|
-
}
|
|
8916
|
-
}));
|
|
8917
|
-
reg(t({
|
|
8918
|
-
name: "bcdp_wait_page",
|
|
8919
|
-
description: "Page-level wait, op=load|function|request|event. load: a load state (state=load|domcontentloaded|networkidle). function: in-page JS `expression` until truthy (returns the value). request: a request whose URL matches `url` (substring/glob/regex). event: a download. load/function time out softly (ok:false); request/event surface their timeout as ok:false.",
|
|
8920
|
-
parameters: {
|
|
8921
|
-
op: {
|
|
8828
|
+
url: {
|
|
8922
8829
|
type: "string",
|
|
8923
|
-
|
|
8924
|
-
description: "\"load\" | \"function\" | \"request\" | \"event\"."
|
|
8830
|
+
description: "op=response: URL/glob/regex, e.g. '/api/search'. op=request: URL substring / glob / regex."
|
|
8925
8831
|
},
|
|
8926
|
-
|
|
8832
|
+
body: {
|
|
8927
8833
|
type: "string",
|
|
8928
|
-
description: "op=
|
|
8834
|
+
description: "op=response: 'none' (default) | 'text' | 'json'."
|
|
8929
8835
|
},
|
|
8930
8836
|
expression: {
|
|
8931
8837
|
type: "string",
|
|
8932
8838
|
description: "op=function: in-page JS expression evaluated until truthy."
|
|
8933
8839
|
},
|
|
8934
|
-
url: {
|
|
8935
|
-
type: "string",
|
|
8936
|
-
description: "op=request: URL substring / glob / regex."
|
|
8937
|
-
},
|
|
8938
8840
|
timeout: {
|
|
8939
8841
|
type: "number",
|
|
8940
|
-
description: "Wait in ms (default 30000)."
|
|
8842
|
+
description: "Wait in ms (default 10000; page-level ops default 30000)."
|
|
8941
8843
|
},
|
|
8942
8844
|
space: spaceParam
|
|
8943
8845
|
},
|
|
8944
8846
|
buildScript: (args) => {
|
|
8945
8847
|
const send = (expr) => `console.log('${SENTINEL}' + JSON.stringify(${expr}))\n`;
|
|
8946
8848
|
const op = str(args.op, "").trim();
|
|
8947
|
-
const
|
|
8849
|
+
const asked = num(args.timeout, 0);
|
|
8850
|
+
const to = asked > 0 ? asked : 1e4;
|
|
8851
|
+
const pageTo = asked > 0 ? asked : 3e4;
|
|
8948
8852
|
const head = `${useSpace(str(args.space, cfg.activeSpace))}${ensureRealTab()}`;
|
|
8949
|
-
if (op === "
|
|
8853
|
+
if (op === "duration") {
|
|
8854
|
+
const ms = Math.max(0, num(args.ms, 1e3));
|
|
8855
|
+
return `await page.waitForTimeout(${ms})\n` + send(`{ ok: true, op: 'duration', waitedMs: ${ms} }`);
|
|
8856
|
+
}
|
|
8857
|
+
if (op === "selector") {
|
|
8858
|
+
const sel = str(args.selector, "").trim();
|
|
8859
|
+
if (sel === "") return send(`{ ok: false, op: 'selector', waited: false, reason: 'bcdp_wait: selector is required for op=selector' }`);
|
|
8860
|
+
return head + `await page.waitForSelector(${j(sel)}, { state: ${j(str(args.state, "visible"))}, timeout: ${to} })\n` + send(`{ ok: true, op: 'selector', waited: true, selector: ${j(sel)}, state: ${j(str(args.state, "visible"))} }`);
|
|
8861
|
+
}
|
|
8862
|
+
if (op === "url") {
|
|
8863
|
+
const p = str(args.pattern, "").trim();
|
|
8864
|
+
if (p === "") return send(`{ ok: false, op: 'url', reached: false, reason: 'bcdp_wait: pattern is required for op=url' }`);
|
|
8865
|
+
return head + `const __ok = await page.waitForURL(${j(p)}, { timeout: ${to} }).catch(() => false)\nconst __u = await page.url()\n` + send(`{ ok: !!__ok, op: 'url', reached: !!__ok, url: __u }`);
|
|
8866
|
+
}
|
|
8867
|
+
if (op === "response") {
|
|
8868
|
+
const u = str(args.url, "").trim();
|
|
8869
|
+
if (u === "") return send(`{ ok: false, op: 'response', reason: 'bcdp_wait: url is required for op=response' }`);
|
|
8870
|
+
const mode = str(args.body, "none");
|
|
8871
|
+
const wantBody = mode === "text" || mode === "json";
|
|
8872
|
+
return head + `const __res = await page.waitForResponse(${j(u)}, { timeout: ${to} })\n${wantBody ? `const __body = ${mode === "json" ? "await __res.json().catch(()=>null)" : "await __res.text().catch(()=>null)"}\n` : ""}` + send(`{ ok: true, op: 'response', url: __res.url(), status: __res.status()${wantBody ? ", body: __body" : ""} }`);
|
|
8873
|
+
}
|
|
8874
|
+
if (op === "load") return head + `const __ok = await page.waitForLoadState(${j(str(args.state, "load"))}, { timeout: ${pageTo} })\n` + send(`{ ok: !!__ok, op: 'load', state: ${j(str(args.state, "load"))}, reason: __ok ? null : 'timed out: load state not reached within ${pageTo}ms' }`);
|
|
8950
8875
|
if (op === "function") {
|
|
8951
8876
|
const expr = str(args.expression, "").trim();
|
|
8952
|
-
if (expr === "") return send(`{ ok: false, op: 'function', reason: '
|
|
8953
|
-
return head + `const __v = await page.waitForFunction(${j(safeEvalWrap(expr, true))}, undefined, { timeout: ${
|
|
8877
|
+
if (expr === "") return send(`{ ok: false, op: 'function', reason: 'bcdp_wait: expression is required for op=function' }`);
|
|
8878
|
+
return head + `const __v = await page.waitForFunction(${j(safeEvalWrap(expr, true))}, undefined, { timeout: ${pageTo} })\n` + send(`{ ok: !!__v, op: 'function', value: __v === false ? null : __v, reason: __v === false ? 'timed out: expression never became truthy within ${pageTo}ms' : null }`);
|
|
8954
8879
|
}
|
|
8955
8880
|
if (op === "request") {
|
|
8956
8881
|
const u = str(args.url, "").trim();
|
|
8957
|
-
if (u === "") return send(`{ ok: false, op: 'request', reason: '
|
|
8958
|
-
return head + `try { const __req = await page.waitForRequest(${j(u)}, { timeout: ${
|
|
8882
|
+
if (u === "") return send(`{ ok: false, op: 'request', reason: 'bcdp_wait: url is required for op=request' }`);
|
|
8883
|
+
return head + `try { const __req = await page.waitForRequest(${j(u)}, { timeout: ${pageTo} })\n` + send(`{ ok: true, op: 'request', url: __req.url(), method: __req.method() }`) + `} catch (e) { ${send(`{ ok: false, op: 'request', reason: String(e && e.message || e) }`)} }\n`;
|
|
8959
8884
|
}
|
|
8960
|
-
if (op === "event") return head + `try { const __ev = await page.waitForEvent('download', { timeout: ${
|
|
8961
|
-
return send(`{ ok: false, reason: ${j("
|
|
8885
|
+
if (op === "event") return head + `try { const __ev = await page.waitForEvent('download', { timeout: ${pageTo} })\nconst __p = await __ev.path().catch(() => null)\n` + send(`{ ok: true, op: 'event', event: 'download', suggestedFilename: __ev.suggestedFilename(), url: __ev.url(), path: __p }`) + `} catch (e) { ${send(`{ ok: false, op: 'event', reason: String(e && e.message || e) }`)} }\n`;
|
|
8886
|
+
return send(`{ ok: false, reason: ${j("bcdp_wait: op must be one of duration|selector|url|response|load|function|request|event")} }`);
|
|
8962
8887
|
}
|
|
8963
8888
|
}));
|
|
8964
8889
|
reg(t({
|
|
@@ -9275,61 +9200,6 @@ function registerActionTools(ctx, cfg, reg) {
|
|
|
9275
9200
|
return `${mode === "server" ? "" : `${useSpace(str(args.space, cfg.activeSpace))}${ensureRealTab()}`}${SAFE_FN}const __r = await fetch.${mode === "server" ? "server" : "browser"}(${j(str(args.url, ""))}, ${j(opts)})\nconst __status = typeof __r.status !== "undefined" ? __r.status : 200\nlet __body = null\ntry { __body = typeof __r.text === "function" ? await __r.text() : (typeof __r === "string" ? __r : JSON.stringify(safe(__r))) } catch { __body = null }\nconsole.log('${SENTINEL}' + JSON.stringify({ ok: true, mode: ${j(mode)}, status: __status, body: __body, url: ${j(str(args.url, ""))} }))\n`;
|
|
9276
9201
|
}
|
|
9277
9202
|
}));
|
|
9278
|
-
reg((() => {
|
|
9279
|
-
return defineTool({
|
|
9280
|
-
name: "bcdp_cli",
|
|
9281
|
-
description: "Escape hatch: run an arbitrary `ego-browser nodejs` heredoc script VERBATIM (facades page/browser/taskSpaces/site/fetch and the raw cdp() are preloaded; no preamble is added, so select the task space yourself before touching page.*). Use when the structured bcdp_* tools do not cover the task. Returns the raw output plus the parsed console.log payload when present. These scripts expose the vendored SDK (`taskSpaces`, `page.locator()`, global `cdp()`, `fetch.browser|server`) �?NOT the official docs' `taskSpace()` / `page.click()`.",
|
|
9282
|
-
parameters: { script: {
|
|
9283
|
-
type: "string",
|
|
9284
|
-
required: true,
|
|
9285
|
-
description: "Full JS script body for the heredoc; ego-browser helpers are preloaded. Runs verbatim �?call `await taskSpaces.useOrCreate(name)` first if your script uses page.*. End with console.log(JSON.stringify(payload)) to get it back as `result`."
|
|
9286
|
-
} },
|
|
9287
|
-
output: {
|
|
9288
|
-
schema: {
|
|
9289
|
-
type: "object",
|
|
9290
|
-
additionalProperties: false,
|
|
9291
|
-
properties: {
|
|
9292
|
-
ok: {
|
|
9293
|
-
type: "boolean",
|
|
9294
|
-
required: true
|
|
9295
|
-
},
|
|
9296
|
-
stdout: {
|
|
9297
|
-
type: "string",
|
|
9298
|
-
required: true
|
|
9299
|
-
},
|
|
9300
|
-
stderr: { type: "string" },
|
|
9301
|
-
output: {
|
|
9302
|
-
type: "string",
|
|
9303
|
-
description: "Merged stdout+stderr text of the CLI run. The ego CLI writes script output to stderr on Windows, so read this when `stdout` looks empty."
|
|
9304
|
-
},
|
|
9305
|
-
result: { type: "json" }
|
|
9306
|
-
}
|
|
9307
|
-
},
|
|
9308
|
-
render: renderText
|
|
9309
|
-
},
|
|
9310
|
-
timeoutMs: TOOL_TIMEOUT_MS,
|
|
9311
|
-
execute: async (args, exec) => {
|
|
9312
|
-
cfg.spaceTracker.setCurrentSession(callingSessionId(exec));
|
|
9313
|
-
markEgoToolCall(callingSessionId(exec));
|
|
9314
|
-
const result = await runWithStaleSpaceRetry(ctx, cfg, exec, () => str(args.script, ""));
|
|
9315
|
-
if (!result.ok) throw new Error(attachSessionHint(result.error));
|
|
9316
|
-
const parsed = parseSentinel(mergeCliOutput(result));
|
|
9317
|
-
return {
|
|
9318
|
-
ok: true,
|
|
9319
|
-
stdout: result.stdout,
|
|
9320
|
-
stderr: result.stderr,
|
|
9321
|
-
output: mergeCliOutput(result),
|
|
9322
|
-
result: parsed ?? null
|
|
9323
|
-
};
|
|
9324
|
-
},
|
|
9325
|
-
presentCall: () => ({
|
|
9326
|
-
card: "generic",
|
|
9327
|
-
title: "bcdp_cli",
|
|
9328
|
-
kind: "other",
|
|
9329
|
-
rawInput: null
|
|
9330
|
-
})
|
|
9331
|
-
});
|
|
9332
|
-
})());
|
|
9333
9203
|
}
|
|
9334
9204
|
/** Register bcdp_help / bcdp_doctor / bcdp_script. */
|
|
9335
9205
|
function registerHelpAndDoctor(ctx, cfg, reg, tiers) {
|
|
@@ -9565,7 +9435,7 @@ function registerHelpAndDoctor(ctx, cfg, reg, tiers) {
|
|
|
9565
9435
|
reg((() => {
|
|
9566
9436
|
return defineTool({
|
|
9567
9437
|
name: "bcdp_script",
|
|
9568
|
-
description: "Run an arbitrary `ego-browser nodejs` heredoc script in ONE invocation (page/…locator/browser/taskSpaces/site/fetch/cdp preloaded), and return structured {ok, stdout, stderr, result, durationMs, timedOut}. Use for a full multi-step browser task as a single script. The task space is selected and a real (non-blank) tab activated for you before your script runs, so page.* works directly.
|
|
9438
|
+
description: "Run an arbitrary `ego-browser nodejs` heredoc script in ONE invocation (page/…locator/browser/taskSpaces/site/fetch/cdp preloaded), and return structured {ok, stdout, stderr, result, durationMs, timedOut}. Use for a full multi-step browser task as a single script. The task space is selected and a real (non-blank) tab activated for you before your script runs, so page.* works directly. Set verbatim:true to run the body verbatim with no preamble (the retired bcdp_cli behaviour). These scripts expose the vendored SDK (`taskSpaces`, `page.locator()`, global `cdp()`, `fetch.browser|server`) �?NOT the official docs' `taskSpace()` / `page.click()`.",
|
|
9569
9439
|
parameters: {
|
|
9570
9440
|
script: {
|
|
9571
9441
|
type: "string",
|
|
@@ -9575,6 +9445,10 @@ function registerHelpAndDoctor(ctx, cfg, reg, tiers) {
|
|
|
9575
9445
|
timeoutMs: {
|
|
9576
9446
|
type: "integer",
|
|
9577
9447
|
description: "Per-run timeout in ms (default plugin grace)."
|
|
9448
|
+
},
|
|
9449
|
+
verbatim: {
|
|
9450
|
+
type: "boolean",
|
|
9451
|
+
description: "Run the body verbatim with NO preamble (no task-space selection, no real-tab activation) — the retired bcdp_cli behaviour. Default false prepends the preamble so page.* works directly. In verbatim mode select the space yourself (`await taskSpaces.useOrCreate(name)`) before touching page.*."
|
|
9578
9452
|
}
|
|
9579
9453
|
},
|
|
9580
9454
|
output: {
|
|
@@ -9609,7 +9483,9 @@ function registerHelpAndDoctor(ctx, cfg, reg, tiers) {
|
|
|
9609
9483
|
markEgoToolCall(callingSessionId(exec));
|
|
9610
9484
|
const timeoutMs = typeof args.timeoutMs === "number" && Number.isFinite(args.timeoutMs) && args.timeoutMs > 0 ? args.timeoutMs : void 0;
|
|
9611
9485
|
const start = Date.now();
|
|
9486
|
+
const verbatimMode = bool(args.verbatim, false);
|
|
9612
9487
|
const preamble = (body) => {
|
|
9488
|
+
if (verbatimMode) return body;
|
|
9613
9489
|
if (/taskSpaces\s*\.\s*useOrCreate\s*\(/.test(body)) return body;
|
|
9614
9490
|
return `${useSpace(cfg.activeSpace)}${ensureRealTab()}${body}`;
|
|
9615
9491
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-browser-cdp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "dsh-browser-cdp: DSH browser plugin — attach to a running Chrome/Edge over CDP (no bundled browser needed); structured browser-automation tools (30+ bcdp_*) that drive the vendored ego runtime through ctx.subprocess, plus a realtime watch panel (live SSE screencast + direct mouse interaction + download capture + human-verification notice). Web shell: floating watch panel without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.7-rc.1 ~ 0.2.1-rc.1 line (exact rc enumeration): declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.5-rc.3 use the 0.17.x line]",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|