dsh-adaptive: Self-Checking Plugin Versions and Migration Risks Based on DSH Rules

Preface

DeepSeek Harness (DSH) checks version compatibility during plugin installation and startup since v0.1.7-rc.1; since v0.2.1-alpha.4, version compatibility for third-party plugins is explicitly determined first by engines.dsh. Among community plugins on real machines, many declare neither engines.dsh nor @deepseek-ai/dsh* peerDependencies—DSH will not refuse to install them for this reason, and after upgrades it is hard to determine which plugins are still using renamed or deprecated APIs.

dsh-adaptive (directory name dingchenhui0618-arch/dsh-adaptive, Chinese title “版本自适应” / “Version Adaptive”) is a read-only diagnostic plugin published by maintainer dingchenhui0618-arch, categorized under admin-security. It reads the current DSH runtime version, scans the compatibility of installed plugins in the current Profile using rules consistent with DSH, and performs heuristic scans of source code to mark locations that may still hit breaking changes in the v0.1.6 to v0.2.1 range. It does not connect to the internet and does not modify the state of other plugins.

What This Is

In one sentence: a version adaptive plugin—self-checks the runtime, replicates DSH compatibility determination, provides migration hints, and offers read-only output via panels and HTTP/agent tools.

Maintainer: dingchenhui0618-arch. Repository: https://github.com/dingchenhui0618-arch/dsh-adaptive. Community directory page: https://www.skillhub.cn/plugins/dingchenhui0618-arch/dsh-adaptive. License MIT; package.json version 0.2.0, engines.dsh is >=0.2.1-rc.2 <0.3.0 (README states it has only been tested locally on 0.2.1-rc.2).

Core Functions

Below are the four capability areas summarized from the README; the determination logic originates from DSH packages/boot/app-boot/src/plugin-compatibility.ts, and this plugin replicates it rather than directly calling internal functions.

Identifying Runtime Version

Reads the version from the @deepseek-ai/dsh-base package with installation source in pluginManager.listBundles(); if unavailable, parses @deepseek-ai/dsh-app-boot/package.json (consistent with DSH’s getDshRuntimeVersion()).

Locating the Profile

