CH4ACKO3/dsh-harmony
A library for patching, replacing and decorating dsh plugin during runtime
已收录
10
Dev
Bundle 已验证
功能介绍
在运行时修改 DSH 插件代码,并提供 Patch 排序、检查和热重载。
适合
- 必须修改缺少公共扩展点的内部组件、加载入口或编译行为的 DSH 插件作者。
- 需要明确 Patch 排序、组合变更、检查能力和可逆热重载的多插件环境。
- 希望避免长期维护 fork,同时接受对其他插件内部实现进行版本锁定的团队。
不适合
- 普通 DSH 扩展点已经支持的改动;此时应优先使用标准机制。
- 要求目标插件升级后仍保持稳定公共 API 兼容性的工作流;编译后内部实现依然不稳定。
- 不愿锁定目标版本并在上游源码变化时维护 Patch 匹配预期的团队。
README
dsh-harmony
Runtime Patch coordination for DeepSeek Harness plugins.
A library for patching, replacing and decorating DeepSeek Harness plugins during runtime.
Usage
Just type “What about we use dsh-harmony” when vibe coding your DSH plugin.
Introduction
Use Harmony when one DeepSeek Harness plugin needs to change another without maintaining a fork. Harmony loads Patches before the target runs, changes its compiled code in memory, and starts Harness with the result.
Source Patches find TypeScript AST nodes with TSQuery and rewrite their source ranges with MagicString. They run one after another, each reading the source left by the previous Patch. This lets several plugins change the same target while leaving installed files untouched.
A provider can place its Patches before or after another provider. One Patch may override that rule, and users may interleave Patches from different providers. When several changes must succeed together, a composite Patch gives them one position and one switch; if a member fails, Harmony applies none of them.
For browser plugins, Harmony also keeps provider-owned <style data-plugin> tags in Patch order. A provider owns one style group, so its last enabled Patch decides where that group appears in the CSS cascade. Harmony repeats the ordering after a Patch reload.
Harmony adds modification to the ways DeepSeek Harness plugins can work together.
Why Harmony
Ordinary DSH extension points remain the first choice when the target exposes the behavior you need. Harmony is for the gap between those APIs and maintaining a fork: changing an internal component, loader entry, or compiled behavior that the target does not expose.
| Without Harmony | With Harmony |
|---|---|
| Hide or duplicate an internal UI and keep both implementations aligned | Replace the selected component or compiled call site in place |
Patch node_modules, carry a fork, or reapply edits after upgrades |
Transform source in memory; installed package files remain byte-for-byte unchanged |
| Discover a selector drift only after the UI silently breaks | Pin package version and expect; mismatches fail visibly in status
|
| Treat the final bundle as a black box | Inspect the original, every Patch step, and the final transformed source |
| Remove custom edits manually | Disable or remove the Provider to restore the original behavior |
Harmony does not turn compiled internals into a stable public API. It makes that dependency explicit, ordered, inspectable, and reversible.
Respect
Inspired by Harmony, the project of the same name created by Andreas Pardeike and other contributors for C#.
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:CH4ACKO3/dsh-harmony。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。