返回目录
模型与 MCP 插件

dsh-plugin-update-checker

windrover/dsh-plugin-update-checker

A DeepSeek Harness plugin that adds a Check-updates button to the Plugins settings: scans every installed bundle for published updates and DSH-runtime compatibility, with a per-plugin update action.

Stars
0
Forks
0
Issues
0
更新
21 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:windrover/dsh-plugin-update-checker

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-plugin-update-checker

English · 中文

A DeepSeek Harness plugin that adds a Check updates button to the Built-in plugins settings section. Click it and the plugin scans every installed plugin bundle for (1) the latest published version on the npm registry and (2) its compatibility with the running DSH runtime — then shows one row per bundle.

It lives beside the read-only inventory tab and contributes no configuration of its own. It reports, and for any bundle with a published update it offers a single Update button. Enabling, disabling, or removing a bundle is still done in the sidebar Plugins page or via dsh plugin.

How the Update button works: the host drives the app's own plugin manager, and an update is two manager calls — removeBundle, then installBundle(<name>@<version>). One call is not enough: dsh 0.2.1's manager refuses add for a package that is already a profile dependency (already-installed, thrown before pnpm runs), which is exactly the shape of an update. The installed version is read back off disk afterwards, so a manager that reports success without writing anything surfaces as a failure instead of a version bump. One bundle is deliberately excluded: this plugin cannot remove itself, because removing it would unload the route serving the request — update it with dsh install-plugin dsh-plugin-update-checker@<version> instead.

✨ What it does

Check Source Notes
Update availability npm registry (latest dist-tag vs the installed version) Registry-only. Bundles installed from a tarball / git / path publish nothing, so they are reported as Unsupported rather than falsely Up to date.
Compatibility the bundle's @deepseek-ai/dsh* peerDependencies vs the running DSH version Reuses @deepseek-ai/dsh-app-boot's evaluatePluginCompatibility, the same helper the launcher applies on boot. An exact-version exemption granted in compatibility.json shows as Compatible (exempted).

Compatibility and update availability are computed independently — a slow or unreachable registry can never hide an incompatible peer range, and a local-only bundle still gets a compatibility verdict.

Which registry the scan asks: no longer a hardcoded registry.npmjs.org. The host reads the configuration itself (environment → the profile's .npmrc → the user's ~/.npmrc, first hit wins) and then probes the candidates concurrently, taking the first success. Three cases: nothing configured → race the launcher's mirror against the public registry; the public default configured (npm writes registry=https://registry.npmjs.org/ into ~/.npmrc on its own) → keep it and add the mirror behind it, since both are public and nothing leaks; anything else configured (a corporate or internal registry) → that one alone, never raced against a public registry, because racing would leak internal package names to third parties. The difference is large behind a slow link — measured on one machine, the public registry answered in ~11 s where a mirror answered in ~0.2 s, and racing means a slow registry cannot hold up a fast one even when it is listed first. A bundle that declares publishConfig.registry still uses that registry. The winning registry travels with the row and is reused by the one-click update, so the version is read from, and installed from, the same place.

The host half declares only webServer, and remote is a browser-side service; in this cordis version, touching an undeclared service throws (cannot get property ... without inject). The host therefore cannot ask the plugin manager for registries — reading the configuration, as above, is what that constraint requires.

📸 Where it sits

Open Settings → Built-in plugins. The section now has two tabs:

  • Plugin list — the read-only inventory (shipped by DSH).
  • Check updates — this plugin. It shows the running DSH version, a Check updates button, and the results table (plugin / installed / latest / compatibility / update).

The check is on demand: click the button, the host scans, and the table fills in. One broken manifest or an unreachable registry is isolated to its own row — it never blanks the whole report.

📦 Install

Option A — from npm (recommended)

dsh install-plugin dsh-plugin-update-checker

Installing from the registry matters for this plugin in particular: a github: install is pinned to a commit in the profile lockfile, so re-running the same spec never picks up a newer release, and the panel reports it as Unsupported (it can only compare registry versions). From 0.1.4 on, plain version numbers resolve normally and the panel's own Update button works.

