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-model-select-test

v0.2.1

Published

DeepSeek Harness plugin: inline per-model connectivity test buttons and a one-click catalog update button in the composer model menu (patched derivative of @deepseek-ai/dsh-client-ui-model-selection).

Readme

dsh-model-select-test

模型菜单:每行「测试」按钮与行内耗时结果,组头「⟳ 更新模型」按钮

DeepSeek Harness 插件:在现有模型选择菜单里加入两件事——

  1. 每行一个「测试」按钮:就地测该模型的连通性,不切换当前模型、不关闭菜单、不写聊天记录。
  2. OpenCode Go 组标题右侧一个「⟳ 更新模型」按钮:一键让宿主拉取 OpenCode Go 官方目录并刷新菜单,与 dsh-opencode-go-catalog 插件配合使用(未安装时按钮会显示更新失败,其余功能不受影响)。

不新增页面、侧栏入口或统计面板。

行内测试

每行布局:模型名称 · 测试结果 [测试]

| 情形 | 行内显示 | |---|---| | 进行中 | 测试中…(该行按钮禁用,其他行不受影响) | | 成功 | ✓ 首字 1.1s · 总耗时 1.2s · 重试 0次 | | 上游 429 | ✗ 429 上游过载 · 重试 N次 | | 额度耗尽 | ✗ 额度不足 / ✗ 官方余额不足(与 429 明确区分) | | 密钥问题 | ✗ 密钥错误 / ✗ 未配置密钥 / ✗ 密钥无效 | | 网络类 | ✗ 连接超时 / ✗ 网络错误 / ✗ 上游 5xx | | 其他 | ✗ 空响应、✗ 上下文超限、✗ 超时中止 等 |

  • 结果紧凑显示、过长省略;悬停查看完整信息:本次思考强度、每次尝试的耗时与失败原因。
  • 成功以流式正常终结(stop)为准,不看 HTTP 200;无终结块立即报失败。
  • 首字时间 = 首个可见正文 delta 的时间;总耗时 = 点击到流终结,含等待与重试。
  • 重试沿用该 provider 注册的 retryPolicy(ctx.llm.providerRetryPolicy):可重试代码、maxRetries、Retry-After 上限、退避公式与 dsh-llm-retry 同一套;always 模式有 6 次硬上限并如实显示。
  • 测试走 ctx.llm.stream(),携带一次性 sessionId,让 OpenCode 这类按会话头路由的兼容层保持真实链路;不挂任何工具,输出上限保守。
  • 全程 45s 预算;到点报 超时中止 并附最后一次失败详情。
  • 结果与「提供商+模型」绑定,保留在本次页面运行周期内;不轮询、不持久化。

一键更新模型(OpenCode Go 组头)

  • 位置:opencode-go 分组标题右侧。
  • 点击 → ⟳ 更新模型 → 更新中… → ✓ 已是最新 / ✓ 已更新 +N -M(失败显示 ✗ 更新失败,悬停看原因)。
  • 更新后自动重载本会话模型目录,菜单即时反映新增/退役模型;不切换当前模型、不关闭菜单。
  • 该按钮调用 dsh-opencode-go-catalog 插件的 GET /x-opencode-go-catalog?refresh=1。

安装

plugin_manager action=install_bundle target=<本仓库目录>

安装后会:把 shipped 行 ui-model-selection 置为 disabled: true,并插入本包的一行派生实现——卸载/停用本 bundle 即自动恢复原菜单。

结构

package.json           dsh.client(与 shipped 相同的 inject 列表)+ exports ./client
cordis.patch.yml       禁用 shipped 行 + 插入本包行
build.py               从 shipped client.js 生成 lib/client.js(4 处定点手术)
lib/index.js           宿主:POST /x-model-test(webServer+connection 鉴权)
lib/client.js          生成的客户端(勿手改)
test/host.test.mjs     路由/重试/超时/分类的 15 项单测

重新生成客户端(DSH 升级后)

# 指向当前安装的 shipped 客户端
python build.py "<profile>/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js"
# 或
DSH_MODEL_SELECTION_CLIENT=".../lib/client.js" python build.py

build.py 做 4 处手术,锚点不唯一直接报错,不会静默错改:

  1. 模块 id 改为 dsh-model-select-test;
  2. 模型行 children 注入 ...dshModelTestCells(group, model);
  3. 模型分组渲染包一层 dshModelTestGroup(...)(一键更新按钮);
  4. 工厂尾部追加测试子系统(store、请求、class 组件、CSS)。

其余字节与 shipped 完全一致(键盘导航、搜索、effort 面板保持原行为)。

已验证(DSH 0.2.2-rc.1 实测)

  • 30 行模型 = 30 按钮 = 30 结果槽;搜索过滤后行数与按钮数同步。
  • 点击「测试」:菜单保持打开(busy 中与结束后均 aria-expanded=true),当前模型不变(触发器 label 与行 aria-checked 不变)。
  • 行内 ✓ 首字 1.1s · 总耗时 1.2s · 重试 0次,悬停含 effort 与每 attempt 明细。
  • 组头按钮:⟳ 更新模型 → ✓ 已是最新,菜单不关、模型不变。

许可证

MIT。lib/client.js 是基于 @deepseek-ai/dsh-client-ui-model-selection(MIT)的修补衍生版,上游版权归其作者,本仓库仅新增 build.py 中列明的补丁。

兼容性(重要)

lib/client.js 是从当前 DSH 里 shipped 的 @deepseek-ai/dsh-client-ui-model-selection 整份复制 + 定点插入得来的衍生 bundle,因此它与 DSH 的具体版本绑定:

  • 本版(0.2.1)基于 DSH 0.2.2-rc.3 的 shipped bundle 构建,engines.dsh 声明 >=0.2.2-rc.3。
  • DSH 升级后,shipped bundle 的压缩格式与结构会变(例如 0.2.2-rc.1 → rc.3 去掉了 useAnchoredPosition、把 children: model.name 改成了完全不同的排列),旧副本会失效。
  • 失效时典型症状:底部模型选择按钮整个消失(模块渲染抛错),而其他插件仍正常。

升级 DSH 后如何重建

从当前 app.asar 里取出 shipped bundle,再跑 build.py:

# 1. 取出 shipped client.js(路径示例,版本号以实际为准)
node asar-extract.cjs "%LOCALAPPDATA%\\..\\DeepSeek Harness\\resources\\app.asar" \
  get "dsh/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js" rc3-client.js

# 2. 重建(锚点不匹配时 build.py 会直接报错,不会产出半成品)
python build.py rc3-client.js

build.py 会校验每个锚点必须唯一,任何一处对不上就退出并说明缺哪个锚点, 不会静默跳过。适配 rc.3 所需的四处锚点已写进脚本常量。