dsh-pixel-ui 1.0.0 → 1.5.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.md +180 -158
- package/assets/cover.jpg +0 -0
- package/assets/screenshot-paper.png +0 -0
- package/assets/screenshot-retro.png +0 -0
- package/assets/screenshot-warm.png +0 -0
- package/assets/screenshot-wood.png +0 -0
- package/lib/client.js +157 -576
- package/lib/client.js.map +3 -3
- package/lib/index.js +120 -5
- package/package.json +44 -5
- package/assets/screenshot-paper-chat.png +0 -0
- package/assets/screenshot-retro-chat.png +0 -0
- package/assets/screenshot-warm-chat.png +0 -0
- package/assets/screenshot-wood-chat.png +0 -0
package/README.md
CHANGED
|
@@ -1,158 +1,180 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
##
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./assets/cover.jpg" alt="dsh-pixel-ui 四主题角色封面:像素·木屋 / 像素·羊皮纸 / 像素·暖阳 / 像素·终端绿" width="720" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# 🪵 dsh-pixel-ui
|
|
6
|
+
|
|
7
|
+
> DeepSeek Harness 像素皮肤(Agent Xi 风格):四个主题一键切换——像素·木屋 / 像素·羊皮纸 / 像素·暖阳 / 像素·终端绿,随时可切回现代默认 UI。
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
`dsh-pixel-ui` 是一个**皮肤插件**,把 dsh Web GUI 重皮肤成像素 RPG 风:
|
|
20
|
+
|
|
21
|
+
1. **四个主题**:像素·木屋(深木 + 金)、像素·羊皮纸(浅色纸面 + 金棕)、像素·暖阳(暖橙木)、像素·终端绿(终端绿字),色板与 Agent Xi 主题系统同源;
|
|
22
|
+
2. **像素质感**:**完全平面**——整像素 2px 描边、平涂色块的一档明度差、2px 棋盘抖动、手绘 SVG 像素图形(对勾/单选点/下拉箭头/光标),全表零 `box-shadow` 与 `text-shadow`;标题/页签/列表用像素字体,正文与代码走 mono,长文不累眼;
|
|
23
|
+
3. **桌面端友好**:内容列宽随视口撑开(`clamp(680px, 64vw - 140px, 1200px)`,窄屏仍是宿主原本的 680px),皮肤选择在 `dsh-app://` 页面上也能恢复。
|
|
24
|
+
|
|
25
|
+
**适合谁**:想要像素风 / 星露谷风 / 复古终端外观的 dsh 用户;想给会话截图加一点氛围感的博主和开发者。
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## Themes
|
|
29
|
+
|
|
30
|
+
### 像素·木屋 · `pixel-wood`
|
|
31
|
+
|
|
32
|
+
> 深色 · 深木 `#1A0F06` + 金 `#F4D03F`(默认主题)
|
|
33
|
+
|
|
34
|
+
<img src="./assets/screenshot-wood.png" alt="像素·木屋" width="100%" />
|
|
35
|
+
|
|
36
|
+
### 像素·羊皮纸 · `pixel-paper`
|
|
37
|
+
|
|
38
|
+
> 浅色 · 纸面 `#F0E8D8` + 深金棕 `#A07000`
|
|
39
|
+
|
|
40
|
+
<img src="./assets/screenshot-paper.png" alt="像素·羊皮纸" width="100%" />
|
|
41
|
+
|
|
42
|
+
### 像素·暖阳 · `pixel-warm`
|
|
43
|
+
|
|
44
|
+
> 深色 · 暖木 `#1E0E04` + 橙 `#FF8C42`
|
|
45
|
+
|
|
46
|
+
<img src="./assets/screenshot-warm.png" alt="像素·暖阳" width="100%" />
|
|
47
|
+
|
|
48
|
+
### 像素·终端绿 · `pixel-retro`
|
|
49
|
+
|
|
50
|
+
> 深色 · 墨绿 `#0A0E0A` + 绿 `#33FF33`
|
|
51
|
+
|
|
52
|
+
<img src="./assets/screenshot-retro.png" alt="像素·终端绿" width="100%" />
|
|
53
|
+
|
|
54
|
+
> 截图取自 DSH Desktop(1920×1200 @125% 缩放)。截图由插件市场按本仓库根的
|
|
55
|
+
> [`screenshots.json`](screenshots.json) 读取——换图只推自己的仓库,不必提 PR。
|
|
56
|
+
|
|
57
|
+
## Compatibility
|
|
58
|
+
|
|
59
|
+
| 项 | 支持范围 |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| dsh 生态 | `0.1.0-rc.6` ~ `0.2.x`(ThemeService `register`/`setTheme` + `settings.general.item` 槽位;`0.2.1-rc.3` 已按源码逐条核对,并用 0.2.1 真实的 `ThemeRuntime` 跑通注册/恢复/切换契约;见 `docs/dev/迭代记录.md`) |
|
|
62
|
+
| 兼容声明 | 同时声明 `engines.dsh` 与 `@deepseek-ai/dsh-*` peers:0.2.1 的 app-boot 优先读 `engines.dsh`,dshmarket 的发现页把两者取交集;任一判定器都能过 |
|
|
63
|
+
| DSH Desktop | 2.0.x(web 兼容模式/高级模式均适用) |
|
|
64
|
+
| 模式 | 三深色 + 一浅色(`colorScheme` 按主题声明) |
|
|
65
|
+
| 浏览器 | 现代 Chromium / Firefox(`localStorage` + CSS 变量 + SVG 光标) |
|
|
66
|
+
| 字体 | fusion-pixel 12px zh_hans(MIT)+ Press Start 2P(OFL),随包分发 |
|
|
67
|
+
| 对比度 | 四主题全部通过 WCAG AA(正文 ≥4.5:1、非文本 ≥3:1,`npm run test:contrast` 门禁) |
|
|
68
|
+
|
|
69
|
+
## Install / Uninstall
|
|
70
|
+
|
|
71
|
+
### Install
|
|
72
|
+
|
|
73
|
+
npm(推荐):
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
dsh plugin add dsh-pixel-ui
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
GitHub Releases(无需 npm,同样开箱即用):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# 下载 Releases 里的 dsh-pixel-ui-<version>.tgz
|
|
83
|
+
dsh plugin add ./dsh-pixel-ui-1.5.1.tgz
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
GitHub 源码(构建产物已随仓库提交,无需构建):
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
dsh plugin add github:zhang66633/dsh-pixel-ui
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
本地开发(link 方式):
|
|
93
|
+
|
|
94
|
+
```jsonc
|
|
95
|
+
// <profile>/package.json
|
|
96
|
+
{
|
|
97
|
+
"dependencies": { "dsh-pixel-ui": "link:<仓库路径>" },
|
|
98
|
+
"dsh": { "profile": { "bundles": ["dsh-pixel-ui"] } }
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
cd <profile> && pnpm install
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
安装后重启 dsh / DSH Desktop,皮肤才会进入 Loader 组合。
|
|
107
|
+
|
|
108
|
+
#### DSH Desktop 用户
|
|
109
|
+
|
|
110
|
+
1. 托盘右键 → **Open DSH Terminal**,在终端里执行 `dsh plugin add dsh-pixel-ui`(自动作用于当前 profile,如 `desktop`);
|
|
111
|
+
2. 退出并重新打开 DSH Desktop。
|
|
112
|
+
|
|
113
|
+
#### 主题记忆(桌面端随机端口不再失忆)
|
|
114
|
+
|
|
115
|
+
DSH Desktop 默认每次启动随机分配本地 Web 端口,而浏览器 `localStorage` 按 origin(含端口)隔离——旧版本因此会在重启后忘记皮肤选择。v1.4.0 起(v1.5.0 起桌面端改走宿主 index 注入),最后一次选择的主题会同时写入宿主侧文件(`$DSH_HOME/storages/dsh-pixel-ui/preference.json`,经 `/dsh-pixel-ui/preference` 路由读写),与端口无关;`localStorage` 退化为同端口的快速镜像。无需任何配置,固定端口(`dsh-desktop.port`)现在只是可选项。
|
|
116
|
+
|
|
117
|
+
### Upgrade
|
|
118
|
+
|
|
119
|
+
- npm:重新运行 `dsh plugin add`(固定版本号);
|
|
120
|
+
- 本地 link:`git pull` 后重新构建(`npm run build`),刷新浏览器。
|
|
121
|
+
|
|
122
|
+
### Disable
|
|
123
|
+
|
|
124
|
+
只从 `dsh.profile.bundles` 移除 `dsh-pixel-ui`(依赖可以保留)——皮肤不再注入,UI 回到现代默认。
|
|
125
|
+
|
|
126
|
+
### Uninstall
|
|
127
|
+
|
|
128
|
+
从 profile `package.json` 移除依赖与 bundles 条目,`pnpm install`。
|
|
129
|
+
|
|
130
|
+
## Quick start
|
|
131
|
+
|
|
132
|
+
1. 安装后重启 dsh / DSH Desktop;
|
|
133
|
+
2. 首次加载自动激活默认主题「像素·木屋」;
|
|
134
|
+
3. 设置 → 通用 → **像素主题**,五个按钮一键切换四个皮肤和「现代默认」;
|
|
135
|
+
4. 选「现代默认」(或外观行选 浅色 / 深色 / 跟随系统)即整体退出皮肤,选择会被记住,下次打开不复活。
|
|
136
|
+
|
|
137
|
+
最小可复现示例:安装 → 重启 → 木屋主题上身 → 切换到「像素·羊皮纸」→ 输入框文字清晰可读 → 点「现代默认」→ 页面立即回到现代 UI → 刷新页面仍是现代 UI。
|
|
138
|
+
|
|
139
|
+
## Configuration
|
|
140
|
+
|
|
141
|
+
- **无配置项**:四个主题的 13+1 个 `--dsw-alias-*` token 定义在 `src/client/index.js` 的 `THEMES`,像素质感样式在 `src/client/pixel.css`;
|
|
142
|
+
- **默认主题**:`pixel-wood`(仅首次安装时自动激活,之后尊重你的选择);
|
|
143
|
+
- **持久化**:双层——宿主文件 `$DSH_HOME/storages/dsh-pixel-ui/preference.json`(权威,跨端口/跨浏览器)+ 浏览器 `localStorage` 的 `dsh-pixel-ui:theme`(同 origin 镜像);
|
|
144
|
+
- 无环境变量、无敏感项。
|
|
145
|
+
|
|
146
|
+
## Permissions & data
|
|
147
|
+
|
|
148
|
+
- 宿主进程:**只读**本包内字体文件;在 `$DSH_HOME/storages/dsh-pixel-ui/` 下读写一个主题偏好 JSON(仅注册 `/dsh-pixel-ui/fonts/*` 与 `/dsh-pixel-ui/preference` 两个路由,字体文件名白名单、主题 id 白名单,均无路径穿越);
|
|
149
|
+
- 浏览器半边:注册主题 + 注入样式表 + 一个设置行;无网络请求、无遥测、不读凭据,只在 `localStorage` 存一个主题 id。
|
|
150
|
+
|
|
151
|
+
## Troubleshooting
|
|
152
|
+
|
|
153
|
+
| 现象 | 处理 |
|
|
154
|
+
| --- | --- |
|
|
155
|
+
| 皮肤没生效 | `dsh --profile <name> --dump-config`(DSH Desktop 终端里直接 `dsh --dump-config`)确认 `dsh-pixel-ui` 在树;设置 → 通用 → 像素主题 里选一个主题;重启(node 半边改路由后必须重启,client 半边刷新即可) |
|
|
156
|
+
| 想回现代默认 | 设置 → 通用 → 像素主题 → 点「现代默认」(或外观行选 浅色/深色/跟随系统) |
|
|
157
|
+
| 主题没记住 | 确认浏览器未禁用 `localStorage`;v1.4.0 起以宿主文件为权威(桌面端经 index 注入下发),检查 `$DSH_HOME/storages/dsh-pixel-ui/preference.json` 是否存在且内容合法 |
|
|
158
|
+
| 字体没加载 | 浏览器控制台(F12 → Network)看 `/dsh-pixel-ui/fonts/*` 是否 200 |
|
|
159
|
+
| 偏好路由 404 | 宿主还是旧版 node 半边:重启 DSH Desktop;未重启期间功能自动降级为 localStorage 记忆 |
|
|
160
|
+
| 回滚 | 从 `dsh.profile.bundles` 移除插件条目并 `pnpm install` —— profile 其余部分不受影响 |
|
|
161
|
+
|
|
162
|
+
## Development
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npm install
|
|
166
|
+
npm run build # 构建 lib/client.js(wire 格式,CSS 以文本内联)
|
|
167
|
+
npm test # test:host + test:client + test:contrast 三件套
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
- `scripts/test-host.mjs`:node 半边(字体白名单 / 偏好路由读写与校验 / dispose)
|
|
171
|
+
- `scripts/test-client.mjs`:browser 半边(加载真实 lib/client.js,覆盖注册、恢复矩阵、交互、渲染、dispose)
|
|
172
|
+
- `scripts/audit-contrast.mjs`:四主题 WCAG 对比度门禁(改 palette 必跑)
|
|
173
|
+
|
|
174
|
+
改动皮肤后重新构建并刷新浏览器即可(link 安装方式下无需重启 dsh;动了 `lib/index.js` 的路由则需重启)。开发文档在 `docs/dev/`(计划 / 迭代 / 踩坑)。欢迎 PR;行为变更请同步更新 README。
|
|
175
|
+
|
|
176
|
+
## License & security
|
|
177
|
+
|
|
178
|
+
[MIT](./LICENSE) © 2026 zhang66633 · 字体:fusion-pixel(MIT)、Press Start 2P(SIL OFL)。
|
|
179
|
+
|
|
180
|
+
安全问题请通过 GitHub **security advisory** 私下报告,不要发公开 issue。
|
package/assets/cover.jpg
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|