Bundle
dsh-model-provider-badge
DeepSeek Harness plugin: replace the model selector with one that shows real brand marks per provider (DeepSeek, Zhipu, Xiaomi, OpenCode Go…), so same-named models on different providers are never confused. Theme-adaptive, OpenCode-flavored.
- Source
- weijianguizhou
- License
- MIT
- Updated
- Updated 21 days ago
Readme
# dsh-model-provider-badge
DSH(DeepSeek Harness)插件:用带**真实品牌标志**的模型选择器替换官方默认选择器,让 DeepSeek 官方、智谱、小米、OpenCode Go 等提供商里同名模型一眼可辨,不再混淆。
> 示例:`DeepSeek-official` 的 `deepseek-v4-flash` 和 `opencode-go` 的 `deepseek-v4-flash` 现在分别带有 DeepSeek 鲸鱼标和 OpenCode 终端窗标。
## 特性
- **真实品牌标志**:DeepSeek、智谱、小米、OpenCode 等使用官方/公开的品牌 SVG,未知提供商按 id 哈希着色的云朵兜底。
- **跟随 DSH 主题**:所有面板/文字/边框颜色取自 DSH 主题变量(`--dsw-*`),浅色/深色皮肤自动适配。
- **OpenCode 风格结构**:等宽字体、`> MODELS` 表头、`>` 勾选符、紧凑排版。
- **零侵入**:通过 slot 负优先级(`-10`)遮挡官方 seat,不修改任何官方代码。
- **变体解析**:`-vision` / `-official` 等分组 id 自动映射回基础品牌(如 `deepseek-vision` → DeepSeek)。
## 安装
在目标 profile 中作为 link 依赖安装并加入 bundle 层:
```bash
# 在 profile 目录执行(用 DSH CLI)
dsh plugin --profile desktop add link:/path/to/dsh-model-provider-badge
```
或在 `profiles/<name>/package.json` 手动加入依赖,并确保它出现在 `dsh.profile.bundles` 列表中。装完重启 DSH Desktop 即生效。
## 开发构建
```bash
npm install # 安装 esbuild
npm run build:client # 构建 client bundle 到 lib/client.js
npm run check # 语法检查
```
## 工作原理
1. 客户端 bundle(`lib/client.js`)以 `dsh.client.platform: web` 注册,由 harness 的 `ClientModuleRegistry` 扫描进 manifest,经 `/plugins/dsh-model-provider-badge/client.js` 下发到浏览器。
2. 插件在 `conversation.input.model` 单槽位注册,优先级 `-10`(官方为 `0`,数值低者渲染)从而遮挡官方组件。
3. 通过与官方相同的链路拉取模型目录:`connection.api.sessions.models({ sessionId })` 与 `connection.api.sessions.selectModel({...})`。
## 目录结构
```
src/client/ 客户端组件(index.js)、样式(styles.js)、品牌标志(badges.js)
src/host/ host 侧占位入口
scripts/ esbuild 构建脚本
lib/ 构建产物(client bundle)
cordis.patch.yml bundle 补丁:插入插件行
```
## License
MITInstall
dsh plugin --profile web add github:weijianguizhou/dsh-model-provider-badge
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-model-provider-badge from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.