Option B — from this GitHub repository

  1. Open the sidebar Plugins page → Add plugin.

  2. In the source field, enter one of these install specs (the launcher resolves them through installBundle, the same primitive the GUI uses):

    github:windrover/dsh-plugin-update-checker
    # or the full URL:
    https://github.com/windrover/dsh-plugin-update-checker
  3. Restart to load the new bundle:

    dsh check     # iron rule #1: preflight before restart
    dsh restart   # reloads the web profile; the new bundle loads
  4. Open Settings → Built-in plugins → Check updates → Check updates. The Check button's fetch('/api/plugin-update-checker/scan') runs inside the authenticated browser session, so it needs no manual token.

This repository is public, so installing directly from GitHub works without any extra authentication. On networks where registry.npmjs.org is unreachable, the launcher uses registry.npmmirror.com automatically.

Option B — local link (for development / editing the plugin)

  1. Clone the package where your profile can link it:

    # e.g. inside your DSH workspace
    git clone https://github.com/windrover/dsh-plugin-update-checker dsh-plugin-update-checker
  2. Link it into your profile. Add a link: dependency + a bundles entry to the profile manifest:

    // ~/.dsh/profiles/web/package.json
    {
      "dependencies": {
        "dsh-plugin-update-checker": "link:/abs/path/to/dsh-plugin-update-checker"
      },
      "dsh": { "profile": { "bundles": [ "…", "dsh-plugin-update-checker" ] } }
    }

    Then install. npm install rejects the link: protocol in this profile — use pnpm (the profile is a pnpm workspace), which is what dsh wires under the hood:

    cd ~/.dsh/profiles/web
    pnpm install --registry=https://registry.npmmirror.com   # link: deps don't hit the network

    dsh's wire_link_plugin_deps auto-symlinks any @deepseek-ai/* the plugin imports into its own node_modules, but it does not handle plain npm packages — so pre-link the one real dependency yourself (the documented link-plugin gotcha: a link: plugin can't resolve packages that aren't hoisted into its tree):

    mkdir -p dsh-plugin-update-checker/node_modules
    ln -sfn ~/.npm/_npx/<active-dsh-hash>/node_modules/semver \
            dsh-plugin-update-checker/node_modules/semver
  3. Restart and open it (dsh check && dsh restart, then the same Settings path as Option A).

🔌 How it is built

One bundle, two halves:

  • Host (lib/index.js → lib/host/update-checker.js) registers two routes. POST /api/plugin-update-checker/scan walks the profile's bundles from disk, reads each manifest, evaluates peer compatibility, and probes the registry. POST /api/plugin-update-checker/update takes { name, version, registry? } and runs the update through the host's pluginManager service (lib/host/update.js): attempt installBundle, and when the manager answers already-installed, removeBundle and install again — then read the installed version back. cordis.patch.yml adds the Loader row.
  • Browser (lib/client.js) registers a tab into the settings.plugins.tab slot of the Built-in-plugins section and renders the result with react (require("react")) and the design tokens DSH already exposes. It talks to the host routes only — it no longer reaches remote.pluginManager itself. The bundle id equals the package name — the contract dsh-client-modules enforces.

🧪 Test

npm test     # every test below, in order

test/client-contract.test.mjs pins the browser-half contract (id == package name, one settings.plugins.tab registration, renderable body). test/update.test.mjs pins the update orchestration against a fake manager (remove-then-install, the self-update refusal, which failure stops the sequence). test/update-route.test.mjs drives the route end to end on a throwaway profile, including the "manager says applied but the disk did not move" case. test/layering.test.mjs keeps the host split one-way and ctx confined to the entry module.

📝 Limitations

  • Reports and updates, does not toggle — it never enables, disables, or removes a bundle on its own initiative; the removal in an update is the manager's own two-step for that one bundle. A failed update is reported per row, not retried automatically.
  • Cannot update itself — the Update button is replaced by a clear refusal; use dsh install-plugin dsh-plugin-update-checker@<version> from a terminal, then restart.
  • Reports the runtime, never updates it — the DSH runtime row has no Update button in any carrier. On the desktop it reads Updated by the app and points at the menu bar; on a CLI/web host it keeps Update available and shows the npm install -g @deepseek-ai/dsh@<version> command. Naming the actor is deliberate: a button this panel cannot honour reads as a broken control.
  • Registry reachability — registry checks need network access to the configured registry; offline or firewalled hosts show Unknown per bundle.
  • Local / git / tarball bundles — publish no registry version, so their update status is Unsupported. Their compatibility is still evaluated from the local manifest.

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类模型与 MCP
规则置信度中

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek。