dsh-browser-cdp 1.9.7 → 1.9.9

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 CHANGED
@@ -1,3 +1,24 @@
1
+ ## 1.9.9 (2026-11-10)
2
+
3
+ **Tabbit 路线补上全模式:后台 tab 也出图(轮转捕获)。**
4
+
5
+ - **之前的状态**:`tabTracking: all` 只在 ego-cli 帧轮询里生效;Tabbit 虽已进同一个 tab bucket(列表 + @ 报告),但画面仍只拍激活那一个。
6
+ - **现在的做法**:Tabbit 帧轮询按模式定计划:
7
+ - `仅激活`:1 次 CLI 运行(active tab);
8
+ - `全模式`:active tab **每 tick 都拍**,另加 **1 个后台 tab 轮转**(`tabbitFrameRR`)——N 个 tab 每 tick 仍是 2 次运行,每个后台 tab 约 `N×3s` 刷新一次;没有拿 N 次运行去挤爆同一 executor、把面板拖过自己的节奏。
9
+ - **临时文件按 tab 分路径**(`…-<pid>-<tabId>.jpg`),免得同一 tick 内后一张盖掉前一张。
10
+ - **广播**:改用 `broadcastCliFrames(images, rows)`,一轮一个 `spaces` + 每个 tab 一个 `frame`(按 targetId 绑图);面板早就按 `targetId` 分缓存,无需改客户端。
11
+ - **测试**:1021 passed / 13 skipped。
12
+
13
+ ## 1.9.8 (2026-11-10)
14
+
15
+ **登录/验证横幅:说明文字按比例收缩,不截断、不隐藏。**
16
+
17
+ - 撤回 1.9.7 的“超长省略 + 窄宽度隐藏 note”做法;`loginSelfPersist` 恢复完整文案(中/英)。
18
+ - 比例:主文案 `flex: 2 1 11~12em`,说明 `flex: 1 1 9~10em`,两边都 `min-width: 0` + `white-space: normal` + `overflow-wrap: anywhere` → 两者按 2:1 分享行宽,放不下就各自换行,绝不出 1 字一列、也不省略。
19
+ - `@container (max-width: 260px)` 只保留“隐藏 captcha kind 胶囊”这一项装饰降级。
20
+ - **测试**:1021 passed / 13 skipped(纯样式)。
21
+
1
22
  ## 1.9.7 (2026-11-10)
2
23
 
3
24
  **窄宽度下登录/验证横幅不再被挤成一列字。**
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": "1.9.7",
5
+ "version": "1.9.9",
6
6
  "manifestVersion": "0.15",
