nmbzth/dsh_update_check

1. Check on startup — checks the official repository 3 seconds after the page loads (and again on connection/reset). 2. Based on the official GitHub repo — tries releases/latest API → tags API → releases page HTML in order, with a 10 s timeout; tags with a dsh-v prefix parse correctly (semver-style comparison, including rc/beta prereleases). 3. Network failure notice — when GitHub is unreachable, the top banner shows "Cannot reach GitHub, check failed" with Retry / Close.

catalog 简介 / catalog descriptioncatalog description:dsh_update_check是一个dsh插件,能自动检查dsh官方上游仓库比对差异,并提示更新。由于预览版的更新常具破坏性,可能不兼容旧文件导致出错,所以不提供安装功能...... Dynamic Cordis plugin for DeepSeek Harness update checking.

项目介绍Project Overview

dsh_update_check 是 DSH 插件,启动时访问官方 GitHub 仓库,按 releases API、tags API、网页 HTML 回退比较版本,顶部横幅提示新版本,并在设置中提供独立更新页;还依据 semver 与发行说明关键词分级提示破坏性更新。适用于全局 npm 安装的 DSH;pnpm、bun 或源码安装可能无法读取本地版本,GitHub 匿名接口也有每小时 60 次限制。

dsh_update_check is a DSH plugin that checks the official upstream DeepSeek Harness repository on startup and on connection reset, using the releases API, tags API, and HTML fallback. It shows persistent update banners, provides a dedicated Settings page, and grades possible breaking changes through semver and release-note keywords. Use it to track DSH updates. Caveat: local version detection works best with global npm installs, and anonymous GitHub API requests are limited to 60 per hour per IP.

或使用命令行安装(适合开发者)Or use CLI install (for developers)

命令行安装CLI Install

dsh plugin --profile web add github:nmbzth/dsh_update_check

nmbzth/dsh_update_check 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

中文 README · English

dsh_update_check

dsh_update_check is a DSH plugin that automatically compares the official upstream DeepSeek Harness repository and prompts you when an update is available.

License: MIT

