dsh-browser-cdp 0.17.3 → 0.18.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.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # dsh-browser-cdp — 看得见的 Agent 浏览器(CDP 接入)
2
2
 
3
3
  <p align="center">
4
- <img src="https://img.shields.io/badge/DSH-%3E%3D0.1.7--rc.1-blue" alt="DSH >= 0.1.7-rc.1">
4
+ <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.0--rc.1-blue" alt="DSH >= 0.2.0-rc.1">
5
5
  <img src="https://img.shields.io/badge/DSH--better--sidebar-%3E%3D0.12.2(optional)-red" alt="dsh-better-sidebar >= 0.12.2 (optional)">
6
6
  <img src="https://img.shields.io/badge/Node-%3E%3D22-brightgreen?logo=node.js&logoColor=white" alt="Node >= 22">
7
7
  </p>
@@ -12,11 +12,11 @@
12
12
 
13
13
  | 依赖 | 最低版本 | 推荐版本 | 说明 |
14
14
  |---|---|---|---|
15
- | **DSH** (DeepSeek Harness) | `0.1.7-rc.1` | `≥ 0.1.7-rc.1` | 0.1.7 起设置面为声明式(Config `.volatile()` 字段自动生成设置表单),`.volatile()` 在更早的宿主上不存在。peer 依赖同步锁定 `>=0.1.7-rc.1 <0.2.0-0`。DSH `0.1.2-rc.1` ~ `0.1.6` 请使用 0.16.x 版本线(含旧的 `settings.plugin.item` 设置卡),0.1.0-rc.x / 0.1.1-rc.x 请使用 v0.8.0 及更早版本 |
15
+ | **DSH** (DeepSeek Harness) | `0.2.0-rc.1` | `≥ 0.2.0-rc.1 <0.2.1-0` | 0.2.0 线:peer 依赖同步锁定 `>=0.2.0-rc.1 <0.2.1-0`;宿主对插件 API 向后兼容(0.2.0 的 composer/`forkSession` 为签名扩展,插件仅作调用方,免改)。声明式设置面自 0.1.7 引入(Config `.volatile()` 字段自动生成设置表单),0.2.0 延续该形态。DSH `0.1.2-rc.1` ~ `0.1.7` 请使用 **0.17.x** 版本线,0.1.0-rc.x / 0.1.1-rc.x 请使用 v0.8.0 及更早版本 |
16
16
  | **dsh-better-sidebar** | `0.12.2`(可选) | `≥ 0.17.1` | 未安装时自动回退浮动观察球;`< 0.12.2` 可运行但外部链接拦截(`urlTarget`)静默降级 |
17
17
  | **Node.js** | `22` | — | harness 环境自带 |
18
18
 
19
- **DSH 全版本适配说明**:本版本(v0.17.0 起)面向 DSH `0.1.7-rc.1+` 的声明式设置面:插件不再注册任何设置节(`ctx.settings` 注册类 API 已被宿主删除),改为在 Config schema 上以 `.volatile()` 标记可配置字段,由宿主设置页自动生成表单;volatile 字段变更通过 `loader/volatile-update` 事件热生效,无需重载插件。核心宿主 API(`defineTool`、`ctx.tools.register`、`ctx.subprocess.spawn`、`ctx.webServer.register`、`ctx.inject`、`ModuleLoader` CJS factory、`cordis.patch.yml`)沿用 0.1.2 以来形态。DSH `0.1.2-rc.1` ~ `0.1.6` 请使用 0.16.x 版本线。
19
+ **DSH 全版本适配说明**:本版本(**v0.18.0 起,0.2.0 线**)面向 DSH `0.2.0-rc.1+`:相对 0.1.7 线(v0.17.x)**零代码改动**,纯依赖/元数据换代——0.2.0 宿主对插件 API 向后兼容,本插件经 `ctx.get('conversation').input` 门面投递选区(不调 `submit()`、不 override),不在 0.2.0 变更影响面内。声明式设置面自 0.1.7 引入:插件不再注册任何设置节(`ctx.settings` 注册类 API 已被宿主删除),改为在 Config schema 上以 `.volatile()` 标记可配置字段,由宿主设置页自动生成表单;volatile 字段变更通过 `loader/volatile-update` 事件热生效,无需重载插件。核心宿主 API(`defineTool`、`ctx.tools.register`、`ctx.subprocess.spawn`、`ctx.webServer.register`、`ctx.inject`、`ModuleLoader` CJS factory、`cordis.patch.yml`)沿用 0.1.2 以来形态。DSH `0.1.2-rc.1` ~ `0.1.7` 请使用 **0.17.x** 版本线。
20
20
 
21
21
  **dsh-better-sidebar 适配说明**:本插件通过 `ctx.betterSidebar` 服务(try-catch 防御性获取)注册侧边栏 Tab 并监听外部链接。关键 API 引入版本:
22
22
 
@@ -34,7 +34,7 @@
34
34
 
35
35
  **登录态导入(v0.8.5 新增)**:工具 `bcdp_login_import`,把你日常 Chrome/Edge/Brave 里的登录 cookie **按域名**复制进 agent 浏览器(真实二进制无头启动 + CDP 透传读取,兼容 Chrome 127+ 的 App-Bound Encryption,不做离线解密;源浏览器运行中可选择优雅关闭后导入,窗口下次启动自动恢复)。cookie 值不出现在任何日志与输出中;导入前自动备份源 cookie 库,异常清空自动还原。配合默认的磁盘持久化 Profile,导入的登录态跨重启永久保留。
36
36
 
