Foreword¶
DeepSeek Harness (DSH) decomposes capabilities into plugins, with most collaborations handled via extension points exposed by target plugins. However, in real-world development, another class of needs arises: modifying components, loading entry points, or compiled behaviors within the target plugin itself, even when no corresponding API is provided. Common practices include forking the code, directly editing files in node_modules, or manually reapplying patches after each upgrade—high maintenance cost, and prone to silent failures after updates.
Here, we introduce dsh-harmony (GitHub: memorax-ai/dsh-harmony). It is a runtime Patch coordination library that allows plugins to perform in-memory source code transformations on another DSH plugin—without maintaining forks or modifying installed package files on disk.
What It Is¶
dsh-harmony is maintained by memorax-ai, currently at npm version 0.7.3 under the MIT license. The project is categorized as Workflow in the SkillHub community directory, with approximately 16 stars and 2 forks on GitHub.
In one sentence: At runtime within DeepSeek Harness, it patches, replaces, and decorates compiled code of target plugins, while installed package files remain byte-untouched.
The design is inspired by the Harmony project created by Andreas Pardeike and others in the C# ecosystem. DSH’s Harmony addresses the problem of “internal behavior rewriting” between plugins, rather than replacing DSH’s built-in public extension points.
Core Features¶
Runtime Source Code Transformation¶
Harmony loads patches before the target plugin runs, rewrites its compiled code in memory, then launches the Harness. Patches locate TypeScript AST nodes via TSQuery and rewrite source code ranges using MagicString. Multiple patches execute sequentially, with each subsequent patch reading the source code left by the previous one.
This means:
- Multiple plugins can submit patches to the same target without affecting the installed files on disk.
- You can
inspectthe original source code, the result of each patch step, and the final transformed source—rather than treating the bundle as a black box. - After disabling or removing a Provider, the original behavior is restored.
Provider and Patch Ordering¶
Providers can place patches before or after another Provider; individual patches can also declare their own before / after rules. Users can further interleave patch orders across Providers in Settings → Harmony.
When multiple changes must succeed together, composite patches can be used: multiple members share one order slot and one toggle; if any member fails, the entire group is disabled.
Harmony maintains a global patchOrder and validates that each registered patch appears exactly once in the saved list. Plugin-level disabling uses an independent provider/* toggle and does not clear individual patch enable states; re-enabling a plugin restores only the patches that were individually enabled before the plugin was disabled.
Style Ordering for Browser Plugins¶
For browser-type plugins, Harmony maintains the <style data-plugin> tags owned by each Provider according to patch order. One Provider corresponds to one set of styles; the last enabled patch in that set determines its position in the CSS cascade. After patch reloading, order is realigned.
Version Pinning and Health Checks¶
Patches can pin target package versions and expect assertions. When versions mismatch, failure is immediately visible in status, rather than being discovered only after UI selectors drift.
CLI and WebUI¶
After launching the WebUI, Profiles can be managed in Settings → Harmony. The terminal side supports interactive or non-interactive operations for any Profile. Commands interact transactionally with the running Host and report live status, performing atomic validation and updates for stopped Profiles with offline status.
Installation and Enablement¶
Environment Requirements:
- Node.js
^22.22.3or>=24.11.1 @deepseek-ai/dsh@0.1.0-rc.8or@deepseek-ai/dsh@0.1.1-rc.1
First, install globally, then launch the WebUI:
npm install -g @deepseek-ai/dsh@0.1.1-rc.1
npm install -g dsh-harmony
dsh web
After launch, complete configuration in Settings → Harmony. Details on Profiles, Desktop integration, updates, and uninstallation can be found in the official installation guide.
Common CLI examples (using the web Profile):
dsh harmony --profile web
dsh harmony status --json --profile web
dsh harmony disable my-provider/optional-patch --profile web
dsh harmony enable-provider my-provider --profile web
dsh harmony patch-order show --profile web
dsh harmony patch-order move my-provider/optional-patch --before other-provider/base --profile web
dsh harmony patch-order auto --profile web
dsh harmony provider-order move my-provider --after base-provider --profile web
dsh harmony inspect target-package --patch my-provider/optional-patch --summary --profile web
dsh harmony reload my-provider --profile web
In the TUI, press Tab to switch between Provider and Patch views. status, patch-order show, and provider-order show exit with status code 1 on health or order constraint failures; inspect --summary omits the full transformed source, and --patch <key> inspects only targets touched by the specified patch. reload requires the Host to be running.
Before writing, reviewing, or debugging patches, the repository provides the AI agent skill document use-dsh-harmony, covering installation, patch selection and writing, runtime operations, and troubleshooting.
Typical Usage¶
When to Use Harmony¶
The comparison table in the README outlines the applicable boundaries:
| Without Harmony | With Harmony |
|---|---|
| Hide or duplicate internal UI, and maintain two implementations long-term | Replace selected components or compilation call sites in-place |
Edit node_modules, maintain forks, reapply patches after upgrades |
Transform source code in memory; installed package files remain unchanged |
| UI silently breaks after selector drift | Pin versions and expect; failures are visible in status on mismatch |
| Treat the final bundle as a black box | Inspect original source, each patch step, and the final result |
| Manually undo custom changes | Disable or remove Provider to revert |
Principle: Exposed extension points on the target plugin remain the first choice; Harmony fills the gap between “no API” and “不想 fork” (not wanting to fork). It does not turn compile-time internal implementations into stable public APIs but makes such dependencies sortable, inspectable, and rollbackable.
Entry Point Hints for Developing Patches¶
The Usage section of the README states: When vibe coding DSH plugins, you can directly say “What about we use dsh-harmony” as a starting point. Specific details on the patch model, Provider declarations, description fields, composite patches, etc., are based on the official documentation and the repository README.
Use Cases and Considerations¶
Who It’s For
- Plugin authors who need to modify the internal implementation of other DSH plugins where no extension points are provided.
- Teams that need to coordinate source-code-level changes to the same target across multiple plugins, with clear ordering and toggles.
- Frontend integration scenarios where browser plugins are maintained and control over Provider style injection order is required.
Important Notes
- Permissions: Harmony runs with the current
dshprocess permissions, and patches rewrite plugin behavior at runtime. Before installation or use, read the source code and MIT license to ensure the Provider source is trustworthy. - Stability: Depends on the internal structure of the target plugin. After major version upgrades of the target, patches may break; version pinning and
statuschecks should be used accordingly. - Ecosystem Positioning: SkillHub is a DSH plugin community directory aimed at Chinese users and has no official affiliation with DeepSeek / High-Flyer. DSH itself follows the “everything is a plugin” philosophy, and Harmony adds an additional layer of plugin collaboration on top.
Conclusion¶
dsh-harmony brings “modifying another plugin’s internal implementation” from forking and editing node_modules back into an orchestrated, observable, and reversible runtime Patch process. If your workflow is stuck in the gap between extension points and forking, you can start by installing the global package, opening Settings → Harmony, and giving it a try.
- Community Directory: https://www.skillhub.cn/plugins/memorax-ai/dsh-harmony
- GitHub: https://github.com/memorax-ai/dsh-harmony
- Documentation: https://memorax-ai.github.io/dsh-harmony/