npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-better-model-selector

v1.0.0

Published

DSH web plugin: splits the composer model selector into two independent controls — a searchable, favorite-marking model dropdown and a reasoning-effort slider — plus Ctrl+P (cycle favorite models) and Ctrl+T (cycle reasoning effort) shortcuts.

Downloads

112

Readme

dsh-better-model-selector

npm version

改造对话界面(composer)的模型选择器:把原来「模型 + 思考强度」集成在一个二级菜单里的组件,拆成两个可以单独设置的独立控件。

  • 模型选择器:保持下拉选单,但增加搜索和**标记喜爱(收藏)**功能。
  • 思考强度选择器:改成滑动条样式,更直观。
  • 快捷键:
    • Ctrl/Cmd + P — 快速切换模型,在收藏模型中轮换。
    • Ctrl/Cmd + T — 轮换思考强度。

原理

插件覆盖内置的 conversation.input.model slot(以更低优先级 -1 遮蔽内置的 ModelSelect,后者注册优先级为 0),并用同一个会话级 ModelDirectory(ctx.modelDirectories,由 @deepseek-ai/dsh-client-ui-model-selection 提供)读写模型与推理强度。因此它和 /model 命令弹窗共享同一份状态,任意入口切换后另一入口立即同步。

收藏列表持久化到主机级 cookie(dms_favs,path=/,约 1 年有效期),仅本地保存、不写入会话。之所以用 cookie 而不是 localStorage:localStorage 按「协议 + 主机 + 端口」隔离,而 dsh web(dshdeck)每次重启端口会变,旧端口的 localStorage 就找不到了;cookie 只按主机隔离,跨端口依然可见。首次读取会自动迁移旧版 cookie(dmt_favs)与旧版 localStorage(dsh-model-toolbox:favorites:v1)里的收藏。

安装

前置:DSH 已初始化 web profile(dsh web 能正常运行),Node.js ≥ 20。

⚠️ 依赖 DSH 的 next 通道:peerDependencies 指向 @deepseek-ai/* ^0.1.0-rc.6(npm 上的 next dist-tag)。若你的 DSH 走 latest(0.0.1-rc.x),可能不满足依赖、缺少本插件所需的 modelDirectories 服务。

npm 安装(推荐,自动挂载):

dsh plugin --profile web add dsh-better-model-selector

该命令会自动:登记依赖 → 识别包内 dsh.bundle.patch(cordis.patch.yml)→ 注册进 dsh.profile.bundles 完成挂载。装完重启 dsh + 硬刷新浏览器(Cmd/Ctrl+Shift+R)即可。

若报 minimum release age(发布不足 24 小时),重跑一次即可(pnpm 会自动补 minimumReleaseAgeExclude)。

从源码安装(开发):把本目录拷贝/软链到 ~/.dsh/profiles/web/node_modules/dsh-better-model-selector,并在 ~/.dsh/profiles/web/cordis.patch.yml 追加:

- insert:
    - id: dsh-better-model-selector
      name: dsh-better-model-selector

然后重启 dsh web + 硬刷新。

旧版本迁移(手动挂载 → npm 通道)

若之前通过「源码目录 + 手动挂载行」安装,切到 npm 通道时按顺序执行(跳过 1、2 步会双挂载:两个 host 半、出现两份 UI):

  1. 删除手动挂载行:编辑 ~/.dsh/profiles/web/cordis.patch.yml(早期全局安装可能是 ~/.dsh/cordis.patch.yml),删除 dsh-better-model-selector 对应的 - insert: { id: ..., name: ... } 段。

  2. 删除旧包实体:

    Remove-Item -Recurse -Force "$HOME\.dsh\profiles\web\node_modules\dsh-better-model-selector"
  3. 官方 CLI 安装 npm 版:dsh plugin --profile web add dsh-better-model-selector

  4. 重启 dsh + 硬刷新。

收藏/凭据不受影响(收藏存于主机级 cookie,与安装方式无关)。

结构

dsh-better-model-selector/
├── package.json       # dsh.bundle.patch + dsh.client + exports["./client"]
├── cordis.patch.yml   # 自动挂载补丁(insert 条目)
└── lib/
    ├── index.js       # host 半(纯客户端插件,空 apply)
    └── client.js      # 浏览器半:模型下拉 + 搜索/收藏 + 思考强度滑动条 + 快捷键

已知限制

  • 思考强度滑动条仅在当前模型公布推理强度元数据时显示(与内置行为一致)。
  • 已寻址子代理(subagent)会话不提供模型选择,控件隐藏、快捷键失效(与内置行为一致)。
  • Ctrl+P/Ctrl+T 仅当存在当前会话时接管按键;无会话时不拦截浏览器默认行为(Ctrl+T 新建标签页等)。