Skip to content

dsh-model-select-plus

Verified

dsh-model-select-plus · v0.1.7 · MIT · Web UI

A richer model-selection popup for DeepSeek Harness: provider-grouped models with descriptions, inline reasoning-effort chips, search and pinned favorites — replaces the composer's default ModelSelect.

Install

dsh plugin add dsh-model-select-plus

Confirm the layer applied with dsh --profile default --dump-config — see the install guide.

Source

Published to npm without a public repository. Inspect the package contents before installing.

Tags

Readme

dsh-model-select-plus

对 DeepSeek Harness 网页端 模型选择弹窗(composer 左下角 conversation.input.model 座位)的信息增强式重写,打包为一个可安装、可发布到 npm 的 dsh 插件。

特性

  1. 信息增强:模型按 provider 分组,行内显示名称、2 行截断描述;推理等级以 chips(含“默认”)呈现,悬停可见说明。
  2. 推理等级一键切换:行内点等级 chip 即切换模型+推理等级,无需二级钻取。
  3. 搜索:按模型名 / 描述 / provider 过滤,带放大镜图标与清除按钮。
  4. 收藏置顶:行首星标收藏,收藏项置顶为独立分组(插件生命周期内的浏览器内存保存)。
  5. 分组折叠:非当前模型选中组默认折叠,仅当前模型所在组默认展开;点击分组标题即可折叠 / 展开,行尾带数量指示;手动折叠状态在菜单开合间保留,切换模型后自动展开新组;搜索时自动展开全部,避免匹配项被隐藏。
  6. 模型组快捷 Tag 导航:搜索栏下方是单行横向滚动的模型组标签条(含“收藏”,星标图标),不再包裹成多行、也不再重复组内数量(数量只出现在分组标题右侧);当前模型所在组描边高亮并自动滚入视野;点击任意 Tag 只展开该组并折叠其余组,同时平滑滚动定位;输入搜索词时标签条自动收起,把高度让给结果。
  7. 供应商/模型显示:composer 触发按钮显示当前选择为 供应商/模型 格式,供应商取组显示名(缺失时回退 provider id)。
  8. 视觉与布局:沿用 DSH 自带菜单/输入框的视觉语言——--dsw-menu-surface-fill + --dsw-menu-backdrop-filter 的半透明浮层、--dsw-elevation-prominent 描边投影、16px 卡片圆角、32px 搜索框;触发按钮对齐 composer 同排控件(13/20、28px 高、长名称省略),面板宽 384px。分组标题滚动时吸顶(不透明填充,行不会透出),底部常驻条显示当前模型 + Esc 提示。打开时按触发按钮在视口内的剩余空间决定向上/向下弹、收敛高度并把左右夹在视口内(短窗口不再被 composer 的滚动容器裁掉顶部),搜索框自动聚焦、Esc 关闭并把焦点还给触发按钮。浅/深色均走主题令牌;所有图标为手绘 SVG,不用文字字符充当图标。

安装

把本包加进 dsh profile 的依赖即可(配合 dsh.bundle.patch 自动挂载 host / client 双侧):

# 在 dsh profile 目录里
pnpm add dsh-model-select-plus
# 或
npm i dsh-model-select-plus

重启 dsh web 后,composer 的模型选择框即被替换。

  • Host 侧(exports .)通过 cordis.patch.yml 挂载,向宿主 webserver 注册 GET /plugins/dsh-model-select-plus/api/catalog 与 POST /plugins/dsh-model-select-plus/api/select。
  • Client 侧(exports ./client)由 dsh.client 注入加载,替换 conversation.input.model 占位(priority: -1)。

两个 API 都调用宿主的 ctx.sessionController——这是 0.1.2 里取代已删除 apiProxy.sessions 的 Remote 服务,modelCatalog() 列出当前可路由的模型目录,selectModel() 经 llm.resolveCallConfig 校验后设置会话 Agent 的实时选择引用并保存默认模型。

数据路径

浏览器 (client bundle)
  └─ fetch /plugins/dsh-model-select-plus/api/{catalog,select}
       └─ host plugin (ctx.webServer)  →  ctx.sessionController.{modelCatalog,selectModel}

(持久化插件避免动态插件的 harness/host 内建,采用与 plugin-dashboard 相同的 webserver+fetch 模式。)

开发

pnpm install          # workspace 安装
pnpm run build        # esbuild 打包 src/client.js → lib/client.cjs,并拷贝 host 到 lib/
pnpm run smoke        # 校验 lib/ 产物

lib/ 为构建产物、已被 .gitignore 忽略;npm publish 会在 prepublishOnly 阶段自动构建。

发布到 npmjs

# 首次:登录
npm login

# 在包目录
npm publish

publishConfig 已设为 access: public + registry: https://registry.npmjs.org/。

License

MIT