The host process may not have DSH_PROFILE_DIR injected by the shell. It tries the following in order of trustworthiness: plugin config profileDir → environment variable DSH_PROFILE_DIR → profileContext.packageManager.env → directories in $DSH_HOME/profiles/* where this plugin is already installed. When multiple candidates exist, it picks the one whose cordis.patch.yml was most recently modified, and notes the source in the panel and report.

Compatibility Matrix

Reads each dependency from the Profile’s package.json, resolves the actual package directory (link: resolves to a real path), and assigns one of the following statuses: Compatible / Incompatible / Authorized Exception / No Version Constraint Declared / Manifest Undeterminable / Unreadable.

Key rules (consistent with DSH):

  • When the manifest has engines.dsh, it alone determines compatibility; peerDependencies are ignored;
  • Otherwise, check every @deepseek-ai/dsh / @deepseek-ai/dsh-* peer range; all must be satisfied for compatibility;
  • When peer is workspace:^ / workspace:~ / workspace:*, it is treated as the current runtime version;
  • Pre-release versions participate in comparison (includePrerelease);
  • Exceptions match by name@version → allowed runtime list from pluginManager.listVersionExemptions();
  • An empty string for engines.dsh is judged as unsatisfied; malformed manifests cause DSH to throw an error, while this plugin downgrades to “Manifest Undeterminable” and explains the reason.

Migration Hints

Performs heuristic static scanning of plugin package source code against a built-in release notes rule table (breaking change snapshot from v0.1.6-alpha.1 → v0.2.1-rc.2), outputting file:line and suggestions. A hit only indicates that a related symbol appears in the source code, not that a runtime failure is certain; a miss does not guarantee no risk. The scan skips directories such as node_modules, test, dist, and limits extensions to .js/.mjs/.cjs/.ts/.tsx/.jsx/.yml/.yaml.

Rule examples (see the repository README for the complete table):

id Since Version Detected Legacy Interface
agent-session-start 0.1.6-alpha.1 'agent/session-start' (changed to agent/created)
session-sync-history 0.1.6-alpha.1 .snapshotEvents(, .eventAt(, .ownEvents(
settings-yaml 0.1.7-alpha.1 settings.yaml
workspace-read-text 0.1.7-alpha.1 .readText( (changed to readBytes)

UI and Entry Points

Right-side tab “版本自适应” (“Version Adaptive”) in the conversation view (conversation.view, order 55). The panel displays the runtime version and its source, Profile, total dependency count and counts per status, an expandable per-plugin table (version constraints, unsatisfied items, migration hints, a “适配到当前版本” / “Adapt to Current Version” dispatch entry for link: local plugins), and a collapsible section for version content; the top-right corner supports “重新扫描” (“Rescan”) and “复制 Markdown” (“Copy Markdown”). The screenshots in the README are based on the desktop Profile, runtime 0.2.1-rc.2, and 18 dependencies.

Installation and Activation

The official README’s installation method is to have DSH install the local directory as a bundle; do not manually modify the Profile’s package.json / cordis.patch.yml:

# In DSH: Plugin management page → Install → Select local directory D:\Projects\dsh-adaptive

After installation, the plugin management page displays the Chinese title “版本自适应” (“Version Adaptive”) and its description. This plugin runs with the permissions of the current DSH process; please review the repository source code and MIT license before installing.

Typical Usage

Panel Operations

Open the “版本自适应” (“Version Adaptive”) tab to view scan results; use the “重新扫描” (“Rescan”) button on the panel when you need to force a rescan.

HTTP (also used internally by the panel)

GET /dsh-adaptive/state
GET /dsh-adaptive/state?refresh=1
POST /dsh-adaptive/scan
GET /dsh-adaptive/report.md

?refresh=1 indicates a forced rescan.

Agent Tools

Tool name adaptive_report, parameters include refresh, format: json|markdown, includeHints; when format=markdown, a complete Markdown report is included.

Dispatching “适配到当前版本” (“Adapt to Current Version”)

The panel only performs diagnostics and does not modify code. Clicking “适配到当前版本” (“Adapt to Current Version”) at the end of a row dispatches the task into that plugin’s own session (where the agent there modifies code, tests, and commits); it does not create a new session or make changes in the current conversation.

GET /dsh-adaptive/sessions?dir=<plugin directory>&name=<package name>
POST /dsh-adaptive/dispatch?name=<package name>[&session=<session id>]

Session lookup order: working directory equals the plugin repository → session title matches the package name → parent working directory; when no exact match is found, candidates are listed (ECHOOSE), and selections can be remembered in the browser’s localStorage. Tasks are delivered into the target session’s inbox via the host’s sessionController.prompt (mode: 'queue').

Applicable Scenarios and Cautions

Suitable for: maintainers who have many third-party or link: self-developed plugins mixed in their local Profile, are preparing to upgrade DSH or need to verify engines.dsh / peer declarations, and need to troubleshoot legacy APIs by file line number.

Important cautions:

  • Read-only: This plugin does not install, uninstall, change plugin states, or write files; dispatch only delivers messages, and changes occur under the target session and its agent’s permissions.
  • No internet access: Version content is a built-in snapshot; after DSH releases a new version, the snapshot within the plugin needs to be updated.
  • Heuristic migration hints cannot replace reading official release notes.
  • Compatibility determination is a replication; when DSH changes its criteria, this plugin needs to be maintained in sync.
  • Since 0.2.1-rc.2, ctx.inject is used to wait for webServer / tools to be ready before registering, to avoid panels and tools silently disappearing; self.toolRegistered and self.registration can be viewed in the panel footer.

Development self-tests (in the repository):

cd D:\Projects\dsh-adaptive
node --test test/*.test.mjs

Conclusion

dsh-adaptive lays out “who declared what, whether the runtime satisfies it, and whether it still resembles old API versions” in the panel and reports, facilitating read-only inventory before upgrading DSH; when you need to actually modify a plugin, use “适配到当前版本” (“Adapt to Current Version”) to hand the task to that plugin’s own session.

Community directories such as SkillHub are independent sites with no official affiliation with DeepSeek / High-Flyer (幻方); the plugin ecosystem follows DSH’s “everything is a plugin” philosophy, and specific capabilities are subject to the repository README and source code.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye