DSH Plugin Manager
  
English | 简体中文
!DSH Plugin Manager: mod-style plugin management for DeepSeek Harness
@zaogaogwc/dsh-plugin-manager is a mod-style plugin manager for the DeepSeek Harness (DSH) Web GUI. It turns source packages, Loader instances, and Agent presets into an understandable, reviewable, and reversible management interface.
Open it from Settings → Plugins → Plugin Manager. In the current Chinese UI, the path is 设置 → 插件 → 插件管理.
> This project manages enablement state. “Disable” never means “uninstall”: plugin files and npm dependencies are not deleted.
Why it exists
Once a Web profile contains many plugin packages, it becomes difficult to tell where a plugin came from, whether its current state belongs to Loader or Cordis, and how to switch a task-specific group of plugins without making unsafe configuration edits.
The manager organizes the system into three levels:
1. Scheme or source package — official/user Agent presets and installed source packages are peers. 2. Functional category — entries are grouped by purpose, such as files, shell, planning, Web, or settings. 3. Plugin instance — the actual Loader entry, configuration state, Cordis FiberState, and diagnostics.
For example, example-package/plugin-a and example-package/plugin-b are visibly presented as members of example-package, rather than as unrelated plugins with unknown provenance.
Features
Browsing and provenance
- Reconstructs real installation provenance from the current profile bundle list and bundle patches.
- Expands a source package into package metadata, functional categories, plugin instances, and state.
- Ships official catalog metadata only; it does not embed information about user-installed third-party packages.
- Keeps third-party descriptions in the author's original language. AI classification is stored only in the local browser.
Safe enable/disable operations
- Enables or disables an individual plugin, a category, or an entire source package.
- Requires a change preview and explicit confirmation for every batch operation.
- Atomically updates the manager-owned block in
~/.dsh/cordis.patch.yml. - Keeps the latest 20 change records and can undo the last manager operation.
- “Restore all defaults” removes only disable entries owned by this manager.
- Managed-block repair removes duplicates and invalid rows while preserving user-written configuration and blocks owned by other tools.
Harness-native lifecycle behavior
The manager never mutates a live Cordis Fiber directly. After confirmation, it updates the patch file and lets the official DSH plugin-include watcher and Loader perform the lifecycle transition.
flowchart LR
UI[Plugin Manager UI] --> Preview[Change preview]
Preview --> Confirm[User confirmation]
Confirm --> Patch[Atomic cordis.patch.yml update]
Patch --> Watcher[Official include watcher]
Watcher --> Loader[Loader lifecycle]
Loader --> Cordis[Cordis FiberState]
Cordis --> UI- Normal enable/disable operations are usually hot-reloaded by the watcher.
- A running Agent session keeps the capability generation it started with.
- A newly created Agent preset affects only future sessions.
- An npm package update changes both Host and Client code, so the manager explicitly requires a DSH restart afterward.
State and diagnostics
Configuration, Loader, Cordis, and manager-derived states remain separate.
| Field | Meaning |
|---|---|
availability | live, configured, disposed, or preset-only declared |
configState | Loader configuration state: enabled or disabled |
fiberState | Cordis pending, loading, active, failed, disposed, unloading, or absent |
status | Primary UI state, including active, disabled, not running, and restart required |
issue | Separate diagnostics such as a missing dependency or load failure |
“Restart required” is a manager-derived update condition and is never presented as a native Cordis state.
Named mod schemes
Save the current third-party enablement state of the Web profile as a named scheme, such as “Writing”, “Development”, or “Minimal”.
- A scheme stores enablement state only; it does not copy or delete package files.
- Applying a scheme still requires a change preview.
- Multiple schemes remain independent and can be updated, applied, or removed.
- Corrupt scheme storage is treated as read-only to avoid overwriting recoverable data.
Agent preset authoring
Agent presets and mod schemes are intentionally different concepts:
| Object | Scope | Effective time | Storage |
|---|---|---|---|
| Mod scheme | Third-party host plugins in the current Web profile | After watcher/Loader applies the patch | Manager state directory |
| Agent preset | Capability composition for new Agent sessions | New sessions created afterward | DSH Agent preset directory |
A new Agent preset can be based on any official or user preset. The differential merge preserves source-specific tools, configuration, comments, and unknown entries that are not part of the bundled catalog.
AI-assisted filtering
Given a natural-language requirement, AI can propose categories or an enable/disable plan for third-party plugins.
- AI returns a candidate plan and never applies it directly.
- The user must open the change preview and confirm again.
- Official tool categories come from bundled metadata and cannot be rewritten by AI.
- Information about locally installed third-party plugins is never added to the published source package.
- If the model service is unavailable, browsing, manual switching, and named schemes still work.
Bilingual official descriptions
Bundled official tool descriptions are available in Chinese and English and subscribe to the official DSH locale service. They switch with the DSH language setting. Third-party descriptions remain unchanged and are not automatically translated.
npm source-package updates
For third-party source packages installed from an npm registry, the manager can:
1. Query the current profile registry for the latest version. 2. Display installed and target versions. 3. Invoke the official DSH plugin update command after a second confirmation. 4. Back up the profile manifest, lockfile, and managed state first. 5. Verify the installed version and automatically roll back on failure. 6. Keep newly introduced child entries disabled when the source package was fully disabled before updating. 7. Mark the package as requiring restart until a new DSH process takes over.
Local links, Git sources, URLs, archives, npm aliases, and official packages never enter the registry update path by mistake.
Security boundaries
- Official host components and the manager itself cannot be disabled from this UI.
- Disabling never uninstalls or modifies third-party package files.
- APIs that write files, invoke AI, or update packages require a loopback request.
- Sensitive APIs return
403when the Web UI is accessed over a LAN address. - An update may run installation scripts permitted by the target npm package; the confirmation UI states this risk explicitly.
- The manager owns only its patch block and state files. It does not take lifecycle ownership away from Cordis or Loader.
Requirements
- Node.js
^22.19.0or>=24.0.0 - A DeepSeek Harness Web profile
- DSH/Cordis versions compatible with the peer dependencies in
package.json - pnpm and tsdown when building from source
Installation
Install from npm
After the package is published:
dsh plugin --profile web add @zaogaogwc/dsh-plugin-manager
dsh webOpen http://127.0.0.1:3080, then go to Settings → Plugins → Plugin Manager.
Install from source
git clone https://github.com/Zaogaogwc/dsh-plugin-manager.git
cd dsh-plugin-manager
pnpm install --frozen-lockfile
pnpm test
pnpm build
dsh plugin --profile web add link:<absolute-package-path>
dsh webOn Windows, create a junction when the source path contains spaces:
New-Item -ItemType Junction -Path D:\dsh-plugin-manager -Target (Resolve-Path .)
dsh plugin --profile web add link:D:/dsh-plugin-managerThe build must produce lib/index.js and lib/client.cjs. The client bundle must register through DSH __ModuleLoader__.load; an unregistered browser ESM file is not a valid release artifact.
Usage
Disable a plugin, category, or source package
1. Expand the source package and review its description and actual plugin count. 2. Select Disable; the page scrolls to the confirmation area. 3. Review direct changes and dependency impact. 4. Confirm and wait for Loader to settle.
Save and apply a mod scheme
1. Adjust the current third-party plugin states. 2. Enter a name under Mod schemes and save the current state. 3. Select the scheme later and inspect its preview. 4. Confirm to let watcher/Loader apply it.
Create an Agent preset from an existing preset
1. Expand an official or user Agent preset. 2. Choose it as the base for a new preset. 3. Adjust capabilities and enter a new identifier and display name. 4. Generate and validate it for Agent sessions created afterward.
Data and files
| Path | Purpose |
|---|---|
~/.dsh/cordis.patch.yml | Manager-owned disable block |
~/.dsh/plugin-manager/history.json | Recent enable/disable history |
~/.dsh/plugin-manager/mod-schemes.json | Named mod schemes |
<profile>/.dsh-plugin-manager-backups/ | Package-update backups and restart state |
API overview
The host registers /api/plugin-manager/* routes for catalog and provenance reads, AI classification and recommendations, change preview and application, history and repair, mod schemes, npm updates, and Agent preset creation.
Source layout
src/
index.js Host entry point and route registration
routes.js Inventory, AI, transactions, history, update, and preset APIs
inventory.js Bundle provenance, Loader/Cordis snapshot, and preset projection
catalog.js Official bilingual metadata, composition, and differential merge
persist-toggle.js Atomic patch, history, undo, restore, and repair
mod-schemes.js Independent named mod-scheme storage
package-update.js Registry check, profile backup, update, and rollback
client/
index.js React management UI and state interactions
api.js Same-origin API client
test/ Logic, persistence, update, and client-state testsDevelopment and verification
pnpm install --frozen-lockfile
pnpm test
pnpm build
pnpm pack:checkBefore publishing, verify that:
1. The Plugin Manager tab appears without blocking other client modules. 2. Plugin, category, and package operations open the confirmation area first. 3. cordis.patch.yml changes only inside the manager-owned block and survives restart. 4. Restore and repair preserve unrelated configuration. 5. Mod schemes and Agent presets remain clearly separate. 6. A successful npm update requires restart; a failed update restores the profile and lockfile. 7. Official descriptions switch between Chinese and English with DSH locale.
Troubleshooting
Client bundle loaded without registering
loaded without registering "@zaogaogwc/dsh-plugin-manager" via __ModuleLoader__.loadThis usually means lib/client.cjs was not rebuilt, the browser cached an older bundle, or the package name differs between package.json, cordis.patch.yml, and the Loader banner. Run pnpm build, confirm that all three use the new package name, restart DSH, and refresh the page.
Disable appears to do nothing
- Check whether the page scrolled to the change-preview area.
- Official host components and the manager itself are protected.
- LAN access triggers the loopback fence; use
127.0.0.1orlocalhost. - Inspect managed status and check for missing dependencies, load failures, or restart-required state.
Why does a package update require restart?
Enable/disable operations change Loader configuration and can be watcher-driven. A package update replaces both Host and Client code. Restarting ensures that both sides run the same version instead of presenting a partial hot replacement as a complete update.
Is disabling the same as uninstalling?
No. Disabling writes a Loader patch only. The package remains in the profile dependency manifest and on disk. Uninstallation requires an explicit DSH plugin removal command.
Known limitations
- The management UI itself is currently primarily Chinese; official tool descriptions follow DSH locale in Chinese or English.
- AI classification and recommendation depend on the active DSH model service and remain advisory.
- One-click updates support only recognized third-party npm registry sources.
- The loopback fence intentionally blocks sensitive write operations from LAN-hosted pages.
- The manager reports states observable from the current profile; it does not replace low-level DSH/Cordis log diagnostics.
Privacy
The published package contains official catalog metadata and generic logic only. It does not include a list of third-party plugins installed on the author's or a user's machine. Third-party names in the README and cover use placeholders such as example-package.
License
[MIT](./LICENSE)