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-version-autoupdate

v0.3.21

Published

Draggable floating version capsule (restored from 0.3.7) + one-click update.

Readme

dsh-version-autoupdate

DSH (DeepSeek Harness) 双面 Cordis 插件:在 Web UI 中显示 DSH 版本角标(最新=绿 / 可更新=黄 / 待重启=蓝 / 失败=红 / 未知=灰),并支持一键自动更新

功能

  • 版本角标:右上角(会话头部工具栏)常驻显示当前运行版本的更新状态,每 60 秒自动刷新。
  • 状态判定:对比「当前运行 / 已安装 / 目标最新」,语义化版本比较(含 -rc.N 预发布段)。
  • 目标版本 = registry 最高版本:不依赖 npm latest 标签(历史上常滞后于真正最高版本),而是枚举 registry 全部版本取语义化最高者——因此从 DSH 0.1.0-rc.6 到未来的 0.6.x 都能被正确识别并追新。
  • 更新通道 channel(插件配置,可切):
    • preview(默认):最高版本,含预发布/rc(如 0.1.0-rc.8、未来 0.6.0-rc.N);
    • stable:只认不带预发布后缀的最高正式版;若暂无正式版则自动回退到 preview。
    • 面板会同时显示「预览最新 / 稳定最新 / 目标版本(按当前通道)」。
  • 一键更新:可更新时点击角标 → 面板 → 「⚡ 立即更新」,使用与当前 dsh 同 Node 目录的 npm(不再误用 PATH 里的 Cursor/旧 Node)执行 npm install -g @deepseek-ai/dsh@<target> → 显示实时进度 → 「更新完成 · 重启生效」。默认安装超时 10 分钟installTimeoutMs,小型 VPS 可调大)。内存不足(Linux MemAvailable < 400MB)时会拒绝安装,避免半装损坏。
  • 只读探测:拉取仅通过 subprocess + web 服务的只读链路;更新由用户点按钮触发,不静默后台安装。
  • 点击外部关闭:面板在点击任意非角标区域后自动关闭(无 × 按钮)。

架构

  • Host 面src/index.ts):纯逻辑 + 服务消费(fs / subprocess / web / sandboxPolicy / timer / webServer)。通过 webServer.register 暴露同源 JSON API:
    • GET /dsh-version-updater/status
    • POST /dsh-version-updater/start-update
  • Client 面src/client.tsx):通过 exports["./client"] 分发,注册到会话头部工具栏槽位,调用上面的 JSON API 渲染角标与面板。

安装

npm i -g dsh-version-autoupdate
# 在 cordis.yml 中写入一行:
# - id: dsh-version-autoupdate
#   name: 'dsh-version-autoupdate'

验证边界(重要) Host 面的版本探测与更新逻辑通过真实的 DSH Service 接口实现,并已在本仓库做单测烟测。Client 面遵循 DSH 官方双面插件布局(dsh.client + exports["./client"]),槽位与 JSON 通信按当前版本接口实现,但在你的目标 DSH 版本上可能需按该版本的槽位键/契约微调。请以目标部署的实际 dsh install 结果为准。

使用

安装并加载插件后:

  1. 重启 dsh web 服务,右上角出现版本角标。
  2. 角标颜色含义见上。
  3. 当显示「可更新」时点击角标 → 面板 → 「⚡ 立即更新」,等待完成。
  4. 完成后提示重启 dsh web 进程使新版本生效(运行中的进程无法安全自重启)。
  5. 想切换更新通道(预览/稳定)在 DSH 插件配置里把 channel 改为 previewstable 后重启即可。

配置(cordis.yml / cordis.patch.yml)

| 字段 | 默认 | 说明 | |------|------|------| | packageManager | npm | 固定用 npm;也可 pnpm / yarn / auto | | packageManagerPath | — | 推荐在 2G VPS 上显式指定,如 /home/ubuntu/.local/node-v22.19.0/bin/npm | | minAvailableMemoryMb | 400 | Linux 可用内存低于此值时拒绝更新(0 关闭) | | installTimeoutMs | 600000 | 全局安装最长等待时间(毫秒),默认 10 分钟;慢速 VPS 可调到 900000(15 分钟) | | installGraceMs | 60000 | 超时后 SIGTERM 的宽限期(毫秒) | | channel | preview | stable 只追正式版 |

- id: dsh-version-autoupdate
  name: dsh-version-autoupdate
  config:
    packageManager: npm
    packageManagerPath: /home/ubuntu/.local/node-v22.19.0/bin/npm
    minAvailableMemoryMb: 400
    installTimeoutMs: 900000   # 15 min on slow 2G VPS

更新超时

若面板显示「更新超时(600 秒)」且 npm 日志仍在 http fetch,说明安装未失败,只是超过了默认等待时间。可:

  1. 在插件配置中增大 installTimeoutMs(如 900000)后重启 dsh web 再试;
  2. 或 SSH 到服务器手动执行(使用与 dsh 同 Node 的 npm 绝对路径):
/home/ubuntu/.local/node-v22.19.0/bin/npm install -g @deepseek-ai/[email protected] --no-audit --no-fund --omit=optional

超时不等于 dsh 已损坏;只有安装命令非零退出且 dsh 无法启动时才需要回滚到旧版本。

npm install -g 中途被 OOM 杀死,dsh 可能每 5 秒崩溃重启。在控制台 VNC 登录后执行:

/home/ubuntu/.local/node-v22.19.0/bin/npm install -g @deepseek-ai/dsh@<上一个正常版本>
# 或
npm install -g @deepseek-ai/dsh@latest   # 确认 which npm 指向正确 Node

开发

npm install
npm run build     # 先构建 client bundle (lib/client.js),再 tsc 编译 host (lib/)
npm test          # 构建校验

许可

MIT