dsh-dream-skin 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-dream-skin contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,261 @@
1
+ <p align="center">
2
+ <a href="./README.md">中文</a> · <strong>English</strong>
3
+ </p>
4
+
5
+ <div align="center">
6
+
7
+ # dsh-dream-skin 🔮
8
+
9
+ **Make DeepSeek Harness breathe, feel, and belong to you.**
10
+
11
+ Native skinning + wallpaper + theme packs — a romance-engineered project built entirely on DSH's official `--dsw-*` token system.
12
+
13
+ > 3-line install · 8 original themes · 2 visual layers · 1-click share
14
+
15
+ [中文](./README.md) · [Changelog](./CHANGELOG.md) · [Project Notes](./docs/PROJECT.md) · [Publishing Guide](./docs/publishing-to-npm.md)
16
+
17
+ ![npm version](https://img.shields.io/npm/v/dsh-dream-skin?color=4f83f2&label=npm)
18
+ ![license](https://img.shields.io/github/license/RevolutionLA/dsh-dream-skin?color=34d399)
19
+ ![node](https://img.shields.io/badge/node-%3E%3D18-6d9af6)
20
+ ![dsh](https://img.shields.io/badge/dsh-0.1.0--rc.6-blueviolet)
21
+ ![plugin type](https://img.shields.io/badge/plugin-dual--face%20(dsh.bundle%2Bdsh.client)-4f83f2)
22
+ ![ci](https://img.shields.io/github/actions/workflow/status/RevolutionLA/dsh-dream-skin/ci.yml?branch=main&label=CI&color=34d399)
23
+ ![code size](https://img.shields.io/github/languages/code-size/RevolutionLA/dsh-dream-skin?color=orange)
24
+
25
+ </div>
26
+
27
+ > **Homage to [Codex-Dream-Skin](https://github.com/Fei-Away/Codex-Dream-Skin).** But the approach is different:
28
+ > Codex injects CSS into the desktop client's renderer via CDP, whereas DSH is a **token-driven Web GUI** that ships
29
+ > first-class "third-party plugins registering themes". So this plugin is **purely native** — no injection, no binary
30
+ > patches, and it won't break on client updates.
31
+ >
32
+ > **Not an official product.** Just a way to dress up your DeepSeek Harness workspace.
33
+
34
+ ---
35
+
36
+ ## 🏆 Why it earns a star (vs alternatives)
37
+
38
+ | Capability | Ours | Other DSH skinning | Codex-Dream-Skin (desktop) |
39
+ |------|:---:|:---:|:---:|
40
+ | Native token themes — no injection, no installer patches | ✅ | ✅ | ❌ (CDP injection) |
41
+ | Custom wallpaper + opacity/blur | ✅ | partial | ✅ |
42
+ | **Theme-pack import/export + share links** | ✅ | ❌ | ✅ (zip packs) |
43
+ | **Per-user Accent override** | ✅ | ❌ | partial |
44
+ | **Wallpaper 2.0 (URL / gradient / per-skin suggestion / auto-dim)** | ✅ | ❌ | ✅ |
45
+ | Local pack library + favorites + surprise-me | ✅ | ❌ | partial |
46
+ | Validation + rollback | ✅ | partial | ✅ |
47
+ | **Browser Web GUI, cross-platform natively** | ✅ | ✅ | ❌ (needs desktop App) |
48
+
49
+ ## ✨ Features
50
+
51
+ | Capability | Description |
52
+ |------------|-------------|
53
+ | 🎨 **8 bundled presets (Mirage)** | Switch instantly under **Settings → General → Skins**, light & dark |
54
+ | 🖼️ **Custom wallpaper** | Pick a local image (auto-compressed ≤2MB), tune **opacity / blur** |
55
+ | 🔤 **Opaque inner surfaces** | Cards, inputs, message bubbles stay readable — never washed out |
56
+ | ↩️ **Default restore** | Back to DSH's built-in appearance (follow system) in one click |
57
+ | 💾 **Local persistence** | Skin & wallpaper stored in `localStorage`, survives reload |
58
+
59
+ ## 🚀 Advanced capabilities (P0)
60
+
61
+ Differentiation inspired by existing DSH skin projects plus Codex's skin UX:
62
+
63
+ | Capability | Description |
64
+ |------------|-------------|
65
+ | 📦 **Theme-pack format + import/export** | A `*.dsh-theme.json` pack = format marker + version + manifest (id/name/author/scheme/accent/tokens). Import a file, one-click apply, and copy a **share link** (encoded in the URL hash) |
66
+ | 🌈 **Per-user Accent** | Stack a custom brand-accent color over the active skin (`overrideTokens` layer, the skin itself untouched), or **randomize** / clear |
67
+ | 🖼️ **Wallpaper 2.0** | Besides local images: **image URL** and **gradient presets**, with a **per-skin suggested gradient** and an **auto-dim** mode (gently fades while focusing tasks) |
68
+ | 🧩 **Local pack library** | All built-in skins + imported packs in one place; **apply / favorite** in a click |
69
+ | 🎲 **Surprise me** | Randomly switch to a theme different from the current one |
70
+ | ⭐ **Favorites** | Star your favorite skins and switch between them fast |
71
+ | ✅ **Validation + rollback** | Pack import validates format / required tokens / color legality; failures or removals fall back safely |
72
+
73
+ ## ⚡ Quick start (3 steps)
74
+
75
+ ```sh
76
+ # 1. install
77
+ dsh plugin --profile web add -w dsh-dream-skin
78
+ # 2. restart
79
+ dsh web
80
+ # 3. open Settings → General → Skins and pick one → done.
81
+ ```
82
+
83
+ > `-w` (workspace) is required because every profile ships a `pnpm-workspace.yaml`.
84
+
85
+ ## 🧩 What kind of plugin is this
86
+
87
+ **A standard dual-face "everything-is-a-plugin" `dsh-plugin` — loaded and used exactly like the official `ui-theme` package.**
88
+
89
+ DeepSeek Harness's motto is *everything is a plugin*: models, tools, sandboxes, sessions, UI, even the Agent Loop
90
+ itself are plugins. `dsh-dream-skin` ships skinning as an npm package that is **isomorphic with the official UI
91
+ packages**:
92
+
93
+ ```text
94
+ ┌──────────── dsh-dream-skin (standard dsh-plugin / dual-face) ─────────────┐
95
+ │ dsh.bundle → cordis.patch.yml inserts the dream-skin entry (host half)│
96
+ │ dsh.client → lib/client.js (browser bundle) (browser half)│
97
+ └───────────────────────────────────────────────────────────────────────────┘
98
+ ```
99
+
100
+ - **Install command = the official one**: `dsh plugin --profile web add dsh-dream-skin`
101
+ - **Uses official extension points**: `ctx.theme` (register themes), `ctx.theme.overrideTokens` (override layers),
102
+ `ctx.slots` (mount UI into **Settings → General**).
103
+ - **Manifest contract matches official packages**: `dsh.bundle` + `dsh.client` + `exports["./client"]`.
104
+
105
+ In other words: you are not installing a fringe script — this is a standard skin plugin inside DSH's official plugin
106
+ system.
107
+
108
+ ## 🖼️ Preview — the Mirage series
109
+
110
+ > Previews below are generated from each skin's **real tokens** — what you see is what you get.
111
+
112
+ <table>
113
+ <tr>
114
+ <td align="center"><img src="docs/previews/abyss.svg" width="220" alt="abyss"/><br/><b>abyss</b></td>
115
+ <td align="center"><img src="docs/previews/aurora.svg" width="220" alt="aurora"/><br/><b>aurora</b></td>
116
+ <td align="center"><img src="docs/previews/nebula.svg" width="220" alt="nebula"/><br/><b>nebula</b></td>
117
+ <td align="center"><img src="docs/previews/ember.svg" width="220" alt="ember"/><br/><b>ember</b></td>
118
+ </tr>
119
+ <tr>
120
+ <td align="center"><img src="docs/previews/midnight.svg" width="220" alt="midnight"/><br/><b>midnight</b></td>
121
+ <td align="center"><img src="docs/previews/ivory.svg" width="220" alt="ivory"/><br/><b>ivory</b></td>
122
+ <td align="center"><img src="docs/previews/mist.svg" width="220" alt="mist"/><br/><b>mist</b></td>
123
+ <td align="center"><img src="docs/previews/rose.svg" width="220" alt="rose"/><br/><b>rose</b></td>
124
+ </tr>
125
+ </table>
126
+
127
+ ## 🎲 The presets
128
+
129
+ | id | scheme | vibe |
130
+ |------|--------|------|
131
+ | `abyss` | 🕶️ dark | DeepSeek deep-blue abyss (anchor) |
132
+ | `aurora` | 🌌 dark | aurora teal-green |
133
+ | `nebula` | 🪐 dark | cosmic purple |
134
+ | `ember` | 🔥 dark | warm ember orange |
135
+ | `midnight` | 🌚 dark | pure-black OLED |
136
+ | `ivory` | 📜 light | warm ivory / paper |
137
+ | `mist` | 🌫️ light | cool blue fog |
138
+ | `rose` | 🌸 light | rose pink / blush |
139
+
140
+ ## 📦 Install
141
+
142
+
143
+ ### Option A: From source / a local directory
144
+
145
+ ```sh
146
+ dsh plugin --profile web add -w /path/to/dsh-dream-skin
147
+ ```
148
+
149
+ > The `-w` flag is **required**: every profile ships a `pnpm-workspace.yaml`, so pnpm treats the profile directory
150
+ > as a workspace root and a bare `add` fails with `ERR_PNPM_ADDING_TO_ROOT`.
151
+
152
+ Then **restart** the web server:
153
+
154
+ ```sh
155
+ # stop the running instance, then:
156
+ dsh web
157
+ ```
158
+
159
+ Open **Settings → General** to see the **Skins**, **Accent**, **Wallpaper** / **Advanced Wallpaper**, and **Theme Packs** rows.
160
+
161
+ ### Option B: From npm (after publishing)
162
+
163
+ ```sh
164
+ dsh plugin --profile web add -w dsh-dream-skin
165
+ ```
166
+
167
+ ## 🧩 Compatibility
168
+
169
+ | Item | Value |
170
+ |------|-------|
171
+ | DeepSeek Harness (`dsh`) | `0.1.0-rc.6` (peerDependencies pinned to `^0.1.0-rc.6`) |
172
+ | Node.js | `>=18` |
173
+ | Browser | modern Chromium / WebKit (native CSS variables & `matchMedia`) |
174
+
175
+ > When upgrading DSH, bump the peerDependencies in `package.json` accordingly.
176
+
177
+ ## ⚙️ How it works
178
+
179
+ DSH's theme system is token-based: the web shell ships `--dsw-*` design tokens, and `ThemeRuntime` lets third-party
180
+ plugins register themes that override the alias layer (`--dsw-alias-*`). This package is a standard dual-face plugin:
181
+
182
+ ```text
183
+ ┌─────────────────────────────────────────────┐
184
+ │ dsh-dream-skin (dual-face plugin) │
185
+ ├────────────────────────────┬────────────────┤
186
+ Host half │ lib/index.js │ Browser half │
187
+ │ cordis.patch.yml inserts │ lib/client.js │
188
+ │ dream-skin loader entry │ __ModuleLoader__│
189
+ └────────────────────────────┴────────────────┘
190
+ │ │
191
+ profile tree loaded /plugins/dsh-dream-skin/client.js
192
+
193
+ ┌────────────────────────────────┬────────────────┐
194
+ │ │ │
195
+ ctx.theme.register(8 skins) ctx.theme.overrideTokens(wallpaper) ctx.slots.inject('settings.general.item')
196
+ ```
197
+
198
+ - **Host half** (`lib/index.js`) — a `dsh.bundle` patch layer inserting the `dream-skin` loader entry; `apply` is a
199
+ no-op, exactly like the shipped `ui-*` packages.
200
+ - **Browser half** (`lib/client.js`):
201
+ 1. registers the 8 skins via `ctx.theme.register(...)`;
202
+ 2. restores the saved skin and applies it with `ctx.theme.setTheme(...)`;
203
+ 3. renders the wallpaper as a `z-index:-1` fixed backdrop and stacks `ctx.theme.overrideTokens(...)` making the
204
+ main canvas (`--dsw-alias-bg-base`) and sidebar (`--dsw-specific-sidebar-fill`) translucent;
205
+ 4. listens for `theme/change` and re-shades the wallpaper wash on skin / scheme switch;
206
+ 5. mounts both rows into the `settings.general.item` slot.
207
+
208
+ Each skin carries its `colorScheme` (`light`/`dark`), driving `body[data-ds-dark-theme]`; the alias-token overrides
209
+ are applied as inline custom properties on `<body>` by ui-layout's ThemePresenter.
210
+
211
+ ## 💼 Persistence notes
212
+
213
+ - Skin & wallpaper are stored in `localStorage` (keys prefixed `dsh-dream-skin:`), **per browser**.
214
+ - Why not Host settings? The Host settings wire only exposes an allowlisted set of namespaces to browser clients
215
+ (`WEB_SETTINGS_NAMESPACES` in `dsh-host-apiproxy`), so a third-party namespace would answer `settings-not-exposed`;
216
+ the product itself keeps remote browser preferences process-local. `localStorage` matches that boundary and
217
+ survives reloads.
218
+
219
+ ## 🛠️ Development / extending themes
220
+
221
+ The client bundle is written directly in the `__ModuleLoader__` format (the same shape tsdown emits for the shipped
222
+ `ui-*` packages), so **no build step** is required. `lib/client.js` may `require` only module-table entities: platform
223
+ seeds (`react`, `react/jsx-runtime`, …) and registered client bundles (`@deepseek-ai/dsh-client-runtime/client`, …).
224
+
225
+ - **Add a built-in skin**: append an object (`id` + `colorScheme` + `tokens`) to the `SKINS` array in `lib/client.js`;
226
+ it then appears in Settings automatically. Add a `skin.<id>` key to both the `zh` and `en` dictionaries.
227
+ - **Ship a theme pack (recommended)**: follow [`docs/examples/sample-theme-pack.json`](./docs/examples/sample-theme-pack.json) —
228
+ one `*.dsh-theme.json` is importable in Settings and shareable via a link, no code changes needed.
229
+ - **Validate**: `npm test` (VM smoke tests covering factory eval, `apply()`, and pack import/persistence).
230
+ - **Repaint**: reference the `--dsw-alias-*` tokens (full contract in [`docs/themes-spec.md`](./docs/themes-spec.md)).
231
+
232
+ ## 📌 Roadmap
233
+
234
+ - [x] v0.1: 8 themes + custom wallpaper (opacity / blur) + local persistence
235
+ - [x] Theme-pack format + import / export / share link (JSON + manifest + validation)
236
+ - [x] Per-user Accent + randomize
237
+ - [x] Wallpaper 2.0 (URL / gradient / per-skin suggestion / auto-dim)
238
+ - [x] Local pack library + one-click apply / favorites / surprise-me
239
+ - [ ] Online palette / theme-preview Studio (pure frontend, contrast checker)
240
+ - [ ] Community theme gallery (submit packs to the repo / online gallery)
241
+ - [ ] Full i18n copy & docs (zh / en / more)
242
+ - [ ] First-paint (FOUC) improvement
243
+
244
+ ## 🤝 Contributing
245
+
246
+ Issues and PRs welcome! Please read the [Contributing Guide](./CONTRIBUTING.md) and follow the
247
+ [Code of Conduct](./CODE_OF_CONDUCT.md).
248
+
249
+ ## 🔒 Security
250
+
251
+ Found a security issue? Don't open a public issue — see the [Security Policy](./SECURITY.md).
252
+
253
+ ## 📄 License
254
+
255
+ [MIT](./LICENSE)
256
+
257
+ ## 🙏 Acknowledgments
258
+
259
+ - Architecture & API reference: the official DeepSeek Harness
260
+ [ui-theme](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/client/ui-theme) client package.
261
+ - Concept homage: [Codex-Dream-Skin](https://github.com/Fei-Away/Codex-Dream-Skin).
package/README.md ADDED
@@ -0,0 +1,255 @@
1
+ <p align="center">
2
+ <strong>中文</strong> · <a href="./README.en.md">English</a>
3
+ </p>
4
+
5
+ <div align="center">
6
+
7
+ # dsh-dream-skin 🔮
8
+
9
+ **让 DeepSeek Harness 也会呼吸、有情绪、属于你。**
10
+
11
+ 原生换肤 + 壁纸 + 主题包,一套完全用官方 `--dsw-*` token 系统实现的浪漫工程。
12
+
13
+ > 3 行安装 · 8 套原创主题 · 2 层视觉叠加 · 1 键分享
14
+
15
+ [English](./README.en.md) · [变更日志](./CHANGELOG.md) · [项目说明](./docs/PROJECT.md) · [发布指引](./docs/publishing-to-npm.md)
16
+
17
+ ![npm version](https://img.shields.io/npm/v/dsh-dream-skin?color=4f83f2&label=npm)
18
+ ![license](https://img.shields.io/github/license/RevolutionLA/dsh-dream-skin?color=34d399)
19
+ ![node](https://img.shields.io/badge/node-%3E%3D18-6d9af6)
20
+ ![dsh](https://img.shields.io/badge/dsh-0.1.0--rc.6-blueviolet)
21
+ ![plugin type](https://img.shields.io/badge/plugin-dual--face%20(dsh.bundle%2Bdsh.client)-4f83f2)
22
+ ![ci](https://img.shields.io/github/actions/workflow/status/RevolutionLA/dsh-dream-skin/ci.yml?branch=main&label=CI&color=34d399)
23
+ ![code size](https://img.shields.io/github/languages/code-size/RevolutionLA/dsh-dream-skin?color=orange)
24
+
25
+ </div>
26
+
27
+ > **致敬 [Codex-Dream-Skin](https://github.com/Fei-Away/Codex-Dream-Skin)。** 但实现路径不同:Codex 是往桌面客户端渲染进程
28
+ > 注入 CSS(CDP),而 DSH 本身是 **token 驱动的 Web GUI**,官方就提供了「第三方插件注册主题」的能力——所以本插件是
29
+ > **纯原生接入**,无注入、不改二进制、不因客户端更新失效。
30
+ >
31
+ > **不是官方产品。** 仅供美化你的 DeepSeek Harness 工作区。
32
+
33
+ ---
34
+
35
+ ## 🏆 为什么值得用(vs 同类)
36
+
37
+ | 能力 | 本插件 | 其它 DSH 换肤方案 | Codex-Dream-Skin (桌面) |
38
+ |------|:---:|:---:|:---:|
39
+ | 原生 token 主题,不注入、不改安装包 | ✅ | ✅ | ❌ (CDP 注入) |
40
+ | 自定义壁纸 + 透明度/模糊 | ✅ | 部分 | ✅ |
41
+ | **主题包导入/导出 + 分享链接** | ✅ | ❌ | ✅ (zip 主题) |
42
+ | **每用户强调色 Accent** | ✅ | ❌ | 部分 |
43
+ | **壁纸 2.0(URL / 渐变 / 每皮肤建议 / 自动弱化)** | ✅ | ❌ | ✅ |
44
+ | 本地主题包库 + 收藏 + 随机 | ✅ | ❌ | 部分 |
45
+ | 校验 + 回滚 | ✅ | 部分 | ✅ |
46
+ | **浏览器 Web GUI,天然跨平台** | ✅ | ✅ | ❌ (需桌面 App) |
47
+
48
+ ## ✨ 功能一览
49
+
50
+ | 能力 | 说明 |
51
+ |------|------|
52
+ | 🎨 **8 套主题预设(Mirage 幻梦)** | 在 **设置 → 常规 → 皮肤** 一键切换,浅色 / 深色兼顾 |
53
+ | 🖼️ **自定义壁纸** | 上传本地图(自动压缩 ≤2MB),调节**透明度 / 模糊** |
54
+ | 🔤 **内层不透明** | 卡片、输入框、消息气泡不被壁纸盖住,可读性优先 |
55
+ | ↩️ **默认还原** | 一键回到 DSH 内置外观(跟随系统) |
56
+ | 💾 **本地持久化** | 皮肤与壁纸存 `localStorage`,刷新 / 重开浏览器不丢 |
57
+
58
+ ## 🚀 进阶能力(P0)
59
+
60
+ 吸取了同类先行项目之短,融入 Codex 换肤的 UX,做了一套差异化能力:
61
+
62
+ | 能力 | 说明 |
63
+ |------|------|
64
+ | 📦 **主题包格式 + 导入/导出** | 一个 `*.dsh-theme.json` 主题包 = 格式标记 + 版本 + manifest(id/name/作者/色系/accent/tokens)。可**导入文件**、**一键应用**、**复制分享链接**(编码进 URL hash) |
65
+ | 🌈 **每用户强调色 Accent** | 为当前皮肤叠加一个自定义品牌强调色(`overrideTokens` 层,不动皮肤本身),或**随机一个** / **恢复主题色** |
66
+ | 🖼️ **壁纸 2.0** | 除本地图外,支持**图片 URL** 与**渐变预设**,每套皮肤**自动建议**一张渐变,可**自动弱化**(聚焦任务时降低干扰) |
67
+ | 🧩 **本地主题包库** | 所有内置皮肤 + 导入的自定义包集中展示,**应用 / 收藏** 一键完成 |
68
+ | 🎲 **换一个试试(surprise me)** | 随机挑一个和你当前不同的主题 |
69
+ | ⭐ **收藏** | 收藏喜欢的皮肤,快速切换 |
70
+ | ✅ **校验 + 回滚** | 导入时会校验格式/必填 token/颜色合法性;失败或移除时安全回退,不做破坏性更改 |
71
+
72
+ ## 🧩 它是什么形式的插件
73
+
74
+ **它是 DeepSeek Harness 的标准「双面插件」(`dsh-plugin`)——加载和用法与官方 `ui-theme` 完全一致。**
75
+
76
+ DeepSeek Harness 的口号是「一切皆插件」:模型、工具、沙箱、会话、UI,乃至 Agent Loop 本身都是插件。
77
+ `dsh-dream-skin` 的本质就是把「换肤」做成一个和官方 UI 包**同构**的 npm 包:
78
+
79
+ ```text
80
+ ┌────────────── dsh-dream-skin(标准 dsh-plugin / 双面插件)──────────────┐
81
+ │ dsh.bundle → cordis.patch.yml 插入 dream-skin 入口 (host 半边) │
82
+ │ dsh.client → lib/client.js(浏览器 bundle) (浏览器半边) │
83
+ └─────────────────────────────────────────────────────────────────────────┘
84
+ ```
85
+
86
+ - **安装命令 = 官方唯一安装命令**:`dsh plugin --profile web add dsh-dream-skin`
87
+ - **调用的是官方扩展点**:`ctx.theme`(注册主题)、`ctx.theme.overrideTokens`(叠加层)、
88
+ `ctx.slots`(把 UI 挂进 **设置 → 常规**)。
89
+ - **manifest 契约与官方一致**:`dsh.bundle` + `dsh.client` + `exports["./client"]`。
90
+
91
+ 也就是说:**你装的不是一个旁门左道的脚本,而是 DSH 官方插件体系里的标准皮肤插件。**
92
+
93
+ ## 🖼️ 预览 — Mirage 幻梦系列
94
+
95
+ > 以下色卡由各皮肤的**真实 token** 生成,所见即所得。点开可放大。
96
+
97
+ <table>
98
+ <tr>
99
+ <td align="center"><img src="docs/previews/abyss.svg" width="220" alt="abyss"/><br/><b>abyss</b> · 深海渊</td>
100
+ <td align="center"><img src="docs/previews/aurora.svg" width="220" alt="aurora"/><br/><b>aurora</b> · 极光</td>
101
+ <td align="center"><img src="docs/previews/nebula.svg" width="220" alt="nebula"/><br/><b>nebula</b> · 星云</td>
102
+ <td align="center"><img src="docs/previews/ember.svg" width="220" alt="ember"/><br/><b>ember</b> · 余烬</td>
103
+ </tr>
104
+ <tr>
105
+ <td align="center"><img src="docs/previews/midnight.svg" width="220" alt="midnight"/><br/><b>midnight</b> · 午夜</td>
106
+ <td align="center"><img src="docs/previews/ivory.svg" width="220" alt="ivory"/><br/><b>ivory</b> · 象牙暖</td>
107
+ <td align="center"><img src="docs/previews/mist.svg" width="220" alt="mist"/><br/><b>mist</b> · 晨雾蓝</td>
108
+ <td align="center"><img src="docs/previews/rose.svg" width="220" alt="rose"/><br/><b>rose</b> · 蔷薇粉</td>
109
+ </tr>
110
+ </table>
111
+
112
+ ### 预设一览
113
+
114
+ | id | 色系 | 氛围 |
115
+ |------|-------|------|
116
+ | `abyss` | 🕶️ dark | DeepSeek 深蓝深渊(品牌锚点) |
117
+ | `aurora` | 🌌 dark | 极光 · 青绿 |
118
+ | `nebula` | 🪐 dark | 星云 · 紫 |
119
+ | `ember` | 🔥 dark | 余烬 · 暖橙 |
120
+ | `midnight` | 🌚 dark | 纯黑 OLED |
121
+ | `ivory` | 📜 light | 象牙暖 · 纸感 |
122
+ | `mist` | 🌫️ light | 晨雾蓝 · 冷调 |
123
+ | `rose` | 🌸 light | 蔷薇粉 |
124
+
125
+ ## ⚡ 快速开始(3 步)
126
+
127
+ ```sh
128
+ # 1. 安装
129
+ dsh plugin --profile web add -w dsh-dream-skin
130
+ # 2. 重启
131
+ dsh web
132
+ # 3. 打开 设置 → 常规 → 皮肤,挑一套 → 完。
133
+ ```
134
+
135
+ > 传入 `-w`(workspace)是因为每个 profile 自带 `pnpm-workspace.yaml`,pnpm 需要知道这是 workspace 安装。
136
+
137
+ ## 📦 安装
138
+
139
+ ### 方式一:从源码 / 本地目录
140
+
141
+ ```sh
142
+ dsh plugin --profile web add -w /path/to/dsh-dream-skin
143
+ ```
144
+
145
+ > `-w` 标志**必需**:每个 profile 自带 `pnpm-workspace.yaml`,pnpm 会把它当作 workspace 根,裸 `add` 会报
146
+ > `ERR_PNPM_ADDING_TO_ROOT`。
147
+
148
+ 然后**重启** web 服务:
149
+
150
+ ```sh
151
+ # 先停掉正在运行的实例,再:
152
+ dsh web
153
+ ```
154
+
155
+ 打开 **设置 → 常规**,即可看到「皮肤」「强调色」「背景图片 / 高级壁纸」与「主题包」等行。
156
+
157
+ ### 方式二:npm 安装(发布后)
158
+
159
+ ```sh
160
+ dsh plugin --profile web add -w dsh-dream-skin
161
+ ```
162
+
163
+ ## 🧩 兼容性
164
+
165
+ | 项 | 值 |
166
+ |------|-----|
167
+ | DeepSeek Harness (`dsh`) | `0.1.0-rc.6`(peerDependencies 以 `^0.1.0-rc.6` 对齐) |
168
+ | Node.js | `>=18` |
169
+ | 浏览器 | 现代 Chromium / WebKit(依赖原生 CSS 变量与 `matchMedia`) |
170
+
171
+ > 升级 DSH 到新版本时,请同步更新 `package.json` 里的 peerDependencies。
172
+
173
+ ## ⚙️ 工作原理
174
+
175
+ DSH 的主题系统是 token 化的:web 外壳内置 `--dsw-*` 设计令牌,`ThemeRuntime` 允许第三方插件注册主题去
176
+ 覆盖别名层(`--dsw-alias-*`)。本插件是标准的「双面」插件:
177
+
178
+ ```text
179
+ ┌─────────────────────────────────────────────┐
180
+ │ dsh-dream-skin (双面插件) │
181
+ ├────────────────────────────┬────────────────┤
182
+ Host 半边 │ lib/index.js │ 浏览器半边 │
183
+ │ cordis.patch.yml 插入 │ lib/client.js │
184
+ │ dream-skin loader 入口 │ __ModuleLoader__│
185
+ └────────────────────────────┴────────────────┘
186
+ │ │
187
+ profile 树加载 /plugins/dsh-dream-skin/client.js
188
+
189
+ ┌────────────────────────────────┬────────────────┐
190
+ │ │ │
191
+ ctx.theme.register(8套皮肤) ctx.theme.overrideTokens(壁纸半透明) ctx.slots.inject('settings.general.item')
192
+ ```
193
+
194
+ - **Host 半边**(`lib/index.js`):`dsh.bundle` patch 层,插入 `dream-skin` loader 入口;`apply` 为空操作,
195
+ 与官方 `ui-*` 包同构。
196
+ - **浏览器半边**(`lib/client.js`):
197
+ 1. `ctx.theme.register(...)` 注册 8 套皮肤;
198
+ 2. 恢复上次保存的皮肤并 `ctx.theme.setTheme(...)` 应用;
199
+ 3. 壁纸渲染为 `z-index:-1` 固定背景层,叠加 `ctx.theme.overrideTokens(...)` 让主画布
200
+ (`--dsw-alias-bg-base`)与侧边栏(`--dsw-specific-sidebar-fill`)半透明;
201
+ 4. 监听 `theme/change`,切皮肤 / 深浅色时自动重新着色壁纸洗色层;
202
+ 5. 把两行 UI 挂进 `settings.general.item` 插槽。
203
+
204
+ 每套皮肤携带自己的 `colorScheme`(`light`/`dark`),驱动 `body[data-ds-dark-theme]`;别名 token 覆盖作为
205
+ `<body>` 内联自定义属性由 ui-layout 的 ThemePresenter 应用。
206
+
207
+ ## 💼 持久化说明
208
+
209
+ - 皮肤与壁纸存于 `localStorage`(键前缀 `dsh-dream-skin:`),**只在当前浏览器生效**。
210
+ - 为何不用 Host settings?DSH 的 Host settings 线路只向浏览器暴露一份白名单命名空间
211
+ (`dsh-host-apiproxy` 的 `WEB_SETTINGS_NAMESPACES`),第三方命名空间会返回 `settings-not-exposed`;
212
+ 产品本身也把远程浏览器偏好进程化。`localStorage` 恰好匹配这一边界,且跨刷新存活。
213
+
214
+ ## 🛠️ 开发 / 扩展主题
215
+
216
+ 客户端 bundle 直接以 `__ModuleLoader__` 格式编写(即 tsdown 为官方 `ui-*` 包输出的形态),**免构建**。
217
+ `lib/client.js` 只能 `require` 模块表实体:平台种子词(`react`、`react/jsx-runtime`、…)与已注册客户端
218
+ bundle(`@deepseek-ai/dsh-client-runtime/client`、…)。
219
+
220
+ - **新增一套内置皮肤**:在 `lib/client.js` 的 `SKINS` 数组加一个对象(`id` + `colorScheme` + `tokens`),
221
+ 它即自动出现在设置里;记得在 `zh` / `en` 词典补 `skin.<id>` 文案。
222
+ - **做一个主题包(推荐分发方式)**:参考 [`docs/examples/sample-theme-pack.json`](./docs/examples/sample-theme-pack.json),
223
+ 一个 `*.dsh-theme.json` 即可在设置里导入或通过分享链接分发给别人,无需改代码。
224
+ - **跑校验**:`npm test`(VM 冒烟测试,覆盖 factory 求值、`apply` 挂载、主题包导入/持久化)。
225
+ - **换配色**:参考 `--dsw-alias-*` 令牌(完整契约见 [`docs/themes-spec.md`](./docs/themes-spec.md))。
226
+
227
+ ## 📌 Roadmap
228
+
229
+ - [x] 首版:8 套主题 + 自定义壁纸(透明度 / 模糊)+ 本地持久化
230
+ - [x] 主题包格式 + 导入 / 导出 / 分享链接(JSON + manifest + 校验)
231
+ - [x] 每用户强调色 Accent + 随机
232
+ - [x] 壁纸 2.0(URL / 渐变 / 每皮肤建议 / 自动弱化)
233
+ - [x] 本地主题包库 + 一键应用 / 收藏 /「换一个试试」
234
+ - [ ] 在线色板 / 主题预览 Studio(纯前端,浏览器内校验 + 对比度检查)
235
+ - [ ] 社区主题库(把主题包投稿到仓库 / 在线 Gallery)
236
+ - [ ] 中 / 英 / 更多语言的完整文案与文档
237
+ - [ ] 首帧无闪烁(FOUC)改进
238
+
239
+ ## 🤝 贡献
240
+
241
+ 欢迎提交 Issue 与 PR!请先阅读 [贡献指南](./CONTRIBUTING.md),并遵循 [Code of Conduct](./CODE_OF_CONDUCT.md)。
242
+
243
+ ## 🔒 安全
244
+
245
+ 发现安全问题?请勿直接开公开 Issue——参见 [安全策略](./SECURITY.md)。
246
+
247
+ ## 📄 开源协议
248
+
249
+ [MIT](./LICENSE)
250
+
251
+ ## 🙏 致谢
252
+
253
+ - 架构与 API 参考:DeepSeek Harness 官方
254
+ [ui-theme](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/client/ui-theme) 客户端包。
255
+ - 概念致敬:[Codex-Dream-Skin](https://github.com/Fei-Away/Codex-Dream-Skin)。
@@ -0,0 +1,7 @@
1
+ # dsh-dream-skin profile patch layer — insert one loader entry for the plugin
2
+ # package. The entry is a normal cordis loader entry (id + package name); the
3
+ # browser half is picked up by dsh-client-modules through the package's
4
+ # dsh.client declaration, exactly like the shipped ui-* packages.
5
+ - insert:
6
+ - id: dream-skin
7
+ name: 'dsh-dream-skin'