dsh-browser-cdp 1.14.6 → 1.14.7

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,15 @@
1
+ ## 1.14.7 (2026-11-22)
2
+
3
+ **观察窗帧解码预换(上游 #82/#81 同构,预防性):`img.src` 直换的解码空白窗口收口。**
4
+
5
+ 反向审计确认的第三个平行面。两处实时帧 flush(浮动观察窗 + 侧栏控制器)此前直接 `img.src = dataUrl`——换帧瞬间旧位图被丢弃、新帧解码期间出现空白窗口,即上游在有头 macOS(M1/M5)实测的面板黑闪(他们以 canvas 合成修复)。我们的 flush 已有 rAF 合帧(一展示一解码,频次已降),但单次直换的空白窗口仍在。
6
+
7
+ - **修复**:两处 flush 改为先经 detached `Image` + `decode()` 预解码新帧,成功后才换 `liveImg.src`——旧画面保留到新位图就绪;`decode()` 不可用或失败时降级为原直换(不劣于从前)。解码期间新到帧保持 `pendingLiveFrame` 语义(apply 只清自己那一帧),最新帧由下一次 rAF 呈现,不丢帧。
8
+ - **诚实声明**:黑闪是视觉缺陷,本地无 DSH 宿主可自动目验——验收 = 构建 + 契约测试 + 所有者目验三段承担;修复取上游同面板架构的实证结论,归类预防性。
9
+ - **契约测试**:新增 `tests/client-render-contract.test.ts`——两处 flush 均须走 `probe.decode().then(apply, apply)`、降级路径存在、`apply` 内换帧仍在。
10
+
11
+ 门禁:`npm run typecheck` 干净;`npm test` **1343 passed / 13 skipped**(+1 契约用例);`npm run build` 后 lib/client.js 含 decode ×2。
12
+
1
13
  ## 1.14.6 (2026-11-22)
2
14
 
3
15
  **JS 弹窗可见性(上游 #104 同构):卡住的步骤从裸超时变成自带「dialog 类型 + 页面 message + 处置指引」的诊断。**
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.14.6",
5
+ "version": "1.14.7",
6
6
  "manifestVersion": "0.15",
7
7
  "facets": {
8
8
  "host": {
package/lib/client.js CHANGED
@@ -3836,10 +3836,18 @@ function mountFloatingWatch(ctx) {
3836
3836
  if (!liveFlushRaf && !disposed) liveFlushRaf = window.requestAnimationFrame(() => {
3837
3837
  liveFlushRaf = null;
3838
3838
  if (disposed || !liveImg || pendingLiveFrame == null) return;
3839
- try {
3840
- liveImg.src = pendingLiveFrame;
3841
- } catch {}
3842
- pendingLiveFrame = null;
3839
+ const frame = pendingLiveFrame;
3840
+ const apply$1 = () => {
3841
+ if (disposed || !liveImg) return;
3842
+ try {
3843
+ liveImg.src = frame;
3844
+ } catch {}
3845
+ if (pendingLiveFrame === frame) pendingLiveFrame = null;
3846
+ };
3847
+ const probe = new window.Image();
3848
+ probe.src = frame;
3849
+ if (typeof probe.decode === "function") probe.decode().then(apply$1, apply$1);
3850
+ else apply$1();
3843
3851
  });
3844
3852
  return;
3845
3853
  }
@@ -5836,10 +5844,18 @@ LivePreviewController.prototype.applyFrame = function(targetId, dataUrl, vw, vh)
5836
5844
  if (!this.liveFlushRaf && !this.disposed) this.liveFlushRaf = window.requestAnimationFrame(function() {
5837
5845
  self2.liveFlushRaf = null;
5838
5846
  if (self2.disposed || !self2.liveImg || self2.pendingLiveFrame == null) return;
5839
- try {
5840
- self2.liveImg.src = self2.pendingLiveFrame;
5841
- } catch (e) {}
5842
- self2.pendingLiveFrame = null;
5847
+ var frame = self2.pendingLiveFrame;
5848
+ var apply$1 = function() {
5849
+ if (self2.disposed || !self2.liveImg) return;
5850
+ try {
5851
+ self2.liveImg.src = frame;
5852
+ } catch (e) {}
5853
+ if (self2.pendingLiveFrame === frame) self2.pendingLiveFrame = null;
5854
+ };
5855
+ var probe = new window.Image();
5856
+ probe.src = frame;
5857
+ if (typeof probe.decode === "function") probe.decode().then(apply$1, apply$1);
5858
+ else apply$1();
5843
5859
  });
5844
5860
  return;
5845
5861
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-browser-cdp",
3
- "version": "1.14.6",
3
+ "version": "1.14.7",
4
4
  "description": "dsh-browser-cdp: visible agent browser for DSH — drives the vendored ego-compatible Chromium over CDP, and can also attach to a running Chrome/Edge/Brave or route through egolite, Tabbit and Lightpanda backends. 35 structured bcdp_* tools; only bcdp_status stays resident by default (lazy injection, −91.9% schema per turn for non-browser sessions). Realtime watch panel with direct click/scroll/IME input, element picks quoted into the composer, human-verification notices; non-CDP channels sync frames by 3s polling. Web shell: floating watch ball without dsh-better-sidebar, sidebar tab with it. Headless/TUI hosts: tools-only. [DSH 0.1.0-rc.2 ~ 0.2.2-rc.1: declarative settings via Config .volatile() fields on 0.1.7+; imperative installSection / module-level registration + describe/mutate bridge on 0.1.0 ~ 0.1.5 (experimental, pending farm). Client peers stay optional so gen-1 hosts without dsh-client-store still load; for a production install on the current line use the 0.17.x line]",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",