7
7
  "facets": {
8
8
  "host": {
package/lib/client.js CHANGED
@@ -598,7 +598,7 @@ var watchEn = {
598
598
  whereLocal: "managed Chrome window",
599
599
  whereGeneric: "agent browser window",
600
600
  loginHeadless: "The active target is Lightpanda (headless) — there is no window to sign in or verify in. Switch to a headed target (CDP endpoint / local Chrome / ego CLI / Tabbit).",
601
- loginSelfPersist: "Saved by the browser profile itself.",
601
+ loginSelfPersist: "This browser keeps the login in its own profile — nothing to save here.",
602
602
  captchaDismiss: "Dismiss",
603
603
  hintReset: "Reset · scroll to pan · Ctrl+scroll to zoom · double-click to reset",
604
604
  hintPan: "Ctrl+scroll to zoom · Ctrl+drag to pan · double-click to reset",
@@ -730,7 +730,7 @@ var watchDict = {
730
730
  whereLocal: "本机 Chrome 窗口(受管启动)",
731
731
  whereGeneric: "agent 浏览器窗口",
732
732
  loginHeadless: "当前激活的是 Lightpanda(无头引擎),没有可登录/验证的窗口;请切换到有头目标(CDP 端点 / 本机 Chrome / ego CLI / Tabbit)。",
733
- loginSelfPersist: "登录态由该浏览器自身保存",
733
+ loginSelfPersist: "登录态保存在该浏览器自己的 profile 里,无需手动落盘。",
734
734
  captchaDismiss: "关闭提示",
735
735
  hintReset: "已复位 · 滚轮滚动页面 · Ctrl+滚轮缩放 · 双击复位",
736
736
  hintPan: "Ctrl+滚轮缩放 · Ctrl+拖动平移 · 双击复位",
@@ -1263,15 +1263,15 @@ const PANEL_CSS = `
1263
1263
  the sentence into a one-character column. */
1264
1264
  flex-wrap: wrap; row-gap:6px; container-type: inline-size; }
1265
1265
  #dsh-ego-login.show { display:flex; }
1266
- #dsh-ego-login .dsh-ego-login-txt { flex:1 1 12em; min-width:0; font-size:11px; line-height:1.45; color:#f5f5f7;
1266
+ #dsh-ego-login .dsh-ego-login-txt { flex:2 1 12em; min-width:0; font-size:11px; line-height:1.45; color:#f5f5f7;
1267
1267
  overflow-wrap: anywhere; }
1268
1268
  #dsh-ego-login .dsh-ego-login-txt b { color:#ffd60a; }
1269
1269
  #dsh-ego-login .dsh-ego-login-btn { flex:none; background:#0a84ff; color:#fff; border:none; border-radius:8px;
1270
1270
  font-size:11px; padding:4px 10px; cursor:pointer; white-space:nowrap; transition: background .15s ease; }
1271
1271
  #dsh-ego-login .dsh-ego-login-btn:hover { background:#338cff; }
1272
1272
  #dsh-ego-login .dsh-ego-login-btn.saving { opacity:.55; pointer-events:none; }
1273
- #dsh-ego-login .dsh-ego-login-note { flex:0 1 auto; min-width:0; max-width:100%; font-size:10.5px; color:#6e6e73;
1274
- white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
1273
+ #dsh-ego-login .dsh-ego-login-note { flex:1 1 10em; min-width:0; max-width:100%; font-size:10.5px; color:#6e6e73;
1274
+ white-space:normal; overflow-wrap:anywhere; }
1275
1275
  /* dismiss (×) on guide strips so the user can close them and reclaim the space */
1276
1276
  .dsh-ego-dismiss { flex:none; width:18px; height:18px; line-height:1; border-radius:50%; border:none;
1277
1277
  background: rgba(255,255,255,.12); color:inherit; font-size:13px; cursor:pointer; opacity:.75;
@@ -1285,10 +1285,12 @@ const PANEL_CSS = `
1285
1285
  border-radius:9px; border:1px solid rgba(255,69,58,.4); background: rgba(255,69,58,.13); color:#ffe1de;
1286
1286
  flex-wrap: wrap; row-gap:6px; container-type: inline-size; }
1287
1287
  @container (max-width: 260px) {
1288
- #dsh-ego-login .dsh-ego-login-note, #dsh-ego-captcha .dsh-ego-captcha-kind { display:none; }
1288
+ /* The kind pill is pure decoration — it is the only thing that steps aside.
1289
+ Text never truncates or hides: both lines shrink proportionally and wrap. */
1290
+ #dsh-ego-captcha .dsh-ego-captcha-kind { display:none; }
1289
1291
  }
1290
1292
  #dsh-ego-captcha.show { display:flex; }
1291
- #dsh-ego-captcha .dsh-ego-captcha-txt { flex:1 1 12em; min-width:0; font-size:11.5px; line-height:1.5;
1293
+ #dsh-ego-captcha .dsh-ego-captcha-txt { flex:2 1 12em; min-width:0; font-size:11.5px; line-height:1.5;
1292
1294
  overflow-wrap: anywhere; }
1293
1295
  #dsh-ego-captcha .dsh-ego-captcha-txt b { color:#ff6961; }
1294
1296
  #dsh-ego-captcha .dsh-ego-captcha-kind { flex:none; font-size:10px; padding:2px 8px; border-radius:999px;
@@ -4221,7 +4223,9 @@ var TAB_CSS = `
4221
4223
  container-type: inline-size;
4222
4224
  }
4223
4225
  @container (max-width: 260px) {
4224
- .dsh-ego-side-login-note, .dsh-ego-side-captcha-kind { display: none; }
4226
+ /* Decoration only: the captcha kind pill steps aside. Every text line keeps
4227
+ rendering — it just shrinks proportionally and wraps. */
4228
+ .dsh-ego-side-captcha-kind { display: none; }
4225
4229
  }
4226
4230
  .dsh-ego-side-login {
4227
4231
  border: 1px solid rgba(255,214,10,.3); background: rgba(255,214,10,.1);
@@ -4229,7 +4233,7 @@ var TAB_CSS = `
4229
4233
  .dsh-ego-side-captcha {
4230
4234
  border: 1px solid rgba(255,69,58,.4); background: rgba(255,69,58,.13);
4231
4235
  }
4232
- .dsh-ego-side-login .dsh-ego-side-login-txt { flex: 1 1 11em; min-width: 0; overflow-wrap: anywhere; }
4236
+ .dsh-ego-side-login .dsh-ego-side-login-txt { flex: 2 1 11em; min-width: 0; overflow-wrap: anywhere; }
4233
4237
  .dsh-ego-side-login .dsh-ego-side-login-txt b { color: #ffd60a; }
4234
4238
  .dsh-ego-side-login-btn {
4235
4239
  flex: none; background: #0a84ff; color: #fff; border: none; border-radius: 7px;
@@ -4238,9 +4242,9 @@ var TAB_CSS = `
4238
4242
  }
4239
4243
  .dsh-ego-side-login-btn:hover { background: #338cff; }
4240
4244
  .dsh-ego-side-login-btn.saving { opacity: .55; pointer-events: none; }
4241
- .dsh-ego-side-login-note { flex: 0 1 auto; min-width: 0; max-width: 100%; font-size: 10px; opacity: .6;
4242
- white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
4243
- .dsh-ego-side-captcha-txt { flex: 1 1 11em; min-width: 0; overflow-wrap: anywhere; }
4245
+ .dsh-ego-side-login-note { flex: 1 1 9em; min-width: 0; max-width: 100%; font-size: 10px; opacity: .6;
4246
+ white-space: normal; overflow-wrap: anywhere; }
4247
+ .dsh-ego-side-captcha-txt { flex: 2 1 11em; min-width: 0; overflow-wrap: anywhere; }
4244
4248
  .dsh-ego-side-captcha-txt b { color: #ff6961; }
4245
4249
  .dsh-ego-side-captcha-kind {
4246
4250
  flex: none; font-size: 9.5px; padding: 2px 7px; border-radius: 999px;
package/lib/index.js CHANGED
@@ -1971,15 +1971,6 @@ function markEgoToolCall(sessionId) {
1971
1971
  sseClients.delete(res);
1972
1972
  }
1973
1973
  }
1974
- function broadcastCliFrame(frame, spaces) {
1975
- broadcastCliFrames([{
1976
- targetId: frame.targetId ?? "",
1977
- png: frame.png,
1978
- fmt: frame.fmt,
1979
- url: frame.url,
1980
- title: frame.title
1981
- }], spaces, frame.updatedAt);
1982
- }
1983
1974
  /**
1984
1975
  * Push one capture CYCLE into the live stream: 全模式 sends one image per tab,
1985
1976
  * 仅激活 sends exactly one. Every image is its own `frame` event keyed by
@@ -10693,7 +10684,9 @@ function apply(ctx, config = {}) {
10693
10684
  let tabbitFrameSeq = 0;
10694
10685
  let tabbitFrameInFlight = false;
10695
10686
  let tabbitFrameSkipLogged = "";
10696
- const tabbitFramePath = join(tmpdir(), `dsh-browser-cdp-frame-${process.pid}.jpg`);
10687
+ const tabbitFramePathFor = (tabId) => join(tmpdir(), `dsh-browser-cdp-frame-${process.pid}-${String(tabId)}.jpg`);
10688
+ /** Round-robin cursor: 3s ticks → active tab every tick, one background tab extra. */
10689
+ let tabbitFrameRR = 0;
10697
10690
  const tabbitFrameTimer = setInterval(async () => {
10698
10691
  const eff = resolveEffectiveLink(cfg.links, cfg.activeTargetId);
10699
10692
  if (eff?.link.kind !== TABBIT_CLI_KIND) return;
@@ -10704,40 +10697,56 @@ function apply(ctx, config = {}) {
10704
10697
  if (tabbitFrameInFlight) return;
10705
10698
  tabbitFrameInFlight = true;
10706
10699
  try {
10707
- const reqId = `frame-${Date.now()}`;
10708
- const js$2 = buildFrameCaptureSnippet(tabbitFramePath);
10709
- const target = _tabbitLastActiveTabId ?? _tabbitTabCache.tabs.find((t) => t.active === true)?.tabId;
10710
- const { receipt } = await runTabbitSnippet(ctx.subprocess, js$2, {
10711
- cliPath: cli.cliPath,
10712
- taskName: _tabbitLastTaskName,
10713
- requestId: reqId,
10714
- ...typeof target === "number" ? { tabId: target } : {}
10715
- });
10716
- const data = receipt.data;
10717
- if (receipt.ok && data?.skipped !== void 0) {
10718
- const key = `${data.skipped}:${data.error ?? ""}`;
10719
- if (tabbitFrameSkipLogged !== key) {
10720
- tabbitFrameSkipLogged = key;
10721
- ctx.logger?.info?.(`dsh-browser-cdp: tabbit frame skipped (${key}) url=${data.url ?? "?"}`);
10700
+ const activeTab = _tabbitLastActiveTabId ?? _tabbitTabCache.tabs.find((t) => t.active === true)?.tabId;
10701
+ const rows = tabbitSpaceRows().tabs;
10702
+ const allMode = getCliTrackAll(cfg.tabTracking === "all");
10703
+ const plan = [typeof activeTab === "number" ? activeTab : void 0];
10704
+ if (allMode) {
10705
+ const others = rows.map((r) => Number(r.targetId)).filter((id) => Number.isFinite(id) && id > 0 && id !== activeTab);
10706
+ if (others.length > 0) {
10707
+ plan.push(others[tabbitFrameRR % others.length]);
10708
+ tabbitFrameRR += 1;
10722
10709
  }
10723
- return;
10724
10710
  }
10725
- tabbitFrameSkipLogged = "";
10726
- if (receipt.ok && typeof data?.path === "string") {
10727
- const png = readFileSync(data.path);
10728
- tabbitFrameSeq++;
10729
- broadcastCliFrame({
10730
- png,
10731
- url: data.url ?? "",
10732
- title: data.title ?? "",
10733
- seq: tabbitFrameSeq,
10734
- updatedAt: Date.now(),
10735
- fmt: "jpeg"
10736
- }, tabbitSpaceRows().tabs);
10711
+ const images = [];
10712
+ let sawSkip = "";
10713
+ let sawNoPath = null;
10714
+ for (const tabId of plan) {
10715
+ const js$2 = buildFrameCaptureSnippet(tabbitFramePathFor(tabId ?? "active"));
10716
+ const { receipt } = await runTabbitSnippet(ctx.subprocess, js$2, {
10717
+ cliPath: cli.cliPath,
10718
+ taskName: _tabbitLastTaskName,
10719
+ requestId: `frame-${Date.now()}-${tabId ?? "active"}`,
10720
+ ...typeof tabId === "number" ? { tabId } : {}
10721
+ });
10722
+ const data = receipt.data;
10723
+ if (receipt.ok && data?.skipped !== void 0) {
10724
+ sawSkip = `${data.skipped}:${data.error ?? ""}`;
10725
+ continue;
10726
+ }
10727
+ if (receipt.ok && typeof data?.path === "string") {
10728
+ images.push({
10729
+ targetId: tabId === void 0 ? "" : String(tabId),
10730
+ png: readFileSync(data.path),
10731
+ fmt: "jpeg",
10732
+ url: data.url ?? "",
10733
+ title: data.title ?? ""
10734
+ });
10735
+ continue;
10736
+ }
10737
+ if (receipt.ok) sawNoPath = data ?? null;
10738
+ else if (receipt.status !== "queued" && receipt.status !== "running") ctx.logger?.warn?.(`dsh-browser-cdp: tabbit frame capture failed: ${receipt.error?.message ?? receipt.status}`);
10739
+ }
10740
+ if (images.length === 0) {
10741
+ if (sawSkip !== "" && tabbitFrameSkipLogged !== sawSkip) {
10742
+ tabbitFrameSkipLogged = sawSkip;
10743
+ ctx.logger?.info?.(`dsh-browser-cdp: tabbit frame skipped (${sawSkip})`);
10744
+ } else if (sawNoPath !== null) ctx.logger?.warn?.(`dsh-browser-cdp: tabbit frame receipt carried no path (data=${JSON.stringify(sawNoPath).slice(0, 120)})`);
10737
10745
  return;
10738
10746
  }
10739
- if (receipt.ok) ctx.logger?.warn?.(`dsh-browser-cdp: tabbit frame receipt carried no path (status=${receipt.status}, data=${JSON.stringify(data ?? null).slice(0, 120)})`);
10740
- else if (receipt.status !== "queued" && receipt.status !== "running") ctx.logger?.warn?.(`dsh-browser-cdp: tabbit frame capture failed: ${receipt.error?.message ?? receipt.status}`);
10747
+ tabbitFrameSkipLogged = "";
10748
+ tabbitFrameSeq++;
10749
+ broadcastCliFrames(images, rows, Date.now());
10741
10750
  } catch (err) {
10742
10751
  ctx.logger?.warn?.(`dsh-browser-cdp: tabbit frame poller error: ${String(err?.message ?? err)}`);
10743
10752
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-browser-cdp",
3
- "version": "1.9.7",
3
+ "version": "1.9.9",
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.7-rc.1 ~ 0.2.2-rc.1 (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",