dsh-mpkg-wallpaper 3.10.0 → 3.10.1
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.en.md +3 -3
- package/README.md +3 -3
- package/lib/client.js +35 -2
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Adds background wallpapers to the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web UI (`dsh web`): **Wallpaper Engine `.mpkg` parsing, Steam Workshop folders, video/web/image wallpapers, time-of-day switching for Time Variation wallpapers, a full-screen blur system, theme colours and glass surfaces, a local wallpaper library, scheduled rotation, a Now playing widget and one-click update**. Almost every appearance detail is adjustable.
|
|
8
8
|
|
|
9
|
-
> Version scope: this document describes the implementation shipped as **`3.10.
|
|
9
|
+
> Version scope: this document describes the implementation shipped as **`3.10.1`** in `package.json`. The publish surface is **15 files** (`lib/` runtime files + `package.json`, `icon.svg`, `cordis.patch.yml`, `README.md`, `README.en.md`, `THIRD-PARTY.md`, `LICENSE`; measured with `npm pack --dry-run`: 15 files / 2,088,240 B unpacked); `lib/liquid-glass/**`, `lib/liquid-glass-bundle.js`, `dist/`, `tools/` and `docs/` never enter the npm package (`package.json:8-21`). Defaults that changed: **`npNowPlaying` off → on** (since 3.8.0) and **`powPauseHidden` off → on** (since 3.9.0, migrating only profiles that never set it; see [What changed in this version](#what-changed-in-this-version)).
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -560,7 +560,7 @@ This section is a file-by-file map of the repository: what enters the npm packag
|
|
|
560
560
|
|
|
561
561
|
```text
|
|
562
562
|
dsh-mpkg-wallpaper/
|
|
563
|
-
├── package.json # version 3.10.
|
|
563
|
+
├── package.json # version 3.10.1; dsh.bundle + dsh.client declarations; files allow-list = publish surface (15 files)
|
|
564
564
|
├── cordis.patch.yml # install declaration used by dsh plugin add
|
|
565
565
|
├── LICENSE # MIT
|
|
566
566
|
├── THIRD-PARTY.md # third-party provenance / clean-room records / licence attribution (shipped)
|
|
@@ -610,7 +610,7 @@ The 12 steps of `tools/check.sh`: ① syntax ② panel smoke + P-66 + folder pic
|
|
|
610
610
|
|
|
611
611
|
## What changed in this version
|
|
612
612
|
|
|
613
|
-
Current version = **3.10.
|
|
613
|
+
Current version = **3.10.1** in `package.json` (this release line: 3.8.0 → 3.8.1 → 3.8.2 → 3.9.0 → 3.9.1 → 3.10.0 → **3.10.1**). Release prerequisites, commands and rollback live in [`docs/RELEASE.md`](docs/RELEASE.md); this round's change list is in [`docs/RELEASE-READY-3.8.0.md`](docs/RELEASE-READY-3.8.0.md); the root causes and on-device readings for Now playing / wallpaper sound are in [`docs/NOW-PLAYING-DSH.md`](docs/NOW-PLAYING-DSH.md) §7.7.
|
|
614
614
|
|
|
615
615
|
- **Now playing is on by default and yields its slot**: the `npNowPlaying` setting is **on by default** (`DEFAULT_NP_NOW_PLAYING` in `lib/client.js`), still in the *Wallpaper* tab directly under the existing `mute` toggle (`toggleRow(t("npNowPlaying"), …)` in `lib/client.js`). Turning it off returns to zero injection (mechanism and criteria in [Now playing and wallpaper sound](#now-playing-and-wallpaper-sound)). Being on by default requires **yielding**: when another plugin has already injected an element into the same host slot we do not mount (or we retract) and leave a queryable state `data-mpw-np-yield` (`occupantOf()` in `lib/now-playing.js`; judged both before and after mounting, and it comes back once the occupant leaves). The component itself is a **line-by-line port of Bencho's "Now playing" (MIT)** with the upstream comments kept verbatim (attribution in `THIRD-PARTY.md` §6); pure math and component are split into `lib/now-playing-math.js` / `lib/now-playing.js` and **inlined byte-for-byte** into the `MPW-NP-GEN-START/END` region of `lib/client.js` by `tools/build-now-playing.mjs`, guarded by two independent drift gates. Mounting and collapse criteria: see [Now playing and wallpaper sound](#now-playing-and-wallpaper-sound).
|
|
616
616
|
- **Wallpaper sound is actually wired up**: the data source only accepts the media element that is **really playing right now** (the hidden shell `#mpw-bgVideo` exists in the DOM under **every** wallpaper type, and the old implementation treated the first selector match as "the current media") ⇒ a video wallpaper's play/pause/mute land on the real element (the **`mute` switch now really reaches the element — unmuting really produces sound**; the old code hard-coded `video.muted = true` and never assigned it from the setting again); audio files that **really exist** in the wallpaper folder play through our own `<audio>` (the scope accepts `mpkgKey="custom|<folder>"`; the old code only accepted `folderName`, so a web wallpaper in a custom folder always built a library route and got a 404) ⇒ **previous/next follow the track-list order and wrap around**, instead of "restart"; for a web wallpaper's in-frame sound only **mute** is a real channel (`canPlay=false` is reported honestly — we do not pretend we can pause in-frame WebAudio); while our player is playing, the frame is force-muted so the same track cannot play twice.
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web 界面(`dsh web`)添加背景壁纸的插件:**Wallpaper Engine `.mpkg` 解析、Steam 创意工坊目录、视频/网页/图片壁纸、时间变化壁纸的多时段切换、整屏虚化体系、主题色与玻璃外观、本地壁纸库、定时轮换、Now playing 控件、一键更新**。外观细节几乎全部可调。
|
|
8
8
|
|
|
9
|
-
> 版本口径:本文件描述的是 `package.json` 里 **`3.10.
|
|
9
|
+
> 版本口径:本文件描述的是 `package.json` 里 **`3.10.1`** 这一版实现。发布面共 **15 个文件**(`lib/` 8 个运行时文件 + `package.json`、`icon.svg`、`cordis.patch.yml`、`README.md`、`README.en.md`、`THIRD-PARTY.md`、`LICENSE`;`npm pack --dry-run` 实测 15 文件 / unpacked 2 088 240 B);`lib/liquid-glass/**`、`lib/liquid-glass-bundle.js`、`dist/`、`tools/`、`docs/` 都不进 npm 包(`package.json:8-21`)。本轮的默认档变化:**`npNowPlaying` 关 → 开**(3.8.0 起)与 **`powPauseHidden` 关 → 开**(3.9.0 起,只迁移"从没设过"的存量档;详见[这一版新增/变更](#这一版新增变更))。
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -560,7 +560,7 @@ node tools/build-bundle.mjs
|
|
|
560
560
|
|
|
561
561
|
```text
|
|
562
562
|
dsh-mpkg-wallpaper/
|
|
563
|
-
├── package.json # 版本 3.10.
|
|
563
|
+
├── package.json # 版本 3.10.1;dsh.bundle + dsh.client 声明;files 白名单 = 发布面(15 文件)
|
|
564
564
|
├── cordis.patch.yml # 插件安装声明(dsh plugin add 使用)
|
|
565
565
|
├── LICENSE # MIT
|
|
566
566
|
├── THIRD-PARTY.md # 第三方来历/洁净室记录与许可归属(随包发布)
|
|
@@ -610,7 +610,7 @@ node tools/style-scope-guard.mjs # 判据是末行「… OK / … ALLOWLISTED
|
|
|
610
610
|
|
|
611
611
|
## 这一版新增/变更
|
|
612
612
|
|
|
613
|
-
当前版本 = `package.json` 的 **3.10.
|
|
613
|
+
当前版本 = `package.json` 的 **3.10.1**(本轮发布线 3.8.0 → 3.8.1 → 3.8.2 → 3.9.0 → 3.9.1 → 3.10.0 → **3.10.1**)。发布前置/命令/回滚见 [`docs/RELEASE.md`](docs/RELEASE.md),本轮改动清单见 [`docs/RELEASE-READY-3.8.0.md`](docs/RELEASE-READY-3.8.0.md),Now playing / 壁纸声音的根因与真机读数见 [`docs/NOW-PLAYING-DSH.md`](docs/NOW-PLAYING-DSH.md) §7.7。
|
|
614
614
|
|
|
615
615
|
- **Now playing 默认挂载 + 会让位**:设置项 `npNowPlaying` **默认开**(`lib/client.js` 的 `DEFAULT_NP_NOW_PLAYING`),仍在「壁纸设置」tab、紧挨既有 `mute` 下方(`lib/client.js` 的 `toggleRow(t("npNowPlaying"), …)`)。关掉即回到零注入(机制与判据见 [Now playing 与壁纸声音](#now-playing-与壁纸声音))。默认开的前提是**礼让**:宿主同一位置已经有别的插件注入的元素时不挂/撤下,并留一个可查询状态 `data-mpw-np-yield`(`lib/now-playing.js` 的 `occupantOf()`;挂载前与挂载后都判,占用者走了再回来)。组件本体是 **Bencho 的 "Now playing"(MIT)逐行移植**(注释原文保留,归属见 `THIRD-PARTY.md` §6);纯数学与组件拆成 `lib/now-playing-math.js` / `lib/now-playing.js`,由 `tools/build-now-playing.mjs` **逐字节内联**进 `lib/client.js` 的 `MPW-NP-GEN-START/END` 生成区,配两道漂移门禁(生成器自比 + 产物反抠比对)。挂载与收起判据见 [Now playing 与壁纸声音](#now-playing-与壁纸声音)。
|
|
616
616
|
- **壁纸声音真的接线**:数据源只认**当前真的在放**的那个媒体元素(页面里那个隐藏空壳 `#mpw-bgVideo` 在**任何壁纸类型下都在 DOM 里**,旧实现按选择器命中它就当"当前媒体")⇒ 视频壁纸的播放/暂停/静音落在真实元素上(**`mute` 开关真的落到元素上:关掉静音就真的出声**,旧写法把 `video.muted` 写死 `true`,之后再没有代码按设置赋值);壁纸目录里**真实存在**的音频文件由我们自己的 `<audio>` 播(作用域认 `mpkgKey="custom|<folder>"`,旧写法只认 `folderName` ⇒ 自定义目录里的 web 壁纸永远拼成 library 路由 404)⇒ **上一首/下一首按清单顺序环形切换**,不再是"回到开头";web 壁纸帧内那份声音只有**静音**这一条真通道(`canPlay=false`,如实显示,不假装能暂停帧内 WebAudio);我们放音时帧内被强制静音(防同一首放两遍)。
|
package/lib/client.js
CHANGED
|
@@ -8920,8 +8920,18 @@ function sectionSigNow() {
|
|
|
8920
8920
|
旧判据只有"可听播放"这一条泛判据(设置是开是关都报),既漏了"静音下可听"这个组合的强调,
|
|
8921
8921
|
也没把 `np.mute` 与可听状态**放在一起**判断。 */
|
|
8922
8922
|
const muteOnAudible = !!(rec.np && rec.np.mute === true && audible);
|
|
8923
|
+
/* ①(2026-09-20 用户澄清后的补网) 用户明确:"别人插件的音效必须我去交互他才会出现,并不会自己出现"
|
|
8924
|
+
⇒ 鲸鱼那条只解释了"交互时响",**解释不了"什么都没动却响"**。真机上不需要交互就能出声、而我们
|
|
8925
|
+
`muted` 又管不到的,只剩 **WebAudio**(Live2D 角色语音 / 壁纸自己用 AudioContext 播的声):
|
|
8926
|
+
它不碰任何 `<audio>/<video>`,所以 `audible` 这条永远抓不到它。判据:
|
|
8927
|
+
· `webaudio-start`(`AudioBufferSourceNode.start()` —— 真的开始出声那一刻);
|
|
8928
|
+
· 或者 `AudioContext` 被 resume 到 running(自动播放解锁/作者主动 resume);
|
|
8929
|
+
只要**静音设置开着**(用户要的是安静)就立刻上报,并带上**是哪个窗口**(帧 URL)与 buffer 时长。 */
|
|
8930
|
+
const webaudioOnMuted = !!(rec.np && rec.np.mute === true)
|
|
8931
|
+
&& (kind === "webaudio-start" || kind === "audioctx-resume");
|
|
8923
8932
|
const suspicious = audible
|
|
8924
8933
|
|| muteOnAudible
|
|
8934
|
+
|| webaudioOnMuted
|
|
8925
8935
|
|| !!(rec.el && rec.el.connected === false && rec.paused === false)
|
|
8926
8936
|
|| (kind === "play" && rec.hidden === true)
|
|
8927
8937
|
|| ((kind === "unmute" || kind === "volume") && rec.hidden === true && rec.muted === false);
|
|
@@ -8931,8 +8941,9 @@ function sectionSigNow() {
|
|
|
8931
8941
|
mpwAuditLastBeacon = Date.now();
|
|
8932
8942
|
try {
|
|
8933
8943
|
mpwWebDiag("audio-audit", {
|
|
8934
|
-
trigger:
|
|
8935
|
-
: (
|
|
8944
|
+
trigger: webaudioOnMuted ? "webaudio-on-muted"
|
|
8945
|
+
: (muteOnAudible ? "mute-on-but-audible"
|
|
8946
|
+
: (audible ? "audible-playback" : (rec.el && rec.el.connected === false ? "detached-playing" : "hidden-transition"))),
|
|
8936
8947
|
record: rec, window: list.slice(-12), count: list.length,
|
|
8937
8948
|
visibility: (() => { try { return document.visibilityState } catch (e) { return null } })(),
|
|
8938
8949
|
});
|
|
@@ -9061,6 +9072,28 @@ function sectionSigNow() {
|
|
|
9061
9072
|
window.__mpwAudioAudit.scanFrames = () => { try { mpwAuditFrameScans = 0; mpwAuditScanFrames(); return true } catch (e) { return false } };
|
|
9062
9073
|
} catch (e) {}
|
|
9063
9074
|
try { mpwAuditPatchWin(window); } catch (e) {}
|
|
9075
|
+
/* ①(2026-09-20) 窗口清单:`webaudio-on-muted` 上报里只有 `win.url`,真机上还要能回答
|
|
9076
|
+
"这个帧是什么"(壁纸帧?哪个插件帧?里面有没有 Live2D?)。纯只读、无副作用。 */
|
|
9077
|
+
try {
|
|
9078
|
+
window.__mpwAudioAudit.frames = () => {
|
|
9079
|
+
const out = [];
|
|
9080
|
+
const walk = (w, depth) => {
|
|
9081
|
+
try {
|
|
9082
|
+
let url = ""; try { url = String(w.location.href || "") } catch (e) { url = "cross-origin" }
|
|
9083
|
+
let live2d = null, media = 0;
|
|
9084
|
+
try {
|
|
9085
|
+
const d = w.document;
|
|
9086
|
+
media = d ? d.querySelectorAll("audio,video").length : 0;
|
|
9087
|
+
live2d = !!(d && (d.querySelector("canvas") && /live2d|model3\.json|loadJson\.json/i.test(String(d.documentElement && d.documentElement.innerHTML || "").slice(0, 200000))));
|
|
9088
|
+
} catch (e) { live2d = null }
|
|
9089
|
+
out.push({ depth, url: url.replace(/token=[^&]*/, "token=…").slice(0, 140), media: media, looksLive2D: live2d, top: depth === 0 });
|
|
9090
|
+
} catch (e) {}
|
|
9091
|
+
try { for (let i = 0; i < w.frames.length; i++) walk(w.frames[i], depth + 1) } catch (e) {}
|
|
9092
|
+
};
|
|
9093
|
+
walk(window, 0);
|
|
9094
|
+
return out;
|
|
9095
|
+
};
|
|
9096
|
+
} catch (e) {}
|
|
9064
9097
|
try { setInterval(mpwAuditScanFrames, 1000); } catch (e) {}
|
|
9065
9098
|
try { mpwTrace("audio-audit:installed", {}); } catch (e) {}
|
|
9066
9099
|
return true;
|
package/package.json
CHANGED