Back to home@d4go

dsh-checker

No description

Stars
1
Language
JavaScript
Created
Aug 19, 2026
Updated
Aug 19, 2026
GitHub repo

Introduction

dsh-checker

English | 中文

Update checker for DeepSeek Harness (dsh).

It adds a Check for updates button to the Web UI session header — right before the shipped Session log button, wearing the exact same style — and opens a centered dialog with the result:

  • already the latest release → a short confirmation;
  • newer release on npm → the version delta plus the exact upgrade commands for your platform (Linux / macOS / Windows), each with a one-click copy button;
  • lookup failed → the error, so you know the check actually ran.

The dialog is bilingual (中文 / English) and follows the language configured in dsh settings (locale.preference), falling back to the browser's language the same way the dsh UI itself does.

How it works

dsh-checker is a Cordis host plugin with three moving parts:

PieceRole
lib/main.jsStable loader shim (never edit). Imports lib/plugin.js?bust=<config.bust> so a config-only patch reload hot-deploys new code without restarting dsh.
lib/plugin.jsRegisters GET /dsh-checker/status (installed vs. latest version, platform-appropriate commands, configured locale) and GET /dsh-checker/banner.js, and injects the script tag into the served index.html.
lib/banner.jsBrowser UI, read from disk on every request: places the header button before Session log (borrowing its CSS class verbatim), renders the centered modal, runs a silent cached check on page load, and handles copy/dismiss.

Version detection resolves the installed @deepseek-ai/dsh package from the running process itself (entry-script anchors plus well-known global npm roots), so it works for global installs on Linux, macOS and Windows. The latest release comes from the npm registry with a 30-minute host-side cache; an explicit button click always bypasses the cache.

The upgrade command defaults per platform and can be overridden per deployment. Only the install command is shown by default — dsh is not necessarily registered as a service on the host, so no restart command is assumed; when it is missing, the dialog shows a plain note to restart whatever runs dsh instead:

PlatformInstall (default)
Linuxsudo npm install -g @deepseek-ai/dsh@latest
macOSsudo npm install -g @deepseek-ai/dsh@latest
Windowsnpm install -g @deepseek-ai/dsh@latest

Running dsh under a service manager? Set restartCommand in the entry config (e.g. systemctl --user restart deepseek-dsh-web) and it is shown as the second, copyable command.

Install

Requirements: dsh 0.1.0-rc era builds with the webServer service (any recent release), Node ≥ 22.

Option A — clone and mount (quick start)

git clone https://github.com/d4go/dsh-checker.git ~/dsh-checker

Append to ~/.dsh/cordis.patch.yml (or a profile's cordis.patch.yml), fixing the path:

- insert:
    - id: dsh-checker
      name: /home/you/dsh-checker/lib/main.js
      config:
        bust: 1

The user patch layer is hot-watched: save the file and the plugin mounts without restarting dsh. Refresh the page.

Option B — install into the profile as a package

dsh plugin --profile web add github:d4go/dsh-checker

then mount it with a profile-relative name:

- insert:
    - id: dsh-checker
      name: ./node_modules/dsh-checker/lib/main.js
      config:
        bust: 1

Configuration

Entry config keys:

KeyDefaultMeaning
bust0Bump to hot-deploy edits of lib/plugin.js.
installCommandplatform defaultOverrides the upgrade command shown first.
restartCommand(none)Optional second command for deployments that run dsh under a service manager; set "" to hide it.
previewUpdatefalsePreview mode: pretend a newer version exists (no registry lookup) so the upgrade dialog can be tried out.

HTTP surface

  • GET /dsh-checker/status — JSON: { ok, platform, locale, current, latest, upToDate, commands, checkedAt } (add ?refresh=1 to force a fresh registry lookup).
  • GET /dsh-checker/locale — JSON: { ok, locale }; the banner polls it so the UI language follows dsh settings live.
  • GET /dsh-checker/banner.js — the UI script.

Uninstall

Remove the insert block from your patch file (hot-applied), then delete the clone. Everything lives outside the dsh installation, so dsh upgrades neither touch nor require it.

Development

  • lib/banner.js edits: refresh the page — no bump, no reload.
  • lib/plugin.js edits: bump bust in the patch config — the shim imports a fresh module URL through config-only HMR.
  • npm run check syntax-checks all three modules.

License

MIT