Перейти к основному содержимому
H

dsh-update-copilot

hezhongtang/dsh-update-copilot

Update copilot for DeepSeek Harness: one scan covers the dsh core, official bundles, and every profile plugin; explains what changed and how risky each update is, then updates only what you confirm.

Установка

dsh plugin --profile web add github:hezhongtang/dsh-update-copilot

README

dsh-update-copilot

License: MIT DSH core Zero build GitHub stars

An update copilot for DeepSeek Harness: tracks the dsh core, shipped bundles, and every installed profile plugin — then helps you decide, and only then updates.

The Update Copilot popup: core packages, per-plugin rows behind-first, up-to-date rows folded away.

English | 中文

Why this exists

DSH moves fast, and so does its plugin ecosystem. Every profile installs plugins through pnpm specs — npm versions, GitHub commit pins, local link: checkouts — and each channel drifts out of date in its own way. Checking them by hand means walking every repo; auto-updating everything blindly means trusting third-party code with your environment.

This plugin takes the middle path: detect everything, summarize what changed, update only what you confirmed. The DSH core is deliberately report-only — upgrading the harness restarts every session, so that decision stays with a human.

Features

🔭 Full radardsh core + shipped bundles (dsh-base, dsh-web-app) + every profile's plugin dependencies, in one scan
🔄 Dual channelnpm registry versions (full semver compare, prerelease-aware) and git upstreams (pinned-commit vs HEAD, link: checkouts via read-only ls-remote)
🧭 Update highlightsPer-item: semver distance, risk level (major → high, minor → medium, patch → low), changelog material — npm versions between yours and latest, GitHub compare commits, release notes (with their body rendered inline), or local git log; every artifact links out (npm version pages, commits, releases, compare views) and every row carries a ↗ to its repository — monorepo sub-packages link to their subdirectory, npm plugins without a resolvable GitHub repository fall back to their npm package page
🤖 Agent toolsupdate_copilot_scan / update_copilot_brief / update_copilot_update — ask your agent "any updates?" and get an honest, data-backed answer
🖥 Web surfacesA sidebar trigger beside Settings (with a lazy badge: the behind-plugin count appears only after the first popup open — no background polling; the badge can be turned off in settings for a quiet sidebar) opens a compact popup — behind rows first, up-to-date rows folded; the full page lives on in Settings → Update Copilot with inline update highlights and two-step confirm updates; updates stream live progress over SSE (resolving / downloading / retrying / stash / pull / restore phases) straight into a per-row progress bar
🛡 Update guardrailsSame-origin POST + explicit confirm, strict target allowlist, single-flight lock, 5-minute timeout; npm/github specs run only through the official dsh plugin CLI, link: checkouts update via git pull in their own directory (auto-stash → pull → restore; conflicts are always handed back for manual handling), file: and official @deepseek-ai/* installs are refused
🌐 Fully bilingualEvery user-facing string — panel, popup, badges, update highlights, recommendations, update errors — follows the UI language (zh/en); the agent tool path keeps stable English identifiers

Install

# from npm (recommended)
dsh plugin --profile web add dsh-update-copilot

# or straight from the GitHub repo
dsh plugin --profile web add github:hezhongtang/dsh-update-copilot

Restart dsh web, then open Settings → Update Copilot. Works the same in any other profile (--profile <name>).

Usage

Ask your agent

"check for updates"

The agent runs update_copilot_scan, then builds a brief for each outdated item and presents the risk before doing anything. Updates run only after you say yes — the update tool rejects calls without confirm: true.

Or use the popup / panel

The sidebar button beside Settings opens the compact radar popup (ESC or backdrop click closes; ?duc=1 in the URL opens it once — handy for screenshots and tests). Settings → Update Copilot is the full page: core status (with a copyable upgrade command — never executed), every profile's plugins with current → latest versions, inline update highlights, and a two-step confirm button per update. After an update, a plugin in the running profile is hot-reloaded in place when its entry and bundle patch are unchanged; the restart banner is only shown for updates outside the phase-1 hot-reload scope (bundle-patch changes, non-current profiles, self-update, etc.).

Agent tool reference

ToolRead/WritePurpose
update_copilot_scanreadFull scan across core + all profiles (10-min cache, force to bypass)
update_copilot_briefreadSemver distance, risk, changelog material, recommendation for one item
update_copilot_updatewriteExecute one confirmed update: npm/github specs through the official dsh plugin CLI (failed/timeout attempts retry automatically — 3 total, 1s/3s backoff); link: checkouts via git pull inside their own directory (auto-stash → pull → restore, conflicts handed back for manual handling), or with source: "remote" switch the dependency to the published npm version (or a github: spec when the package is not on npm) — breaking the local link

How it works

Each dependency spec is classified into a channel, and each channel has its own comparison:

ChannelExample specCurrentLatest
npm^0.1.4installed package.json versionnewest version in the full registry doc
githubgithub:owner/repo#shapinned commit in pnpm-lock.yamlupstream HEAD via GitHub API
linkedlink:../my-pluginlocal git rev-parse HEADgit ls-remote origin HEAD (read-only)

The npm channel deliberately ignores the latest dist-tag: monorepo sub-packages often leave that tag stale, which false-flags installs that are actually newer than the tag. Versions are compared with full semver precedence (prereleases included), so 0.1.0-rc.6 > 0.1.0-rc.5 and 1.0.0 > 1.0.0-rc.1 both hold.

Updates execute through two vetted paths, never a raw shell string: npm/github specs run dsh plugin --profile <p> add <target> — the same path a human would type — with the target string validated against an allowlist; link: checkouts run git directly in their directory (git stash push for local changes → git pullgit stash pop to restore them). Failed or timed-out pulls are retried automatically: 3 total attempts by default, with 1s/3s backoff; merge conflicts or failed restores are never auto-resolved — the result reports attempts, a stash summary, and the last output.

A link: checkout can also be switched to a remote source: the copilot replaces the dependency spec with the newest published npm version (npm registry first), or with github:owner/repo#<origin HEAD> when the package has no npm release. The local link breaks and future updates follow the normal npm/github channel. Switching is destructive, so it always requires explicit confirmation and is never part of the default pull path.

Security

  • The only mutating route is POST /dsh-update-copilot/update: same-origin enforced, confirm: true required.
  • Official @deepseek-ai/* packages and the dsh core are never auto-updated; the core's upgrade command is displayed, not run.
  • All upstream queries are read-only (registry.npmjs.org, api.github.com, git ls-remote) with hard timeouts; a failed check degrades that one item instead of failing the scan.

Limitations

  • Plugin hot reload is phase-1 scoped: it covers updates whose running profile entry still exists and whose new version keeps the same dsh.bundle.patch and dsh.client declaration (this includes link: checkouts — node_modules points at the checkout through a symlink, so the pull takes effect on the same files the reloader reads). Bundle-patch changes, non-current profiles, and copilot self-update still ask for a dsh restart.
  • link: updates require the checkout to have an upstream branch configured; uncommitted changes are auto-stashed and restored after the pull, and a failed restore (stash pop conflict) needs manual git stash list / git stash pop.
  • Switching a link: to a remote source breaks the local link and there is no automatic switch back (the spec must be edited by hand). The npm-first strategy installs the registry version, which may differ from your local development checkout.
  • Unauthenticated GitHub API is rate-limited (60 req/h) — briefs degrade gracefully to version lists.
  • Raw git+https:// specs are reported as-is without a comparison channel.

Contributing

Issues and PRs welcome at hezhongtang/dsh-update-copilot. The codebase is intentionally small and dependency-free — plain ESM on the host, a hand-authored CJS bundle in the browser, no build step to set up.

License

MIT © 2026 hezhongtang

Похожие плагины