dsh-client-ui-skin-kitty 🎀
一个面向 DeepSeek Harness (DSH) Web UI 的 Hello Kitty 皮肤插件(粉色主题 + 自定义壁纸)。
已精简为纯主题:只保留背景/主题,右侧文件面板、token 用量图等工作区功能已移除。
作为静态插件运行:安装进 DSH profile 后,主题与壁纸随 Harness 启动自动恢复,无需手动激活。
目录结构
dsh-client-ui-skin-kitty/
├── package.json # npm 清单(声明 dsh.bundle.patch + dsh.client)
├── skin.json # 皮肤元数据
├── cordis.patch.yml # bundle patch:把本包注册为静态 loader entry
├── theme.css # Hello Kitty 主题(浅/深色,壁纸走 /kitty/wallpaper.jpg)
├── theme.inline.css # 单文件版:壁纸 base64 内联,可直接注入
├── assets/
│ └── kitty-wallpaper.jpg # 壁纸照片(替换它即可换壁纸)
├── lib/
│ ├── index.js # Host 半:提供 /kitty/theme.css + /kitty/wallpaper.jpg
│ └── client.js # Client 半:启动时注入主题样式
├── scripts/inline.mjs # 一键重新生成 theme.inline.css
├── README.md
└── LICENSE
工作原理(静态插件)
package.json 声明 "dsh": { "bundle": { "patch": "./cordis.patch.yml" }, "client": {...} }。
cordis.patch.yml 把本包注册为一条静态 loader entry。
- Host 半(
lib/index.js)用 ctx.inject(["webServer"], ...)(与 dsh-desktop-market-installer
相同的模式)注册两个静态路由:/kitty/theme.css、/kitty/wallpaper.jpg。
- Client 半(
lib/client.js)启动时注入
<link rel="stylesheet" href="/kitty/theme.css">(幂等),主题即生效。
踩坑记录:
- Host 半不能用
ctx.get("fs") / ctx.get("webServer") —— profile 根 context
里拿不到这些服务,会导致插件静默失效(apply 提前 return、无任何报错)。必须显式
ctx.inject(["webServer"], cb)。
- 主框架类名是 CSS Module 哈希,随 DSH 版本变化(0.7.1 =
.m45BUG_frame,
0.9.0 = .pI_x6G_frame)。不要写死单个哈希:theme.css 现在同时用
「已知哈希 + #root > [class$="_frame"] 层级选择器 + body 兜底」三层匹配,
升级后任一命中即可显示壁纸。壁纸 URL 通过 --kitty-wallpaper 变量只写一次,
内联版因此只内嵌一份 base64。
安装进 DSH profile(桌面端/Web 端重启后自动加载)
# 在 DSH 的 web profile 里安装本包(路径换成你的实际路径)
dsh plugin --profile web add file:/path/to/dsh-client-ui-skin-kitty
安装后重启 Harness 即生效:Kitty 粉色主题 + 壁纸自动恢复。
换壁纸 / 改主题
- 换壁纸:替换
assets/kitty-wallpaper.jpg,再 npm run inline(生成新内联版)。
- 改主题:直接编辑
theme.css(Host 每次请求实时读取,改完刷新页面即生效,
无需重启 Harness),改完 npm run inline 同步内联版。
- 若某天壁纸又不显示:多半是 DSH 升级后主框架类名/结构变了,按上面的三层选择器
再加一条当前版本的哈希即可(用
dsh-client-ui-layout 的 AppFrame CSS 里
<hash>_frame 那个类名)。
打包 & 发布
npm run inline # 重新生成单文件内联版(改壁纸后)
npm pack # 产出 dsh-client-ui-skin-kitty-1.0.0.tgz
npm publish --access public # 发布到 npm(需先 npm login)
推送到你的 GitHub
cd dsh-client-ui-skin-kitty
git remote add origin https://github.com/luongthimydieu/dsh-client-ui-skin-kitty.git
git branch -M main
git push -u origin main
License
MIT