dsh-model-provider-badge
A DeepSeek Harness (DSH) web client plugin that shows the active model
provider name in the composer, beside the stock model selector — so when you
use a non-official model you can see at a glance which provider it comes from,
e.g. opencode-go.
It is a pure browser-side UI plugin (a dsh.client row). It adds a small
read-only badge into the additive conversation.input.right seat (bottom-right
of the input, next to the model selector, left of the send button) and reads the
same per-session model directory the stock selector uses, so it stays in sync
when you switch model/provider.
Requirements
- A DeepSeek Harness install with the Web profile (the browser GUI).
- The stock model-selection plugin
@deepseek-ai/dsh-client-ui-model-selection
(it is part of the default Web composition and provides themodelDirectories
client service this badge reads). If that plugin is disabled the badge renders
nothing rather than erroring.
What it looks like / where it appears
... model selector [ opencode-go ] [ send ]
The badge is styled to match the stock model label (13px / weight 500 /
var(--dsw-alias-label-secondary)), truncated with an ellipsis beyond 140px,
and its full value is available as a tooltip.
Package layout
dsh-model-provider-badge/
├── package.json # dsh.client + dsh.bundle.patch declarations, exports["./client"]
├── cordis.patch.yml # dsh.bundle.patch layer: auto-inserts the plugin row on install
├── lib/
│ ├── index.js # host half: empty apply() so the host Loader sees the entry
│ └── client.js # web half: window.__ModuleLoader__.load({ id, factory }) — 唯一实现
├── README.md / README.zh.md / LICENSE / .gitignore
lib/ is the single source of truth (no separate src/), mirroring the official
DeepSeek Harness client-plugin standard:
package.jsondeclares"dsh": { "client": { "platform": "web" }, "bundle": { "patch": "./cordis.patch.yml" } }
andexports["./client"]pointing at the web bundle.cordis.patch.ymlis thedsh.bundle.patchlayer: the official CLI adds this
package to the profile's bundle stack and the patch inserts the plugin row at
startup — no manual profile editing.lib/index.jsprovides an emptyapply()so the package appears as a host
Loader entry (see the node half of any shippeddsh-client-ui-*package).lib/client.jsregisters itself with the shell module loader
(window.__ModuleLoader__.load({ id, factory }),id= package name) and
exports a Cordis plugin{ inject: ["slots"], apply }.
安装 / 使用(另一台电脑同样适用)
前置要求:DSH 已安装(dsh web 可启动),Node.js ≥ 20,pnpm ≥ 10。
方式一:本地 tarball(无需发布)
在包目录打包:
cd dsh-model-provider-badge
pnpm pack
得到 dsh-model-provider-badge-0.1.0.tgz,复制到目标电脑后安装:
dsh plugin --profile web add ./dsh-model-provider-badge-0.1.0.tgz
方式二:发布到 npm 后安装
cd dsh-model-provider-badge
pnpm publish
dsh plugin --profile web add dsh-model-provider-badge
方式三:Git 仓库
dsh plugin --profile web add git+https://github.com/<you>/dsh-model-provider-badge.git
安装完成后重启 dsh web 进程,新的 client bundle 才会进入页面启动清单(
window.__DSH_BOOT__)。
首次添加新浏览器插件时,首次会话可能在界面中需要批准该 Client 包。
卸载
dsh plugin --profile web remove dsh-model-provider-badge
然后重启 dsh web 进程。
Behavior details
- Reads
ctx.modelDirectories.directoryFor(sessionId).storeand displays
current.provider(e.g.opencode-go). - Subscribes to the directory store, so it updates when you change model/provider
in the stock selector. - Loads the directory if it is idle, so the badge appears without you opening the
selector first. - Works in normal (non-addressed) sessions. For addressed subagent sessions the
directory is unavailable and the badge renders nothing.
License
MIT