@luosuqwq/dsh-ui-appearance 0.0.0-stage → 0.1.2

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/AGENTS.md ADDED
@@ -0,0 +1,77 @@
1
+ # AGENTS.md — dsh-ui-appearance
2
+
3
+ English | [中文](#中文)
4
+
5
+ Machine-actionable notes for coding agents. Human documentation: [README.md](README.md) / [README.zh-CN.md](README.zh-CN.md).
6
+
7
+ ## What this package is
8
+
9
+ A DeepSeek Harness Web bundle (`dsh-ui-appearance`). A Host half serves the configured wallpaper folder and a Client half adds the Appearance settings page and applies the look. No agent tools are mounted.
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ git clone https://github.com/LuosuQWQ/dsh-ui-appearance.git
15
+ dsh plugin --profile <profile> add link:<absolute path>/dsh-ui-appearance
16
+ # restart DSH; Settings -> Appearance appears
17
+ ```
18
+
19
+ ## Config and behavior
20
+
21
+ - Wallpaper source: a folder chosen in the settings page (the page opens it with the OS file manager); only image files are served.
22
+ - Two default wallpapers ship in `assets/backgrounds/`; fresh profiles start on version 2.
23
+ - Settings live in the DSH settings store, not in this package.
24
+ - Effects are CSS-only; no network calls beyond the user's own DSH.
25
+
26
+ ## Post-install handoff (agents)
27
+
28
+ Tell the owner, in one short message: restart DSH, open **Settings → Appearance (外观)**, pick a wallpaper folder or keep the bundled defaults; everything applies live. No network, no tokens, no server to start.
29
+
30
+ ## Constraints for contributors
31
+
32
+ - Do not add personal wallpapers or machine paths to the repository or the packed tarball.
33
+ - Keep per-frame work out of the streaming hot path (debounced sync, cached measurements).
34
+ - `npm test` runs the motion/defaults checks.
35
+
36
+ ---
37
+
38
+ <a id="中文"></a>
39
+
40
+ # AGENTS.md — dsh-ui-appearance(中文)
41
+
42
+ 给编码 agent 的机器可读说明。人类文档:[README.md](README.md) / [README.zh-CN.md](README.zh-CN.md)。
43
+
44
+ ## 这个包是什么
45
+
46
+ 一个 DeepSeek Harness Web bundle(`dsh-ui-appearance`)。Host 半负责把用户配置的壁纸文件夹以 HTTP 提供,Client 半负责「外观」设置页和把外观应用到界面。不挂载任何 agent 工具。
47
+
48
+ ## 安装
49
+
50
+ ```sh
51
+ git clone https://github.com/LuosuQWQ/dsh-ui-appearance.git
52
+ dsh plugin --profile <profile> add link:<本地绝对路径>/dsh-ui-appearance
53
+ # 重启 DSH;设置里会出现「外观」
54
+ ```
55
+
56
+ ## 配置与行为
57
+
58
+ - 壁纸来源:在设置页选择文件夹(页面用系统文件管理器打开它);只提供图片文件。
59
+ - 自带两张默认壁纸,位于 `assets/backgrounds/`;全新 profile 默认使用 version2。
60
+ - 设置存在 DSH 的设置存储里,不在本包内。
61
+ - 效果全部是 CSS;除用户自己的 DSH 外不发起任何网络请求。
62
+
63
+ ## 安装后交接(给 agent)
64
+
65
+ 用一句话告诉主人:重启 DSH,打开 **设置 → 外观**,选壁纸文件夹或用自带默认壁纸,改动即时生效。没有网络请求、没有 token、不需要启动服务。
66
+
67
+ ## 贡献约束
68
+
69
+ - 不要把个人壁纸或本机路径加进仓库或打包产物。
70
+ - 每帧工作不要放进流式热路径(用防抖同步、缓存测量值)。
71
+ - `npm test` 跑动效与默认值检查。
72
+
73
+ ## 验收
74
+
75
+ ```sh
76
+ npm test
77
+ ```
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LuoSu
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.md CHANGED
@@ -1,3 +1,242 @@
1
- # Temporary Holding Version
1
+ English | [简体中文](README.zh-CN.md)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # dsh-ui-appearance
4
+
5
+ > Wallpaper, glass panels and chat-box styling for the DeepSeek Harness web UI.
6
+
7
+ The DSH web interface ships with one plain look. This bundle adds an "Appearance (外观)" page to Settings where you can put a wallpaper behind the app, make the conversation card, composer and settings panel translucent with a backdrop blur, tune the sidebar, and switch on a pointer-following parallax and an auto-hiding sidebar. It is a local UI bundle: the only server it talks to is your own DSH instance, serving your own images back to the browser.
8
+
9
+ ![dsh-ui-appearance](docs/preview/hero.jpg)
10
+
11
+ ## Why this plugin
12
+
13
+ Wallpaper and glass effects are easy to add and easy to make a long session stutter. This bundle keeps every effect out of the streaming hot path instead of re-rendering the shell on each token.
14
+
15
+ | | dsh-ui-appearance | a naive wallpaper layer |
16
+ | --- | --- | --- |
17
+ | Long sessions | debounced full syncs, cheap light syncs, cached measurement, a tooltip observer that ignores its own mutations | re-layout on every streamed token |
18
+ | Sources | a folder you pick, with decoded Chinese names; only images are served | paste a path |
19
+ | Scope | conversation card, composer, settings panel and sidebar tuned separately | one global opacity |
20
+ | Privacy | CSS only, served by your own DSH; no network, no CDN | often loads remote assets |
21
+
22
+ ## Quick start / 快速开始
23
+
24
+ **What it is (EN).** A DeepSeek Harness Web bundle that changes how DSH looks: wallpaper layer, translucent glass panels, composer and sidebar styling, pointer parallax and an auto-hiding sidebar. Everything runs locally; custom wallpapers are read from a folder you choose and served back to your own browser.
25
+
26
+ **这是什么(中文)。** 一个改 DeepSeek Harness 外观的 Web 插件包:壁纸层、玻璃拟态面板、输入框与侧边栏样式、指针视差、自动隐藏侧边栏。全部在本地运行,自定义壁纸来自你指定的文件夹,只在你自己的浏览器里显示。
27
+
28
+ **Install (EN).**
29
+ 1. Add the bundle to a DSH profile — Desktop: **Settings → Plugins**; CLI:
30
+ ```sh
31
+ git clone https://github.com/LuosuQWQ/dsh-ui-appearance.git
32
+ dsh plugin --profile <profile> add link:<absolute-path>/dsh-ui-appearance
33
+ ```
34
+ 2. Restart DSH. Open **Settings → Appearance (外观)**.
35
+ 3. Pick a wallpaper folder with the **壁纸文件夹** button, or keep the bundled defaults. Everything applies live.
36
+
37
+ **安装(中文)。**
38
+ 1. 加进一个 DSH profile——桌面版:**设置 → 插件**;命令行:
39
+ ```sh
40
+ git clone https://github.com/LuosuQWQ/dsh-ui-appearance.git
41
+ dsh plugin --profile <profile> add link:<本地绝对路径>/dsh-ui-appearance
42
+ ```
43
+ 2. **重启 DSH**,打开 **设置 → 外观**。
44
+ 3. 用 **壁纸文件夹** 按钮选目录,或直接使用自带默认壁纸;改动即时生效。
45
+
46
+ > After installing, tell the owner: **restart DSH, then open Settings → Appearance (外观)**. There is no other setup; the two default wallpapers are already bundled.
47
+
48
+ **For agents.** See [AGENTS.md](AGENTS.md) for config keys, defaults and constraints.
49
+
50
+ ## Screenshots
51
+
52
+ ![Home with a wallpaper and glass panels](docs/preview/home.jpg)
53
+
54
+ **1** Wallpaper layer behind the whole app; the conversation card, composer and sidebar stay legible on top of it.
55
+
56
+ ![Appearance settings](docs/preview/settings.jpg)
57
+
58
+ **2** Wallpaper source and the **壁纸文件夹** button: the page opens your folder instead of asking for a path, and shows decoded names. **3** Transparency, blur, mask and pointer parallax. **4** Sidebar opacity and auto-hide.
59
+
60
+ ![Pointer parallax: the wallpaper drifts with the cursor](docs/preview/parallax.gif)
61
+
62
+ **Pointer parallax.** The wallpaper layer drifts against the pointer; the amplitude and easing are adjustable in Settings → Appearance. This is a real capture of the browser UI moving the cursor across the window.
63
+
64
+ ## Features
65
+
66
+ - **Wallpaper layer** behind the whole app: cover / contain / tile / stretch / auto sizing, opacity, blur and a color wash on top.
67
+ - **Pointer parallax**: the wallpaper drifts with the cursor; amplitude and easing are adjustable.
68
+ - **Glass conversation area**: background color, opacity, backdrop-blur strength, and a max width for the conversation column.
69
+ - **Glass composer and settings panel**, each with its own color, opacity and blur; the composer also has border style and corner radius.
70
+ - **Sidebar controls**: translucent fill plus optional auto-hide, where the bar slides off the left edge and comes back when the pointer reaches it.
71
+ - **Consistent cards elsewhere**: the same card can be applied to the Plugins and Scheduled-tasks pages, and the right-hand document preview panel reuses the conversation glass.
72
+
73
+ ## Requirements
74
+
75
+ - DeepSeek Harness 0.2.x (developed against 0.2.2-rc.5), running the web UI — the desktop app and `dsh web` share the same interface.
76
+ - No extra npm packages and no external service.
77
+ - A wallpaper: two defaults (花与大肥鱼 version1 / version2) ship with the plugin, and a fresh install starts on version2. Drop your own JPEG/PNG/WebP/GIF (12 MB or less each) into the wallpaper folder to add more.
78
+
79
+ ## Install
80
+
81
+ This directory is a DSH bundle with two halves: `lib/host/index.js` (the module named by the composition row) and `lib/client/index.js`, exposed to the web UI through `exports["./client"]` and `dsh.client.platform: "web"`.
82
+
83
+ Install it from the checkout with the plugin manager:
84
+
85
+ ```text
86
+ plugin_manager: { action: "install_bundle", target: "<path-to-checkout>" }
87
+ ```
88
+
89
+ Or add it to a profile by hand — in the profile's `package.json`:
90
+
91
+ ```json
92
+ {
93
+ "dependencies": {
94
+ "dsh-ui-appearance": "link:<path-to-checkout>"
95
+ },
96
+ "dsh": {
97
+ "profile": {
98
+ "bundles": ["dsh-ui-appearance"]
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ then run `pnpm install` in the profile directory.
105
+
106
+ Restart DSH after installing, then reload the page: both halves are composed when the DSH process starts, so a browser refresh alone does not pick up a fresh install. Use a hard reload (Ctrl+F5) if the browser still has an older client bundle cached. Removing the bundle is `plugin_manager: { action: "remove_bundle", target: "dsh-ui-appearance" }`, plus dropping the row from the profile.
107
+
108
+ ## Configuration
109
+
110
+ All options live on the Appearance page (Settings → 外观). Changes are applied immediately and stored twice: in the browser under `localStorage["dsh-ui-appearance:settings"]`, and on the host at `config.json`:
111
+
112
+ ```text
113
+ ~/.dsh/plugins/dsh-ui-appearance/config.json
114
+ ```
115
+
116
+ Missing fields fall back to the defaults below, and the host clamps every numeric value into its allowed range when it saves.
117
+
118
+ | Field | Type | Default | Meaning |
119
+ | --- | --- | --- | --- |
120
+ | `bgImage` | string | bundled version2 | Selected wallpaper as a URL (`/bg/<file>`); empty means no wallpaper |
121
+ | `bgSize` | `cover` / `contain` / `tile` / `stretch` / `auto` | `cover` | How the image fills the window |
122
+ | `bgOpacity` | number 0–1 | `1` | Wallpaper opacity |
123
+ | `bgBlur` | px 0–60 | `0` | Blur applied to the wallpaper |
124
+ | `bgMask` | color | `#f8f7f7` | Wash color drawn above the wallpaper |
125
+ | `bgMaskOpacity` | number 0–1 | `0` | Wash strength |
126
+ | `parallaxEnabled` | boolean | `true` | Make the wallpaper follow the pointer |
127
+ | `parallaxAmplitude` | px 0–50 | `12` | Maximum travel in each direction |
128
+ | `parallaxEasing` | `ease-out` / `ease-in` / `ease-in-out` | `ease-out` | Transition easing of the parallax |
129
+ | `sidebarOpacity` | number 0–1 | `0.4` | Opacity of the sidebar fill |
130
+ | `sidebarAutoHide` | boolean | `false` | Slide the sidebar off the left edge |
131
+ | `prewarmFirstSlide` | boolean | `true` | Rasterize the hidden sidebar in the background so the first reveal does not stutter |
132
+
133
+ | Field | Type | Default | Meaning |
134
+ | --- | --- | --- | --- |
135
+ | `conversationEnabled` | boolean | `true` | Draw the glass conversation card |
136
+ | `conversationColor` | color | `#ffffff` | Card background color |
137
+ | `conversationOpacity` | number 0–1 | `0.2` | Card opacity |
138
+ | `conversationBlur` | px 0–60 | `2` | Backdrop-blur strength |
139
+ | `conversationWidth` | px 420–1200 | `870` | Maximum width of the conversation column |
140
+ | `pageCard` | boolean | `true` | Same card on the Plugins and Scheduled-tasks pages (requires `conversationEnabled`) |
141
+ | `previewPopupShared` | boolean | `true` | Use the conversation glass for the right-hand document preview |
142
+ | `previewPopupInset` | px 0–48 | `8` | Outer margin of the preview panel (top, right and bottom) |
143
+ | `chatBoxColor` | color | `#ffffff` | Composer background color |
144
+ | `chatBoxOpacity` | number 0–1 | `0.59` | Composer opacity |
145
+ | `chatBoxBlur` | px 0–60 | `0` | Composer backdrop-blur strength |
146
+ | `chatBoxBorder` | `none` / `thin` / `thick` | `none` | Composer border style |
147
+ | `chatBoxRadius` | px 0–60 | `24` | Composer corner radius |
148
+ | `settingsColor` | color | `#ffffff` | Settings panel background color |
149
+ | `settingsOpacity` | number 0–1 | `0.4` | Settings panel opacity |
150
+ | `settingsBlur` | px 0–60 | `16` | Settings panel backdrop-blur strength |
151
+
152
+ The page labels are Chinese-only; the field names above are the keys stored in `config.json`.
153
+
154
+ A hand-written `config.json` only needs the values you want to change:
155
+
156
+ ```json
157
+ {
158
+ "bgImage": "/bg/my-wallpaper.jpg",
159
+ "bgSize": "cover",
160
+ "bgOpacity": 0.9,
161
+ "parallaxEnabled": true,
162
+ "sidebarAutoHide": true,
163
+ "conversationOpacity": 0.7,
164
+ "conversationBlur": 14
165
+ }
166
+ ```
167
+
168
+ ### Where wallpapers come from
169
+
170
+ The picker lists image files from up to three directories:
171
+
172
+ 1. `DSH_APPEARANCE_ASSETS` — an optional extra folder you point at. Images there are served read-only. The variable is read when the plugin loads, so restart DSH after changing it.
173
+ 2. `<workspace>/plugins/dsh-ui-appearance/assets/backgrounds/` — the writable folder. The **壁纸文件夹** button in Settings → Appearance opens it in your file manager; anything dropped in appears in the wallpaper dropdown.
174
+ 3. `assets/backgrounds/` inside the installed package — the bundled defaults. Read-only, and it is what makes the two shipped wallpapers available after an npm install that has no checkout.
175
+
176
+ `<workspace>` is `DSH_WORKSPACE` when set, otherwise the first workspace registered in DSH, otherwise the process working directory.
177
+
178
+ The repository ships exactly two wallpapers — 花与大肥鱼 version1.png and version2.png, both 2560×1440 PNG — and `.gitignore` keeps every other image in that folder out of git. Add your own files there too: a user file of the same name wins over the bundled default. When this checkout is linked into a workspace as `plugins/dsh-ui-appearance` (the usual development setup), the checkout folder *is* directory 2 above. Copy files in, press **壁纸文件夹** in Settings → Appearance to open the folder, then reopen the Appearance page to pick one. All directories are listed and searched when an image is requested; the first match wins. The host keeps its `/bg/upload` route for API callers — it writes under a random file name — but the settings page no longer uses it.
179
+
180
+ ## Usage
181
+
182
+ Open Settings (the gear icon) and pick 外观. The page is organised as 壁纸背景, 视差动效, 侧边栏, 会话对话区, 聊天框 and 设置面板.
183
+
184
+ - **Wallpaper**: the dropdown lists the bundled defaults plus everything in the wallpaper folder plus 不使用壁纸 (no wallpaper), and the **壁纸文件夹** button opens that folder in the system file manager. A fresh install selects version2; picking 不使用壁纸 stores an empty choice, so it stays off. The list refreshes after the button is used, and a selected image that no longer exists still appears, marked as no longer in the folder.
185
+ - **Auto-hide**: with 自动隐藏到左侧 enabled, the sidebar slides out of the window and reappears when the pointer comes within 20 px of the left edge; it hides again once the pointer leaves. The sidebar's own collapse button toggles this mode on and off.
186
+ - **Warm-up**: 首次滑入前预热 draws the hidden sidebar once in the background so the first reveal does not pay the rasterization cost. Turn it off to skip that work; the first reveal may then drop a few frames.
187
+ - **Conversation**: 启用区分 must stay on for the conversation card, the composer glass and the page cards. 插件/任务页也用会话卡片 extends the same card to the Plugins and Scheduled-tasks pages; turning either option off returns those pages to the stock layout.
188
+ - **Document preview**: 应用到文档预览弹窗 lets the right-hand preview panel share the conversation glass; 弹窗外边距 sets its top, right and bottom margin. The left edge stays flush on purpose, so dragging the divider does not force the panel contents to reflow on every pointer move.
189
+ - **Latest message**: when you scroll away from the newest message in a long conversation, a "↓" button appears at the bottom right and jumps back to the end. The stock scroll-to-bottom control is hidden while the bundle is active.
190
+ - **Turning it off**: disable the bundle row on the Plugins page or remove it from the profile; the plugin puts back the inline styles it changed. To reset the look completely, delete `config.json` and the `dsh-ui-appearance:settings` localStorage key.
191
+
192
+ ## How it works
193
+
194
+ - The host half serves `/bg/*`: it lists the wallpaper folders with decoded names, reads and writes `config.json`, opens the wallpaper folder via `/bg/reveal`, accepts uploads and returns image bytes. It also injects a small `<style>` element into the `<head>` of every page the DSH web server serves, so a configured wallpaper paints before any client script runs.
195
+ - The client half is a web client module. It appends its own `<style>` elements, builds a fixed wallpaper layer plus a mask layer, publishes the settings as CSS custom properties on `<html>`, and keeps the app frame's grid columns in sync with the sidebar and the right-hand preview panel.
196
+ - Settings are applied from localStorage immediately and mirrored to `config.json` by the host, which validates every numeric value on save.
197
+ - The bundle only adds CSS and marks the official containers it needs; disabling it removes those marks and styles again.
198
+
199
+ ## Limitations
200
+
201
+ - Web UI only: it styles the DSH browser interface, and CLI sessions are unaffected.
202
+ - The Appearance page is hard-coded in Chinese, so its labels do not follow the UI language.
203
+ - Styling depends on the official DOM (`frame`, `sidebarCol`, `centerCol`, `data-slot` anchors, `data-sidebar-right-panel`). A DSH release that renames those can disable part of the styling until the plugin is updated.
204
+ - Auto-hide assumes the sidebar is on the left.
205
+ - Backdrop blur is GPU work; several large glass surfaces on a weak GPU can cost frames. Lower the blur values if scrolling feels heavy.
206
+ - Wallpapers are limited to 12 MB each and to JPEG/PNG/WebP/GIF.
207
+ - Opening the wallpaper folder needs the host half to run the current code: after upgrading this plugin, restart DSH (client code hot-reloads, host routes do not).
208
+ - Two wallpapers are bundled (about 9 MB of the repository); everything else you add lives in your workspace and is not committed.
209
+
210
+ ## Development
211
+
212
+ Static regression checks (no third-party dependencies; asserts the streaming hot path has no per-frame whole-document scans or forced layouts):
213
+
214
+ ```bash
215
+ node test/appearance-motion.cjs
216
+ ```
217
+
218
+ Manual checks:
219
+
220
+ 1. Enable the bundle in a profile and start DSH.
221
+ 2. Reload the web UI, with a hard reload (Ctrl+F5) if the client bundle was rebuilt.
222
+ 3. Settings → 外观 should render. The host routes can also be queried directly:
223
+
224
+ ```bash
225
+ curl -s http://127.0.0.1:<port>/bg/list
226
+ curl -s http://127.0.0.1:<port>/bg/path
227
+ curl -s http://127.0.0.1:<port>/bg/config
228
+ ```
229
+
230
+ `/bg/list` returns `[{ url, name }]` with the name decoded, `/bg/path` the writable folder, `POST /bg/reveal` opens it in the OS file manager, and `/bg/config` the stored settings — the last one answers 404 until the page has saved at least once.
231
+
232
+ | Path | Role |
233
+ | --- | --- |
234
+ | `lib/host/index.js` | Host half: `/bg/*` routes, config file, early wallpaper injection |
235
+ | `lib/client/index.js` | Client half: styles, wallpaper layer, settings page |
236
+ | `assets/backgrounds/` | Put your own wallpapers here |
237
+ | `test/appearance-motion.cjs` | Static checks for structure and the hot path |
238
+ | `cordis.patch.yml` | The bundle's composition row |
239
+
240
+ ## License
241
+
242
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,234 @@
1
+ [English](README.md) | 简体中文
2
+
3
+ # dsh-ui-appearance
4
+
5
+ > 给 DeepSeek Harness 的网页界面换上壁纸、毛玻璃面板与聊天框样式。
6
+
7
+ DSH 的网页界面默认只有一套朴素外观。这个 bundle 在设置里加了一页「外观」:可以把壁纸铺在背后,把会话卡片、输入框和设置面板做成半透明毛玻璃,调侧边栏的透明度,并打开跟随鼠标的视差和自动隐藏侧边栏。它是纯本地的界面插件——除了你自己的 DSH 服务在把图片发回浏览器之外,不连任何外部服务。
8
+
9
+ ![dsh-ui-appearance](docs/preview/hero.jpg)
10
+
11
+ ## 为什么用它
12
+
13
+ 壁纸和玻璃效果容易加,也容易让长会话变卡。这个 bundle 的原则是:所有效果都离流式热路径远一点,而不是每来一个 token 就重排一次界面。
14
+
15
+ | | dsh-ui-appearance | 普通壁纸层 |
16
+ | --- | --- | --- |
17
+ | 长会话 | 防抖全量同步、轻量同步、缓存测量、忽略自身变更的 tooltip 观察器 | 每个流式 token 都重排 |
18
+ | 壁纸来源 | 选一个文件夹,中文名自动解码;只提供图片 | 手填路径 |
19
+ | 可调范围 | 对话卡、输入框、设置面板、侧边栏分开调 | 一个全局透明度 |
20
+ | 隐私 | 纯 CSS,只由你自己的 DSH 提供;无网络、无 CDN | 经常加载远程资源 |
21
+
22
+ ## 快速开始 / Quick start
23
+
24
+ **这是什么。** 一个改 DeepSeek Harness 外观的 Web 插件包:壁纸层、玻璃拟态面板、输入框与侧边栏样式、指针视差、自动隐藏侧边栏。全部本地运行,自定义壁纸来自你指定的文件夹。
25
+
26
+ **What it is.** A DSH Web bundle that changes the look: wallpaper layer, glass panels, composer and sidebar styling, pointer parallax, auto-hiding sidebar.
27
+
28
+ **安装。**
29
+ 1. 加进一个 DSH profile——桌面版:**设置 → 插件**;命令行:
30
+ ```sh
31
+ git clone https://github.com/LuosuQWQ/dsh-ui-appearance.git
32
+ dsh plugin --profile <profile> add link:<本地绝对路径>/dsh-ui-appearance
33
+ ```
34
+ 2. **重启 DSH**,打开 **设置 → 外观**。
35
+ 3. 用 **壁纸文件夹** 按钮选目录,或使用自带默认壁纸。
36
+
37
+ > 装好后请告诉主人:**重启 DSH,然后打开「设置 → 外观」**。不需要其他配置,自带两张默认壁纸。
38
+
39
+ **给 agent。** 配置键、默认值与约束见 [AGENTS.md](AGENTS.md)。
40
+
41
+ ## 截图
42
+
43
+ ![壁纸与玻璃面板的首页](docs/preview/home.jpg)
44
+
45
+ **1** 整个应用背后的壁纸层;对话卡片、输入框和侧边栏仍然清晰可读。
46
+
47
+ ![外观设置](docs/preview/settings.jpg)
48
+
49
+ **2** 壁纸来源与 **壁纸文件夹** 按钮:页面直接打开你的文件夹而不是让你填路径,中文名自动解码。**3** 透明度、模糊、遮罩与指针视差。**4** 侧边栏透明度与自动隐藏。
50
+
51
+ ![指针视差:壁纸随光标轻微漂移](docs/preview/parallax.gif)
52
+
53
+ **指针视差。** 壁纸层会随光标轻微反向漂移,幅度与缓动可在「设置 → 外观」里调。这张 GIF 是浏览器界面里真实移动光标录制的。
54
+
55
+ ## 功能
56
+
57
+ - **整屏壁纸层**:裁切 / 居中 / 平铺 / 拉伸 / 适应五种尺寸模式,外加透明度、模糊和一层遮罩色。
58
+ - **指针视差**:壁纸随鼠标产生位移,幅度与缓动可调。
59
+ - **会话区毛玻璃**:底色、透明度、背景模糊强度,以及会话列的最大宽度。
60
+ - **输入框与设置面板毛玻璃**:各自独立的底色、透明度、模糊;输入框另有边框样式与圆角。
61
+ - **侧边栏控制**:半透明填充,可选的自动隐藏——侧边栏滑出左边缘,鼠标靠近时再滑回来。
62
+ - **卡片保持一致**:同一套卡片可以套到「插件」页和「自动化任务」页;右侧的文档预览面板复用会话区的玻璃参数。
63
+
64
+ ## 运行要求
65
+
66
+ - DeepSeek Harness 0.2.x(基于 0.2.2-rc.5 开发验证),运行的是网页界面——桌面版和 `dsh web` 用的是同一个界面。
67
+ - 不需要额外的 npm 包,也不需要外部服务。
68
+ - 壁纸:随包附带两张默认壁纸(花与大肥鱼 version1 / version2),未配置过的新用户默认使用 version2。想加自己的图片,把 JPEG/PNG/WebP/GIF(单张不超过 12 MB)放进壁纸文件夹即可。
69
+
70
+ ## 安装
71
+
72
+ 这个目录是一个 DSH bundle,分两半:`lib/host/index.js`(组合行指向的模块)和 `lib/client/index.js`(通过 `exports["./client"]` 与 `dsh.client.platform: "web"` 提供给网页界面)。
73
+
74
+ 用插件管理器从检出目录安装:
75
+
76
+ ```text
77
+ plugin_manager: { action: "install_bundle", target: "<path-to-checkout>" }
78
+ ```
79
+
80
+ 也可以手工写进 profile 的 `package.json`:
81
+
82
+ ```json
83
+ {
84
+ "dependencies": {
85
+ "dsh-ui-appearance": "link:<path-to-checkout>"
86
+ },
87
+ "dsh": {
88
+ "profile": {
89
+ "bundles": ["dsh-ui-appearance"]
90
+ }
91
+ }
92
+ }
93
+ ```
94
+
95
+ 然后在 profile 目录执行 `pnpm install`。
96
+
97
+ 安装后要重启 DSH,再刷新页面:两半都在 DSH 进程启动时组合,只刷新浏览器不会加载新装的 bundle。如果浏览器还缓存着旧产物,用强制刷新(Ctrl+F5)。卸载用 `plugin_manager: { action: "remove_bundle", target: "dsh-ui-appearance" }`,同时把 profile 里那一行去掉。
98
+
99
+ ## 配置
100
+
101
+ 所有选项都在「设置 → 外观」页上。改动立即生效,并且存两份:浏览器里的 `localStorage["dsh-ui-appearance:settings"]`,以及宿主上的 `config.json`:
102
+
103
+ ```text
104
+ ~/.dsh/plugins/dsh-ui-appearance/config.json
105
+ ```
106
+
107
+ 缺失的字段回退到下面的默认值;宿主保存时会把每个数值夹到允许范围内。
108
+
109
+ | 字段 | 类型 | 默认值 | 说明 |
110
+ | --- | --- | --- | --- |
111
+ | `bgImage` | 字符串 | 随包 version2 | 选中的壁纸,形如 `/bg/<file>`;空表示不用壁纸 |
112
+ | `bgSize` | `cover` / `contain` / `tile` / `stretch` / `auto` | `cover` | 壁纸填充窗口的方式 |
113
+ | `bgOpacity` | 数值 0–1 | `1` | 壁纸透明度 |
114
+ | `bgBlur` | px 0–60 | `0` | 壁纸模糊 |
115
+ | `bgMask` | 颜色 | `#f8f7f7` | 压在壁纸上方的遮罩色 |
116
+ | `bgMaskOpacity` | 数值 0–1 | `0` | 遮罩浓度 |
117
+ | `parallaxEnabled` | 布尔 | `true` | 壁纸是否跟随鼠标 |
118
+ | `parallaxAmplitude` | px 0–50 | `12` | 每个方向的最大位移 |
119
+ | `parallaxEasing` | `ease-out` / `ease-in` / `ease-in-out` | `ease-out` | 视差过渡的缓动 |
120
+ | `sidebarOpacity` | 数值 0–1 | `0.4` | 侧边栏填充的透明度 |
121
+ | `sidebarAutoHide` | 布尔 | `false` | 把侧边栏滑出左边缘 |
122
+ | `prewarmFirstSlide` | 布尔 | `true` | 后台先光栅化一次隐藏的侧边栏,避免首次滑入掉帧 |
123
+
124
+ | 字段 | 类型 | 默认值 | 说明 |
125
+ | --- | --- | --- | --- |
126
+ | `conversationEnabled` | 布尔 | `true` | 是否绘制会话区的玻璃卡片 |
127
+ | `conversationColor` | 颜色 | `#ffffff` | 卡片底色 |
128
+ | `conversationOpacity` | 数值 0–1 | `0.2` | 卡片透明度 |
129
+ | `conversationBlur` | px 0–60 | `2` | 背景模糊强度 |
130
+ | `conversationWidth` | px 420–1200 | `870` | 会话列的最大宽度 |
131
+ | `pageCard` | 布尔 | `true` | 「插件」与「自动化任务」页也用同一张卡片(需要 `conversationEnabled`) |
132
+ | `previewPopupShared` | 布尔 | `true` | 右侧文档预览面板复用会话区的玻璃参数 |
133
+ | `previewPopupInset` | px 0–48 | `8` | 预览面板的外边距(上、右、下) |
134
+ | `chatBoxColor` | 颜色 | `#ffffff` | 输入框底色 |
135
+ | `chatBoxOpacity` | 数值 0–1 | `0.59` | 输入框透明度 |
136
+ | `chatBoxBlur` | px 0–60 | `0` | 输入框背景模糊强度 |
137
+ | `chatBoxBorder` | `none` / `thin` / `thick` | `none` | 输入框边框样式 |
138
+ | `chatBoxRadius` | px 0–60 | `24` | 输入框圆角 |
139
+ | `settingsColor` | 颜色 | `#ffffff` | 设置面板底色 |
140
+ | `settingsOpacity` | 数值 0–1 | `0.4` | 设置面板透明度 |
141
+ | `settingsBlur` | px 0–60 | `16` | 设置面板背景模糊强度 |
142
+
143
+ 页面上的分组标题是「壁纸背景 / 视差动效 / 侧边栏 / 会话对话区 / 聊天框 / 设置面板」,上表的字段名就是 `config.json` 里的键名。
144
+
145
+ 手写 `config.json` 时只写想改的值即可:
146
+
147
+ ```json
148
+ {
149
+ "bgImage": "/bg/my-wallpaper.jpg",
150
+ "bgSize": "cover",
151
+ "bgOpacity": 0.9,
152
+ "parallaxEnabled": true,
153
+ "sidebarAutoHide": true,
154
+ "conversationOpacity": 0.7,
155
+ "conversationBlur": 14
156
+ }
157
+ ```
158
+
159
+ ### 壁纸放在哪里
160
+
161
+ 壁纸选择器会从最多三个目录读取图片:
162
+
163
+ 1. `DSH_APPEARANCE_ASSETS` —— 可选,指向一个额外的图片目录,里面的图片只读提供。这个环境变量在插件加载时读取,改完要重启 DSH。
164
+ 2. `<workspace>/plugins/dsh-ui-appearance/assets/backgrounds/` —— 可写目录。「设置 → 外观」里的 **壁纸文件夹** 按钮会用系统文件管理器打开它,放进去的图片会出现在壁纸下拉框里。
165
+ 3. 安装包内的 `assets/backgrounds/` —— 随包附带的默认壁纸,只读。npm 安装(没有检出目录)时,默认壁纸就靠它提供。
166
+
167
+ `<workspace>` 取 `DSH_WORKSPACE`(设了的话),否则取 DSH 注册的第一个工作区,再否则取进程工作目录。
168
+
169
+ 仓库只附带两张壁纸——花与大肥鱼 version1.png 和 version2.png(2560×1440 PNG,合计约 9 MB),`.gitignore` 会把该目录里的其它图片挡在仓库之外。你也可以把自己的图片放进去:同名文件优先于随包默认壁纸。当这个检出以 `plugins/dsh-ui-appearance` 的形式链接进工作区时(常见的开发方式),检出目录正是上面第 2 个目录。把文件拷进去,在「设置 → 外观」里点 **壁纸文件夹** 打开目录,回到「外观」页就能选。所有目录里的图片都会列进选择器、也都能被请求到,按顺序取第一个命中的文件。宿主仍保留 `/bg/upload` 接口给程序调用(写入时用随机文件名),设置页已不再使用它。
170
+
171
+ ## 使用
172
+
173
+ 打开「设置」(齿轮图标),选「外观」。页面分组为 壁纸背景、视差动效、侧边栏、会话对话区、聊天框、设置面板。
174
+
175
+ - **壁纸**:下拉框列出随包默认壁纸、壁纸文件夹里的图片以及「不使用壁纸」,右边的 **壁纸文件夹** 按钮用系统文件管理器打开那个目录。新安装默认选 version2;选过「不使用壁纸」会存成空值,之后不会自己变回默认。点过按钮会刷新列表;选中的图片被删掉后仍会显示,并标注「已不在文件夹中」。
176
+ - **自动隐藏**:打开「自动隐藏到左侧」后,侧边栏滑出窗口,鼠标进到距左边缘 20 px 以内就滑回来,离开后再收起。侧边栏自带的收起按钮会切换这个模式的开关。
177
+ - **预热**:「首次滑入前预热(减少首帧卡顿)」会趁空闲时在屏幕内画一帧隐藏的侧边栏,让第一次滑入不必再付光栅化开销。关掉可以省掉这次绘制,代价是首次展开可能掉几帧。
178
+ - **会话区**:「启用区分」必须开着,会话卡片、输入框玻璃和页面卡片才会出现。「插件/任务页也用会话卡片」把同一张卡片套到「插件」和「自动化任务」页;任一项关掉,那些页面就回到官方布局。
179
+ - **文档预览**:「应用到文档预览弹窗」让右侧预览面板复用会话区的玻璃参数;「弹窗外边距(上/下/右)」设它的上、右、下边距。左缘故意不内缩,否则拖动分界线时面板内容每一帧都要重新排版。
180
+ - **最新消息**:长对话里滚离最新一条时,右下角会出现「↓」按钮,点一下回到末尾。bundle 生效期间官方自带的回到底部按钮会被隐藏。
181
+ - **关闭**:在「插件」页关掉这个 bundle 的行(或从 profile 里移除),插件会把它改过的行内样式还原。要彻底重置外观,删掉 `config.json` 和 `dsh-ui-appearance:settings` 这个 localStorage 键。
182
+
183
+ ## 实现机制
184
+
185
+ - 宿主半提供 `/bg/*`:列壁纸目录(名字已解码,供界面直接显示)、读写 `config.json`、用 `/bg/reveal` 打开壁纸文件夹、接收上传、返回图片字节。它还会往 DSH 网页服务返回的每个页面 `<head>` 里注入一小段 `<style>`,所以配好壁纸后,在任何客户端脚本跑起来之前壁纸就已经画上了。
186
+ - 客户端半是一个 web 客户端模块:追加自己的 `<style>`,建一层固定壁纸和一层遮罩,把设置写成 `<html>` 上的 CSS 自定义属性,并让应用主框架的网格列跟随侧边栏与右侧预览面板。
187
+ - 设置先从 localStorage 立刻生效,再由宿主同步进 `config.json`;宿主保存时会校验每个数值。
188
+ - 插件只加 CSS 并给需要的官方容器打标记;停用时把这些标记和样式清掉。
189
+ - 流式输出期间 DOM 每秒要变几十次,插件对变更做了分级:轻活(跟随最新、按钮显隐)每帧做,而「全文档查询 + 几十个 CSS 变量 + 主题 token」这类重活去抖到静默 160 ms 之后才跑,切会话/换面板/开右栏这类结构性变化才立刻全量同步。这样转写越长,每帧的固定开销也不会跟着涨。
190
+
191
+ ## 已知限制
192
+
193
+ - 只作用于网页界面:它美化的是 DSH 的浏览器界面,CLI 会话不受影响。
194
+ - 「外观」页的文案写死为中文,不跟随界面语言切换。
195
+ - 样式依赖官方 DOM 结构(`frame`、`sidebarCol`、`centerCol`、`data-slot` 锚点、`data-sidebar-right-panel`)。某个 DSH 版本改了这些名字,对应部分的样式就会失效,直到插件跟上。
196
+ - 自动隐藏假定侧边栏在左侧。
197
+ - 背景模糊是 GPU 开销;弱显卡上同时存在多块大面积毛玻璃会掉帧,觉得滚动发涩就调低模糊值。
198
+ - 壁纸单张限制 12 MB,且只接受 JPEG/PNG/WebP/GIF。
199
+ - 打开壁纸文件夹依赖宿主半的新代码:升级插件后需要重启 DSH(客户端代码会热重载,宿主路由不会)。
200
+ - 仓库附带两张壁纸(约占 9 MB);你后来添加的壁纸都在自己的工作区里,不会进仓库。
201
+
202
+ ## 开发
203
+
204
+ 静态回归(无需第三方依赖,检查串流热路径里没有逐帧全量扫描/强制布局):
205
+
206
+ ```bash
207
+ node test/appearance-motion.cjs
208
+ ```
209
+
210
+ 手工验证:
211
+
212
+ 1. 在 profile 里启用 bundle,启动 DSH。
213
+ 2. 刷新网页界面;如果客户端产物重建过,用强制刷新(Ctrl+F5)。
214
+ 3. 「设置 → 外观」应能正常渲染。宿主路由也可以直接查:
215
+
216
+ ```bash
217
+ curl -s http://127.0.0.1:<port>/bg/list
218
+ curl -s http://127.0.0.1:<port>/bg/path
219
+ curl -s http://127.0.0.1:<port>/bg/config
220
+ ```
221
+
222
+ `/bg/list` 返回 `[{ url, name }]`(name 已解码),`/bg/path` 返回可写目录,`POST /bg/reveal` 用系统文件管理器打开它,`/bg/config` 返回已保存的设置——页面还没保存过时最后一个返回 404。
223
+
224
+ | 路径 | 作用 |
225
+ | --- | --- |
226
+ | `lib/host/index.js` | 宿主半:`/bg/*` 路由、配置文件、首屏壁纸注入 |
227
+ | `lib/client/index.js` | 客户端半:样式、壁纸层、设置页 |
228
+ | `assets/backgrounds/` | 放你自己的壁纸 |
229
+ | `test/appearance-motion.cjs` | 结构与热路径的静态回归 |
230
+ | `cordis.patch.yml` | bundle 自己的组合行 |
231
+
232
+ ## 许可证
233
+
234
+ MIT,见 [LICENSE](LICENSE)。
@@ -0,0 +1,8 @@
1
+ # This bundle owns its composition row. The Plugins page switch toggles bundle
2
+ # membership (`dsh.profile.bundles`), and the per-row switch writes
3
+ # `{ id, disabled }` into the profile patch — both only work when the row lives
4
+ # in the bundle's own patch (that is what the page renders as `declaredRows`).
5
+ # It used to sit in the profile patch layer, which made the switch a no-op.
6
+ - insert:
7
+ - id: dsh-ui-appearance
8
+ name: @luosuqwq/dsh-ui-appearance
package/icon.svg ADDED
@@ -0,0 +1,16 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" color="#5b6673">
2
+ <defs>
3
+ <mask id="moonBite" maskUnits="userSpaceOnUse">
4
+ <rect width="64" height="64" fill="#fff"/>
5
+ <circle cx="53" cy="33" r="11.5" fill="#000"/>
6
+ </mask>
7
+ </defs>
8
+ <g fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round">
9
+ <circle cx="20" cy="20" r="6"/>
10
+ <path d="M20 9.5V6"/>
11
+ <path d="M30.5 20H34"/>
12
+ <path d="M9.5 20H6"/>
13
+ <path d="M20 30.5V34"/>
14
+ </g>
15
+ <circle cx="45" cy="42" r="12" fill="#3b78b5" mask="url(#moonBite)"/>
16
+ </svg>