Features

  1. Check on startup — checks the official repository 3 seconds after the page loads (and again on connection/reset).
  2. Based on the official GitHub repo — tries releases/latest API → tags API → releases page HTML in order, with a 10 s timeout; tags with a dsh-v* prefix parse correctly (semver-style comparison, including rc/beta prereleases).
  3. Network failure notice — when GitHub is unreachable, the top banner shows "Cannot reach GitHub, check failed" with Retry / Close.
  4. Persistent update reminder — "New version: current X → latest Y" with Later, no auto-dismiss timer (only clicking closes it). After clicking Later, the same version never pops up again (not even from the settings page's manual "Check now"); it only reappears when a new version (latest changes) is published.
  5. Dedicated settings page — a standalone "↑ Check for updates" page in Settings (same level as General / Models / Plugins, listed last), showing current version / latest version / last check / status, with a "Check now" button.
  6. Breaking-change warning (important) — DSH has announced future breaking updates that may be incompatible with older plugins. The plugin detects breaking updates with two signals, graded:
    • Semver (deterministic): major change, or minor change during 0.x.
    • Official release notes: keyword matching, graded:
      • Strong signals (breaking change, 破坏性更新, 破坏…兼容, etc.) → yellow highlight + ⚠️ "Breaking update detected";
      • Weak signals (incompatible, migration, removed, deprecated, 不兼容, 迁移, 移除, etc.) → yellow highlight + ⚠️ "Possibly breaking update", and the details page lists the matched keywords and the original snippets for you to verify.
    • Risk details are informational only ("Learn the risk" → "Got it").

Installation

Static plugin

The plugin is distributed as the npm package dsh-update-check (plugin/ directory) and is mounted into the host composition, loading automatically when DSH starts:

  1. Install the package: copy the plugin/ directory into your profile's node_modules (Windows default: C:\Users\<you>\.dsh\profiles\<profile>\node_modules\dsh-update-check\, containing package.json + lib/);

  2. Mount it: edit that profile's cordis.patch.yml and append:

    - insert:
        - id: upd-check
          name: 'dsh-update-check'
    
  3. Restart DSH: it takes effect without any manual loading and stays resident (no reinstall needed after DSH updates).

Note: the Host exposes GET /upd-check/api/check through the host webServer (the Host declares inject: ['webServer'] as a hard dependency so routes register after the service is ready). The browser client bundle (ModuleLoader format) is auto-bundled by dsh's client-modules via exports["./client"] + the dsh.client field in package.json; it mounts the shell.overlay banner and registers the dedicated "Check for updates" page (settings.section, same level as General / Models / Plugins).

How it works

Side Responsibility
Host (plugin/lib/index.js) Fetches GitHub official APIs, reads the locally installed version (npm ls -gnpm root -g + read package.json), compares versions, and grades breaking-change signals.
Client (plugin/lib/client.js) shell.overlay top banner + the dedicated Settings page (settings.section); shows update reminders, breaking-risk details with matched keyword snippets, and network errors.
Communication webServer HTTP route (/upd-check/api/check) + same-origin fetch

Three-level network fallback:

  1. web.fetch (when a fetch provider is mounted);
  2. subprocess running node - (script fed via stdin) with the standard fetch (auto-follows redirects);
  3. When the first two fail (typical case: hosts hijacked by third-party tools such as Steamcommunity302 pointing github.com at 127.0.0.1 with a self-signed cert) → the script resolves real IPs via dns.resolve4, connects directly with servername/Host headers, manually follows redirects, and retries IP by IP.

Compatibility and known limitations

Item Status Notes
Windows / macOS / Linux Shell fallback chain (cmd.exesh); node resolution tries nodenode.exe; no hard-coded paths
DSH installed via npm globally Local version read via npm ls -g @deepseek-ai/dsh / npm root -g
pnpm / bun / git clone installs ⚠️ Local version may be unreadable; banner shows "Latest version X (cannot read local version)"; remote check is unaffected
hosts hijacking (Steamcommunity302 etc.) Built-in DNS direct-connect bypass
Deployments without a fetch provider Node direct-connect fallback
GitHub anonymous API rate limit ⚠️ 60 req/h/IP; one auto-check per page load plus on-demand manual checks are usually enough
DSH version adaptation ⚠️ Slot names (shell.overlay, settings.section) verified against 0.1.0-rc.x; if the slot tree changes in future versions the UI simply won't mount (no crash), and Host checks keep working
Breaking-change detection Semver detection is deterministic; release-note keywords are graded (strong → breaking; weak → yellow warning with matched keywords and snippets)
Static plugin Auto-loads with DSH; no reinstall after DSH restart/update; Host has no harness, uses same-origin webServer HTTP (localhost only)

Troubleshooting

  • "Cannot reach GitHub" all the time: check C:\Windows\System32\drivers\etc\hosts for hijack lines mapping github.com / api.github.com127.0.0.1 (common with Steamcommunity302 and similar tools); delete those lines (admin rights) or rely on the built-in DNS bypass, then click Retry.
  • Plugin not working: confirm node_modules/dsh-update-check exists, the cordis.patch.yml line is present, and restart DSH; check GET /upd-check/api/check returns JSON.
  • No "Check for updates" page in Settings: make sure the client bundle was scanned (restart + refresh); the page is a top-level Settings page (same level as General/Models/Plugins).
  • "Cannot read local version": DSH is not installed as a global npm package; the remote version still displays normally.
  • The banner reappears after "Later": the client remembers the ignored version; the same version won't pop up again after connection resets, page reloads, or even settings-page manual checks. The banner only reappears when a new version (latest) is published.
  • Settings "Check now" pops the top banner: manual checks only update the Settings page state and no longer pop the top banner; the top banner is reserved for auto-checks and banner actions (Retry).
  • Yellow warning false positives/negatives: breaking detection primarily relies on semver (deterministic); release-note keywords are a best-effort supplement. Weak signals only say "possibly" and show the original snippets for verification; if the official notes don't contain the keywords, a release-notes signal may be missed, but the version signal still covers it.

Development & contribution

  • Plugin source: plugin/ directory = the npm package dsh-update-check (lib/index.js Host + lib/client.js browser bundle).
  • Local validation: node scripts/check-src.js (syntax + contract checks; CI runs the same).
  • Issues and PRs are welcome.

License

MIT © nmbzth

上一个 Prev dsh-opencode-go-quota 下一个 Next dsh-habit