deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
一个用于 DeepSeek Harness (DSH) Web 界面的外观自定义插件。它让你可以给主界面、边栏、顶栏三个区域分别上传背景图片,并自由拖拽定位、调节不透明度,还支持主题色、圆角和界面缩放。
localStorage,图片本体存入 IndexedDB(不再受 5MB 配额限制);刷新不丢、多标签页自动同步、可一键重置;IDB 不可用时自动回退内嵌存储一个 DSH 客户端插件是一个 npm 包,通过三个约定接入:
| 约定 | 本包实现 |
|---|---|
package.json 声明 "dsh": { "client": { "platform": "web", "inject": [...] } } |
声明浏览器插件及其依赖 |
exports["./client"] 指向成品 bundle |
lib/client.js(手写、零构建) |
bundle 通过 window.__ModuleLoader__.load({ id, factory }) 注册,工厂返回 { apply, inject } |
标准 Cordis 插件 |
宿主侧的 dsh-client-modules 扫描已启用插件行,把 bundle 发布到 /plugins/<id>/client.js 并注入 window.__DSH_BOOT__;Web 外壳内核据此挂载插件。
界面真正「盖住背景」的层是几个布局元素,它们的 background 都是 var(--dsw-alias-bg-*):
.pI_x6G_frame)+ 会话根(.wSkVaW_root).pI_x6G_sidebarCol)+ 侧栏壳(.hHd-Xa_root)<header> 元素本插件在运行时用 [class*="sidebarCol"] 等选择器定位这些元素,把背景复合值直接设为它们的内联 background,从而绕过「表面透明度」依赖、获得 100% 清晰度。
背景复合值层序:
[洗色层: linear-gradient(底色, 1-不透明度)] <- 实现不透明度语义
[暗化层: linear-gradient(rgba(0,0,0, dim))]
[图片层: url(...) X% Y%/size repeat] <- 位置、显示方式
[底色: var(--dsw-alias-bg-base) 等] <- 自动跟随明暗模式
MutationObserver 监听布局元素重挂载(切会话/热更新)自动重绘;theme/change 时按明暗模式重刷洗色层;插件卸载时清理所有内联背景前置:已安装 DeepSeek Harness,并运行过一次
dsh web(会自动创建 profile 目录)。
PowerShell 里粘贴这一行即可(自动下载、安装、写入配置):
[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; irm https://raw.githubusercontent.com/vonPaulison/deepseek-harness-custom-background/main/install.ps1 | iex
装完重启 dsh web,刷新页面 → 设置 → 外观自定义。重复运行是安全的(幂等)。
不想直接执行远程脚本的话,也可以先下载
install.ps1看一眼再运行,或改用下面手动方式。
dsh plugin --profile web add <本仓库路径>
然后把下面这段合并进 %USERPROFILE%\.dsh\profiles\web\cordis.patch.yml:
- insert:
- id: ui-customizer
name: dsh-ui-customizer
# 1. 放入 web 配置目录的 node_modules
New-Item -ItemType Directory -Force $env:USERPROFILE\.dsh\profiles\web\node_modules | Out-Null
Copy-Item -Recurse <本仓库路径> $env:USERPROFILE\.dsh\profiles\web\node_modules\dsh-ui-customizer
# 2. 把上面的 insert 段合并进 cordis.patch.yml
dsh web(或:若插件行已在运行实例中注册,直接 Ctrl+F5 强刷页面即可加载新 bundle)⚠️ 设置面板打开时会盖住主界面:上传/调整后请关闭设置面板再查看效果(卡片内的预览图可实时看位置与显示方式)。
如果某个区域的背景没有显示:
DSH Web 界面是 slot 树,第三方插件可注册/替换任意区域。可用插槽(声明于各 dsh-client-ui-* 包):
root、shell.overlaysidebar、sidebar.workspaces、sidebar.settings、sidebar.footer.actionconversation.session、conversation.composer(链式,可整体替换输入区)、conversation.chat.node、conversation.chat.turnTail、conversation.input.*、conversation.hero.*settings.trigger、settings.section、settings.general.item、settings.plugins.tab、settings.plugin.itemtool.call.toolview、tool.view.cordis、details注册方式:
// 直接注册(插槽已声明)
ctx.slots.register({ name: "settings.section", id: "...", order: 100, label: "..." }, Component);
// 声明注入(声明者激活后自动注册)
ctx.slots.inject("settings.general.item", () => ctx.slots.register({ ... }, Row));
主题层面:
// 覆盖任意 --dsw-alias-* token(明暗两个值都必须给)
ctx.theme.overrideTokens("你的插件id", { "--dsw-alias-brand-primary": { light: "#4176E6", dark: "#4176E6" } });
// 或注册一个完整可选的第三方主题
ctx.theme.register({ id: "my-theme", colorScheme: "dark", tokens: { ... } });
localStorage,图片在 IndexedDB):换浏览器/清缓存会丢;远程(非本机)浏览器不同步[class*="sidebarCol"]、header 等),DSH 未来大版本若改动结构需同步更新选择器平铺 模式下位置以百分比偏移(图片大于区域时可能无明显位移)!important),头像等圆形元素做了豁免,属「尽力而为」zoom,仅 Chromium 系浏览器生效dsh-ui-customizer/
├── package.json # 插件清单:dsh.client 声明、exports、版本
├── lib/
│ ├── index.js # 宿主(Node)半:空插件,让行在 Cordis 树上激活
│ └── client.js # 浏览器半:window.__ModuleLoader__.load 手写 bundle
├── test/
│ └── simulate.cjs # 模拟模块加载器全链路测试(Node 直接运行)
├── LICENSE
└── README.md
node test/simulate.cjs lib/client.js
本项目为 DeepSeek Harness 的第三方插件,与 DeepSeek 官方无直接关联;DSH 及 `@deepseek-ai/dsh-` 包版权归其各自所有者。*
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。