37
- 一款 **CDP 浏览器代理**:把 [CitroLabs/ego-lite](https://github.com/CitroLabs/ego-lite)(给 AI Agent 用的 Chromium)作为内置运行时接入 DeepSeek Harness,以 **33 个结构化 `bcdp_*` 工具**驱动浏览器,并配一套**实时观察前端口**——agent 后台操作网页时,你能像看直播一样看到它正在浏览的每个页面,还能直接操作它。
37
+ 一款 **CDP 浏览器代理**:把 [CitroLabs/ego-lite](https://github.com/CitroLabs/ego-lite)(给 AI Agent 用的 Chromium)作为内置运行时接入 DeepSeek Harness,以 **38 个结构化 `bcdp_*` 工具**驱动浏览器,并配一套**实时观察前端口**——agent 后台操作网页时,你能像看直播一样看到它正在浏览的每个页面,还能直接操作它。
38
38
 
39
39
  **一点私藏的独特之处(self-observation)**:agent 用的就是这一个 Chromium——连它操作 **DSH 自身**(管理会话、任务看板、调设置)时,观察窗也实时显示、你能随时接手。不只是"看得见 agent 在网页上干活",连 agent 操作 DSH 界面本身都是全程可见、可掌控的。
40
40
 
@@ -48,28 +48,30 @@
48
48
 
49
49
  | 能力 | 本插件(本仓库) | 同类插件(Da1dr1em/dsh-ego-browser) |
50
50
  |---|---|---|
51
- | 结构化工具数 | **32 个**,职责单一、可确定性调用 | **3 个**(`run`/`help`/`status`) |
51
+ | 结构化工具数 | **38 个**,职责单一、可确定性调用 | **3 个**(`run`/`help`/`status`) |
52
52
  | 实时观察窗(CDP JPEG / FFmpeg H.264 双后端 + 标签条 + 历史抽屉) | ✅ 有 | ❌ 无 |
53
53
  | 监控窗鼠标**直接操作**真实浏览器(点击/拖拽/滚动回传 CDP) | ✅ 有 | ❌ 无 |
54
+ | **观察窗点选元素 → 捕获并引用进对话输入框**(`[CDP-PICKS]` 结构化块,人工指认目标) | ✅ 有 | ❌ 无 |
54
55
  | worker 单实例守卫 + 崩溃/重复自愈 | ✅ 有 | ❌ 无 |
55
- | 下载捕获 `ego_download` / 人机验证检测 `ego_captcha`/`ego_page_info` | ✅ 有 | ❌ 无 |
56
+ | 下载捕获 `bcdp_download` / 人机验证检测 `bcdp_captcha`/`bcdp_page_info` | ✅ 有 | ❌ 无 |
56
57
  | 平台自适应(Linux/macOS/Windows 自动探测 + root/无头/`--no-sandbox` 兜底) | ✅ 全平台 | 仅 Windows 预览宿主,需手动配 |
57
- | 登录态落盘持久化 `ego_auth_flush` | ✅ 有 | ⚠️ 仅文档级说明 |
58
+ | 登录态落盘持久化 `bcdp_auth_flush` | ✅ 有 | ⚠️ 仅文档级说明 |
58
59
 
59
- **关键差异两条:**
60
+ **关键差异三条:**
60
61
  - **看得到**:别家是"跑完告诉你结果"的黑盒;我们实时推流,你**看着 agent 操作**,卡在验证码/走岔立刻发现。
61
62
  - **控得住**:别家只读;我们监控窗**直接驱动**同一个 agent 浏览器,需要时你亲手接管(缩放/拖拽/点击),不必打断 agent 重来。
63
+ - **指得准**:你在观察窗里**点选**页面元素,插件捕获其 `backendNodeId`/`tag`/`id` 与语义描述,以 `[CDP-PICKS]` 结构化块并入对话输入框草稿(同页多元素自动合并编号)——agent 拿到的是精确目标,不用猜"你说的按钮是哪个"。
62
64
 
63
- > 以上对比基于公开可见的可核实事实:本仓库代码(`bin/cdp-cast-worker.mjs` 实时推流 + CDP 输入回传、`lib/index.js` 32 个注册工具、`lib/cast-server.js` host 桥接)与同类插件的源码/README。此文档不含对任何他人的贬低——我们只陈述自己多实现并验证了哪些能力。
65
+ > 以上对比基于公开可见的可核实事实:本仓库代码(`bin/cdp-cast-worker.mjs` 实时推流 + CDP 输入回传、`lib/index.js` 38 个注册工具、`lib/cast-server.js` host 桥接、`lib/client.js` 的 `deliverPickToConversation` 点选引用)与同类插件的源码/README(其 `src/tools.ts` 仅注册 `ego_browser_run` / `ego_browser_help` / `ego_browser_status`)。此文档不含对任何他人的贬低——我们只陈述自己多实现并验证了哪些能力。
64
66
 
65
67
  **相对 [ego-lite](https://github.com/CitroLabs/ego-lite) 本体,我们多做了这些(都可对照本仓库代码核实):**
66
68
 
67
69
  | 能力 | 说明(对应代码) |
68
70
  |---|---|
69
- | **观察窗前端口** | ego-lite 本体是无头 CLI(只有 heredoc 脚本 + 文本输出);我们在其上加了 **SSE 实时推流 + 标签条 + 历史抽屉 + 监控窗鼠标直操**(`bin/cdp-cast-worker.mjs`、`lib/cast-server.js`、`lib/client.js`),让"看"和"控"成为一等能力 |
71
+ | **观察窗前端口** | ego-lite 本体是无头 CLI(只有 heredoc 脚本 + 文本输出);我们在其上加了 **SSE 实时推流 + 标签条 + 历史抽屉 + 监控窗鼠标直操 + 点选元素引用进输入框**(`bin/cdp-cast-worker.mjs`、`lib/cast-server.js`、`lib/client.js` 的 `createPickControl`/`deliverPickToConversation`),让"看"、"控"、"指"成为一等能力 |
70
72
  | **开箱即用 + 跨平台自足** | `resolveEgoEnv` 自动探测 Chrome/Edge/Brave,内置 `--no-sandbox` wrapper,root / Docker / 无显示器免配置(`lib/index.js`);不必像官方那样先装一个 GUI 宿主 |
71
73
  | **健壮性层** | 冷启动自动重试(只重试 CDP 瞬态,不吞真错)、worker 单实例守卫 + 崩溃自动重启、插件卸载 fire-and-forget 不阻塞宿主退出、前端帧缓存上限(`withWarmupRetry` / `makeEnsureWorker` / `frameCache`) |
72
- | **运维型工具** | `ego_doctor`(环境体检)、`ego_captcha`(人机验证探测)、`ego_auth_flush`(登录落盘)、`bcdp_login_import`(系统浏览器登录态导入)、`ego_http`(浏览器上下文请求)等,是原生 CLI helper 没有的一层 |
74
+ | **运维型工具** | `bcdp_doctor`(环境体检)、`bcdp_captcha`(人机验证探测)、`bcdp_auth_flush`(登录落盘)、`bcdp_login_import`(系统浏览器登录态导入)、`bcdp_http`(浏览器上下文请求)等,是原生 CLI helper 没有的一层 |
73
75
  | **self-observation** | agent 操作 DSH 自身界面时同样实时可见、可接手 |
74
76
 
75
77
  > 我们不声称媲美官方 macOS App 的内核级快照或原生多窗口体验;本仓库解决的是"把同一套浏览器能力带进 DSH + Linux/WSL + 看得见"这件事。
@@ -166,24 +168,26 @@ dshx list # 应显示:[on] dsh-
166
168
 
167
169
  `bcdp_doctor` 会报告当前序列类型计数、CLI 实际解析到的路径与形态,以及(若同机装了上游 `dsh-ego-browser`)一条共存提示。
168
170
 
169
- ## 工具清单(33 个,前缀 `bcdp_`,完整索引见 `bcdp_help`)
171
+ ## 工具清单(38 个,前缀 `bcdp_`,完整索引见 `bcdp_help`)
170
172
 
171
173
  | 类别 | 工具 |
172
174
  |---|---|
173
- | 任务空间 | `ego_space_open` `ego_space_close` `ego_status` |
174
- | 页面读取 | `ego_snapshot`(语义树) `ego_page_info` `ego_read_element` |
175
- | 导航/等待 | `ego_navigate`(复用 tab) `ego_wait` `ego_wait_for_selector` `ego_wait_for_url` `ego_wait_for_response` |
176
- | 交互 | `ego_click` `ego_fill` `ego_hover` `ego_drag` `ego_select` `ego_check` `ego_key` `ego_scroll` |
177
- | 执行/调试 | `ego_js`(页面求值) `ego_cdp`(原始 CDP) `ego_cli`(任意 heredoc) `ego_script`(多步脚本) |
178
- | 输出 | `ego_screenshot` `ego_download` `ego_upload` |
179
- | 会话/安全 | `ego_auth_flush`(登录落盘) `ego_captcha` `ego_dialog` |
180
- | 元工具 | `ego_help` `ego_doctor` `ego_http` |
175
+ | 任务空间 | `bcdp_space_open` `bcdp_space_close` `bcdp_status` |
176
+ | 页面读取 | `bcdp_snapshot`(语义树) `bcdp_page_info` `bcdp_read_element` |
177
+ | 导航/等待 | `bcdp_navigate`(复用 tab) `bcdp_wait` `bcdp_wait_for_selector` `bcdp_wait_for_url` `bcdp_wait_for_response` |
178
+ | 交互 | `bcdp_click` `bcdp_fill` `bcdp_hover` `bcdp_drag` `bcdp_select` `bcdp_check` `bcdp_key` `bcdp_scroll` |
179
+ | 执行/调试 | `bcdp_js`(页面求值) `bcdp_cdp`(原始 CDP) `bcdp_cli`(任意 heredoc) `bcdp_script`(多步脚本) |
180
+ | 输出 | `bcdp_screenshot` `bcdp_download` `bcdp_upload` |
181
+ | 会话/安全 | `bcdp_auth_flush`(登录落盘) `bcdp_login_import`(跨浏览器登录态导入) `bcdp_captcha` `bcdp_dialog` |
182
+ | 元工具 | `bcdp_help` `bcdp_doctor` `bcdp_http` |
183
+ | 评审(JEV/Laya,外接判定服务可选) | `bcdp_jev_status` `bcdp_jev_frame` `bcdp_jev_ask` `bcdp_jev_run` `bcdp_jev_attempt` |
181
184
 
182
185
  ## 观察窗怎么用
183
186
 
184
187
  右下角 **🌐 常驻小球** → 点开:
185
188
 
186
189
  - **主画面**:agent 当前页面实况;点击/拖动/滚轮直接操作页面,Ctrl+滚轮缩放视图、Ctrl+拖动平移,双击复位。点击画面后可直接键盘输入,支持中文 IME、粘贴、Tab/Enter/方向键及 Ctrl/Cmd 快捷键。
190
+ - **选择元素**(点选引用):点一下工具条进入点选模式,再点实时画面里的任意元素——插件捕获其 `backendNodeId`/`tag`/`id` 与语义描述,以 `[CDP-PICKS]` 结构化块并入对话输入框草稿;同一页面的多次点选自动合并进同一块并依次编号,agent 按编号精确取用。浮动观察球与侧边栏 Tab 均可用。
187
191
  - **标签页条**:顶部横排,点选切换,`×` 关闭。
188
192
  - **历史抽屉**(🕘):按时间回看访问轨迹。
189
193
  - 操作时下方网址行就地显示提示,2 秒后恢复。
@@ -245,7 +249,7 @@ pnpm test # vitest 单元测试
245
249
  pnpm run build # tsdown 三 bundle:lib/index.js + lib/client.js + bin/cdp-cast-worker.mjs
246
250
  ```
247
251
 
248
- > 直接改 `src/`(`src/index.ts` 工具层、`src/client/index.ts` 前端、`src/worker/cdp-cast-worker.ts` worker)。新工具在 `registerActionTools` 里按 `t({...})` 加,并在 `ego_help` 索引(`src/help.ts`)补一条,跑 `pnpm typecheck && pnpm test && pnpm run build`。`lib/` 与 `bin/cdp-cast-worker.mjs` 是构建产物(预构建入库),不要手改。
252
+ > 直接改 `src/`(`src/index.ts` 工具层、`src/client/index.ts` 前端、`src/worker/cdp-cast-worker.ts` worker)。新工具在 `registerActionTools` 里按 `t({...})` 加,并在 `bcdp_help` 索引(`src/help.ts`)补一条,跑 `pnpm typecheck && pnpm test && pnpm run build`。`lib/` 与 `bin/cdp-cast-worker.mjs` 是构建产物(预构建入库),不要手改。
249
253
 
250
254
  `node_modules/` 仅含指向 DSH checkout 的符号链接(编译期类型解析);运行时由 harness 解析 `@deepseek-ai/dsh-tools`。
251
255
 
@@ -2129,10 +2129,14 @@ var require_websocket = /* @__PURE__ */ __commonJS({ "node_modules/ws/lib/websoc
2129
2129
  this._bufferedAmount = 0;
2130
2130
  this._isServer = false;
2131
2131
  this._redirects = 0;
2132
- if (protocols === void 0) protocols = [];
2132
+ if (protocols === void 0) if (!options || options.protocols === void 0) protocols = [];
2133
+ else if (Array.isArray(options.protocols)) protocols = options.protocols;
2134
+ else protocols = [options.protocols];
2133
2135
  else if (!Array.isArray(protocols)) if (typeof protocols === "object" && protocols !== null) {
2134
2136
  options = protocols;
2135
- protocols = [];
2137
+ if (options.protocols === void 0) protocols = [];
2138
+ else if (Array.isArray(options.protocols)) protocols = options.protocols;
2139
+ else protocols = [options.protocols];
2136
2140
  } else protocols = [protocols];
2137
2141
  initAsClient(this, address, protocols, options);
2138
2142
  } else {
@@ -2321,12 +2325,12 @@ var require_websocket = /* @__PURE__ */ __commonJS({ "node_modules/ws/lib/websoc
2321
2325
  if (this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted)) this._socket.end();
2322
2326
  return;
2323
2327
  }
2324
- this._readyState = WebSocket$3.CLOSING;
2325
2328
  this._sender.close(code, data, !this._isServer, (err) => {
2326
2329
  if (err) return;
2327
2330
  this._closeFrameSent = true;
2328
2331
  if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) this._socket.end();
2329
2332
  });
2333
+ this._readyState = WebSocket$3.CLOSING;
2330
2334
  setCloseTimer(this);
2331
2335
  }
2332
2336
  /**
@@ -2609,6 +2613,7 @@ var require_websocket = /* @__PURE__ */ __commonJS({ "node_modules/ws/lib/websoc
2609
2613
  socketPath: void 0,
2610
2614
  hostname: void 0,
2611
2615
  protocol: void 0,
2616
+ protocols: void 0,
2612
2617
  timeout: void 0,
2613
2618
  method: "GET",
2614
2619
  host: void 0,
@@ -517,6 +517,67 @@ async function viewportInfo() {
517
517
  }
518
518
  }
519
519
 
520
+ /** The quality ladder never descends past this; the overrun is reported, not hidden. */
521
+ const JPEG_QUALITY_FLOOR = 24
522
+ /** Ladder step between capture attempts. */
523
+ const JPEG_QUALITY_STEP = 12
524
+
525
+ /**
526
+ * One Page.captureScreenshot round trip: full content size (beyond the
527
+ * viewport), geometrically downscaled when `scale.maxWidth` is narrower than
528
+ * the page. Returns raw bytes for the budget loop to measure.
529
+ */
530
+ async function screenshotOnce(format, quality, scale) {
531
+ const params = { format, captureBeyondViewport: true }
532
+ if (format === 'jpeg' && quality !== null) params.quality = quality
533
+ try {
534
+ const metrics = await call('Page.getLayoutMetrics', {})
535
+ const content = metrics?.cssContentSize || metrics?.contentSize
536
+ const width = Number(content?.width) || 0
537
+ const height = Number(content?.height) || 0
538
+ if (width > 0 && height > 0) {
539
+ const maxWidth = Number(scale?.maxWidth) || 0
540
+ const downscale = maxWidth > 0 && width > maxWidth ? maxWidth / width : 1
541
+ params.clip = { x: 0, y: 0, width, height, scale: downscale }
542
+ }
543
+ } catch { /* no metrics → viewport-only capture; better than failing the shot */ }
544
+ const shot = await call('Page.captureScreenshot', params, undefined, 30000)
545
+ return Buffer.from(String(shot?.data || ''), 'base64')
546
+ }
547
+
548
+ /**
549
+ * Screenshot under a byte budget (阶段 10 frame contract): a JPEG quality
550
+ * ladder that steps down from the requested quality until the shot fits or
551
+ * the floor is reached — `overBudget: true` reports the miss instead of
552
+ * hiding it. PNG and unbounded JPEG are single-attempt (`quality: null`,
553
+ * `overBudget: false`) because they have no knob to turn.
554
+ */
555
+ async function captureWithinBudget(options) {
556
+ const format = options.format === 'png' ? 'png' : 'jpeg'
557
+ const maxBytes = Number(options.maxBytes) || 0
558
+ if (format === 'png' || maxBytes <= 0) {
559
+ const data = await screenshotOnce(format, null, options.scale)
560
+ return { data: data.toString('base64'), bytes: data.length, quality: null, overBudget: false, attempts: 1 }
561
+ }
562
+ let quality = Number(options.quality) || 72
563
+ let attempts = 0
564
+ let best = null
565
+ for (;;) {
566
+ attempts++
567
+ const data = await screenshotOnce(format, quality, options.scale)
568
+ best = { data: data.toString('base64'), bytes: data.length, quality, attempts }
569
+ if (data.length <= maxBytes || quality <= JPEG_QUALITY_FLOOR) break
570
+ quality = Math.max(JPEG_QUALITY_FLOOR, quality - JPEG_QUALITY_STEP)
571
+ }
572
+ return {
573
+ data: best.data,
574
+ bytes: best.bytes,
575
+ quality: best.quality,
576
+ overBudget: best.bytes > maxBytes,
577
+ attempts: best.attempts,
578
+ }
579
+ }
580
+
520
581
  async function handle(method, params) {
521
582
  switch (method) {
522
583
  case 'hello':
package/dsh-plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://dsh.community/schemas/dsh-plugin-0.15.json",
3
3
  "id": "dsh-browser-cdp",
4
4
  "name": "dsh-browser-cdp",
5
- "version": "0.17.0",
5
+ "version": "0.18.0",
6
6
  "manifestVersion": "0.15",
7
7
  "facets": {
8
8
  "host": {
package/lib/client.js CHANGED
@@ -691,6 +691,331 @@ function mountFamilySettingsCard(ctx) {
691
691
  }, FamilySettingsCard);
692
692
  }, "dsh-browser-cdp: family settings tab");
693
693
  }
694
+ var FAM_FIELD_GROUPS = [
695
+ {
696
+ gk: "gBasic",
697
+ en: "Basics",
698
+ zh: "基础",
699
+ fields: [
700
+ {
701
+ k: "isolateSpaces",
702
+ kind: "bool",
703
+ en: ["Space isolation", "Off = persistent profile (logins survive restarts); on = isolated sandbox"],
704
+ zh: ["空间隔离", "关 = 持久化配置(重启保留登录态);开 = 每次隔离沙箱"]
705
+ },
706
+ {
707
+ k: "idleTimeoutMin",
708
+ kind: "num",
709
+ min: 0,
710
+ max: 1440,
711
+ step: 1,
712
+ en: ["Auto-stop idle browser (minutes, 0 = off)", "Stops the backing browser after N minutes without a bcdp_* call; relaunches on demand"],
713
+ zh: ["空闲自动停止(分钟,0 = 不停)", "超过 N 分钟没有 bcdp_* 调用即停止后台浏览器,下次调用按需重启"]
714
+ },
715
+ {
716
+ k: "cdpMode",
717
+ kind: "sel",
718
+ options: [
719
+ "auto",
720
+ "local",
721
+ "remote"
722
+ ],
723
+ en: ["Connection mode", "auto = activated target only; remote = never start a local browser; local = always local control"],
724
+ zh: ["连接模式", "auto = 只用已激活目标;remote = 绝不静默启动本地浏览器;local = 始终本地控制"]
725
+ },
726
+ {
727
+ k: "remoteEnabled",
728
+ kind: "bool",
729
+ en: ["Remote attach master switch", "Off = the target sequence is preserved but inert; does not affect local mode"],
730
+ zh: ["远程接管总开关", "关 = 目标序列保留但不生效;不影响 local 模式"]
731
+ },
732
+ {
733
+ k: "allowLocalFallback",
734
+ kind: "bool",
735
+ en: ["Allow local fallback in auto mode", "auto may launch a local browser when the activated target is unreachable"],
736
+ zh: ["auto 模式允许本地回退", "已激活目标不可达时允许自动拉起本地浏览器"]
737
+ },
738
+ {
739
+ k: "chromePath",
740
+ kind: "str",
741
+ en: ["Chrome/Chromium path", "Empty = auto-detect"],
742
+ zh: ["Chrome/Chromium 路径", "留空 = 自动探测"]
743
+ },
744
+ {
745
+ k: "localHeadless",
746
+ kind: "bool",
747
+ en: ["Launch local browser headless", "Applies to the locally launched browser"],
748
+ zh: ["本地浏览器无头启动", "仅作用于本地拉起的浏览器"]
749
+ },
750
+ {
751
+ k: "localUserDataDir",
752
+ kind: "str",
753
+ en: ["Local profile dir", "Empty = managed dir; never point at your daily Chrome profile"],
754
+ zh: ["本地浏览器 Profile 目录", "留空 = 托管目录;不要指向日常使用的 Chrome 配置"]
755
+ },
756
+ {
757
+ k: "legacyEgoToolNames",
758
+ kind: "bool",
759
+ en: ["Also register legacy ego_* tool names", "For scripts written before the bcdp_* rename; conflicts with the upstream ego-browser plugin"],
760
+ zh: ["同时注册旧版 ego_* 工具名", "给 bcdp_* 更名前的脚本用;与上游 ego-browser 插件互斥"]
761
+ }
762
+ ]
763
+ },
764
+ {
765
+ gk: "gCapture",
766
+ en: "Capture & streaming",
767
+ zh: "截图与推流",
768
+ fields: [
769
+ {
770
+ k: "captureBackend",
771
+ kind: "sel",
772
+ options: [
773
+ "auto",
774
+ "cdp",
775
+ "ffmpeg"
776
+ ],
777
+ en: ["Capture backend", "auto, cdp, or ffmpeg"],
778
+ zh: ["截取后端", "auto / cdp / ffmpeg"]
779
+ },
780
+ {
781
+ k: "streamProfile",
782
+ kind: "sel",
783
+ options: [
784
+ "low",
785
+ "balanced",
786
+ "high"
787
+ ],
788
+ en: ["Capture quality profile", "Overall quality preset"],
789
+ zh: ["画质档位", "整体画质预设"]
790
+ },
791
+ {
792
+ k: "cdpFps",
793
+ kind: "num",
794
+ min: 5,
795
+ max: 30,
796
+ step: 1,
797
+ en: ["CDP preview FPS", ""],
798
+ zh: ["CDP 预览帧率", ""]
799
+ },
800
+ {
801
+ k: "cdpQuality",
802
+ kind: "num",
803
+ min: 1,
804
+ max: 100,
805
+ step: 1,
806
+ en: ["CDP JPEG quality", ""],
807
+ zh: ["CDP JPEG 质量", ""]
808
+ },
809
+ {
810
+ k: "cdpMaxWidth",
811
+ kind: "num",
812
+ min: 320,
813
+ max: 1920,
814
+ step: 40,
815
+ en: ["CDP frame max width", ""],
816
+ zh: ["CDP 帧最大宽度", ""]
817
+ },
818
+ {
819
+ k: "cdpBackstopIntervalMs",
820
+ kind: "num",
821
+ min: 1e3,
822
+ max: 1e4,
823
+ step: 100,
824
+ en: ["CDP recovery interval (ms)", ""],
825
+ zh: ["CDP 恢复截图间隔(ms)", ""]
826
+ },
827
+ {
828
+ k: "ffmpegFps",
829
+ kind: "num",
830
+ min: 5,
831
+ max: 30,
832
+ step: 1,
833
+ en: ["FFmpeg video FPS", ""],
834
+ zh: ["FFmpeg 视频帧率", ""]
835
+ },
836
+ {
837
+ k: "ffmpegMaxWidth",
838
+ kind: "num",
839
+ min: 320,
840
+ max: 1920,
841
+ step: 40,
842
+ en: ["FFmpeg max width", ""],
843
+ zh: ["FFmpeg 最大宽度", ""]
844
+ },
845
+ {
846
+ k: "ffmpegBitrateKbps",
847
+ kind: "num",
848
+ min: 500,
849
+ max: 2e4,
850
+ step: 250,
851
+ en: ["FFmpeg bitrate (kbps)", ""],
852
+ zh: ["FFmpeg 码率(kbps)", ""]
853
+ },
854
+ {
855
+ k: "ffmpegEncoder",
856
+ kind: "sel",
857
+ options: [
858
+ "auto",
859
+ "software",
860
+ "h264_mf",
861
+ "h264_nvenc",
862
+ "h264_qsv",
863
+ "h264_amf",
864
+ "h264_videotoolbox",
865
+ "h264_vaapi"
866
+ ],
867
+ en: ["FFmpeg H.264 encoder", ""],
868
+ zh: ["FFmpeg H.264 编码器", ""]
869
+ },
870
+ {
871
+ k: "ffmpegPath",
872
+ kind: "str",
873
+ en: ["FFmpeg path", "Empty = detect PATH or managed install"],
874
+ zh: ["FFmpeg 路径", "留空 = 探测 PATH 或托管安装"]
875
+ },
876
+ {
877
+ k: "cursorHud",
878
+ kind: "bool",
879
+ en: ["Draw cursor HUD into screenshots", ""],
880
+ zh: ["截图绘制光标 HUD", ""]
881
+ },
882
+ {
883
+ k: "cursorName",
884
+ kind: "str",
885
+ en: ["Cursor HUD label", ""],
886
+ zh: ["光标 HUD 名称", ""]
887
+ },
888
+ {
889
+ k: "githubMirror",
890
+ kind: "str",
891
+ en: ["GitHub download mirror", "HTTPS base replacing https://github.com for managed downloads"],
892
+ zh: ["GitHub 下载镜像", "托管下载时替换 https://github.com 的 HTTPS 前缀"]
893
+ },
894
+ {
895
+ k: "runtimeArgs",
896
+ kind: "str",
897
+ en: ["Extra runtime args", "Appended to the vendored runtime argv; next bcdp_* call"],
898
+ zh: ["运行时附加参数", "追加到托管运行时 argv;下次 bcdp_* 调用生效"]
899
+ },
900
+ {
901
+ k: "chromeArgs",
902
+ kind: "str",
903
+ en: ["Extra Chrome args", "Appended to the Chrome launch argv; next cold start"],
904
+ zh: ["Chrome 附加启动参数", "追加到 Chrome 启动 argv;下次冷启动生效"]
905
+ }
906
+ ]
907
+ },
908
+ {
909
+ gk: "gJudge",
910
+ en: "Judgement (JEV / Laya)",
911
+ zh: "评审(JEV / Laya)",
912
+ fields: [
913
+ {
914
+ k: "judgePrefer",
915
+ kind: "str",
916
+ en: ["Judge hop order", "Comma separated; defaults to \"laya,rule\""],
917
+ zh: ["评审跳序", "逗号分隔;默认 \"laya,rule\""]
918
+ },
919
+ {
920
+ k: "jevUrl",
921
+ kind: "str",
922
+ en: ["JEV base URL", "Leave empty to skip the jev hop"],
923
+ zh: ["JEV 基础 URL", "留空 = 跳过 jev 跳"]
924
+ },
925
+ {
926
+ k: "jevKey",
927
+ kind: "secret",
928
+ en: ["JEV bearer key", "Empty = the jev hop is skipped"],
929
+ zh: ["JEV Bearer Key", "留空 = 跳过 jev 跳"]
930
+ },
931
+ {
932
+ k: "jevModel",
933
+ kind: "str",
934
+ en: ["JEV model", ""],
935
+ zh: ["JEV 模型名", ""]
936
+ },
937
+ {
938
+ k: "jevChunkSize",
939
+ kind: "num",
940
+ min: 1,
941
+ max: 255,
942
+ step: 1,
943
+ en: ["JEV candidates per round", ""],
944
+ zh: ["JEV 每轮候选上限", ""]
945
+ },
946
+ {
947
+ k: "jevMaxImageBytes",
948
+ kind: "num",
949
+ min: 0,
950
+ step: 1024,
951
+ en: ["JEV frame byte budget (0 = unbounded)", ""],
952
+ zh: ["JEV 单帧字节预算(0 = 不限)", ""]
953
+ },
954
+ {
955
+ k: "jevHistoryLimit",
956
+ kind: "num",
957
+ min: 0,
958
+ max: 20,
959
+ step: 1,
960
+ en: ["JEV recent-step window", ""],
961
+ zh: ["JEV 近期步数窗口", ""]
962
+ },
963
+ {
964
+ k: "jevArchiveImage",
965
+ kind: "bool",
966
+ en: ["Embed screenshot in archived bundle", ""],
967
+ zh: ["归档包内嵌截图", ""]
968
+ },
969
+ {
970
+ k: "jevEvaluate",
971
+ kind: "bool",
972
+ en: ["Evaluate every action with the judge", "Costs one judgement call per action"],
973
+ zh: ["每步动作都过评审", "每步多花一次评审调用"]
974
+ },
975
+ {
976
+ k: "jevStepBudget",
977
+ kind: "num",
978
+ min: 1,
979
+ max: 200,
980
+ step: 1,
981
+ en: ["Rounds per bcdp_jev_run", ""],
982
+ zh: ["单次 bcdp_jev_run 轮数上限", ""]
983
+ },
984
+ {
985
+ k: "jevWallMs",
986
+ kind: "num",
987
+ min: 1e3,
988
+ max: 36e5,
989
+ step: 1e3,
990
+ en: ["Wall-clock ceiling per run (ms)", ""],
991
+ zh: ["单次运行墙钟上限(ms)", ""]
992
+ },
993
+ {
994
+ k: "layaUrl",
995
+ kind: "str",
996
+ en: ["Laya base URL", "The sidecar serves 8000"],
997
+ zh: ["Laya 基础 URL", "sidecar 服务 8000 端口"]
998
+ },
999
+ {
1000
+ k: "layaKey",
1001
+ kind: "secret",
1002
+ en: ["Laya key (required)", "Keyless calls are a guaranteed 401"],
1003
+ zh: ["Laya Key(必填)", "无 Key 必然 401"]
1004
+ },
1005
+ {
1006
+ k: "layaModel",
1007
+ kind: "str",
1008
+ en: ["Laya model", ""],
1009
+ zh: ["Laya 模型名", ""]
1010
+ }
1011
+ ]
1012
+ }
1013
+ ];
1014
+ function famText(item, kind) {
1015
+ var pair = _egoLocale === "zh" ? item.zh : item.en;
1016
+ if (kind === "title") return pair[0];
1017
+ return pair[1] || "";
1018
+ }
694
1019
  function FamilySettingsCard(props) {
695
1020
  var scope = props.scope;
696
1021
  var snapshot = React.useSyncExternalStore(function(listener) {
@@ -701,57 +1026,269 @@ function FamilySettingsCard(props) {
701
1026
  var value = snapshot.value || {};
702
1027
  var writable = snapshot.writable === true;
703
1028
  var h = React.createElement;
1029
+ return h("div", { style: {
1030
+ display: "grid",
1031
+ gap: "8px"
1032
+ } }, FAM_FIELD_GROUPS.map(function(group) {
1033
+ return h(FamGroup, {
1034
+ key: group.gk,
1035
+ group,
1036
+ value,
1037
+ writable,
1038
+ scope
1039
+ });
1040
+ }), h(FamLinks, {
1041
+ key: "links",
1042
+ value,
1043
+ writable,
1044
+ scope
1045
+ }));
1046
+ }
1047
+ function FamGroup(props) {
1048
+ var group = props.group;
1049
+ var h = React.createElement;
1050
+ return h("div", { style: {
1051
+ borderTop: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.25))",
1052
+ paddingTop: "6px"
1053
+ } }, h("div", { style: {
1054
+ fontSize: "12px",
1055
+ fontWeight: 600,
1056
+ color: "var(--dsw-alias-label-secondary, rgba(127,127,127,.9))",
1057
+ padding: "2px 0 4px"
1058
+ } }, _egoLocale === "zh" ? group.zh : group.en), group.fields.map(function(f) {
1059
+ return h(FamField, {
1060
+ key: f.k,
1061
+ f,
1062
+ group,
1063
+ ...props
1064
+ });
1065
+ }));
1066
+ }
1067
+ function FamField(props) {
1068
+ var f = props.f;
1069
+ var value = props.value;
1070
+ var writable = props.writable;
1071
+ var scope = props.scope;
1072
+ var h = React.createElement;
704
1073
  var rowStyle = {
705
1074
  display: "flex",
706
1075
  alignItems: "center",
707
1076
  justifyContent: "space-between",
708
1077
  gap: "12px",
709
- padding: "8px 0"
1078
+ padding: "6px 0"
710
1079
  };
711
- var textCol = {
1080
+ var label = h("div", { style: {
712
1081
  display: "flex",
713
1082
  flexDirection: "column",
714
- gap: "2px"
715
- };
716
- var titleStyle = {
1083
+ gap: "2px",
1084
+ minWidth: 0
1085
+ } }, h("span", { style: {
717
1086
  fontSize: "13px",
718
1087
  color: "var(--dsw-alias-label-primary, inherit)"
719
- };
720
- var descStyle = {
1088
+ } }, famText(f, "title")), f.desc === false || !famText(f, "desc") ? null : h("span", { style: {
721
1089
  fontSize: "12px",
722
1090
  color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.8))",
723
1091
  lineHeight: 1.5
724
- };
725
- var idleDraft = React.useState(typeof value.idleTimeoutMin === "number" ? value.idleTimeoutMin : 0);
726
- var idle = idleDraft[0], setIdle = idleDraft[1];
727
- React.useEffect(function() {
728
- setIdle(typeof value.idleTimeoutMin === "number" ? value.idleTimeoutMin : 0);
729
- }, [value.idleTimeoutMin]);
730
- return h("div", { style: {
731
- display: "grid",
732
- gap: "4px"
733
- } }, h("div", { style: rowStyle }, h("div", { style: textCol }, h("span", { style: titleStyle }, wt("famIsolate")), h("span", { style: descStyle }, wt("famIsolateDesc"))), h("input", {
1092
+ } }, famText(f, "desc")));
1093
+ if (f.kind === "bool") return h("div", { style: rowStyle }, label, h("input", {
734
1094
  type: "checkbox",
735
- checked: value.isolateSpaces === true,
1095
+ checked: value[f.k] === true,
736
1096
  disabled: !writable,
737
1097
  onChange: function(e) {
738
- scope.set("isolateSpaces", e.target.checked);
1098
+ scope.set(f.k, e.target.checked);
739
1099
  }
740
- })), h("div", { style: rowStyle }, h("div", { style: textCol }, h("span", { style: titleStyle }, wt("famIdle")), h("span", { style: descStyle }, wt("famIdleDesc"))), h("input", {
741
- type: "number",
742
- min: 0,
743
- max: 1440,
744
- value: idle,
1100
+ }));
1101
+ if (f.kind === "num") return h("div", { style: rowStyle }, label, h(FamNumInput, {
1102
+ f,
1103
+ v: value[f.k],
1104
+ writable,
1105
+ scope
1106
+ }));
1107
+ if (f.kind === "sel") return h("div", { style: rowStyle }, label, h("select", {
1108
+ value: String(value[f.k] ?? f.options[0]),
745
1109
  disabled: !writable,
746
- style: { width: "72px" },
747
- onChange: function(e) {
748
- setIdle(e.target.value === "" ? 0 : Number(e.target.value));
1110
+ style: {
1111
+ font: "inherit",
1112
+ color: "inherit",
1113
+ background: "var(--dsw-alias-bg-module-platform, rgba(127,127,127,.08))",
1114
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
1115
+ borderRadius: "8px",
1116
+ padding: "4px 8px"
749
1117
  },
750
- onBlur: function(e) {
751
- var n = Math.max(0, Math.min(1440, Math.round(Number(e.target.value) || 0)));
752
- scope.set("idleTimeoutMin", n);
1118
+ onChange: function(e) {
1119
+ scope.set(f.k, e.target.value);
753
1120
  }
1121
+ }, f.options.map(function(o) {
1122
+ return h("option", {
1123
+ key: o,
1124
+ value: o
1125
+ }, o);
754
1126
  })));
1127
+ return h("div", { style: {
1128
+ display: "grid",
1129
+ gap: "2px",
1130
+ padding: "6px 0"
1131
+ } }, label, h(FamStrInput, {
1132
+ f,
1133
+ v: value[f.k],
1134
+ writable,
1135
+ scope
1136
+ }));
1137
+ }
1138
+ function FamNumInput(props) {
1139
+ var f = props.f;
1140
+ var h = React.createElement;
1141
+ var draft = React.useState(props.v === void 0 || props.v === null ? "" : String(props.v));
1142
+ var v = draft[0], setV = draft[1];
1143
+ React.useEffect(function() {
1144
+ setV(props.v === void 0 || props.v === null ? "" : String(props.v));
1145
+ }, [props.v]);
1146
+ return h("input", {
1147
+ type: "number",
1148
+ min: f.min,
1149
+ max: f.max,
1150
+ step: f.step,
1151
+ value: v,
1152
+ disabled: !props.writable,
1153
+ style: {
1154
+ width: "96px",
1155
+ font: "inherit",
1156
+ color: "inherit",
1157
+ background: "var(--dsw-alias-bg-module-platform, rgba(127,127,127,.08))",
1158
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
1159
+ borderRadius: "8px",
1160
+ padding: "4px 8px"
1161
+ },
1162
+ onChange: function(e) {
1163
+ setV(e.target.value);
1164
+ },
1165
+ onBlur: function() {
1166
+ if (v === "") return;
1167
+ var n = Number(v);
1168
+ if (!isFinite(n)) return;
1169
+ n = Math.round(n / (f.step || 1)) * (f.step || 1);
1170
+ if (f.min !== void 0) n = Math.max(f.min, n);
1171
+ if (f.max !== void 0) n = Math.min(f.max, n);
1172
+ props.scope.set(f.k, n);
1173
+ }
1174
+ });
1175
+ }
1176
+ function FamStrInput(props) {
1177
+ var f = props.f;
1178
+ var h = React.createElement;
1179
+ var draft = React.useState(props.v === void 0 || props.v === null ? "" : String(props.v));
1180
+ var v = draft[0], setV = draft[1];
1181
+ React.useEffect(function() {
1182
+ setV(props.v === void 0 || props.v === null ? "" : String(props.v));
1183
+ }, [props.v]);
1184
+ return h("input", {
1185
+ type: f.kind === "secret" ? "password" : "text",
1186
+ value: v,
1187
+ disabled: !props.writable,
1188
+ style: {
1189
+ width: "100%",
1190
+ font: "inherit",
1191
+ color: "inherit",
1192
+ background: "var(--dsw-alias-bg-module-platform, rgba(127,127,127,.08))",
1193
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
1194
+ borderRadius: "8px",
1195
+ padding: "5px 10px",
1196
+ boxSizing: "border-box"
1197
+ },
1198
+ onChange: function(e) {
1199
+ setV(e.target.value);
1200
+ },
1201
+ onBlur: function() {
1202
+ props.scope.set(f.k, v);
1203
+ },
1204
+ onKeyDown: function(e) {
1205
+ if (e.key === "Enter") props.scope.set(f.k, v);
1206
+ }
1207
+ });
1208
+ }
1209
+ function FamLinks(props) {
1210
+ var value = props.value;
1211
+ var writable = props.writable;
1212
+ var scope = props.scope;
1213
+ var h = React.createElement;
1214
+ var links = Array.isArray(value.links) ? value.links : [];
1215
+ var activeId = typeof value.activeTargetId === "string" ? value.activeTargetId : "";
1216
+ function setEnabled(idx, on) {
1217
+ var next = links.map(function(row, i) {
1218
+ return i === idx ? {
1219
+ ...row,
1220
+ enabled: on
1221
+ } : row;
1222
+ });
1223
+ scope.set("links", next);
1224
+ }
1225
+ return h("div", { style: {
1226
+ borderTop: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.25))",
1227
+ paddingTop: "6px"
1228
+ } }, h("div", { style: {
1229
+ fontSize: "12px",
1230
+ fontWeight: 600,
1231
+ color: "var(--dsw-alias-label-secondary, rgba(127,127,127,.9))",
1232
+ padding: "2px 0 4px"
1233
+ } }, _egoLocale === "zh" ? "连接目标(顺序即优先级)" : "Connection targets (order = priority)"), links.length === 0 ? h("div", { style: {
1234
+ fontSize: "12px",
1235
+ color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.8))",
1236
+ padding: "4px 0"
1237
+ } }, _egoLocale === "zh" ? "暂无目标 —— 连接序列在 profile 的 cordis.patch.yml links 中维护" : "No targets — maintain the sequence in the profile cordis.patch.yml links") : links.map(function(row, idx) {
1238
+ var label = row.label || row.id || "#" + idx;
1239
+ var detail = row.kind === "ego-cli" ? row.cliPath || "" : row.endpoint || "";
1240
+ var isActive = row.id !== void 0 && row.id === activeId;
1241
+ return h("div", {
1242
+ key: row.id || idx,
1243
+ style: {
1244
+ display: "flex",
1245
+ alignItems: "center",
1246
+ gap: "8px",
1247
+ padding: "5px 0",
1248
+ flexWrap: "wrap"
1249
+ }
1250
+ }, h("input", {
1251
+ type: "checkbox",
1252
+ checked: row.enabled === true,
1253
+ disabled: !writable,
1254
+ title: _egoLocale === "zh" ? "启用" : "Enabled",
1255
+ onChange: function(e) {
1256
+ setEnabled(idx, e.target.checked);
1257
+ }
1258
+ }), h("span", { style: {
1259
+ fontSize: "13px",
1260
+ color: "var(--dsw-alias-label-primary, inherit)"
1261
+ } }, label), h("span", { style: {
1262
+ fontSize: "11px",
1263
+ color: "var(--dsw-alias-label-tertiary, rgba(127,127,127,.7))",
1264
+ minWidth: 0,
1265
+ overflow: "hidden",
1266
+ textOverflow: "ellipsis",
1267
+ whiteSpace: "nowrap",
1268
+ flex: "1 1 120px"
1269
+ } }, detail), isActive ? h("span", { style: {
1270
+ fontSize: "11px",
1271
+ color: "#30d158",
1272
+ flex: "0 0 auto"
1273
+ } }, _egoLocale === "zh" ? "已激活" : "active") : h("button", {
1274
+ type: "button",
1275
+ disabled: !writable,
1276
+ style: {
1277
+ font: "inherit",
1278
+ fontSize: "12px",
1279
+ cursor: writable ? "pointer" : "not-allowed",
1280
+ border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.35))",
1281
+ background: "none",
1282
+ color: "var(--dsw-alias-label-primary, inherit)",
1283
+ borderRadius: "8px",
1284
+ padding: "2px 10px",
1285
+ flex: "0 0 auto"
1286
+ },
1287
+ onClick: function() {
1288
+ scope.set("activeTargetId", row.id);
1289
+ }
1290
+ }, _egoLocale === "zh" ? "激活" : "activate"));
1291
+ }));
755
1292
  }
756
1293
  function apply(ctx) {
757
1294
  mountFamilySettingsCard(ctx);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-browser-cdp",
3
- "version": "0.17.3",
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+ line: declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.6 use the 0.16.x line]",
3
+ "version": "0.18.0",
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.2.0-rc.1+ line: declarative settings via Config .volatile() fields; for DSH 0.1.2-rc.1 ~ 0.1.7 use the 0.17.x line]",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
7
7
  "exports": {
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "dsh": {
23
23
  "engines": {
24
- "dsh": ">=0.1.7-rc.1 <0.1.8-0"
24
+ "dsh": ">=0.2.0-rc.1 <0.2.1-0"
25
25
  },
26
26
  "bundle": {
27
27
  "patch": "./cordis.patch.yml"
@@ -40,12 +40,12 @@
40
40
  "@deepseek-ai/schemastery": "^3.18.4"
41
41
  },
42
42
  "peerDependencies": {
43
- "@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.1.8-0",
44
- "@deepseek-ai/dsh-client-store": ">=0.1.7-rc.1 <0.1.8-0",
45
- "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.7-rc.1 <0.1.8-0",
46
- "@deepseek-ai/dsh-client-ui-slots": ">=0.1.7-rc.1 <0.1.8-0",
47
- "@deepseek-ai/dsh-settings": ">=0.1.7-rc.1 <0.1.8-0",
48
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
43
+ "@deepseek-ai/dsh-client-locale": ">=0.2.0-rc.1 <0.2.1-0",
44
+ "@deepseek-ai/dsh-client-store": ">=0.2.0-rc.1 <0.2.1-0",
45
+ "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.2.0-rc.1 <0.2.1-0",
46
+ "@deepseek-ai/dsh-client-ui-slots": ">=0.2.0-rc.1 <0.2.1-0",
47
+ "@deepseek-ai/dsh-settings": ">=0.2.0-rc.1 <0.2.1-0",
48
+ "@deepseek-ai/dsh-tools": ">=0.2.0-rc.1 <0.2.1-0",
49
49
  "react": "^18.2.0"
50
50
  },
51
51
  "peerDependenciesMeta": {
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "devDependencies": {
75
75
  "@deepseek-ai/cosmokit": "^1.8.5",
76
- "@deepseek-ai/dsh-tools": ">=0.1.7-rc.1 <0.1.8-0",
76
+ "@deepseek-ai/dsh-tools": ">=0.2.0-rc.1 <0.2.1-0",
77
77
  "@types/node": "^22.20.1",
78
78
  "@types/react": "~18.3.31",
79
79
  "@types/ws": "^8.5.10",
@@ -82,11 +82,11 @@
82
82
  "typescript": "^5.9.0",
83
83
  "vitest": "^3.2.0",
84
84
  "ws": "^8.18.0",
85
- "@deepseek-ai/dsh-sandbox": "^0.1.7-rc.1"
85
+ "@deepseek-ai/dsh-sandbox": ">=0.2.0-rc.1 <0.2.1-0"
86
86
  },
87
87
  "engines": {
88
88
  "node": ">=22",
89
- "dsh": ">=0.1.7-rc.1 <0.1.8-0"
89
+ "dsh": ">=0.2.0-rc.1 <0.2.1-0"
90
90
  },
91
91
  "license": "MIT",
92
92
  "repository": {