Introduction¶
The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin”. In local development environments, managing plugin states (disabled field) in configuration files is a standard practice, but this usually requires manually editing YAML files and restarting the instance. For developers who frequently debug or need to quickly start/stop certain Loader entries (fibers), the lack of a visual control mechanism increases the operational cost.
dsh-local-plugin-switch is a plugin that adds a “Local Plugin Switches” section to the DSH settings page. It lists installed non-grouped plugins in the current profile, allows users to click switches to start or stop the corresponding fiber in real time, and persists the state to the configuration file.
Core Capabilities¶
Real-time Switching and Persistence¶
The plugin host immediately stops or starts the target entry’s fiber by calling entry.update({ disabled: true | null }, false, true), without restarting the DSH instance. At the same time, it appends the operation result as - id: <rowId>\n disabled: true|false to the current profile’s cordis.patch.yml file. After the instance restarts, the plugin reads this file and keeps the disabled state.
Self-contained Patch Editor¶
The plugin does not depend on an external marketplace (dsh-market) and embeds a minimal read/write YAML logic in lib/index.js. It uses heuristic matching to handle line-level patch writing (for example, recognizing a disabled field indented with two spaces immediately after - id: X), and supports appending new lines and deleting old lines.
Marking and Filtering¶
- Native/Host Identification: Entries whose module name starts with
@deepseek-ai/orcordis:display a “Native” label; entries matching the protected list display “Host” and cannot be disabled (the protected list is hard-coded inlib/index.jsto prevent accidentally disabling infrastructure and making the page unusable). - Group Filtering: The plugin list only contains non-grouped entries where
entry.options.groupis false. - Favorites to Top: Users can add
☆or★at the beginning of a row to favorite it. The state is saved in the browser’slocalStorage, and favored items appear first after a refresh.
Zero-dependency Architecture¶
The host side only uses Node.js built-in modules (node:fs, node:path, node:os, node:url) and does not introduce a YAML parsing library, reducing dependency complexity.
Interfaces and Slots¶
Host Routes¶
The plugin registers two exact routes (kind: ‘exact’) on the host, attached to ctx.effect and released with the fiber:
| Route | Method | Description |
|---|---|---|
/dsh-local-plugin-switch/list |
GET / HEAD | Returns the list of all non-grouped entries (including entryId, moduleName, enabled, fiberPhase, protected). |
/dsh-local-plugin-switch/toggle |
POST | Receives a {name, enabled} request body. The request body limit is 4096 bytes. Same-origin validation is supported; any tool can POST directly. |
Settings Page Slot¶
The client registers a settings.section slot (id: local-plugin-switch) to create a section on the settings page. This section contains an entry list, switch controls, and status coloring based on fiberPhase (0 pending / 1 loading / 2 active / 3 failed / 4 null / 5 unloading).
Deployment and Activation¶
This plugin currently has no standard installation command and must be mounted manually as follows:
- Copy files: Copy the plugin directory into the profile’s
node_modules.
Copy-Item -Recurse -Force .\dsh-local-plugin-switch $env:DSH_HOME\profiles\web\node_modules\
- Mount the plugin: Append the mount line shipped with this package (i.e., the contents of
cordis.patch.ymlinside the package) to the profile’scordis.patch.yml:
- insert:
- id: dsh-local-plugin-switch
name: dsh-local-plugin-switch
- Restart and refresh: Restart the DSH web instance and perform a hard refresh in the browser (Ctrl+F5).
Typical Usage¶
After deployment, a “Local Plugin Switches” section appears on the DSH settings page. Users can:
* View all current local plugins and their status.
* Click a switch to disable a plugin in real time (the host-side service goes offline immediately).
* After refreshing the page and reopening the settings page, previously disabled plugins remain disabled.
For plugins marked with the dsh.client (client-side) flag, after disabling, the page will usually display “Switched; refresh the page to take effect”.
Limitations and Notes¶
- Patch parsing limits: The patch write-back logic is heuristic, not a full YAML parser. It only recognizes specific line formats; line IDs must match the regex
/^[A-Za-z0-9_.-]+$/, otherwise the write will fail. - Security boundary: The
toggleroute only performs same-origin validation, meaning any tool on the local machine can directly send POST requests to this endpoint to toggle plugins. - Code inconsistency: The client code declares dependencies such as
@deepseek-ai/dsh-client-ui-primitives, but the actual implementation does not use these modules (all UI is hand-written). This is a mismatch between declaration and implementation and does not affect runtime.
Summary¶
dsh-local-plugin-switch provides a lightweight plugin management entry point for local DSH development. Through native slots and HTTP routes, it enables visual switch control and configuration persistence without introducing heavy dependencies. It is suitable for developers who need to frequently debug or manage Loader state in local environments.