Bundle
dsh-valley-liang
Replace DeepSeek Harness Web branding with Liang Wengu and switch logos during Beijing-time peak hours
- Source
- tuzkier
- License
- MIT
- Updated
- Updated 6 days ago
Readme
# 梁文谷(dsh-valley-liang) 把 DeepSeek Harness Web 界面左上角(侧栏)和对话页欢迎语处的官方鲸鱼标,换成你自己的 logo。 纯客户端插件:不往宿主加任何服务,只占用两个品牌插槽。 ## 原理 DSH Web 的侧栏鲸鱼不是一个写死的图片,而是一个插槽占用者: - 侧栏图标 → `sidebar.brand.mark`(size 24) - 对话页欢迎图标 → `conversation.hero.brand.mark`(size 34) 官方包 `@deepseek-ai/dsh-client-ui-brand-official` 在 priority 0 注册鲸鱼标。 插槽系统(SlotCore)的规则是 **priority 最低者渲染**,同 priority 重复注册会报错。 本插件在 **priority -100** 注册你的 logo——稳定遮蔽官方鲸鱼,且永不与官方注册冲突。 想换回鲸鱼,停用/卸载本插件即可,官方注册仍然在,无需改任何官方文件。 附加行为: - **悬停大图**——鼠标放到小图标上弹出 256px 预览(portal 到 body,带圆角阴影 和弹出动效),移开即消失;预览层 `pointer-events:none`,绝不遮挡点击。 - **高峰期换图**——北京时间周一至周五 9:00–12:00、14:00–18:00 显示 `assets/logo-peak.*`(嘘 🤫),其余时间显示 `assets/logo.*`。页面开着也会 每分钟自查时钟,到点自动切换。时段在 `client/client.template.js` 的 `PEAK_RANGES` 里改。 ## 换 logo(日常操作) 把你的新图放到 `assets/logo.png`(或 `logo.jpg` / `logo.webp` / `logo.gif` / `logo.svg`,每种用途同目录下只能有一个),高峰图命名为 `logo-peak.*`,然后: ```sh cd dsh-valley-liang npm run build # 把图片内联进 client/client.js ``` 重启 `dsh web`(或等 HMR 组合刷新)后刷新页面生效。 > 图片会被 base64 内联进 JS bundle(DSH 的插件通道只下发 client.js 一个文件, > 没有静态资源路由)。图标实际显示高度只有 24/34px,导出 256px 见方足矣; > 构建脚本对超过 ~300KB 的源图会提示。 ## 安装 **方式一:tarball 分发包(推荐,离线可用)** ```sh dsh plugin --profile web add ./dsh-valley-liang-0.1.0.tgz ``` CLI 会:把包解到 profile 的 node_modules → 按 `cordis.patch.yml` 的 `insert` 声明把 `dsh-valley-liang` 追加进 `dsh.profile.bundles` → 自动补齐基础 bundle。 重启 `dsh web` 生效。包内 client.js 已预构建,**安装方不需要 Node 构建步骤** (安装走宿主 `dsh` CLI 的 pnpm 转发)。 **方式二:本地目录(开发迭代用,改动实时生效)** ```sh dsh plugin --profile web add /path/to/dsh-valley-liang ``` pnpm 会以 `link:` 方式接入——源目录里 `npm run build` 后刷新页面即可看到新图, 无需重装。 **方式三:手动挂载(不想走 CLI 时)** 1. 把包目录放进 `~/.dsh/profiles/web/node_modules/`; 2. 在 `~/.dsh/profiles/web/package.json` 的 `dsh.profile.bundles` 数组末尾加 `"dsh-valley-liang"`; 3. 重启 `dsh web`。 **发布到 npm 后**(`npm publish`),别人就只是一条: `dsh plugin --profile web add dsh-valley-liang`。 > 分发包里含作者的个人照片(`assets/logo*.png`),装上即显示同样的图; > 想换自己的图见上一节。高峰时段按北京时间内置于包内,修改需重新构建。 ## 卸载 / 停用 - 停用:在 profile 的 `cordis.patch.yml` 里加一行 `- id: valley-liang` + `disabled: true`(插件市场 UI 的开关写的也是这个)。 - 卸载:`dsh plugin --profile web remove dsh-valley-liang`。 ## 文件结构 ``` package.json dsh.client 声明(platform: web + inject),exports["./client"] cordis.patch.yml bundle 补丁:把本插件 insert 进 profile 组合 lib/index.js node 半区(空 apply,仅为让 loader 挂载本包) client/client.template.js 浏览器端源码(ModuleLoader 工厂,占位符 + 高峰时段配置) client/client.js 构建产物(由 scripts/build.mjs 生成,勿手改) scripts/build.mjs 内联 assets/logo.*、logo-peak.* → client/client.js assets/logo.* 平时显示的 logo assets/logo-peak.* 高峰期显示的 logo(缺省则始终用 logo.*) ```
Install
dsh plugin --profile web add github:tuzkier/valley-liang
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-valley-liang from the hub
- This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.