鱼皮AI导航
鱼皮AI导航
  • 主页
  • 社区
  • AI工具
  • AI知识库
  • AI提示词
  • MCP
  • Skills
  • AI学习资源
  • AI资讯
  • GitHub开源
登录/注册

dsh-harmony

在运行时修改 DSH 插件代码,并提供 Patch 排序、检查和热重载。

开发运行时
访问 GitHub
文档README
Harmony

dsh-harmony

Runtime Patch coordination for DeepSeek Harness plugins.
A library for patching, replacing and decorating DeepSeek Harness plugins during runtime.

Get started · Documentation · Report an issue

▼
text
复制代码
<a href="https://awesome-dsh-plugin.com"><img alt="Awesome DSH Plugin" src="https://awesome-dsh-plugin.com/badge.svg"></a> <a href="https://memorax-ai.github.io/dsh-harmony/"><img alt="Harmony" src="https://memorax-ai.github.io/dsh-harmony/harmony-powered.svg"></a>

简体中文 / English

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 HarmonyWith Harmony
Hide or duplicate an internal UI and keep both implementations alignedReplace the selected component or compiled call site in place
Patch node_modules, carry a fork, or reapply edits after upgradesTransform source in memory; installed package files remain byte-for-byte unchanged
Discover a selector drift only after the UI silently breaksPin package version and expect; mismatches fail visibly in status
Treat the final bundle as a black boxInspect the original, every Patch step, and the final transformed source
Remove custom edits manuallyDisable 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#.

AI agents: use the repository skill

Load use-dsh-harmony for installation, Patch selection and authoring, runtime operations, and troubleshooting.

Install

Requires Node.js ^22.22.3 or >=24.11.1 and either @deepseek-ai/dsh@0.1.0-rc.8 or @deepseek-ai/dsh@0.1.1-rc.1.

▼
sh
复制代码
npm install -g @deepseek-ai/dsh@0.1.1-rc.1 npm install -g dsh-harmony dsh web

Open Settings → Harmony after starting the WebUI. For profiles, Desktop integration, updates, and removal, see the installation guide.

Use the terminal UI or non-interactive commands against any profile. Commands contact a running Host transactionally and report live; stopped profiles are validated and updated atomically as offline.

Multiple Hosts may use the same profile. Harmony follows DSH Settings' write model: whole-profile writes are serialized by a file lock and committed atomically; a stale UI save is rejected and refreshed, while concurrent processes use last-complete-write-wins semantics.

▼
sh
复制代码
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

Press Tab in the TUI to switch between Provider and Patch views. The Patch view supports individual and Provider-wide enablement, Patch ordering, automatic sorting, runtime details, and concise inspection. Both views keep the selection visible when a profile is larger than the terminal.

status, patch-order show, and provider-order show exit with status 1 when their health or order constraints fail. patch-order auto and provider-order auto minimize violations while preserving the current order where possible. inspect --summary omits transformed source, while --patch <key> limits inspection to targets touched by one Patch. reload requires a running Host.

Patch model

Harmony runs every Patch from one global patchOrder. Provider-level before and after rules set the usual order. A Patch that declares either rule uses its own rules instead. In Settings → Harmony, users can move a whole provider or place one Patch between Patches from another provider. Plugin and Patch details provide their enable and disable actions, while the Patch status page is a read-only runtime monitor. Harmony checks that the saved list contains every registered Patch exactly once.

Plugin-wide disablement is an independent provider/* flag. It never clears or creates individual Patch flags. Re-enabling a plugin therefore restores only the Patches that were individually enabled before the plugin was disabled.

Every Patch may declare a human-readable description. Harmony exposes it through Patch status and JSON output, and displays it in Settings so users can understand the Patch before changing its order or enablement.

A composite Patch groups several Patches under one order position and switch. Members keep their declared order and apply only when every member succeeds. A failed standalone Patch is reported and skipped; later Patches and the Host continue to run.

Plugin compatibility

Any DSH plugin package can describe its relationships with other plugins under dsh.plugin.compatibility, whether or not it provides Harmony Patches:

▼
json
复制代码
{ "dsh": { "plugin": { "compatibility": { "requires": { "base-plugin": "^2.0.0" }, "conflicts": { "legacy-plugin": "*" }, "integrates": { "optional-renderer": "^1.0.0" } } } } }

requires reports a missing, inactive, or incompatible dependency; conflicts warns when an incompatible pair is active; and integrates reports an available optional integration. These declarations never install, enable, disable, or block plugins. Targets are package names and values are semver ranges. Reciprocal conflict declarations produce one warning, and disabling a Harmony Patch does not disable its owning plugin.

Live reports use the plugins active in Loader. When the profile is stopped, Harmony can only inspect its installation and therefore treats installed profile packages as active.

React-aware patches

Install dsh-harmony-react in a Patch provider when the target is compiled React:

▼
sh
复制代码
npm install dsh-harmony-react

Use element() to change selected compiled jsx / jsxs calls. Use component() to change the shared component definition. Harmony applies both in the same Patch order as every other Source Patch.

APIScope
element()One or more selected call sites: replace, wrap, insert, transform props, or remove
component()Every call through an initialized variable or named function declaration: decorate or replace

To let later Component Patches modify the same definition, Harmony rewrites a function declaration as an initialized const. The new binding is not hoisted. If the file reads the component before its declaration, use a core Source Patch instead. React integration covers selectors, Inspect traces, and Studio.

Documentation

TopicGuide
Runtime architectureWhat is Harmony?
Installation and profilesInstallation
Writing source, semantic, loader, and composite PatchesPatch authoring
Provider/Patch order, status, inspection, and reloadOperations
React-aware patches with dsh-harmony-reactReact integration
Studio previewsStudio integration
Commands, limitations, and failuresCLI · Limitations · Troubleshooting

Powered by Harmony

If your plugin uses Harmony, you’re welcome to use this badge to show your support!

Powered by Harmony

▼
md
复制代码
[![Powered by Harmony](https://memorax-ai.github.io/dsh-harmony/harmony-powered.svg)](https://memorax-ai.github.io/dsh-harmony/)

Development

All maintained implementation code uses TypeScript. Build artifacts are generated for packaging and are not tracked by Git.

Documentation sources and local preview tooling live on the docs branch.

▼
sh
复制代码
npm test

Set DSH_HARMONY_PERF=1 when starting DSH to log one structured timing record for each Harmony startup, plugin update, profile update, and manual reload:

▼
sh
复制代码
DSH_HARMONY_PERF=1 dsh web --no-open

Each record separates Patch preparation, source transformation, Host reload, browser rebuild, and total time. The probe stays inactive by default. Node.js diagnostic tools can instead subscribe to the diagnostics_channel channel dsh-harmony:load without enabling log output.

License

MIT

开发运行时

快捷安装

复制到终端去安装插件

dshplugin--profilewebaddgithub:CH4ACKO3/dsh-harmony

温馨提示

装插件等于在本机跑第三方代码,权限与你相同,能读文件、用凭据、访问网络,工具审批管不到。请只装可信来源,并尽量锁定 commit。

站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
dsh 插件推荐
dsh-simplify
提供 /simplify 命令,让 Agent 在选定的 Git 变更范围内简化代码,支持暂存变更、提交及未跟踪文件。
pi2dsh
Pi Host ABI 兼容引擎:装一次之后,npm 上的 Pi 扩展原包经 `dsh plugin add <pi-package>` 直接作为 DSH 原生插件挂载。已在官方 DSH 上端到端验证 pi-mcp-adapter(完整 MCP 管理面:OAuth、resources、prompts、MCP Apps、elicitation、sampling)、@tintinweb/pi-subagents、pi-code、pi-hermes-memory、pi-background-tasks;`pi2dsh inspect` 在安装前报告一个包的兼容情况。
fn-os-apps#dsh-fnos-plugin
把 DeepSeek Harness 接进飞牛 fnOS:DSH 界面跑在 fnOS 应用框架里时通过 fnOS 浏览器 SDK 工作——DSH 设为跟随系统时读取并跟随 NAS 主题,在设置里列出和取消已授权的 NAS 目录,把文件与链接交给对应的 fnOS 应用打开,并把 DSH 页面标题同步到 fnOS 应用窗口。npm 安装:`dsh plugin --profile web add @tnnevol/dsh-fnos`。
my-dsh-plugins#dsh-my-guardian
插件治理:新装/更新插件先进候选区,启动完成后热挂载——成功自动转正,失败自动禁用,连续失败冻结,一键安全模式,侧边栏诊断面板(npm: `dsh-my-guardian`)。
dsh-ballute
已装插件的崩溃防护:崩溃卡片一键停用、静态预检、黑匣子遥测,以及救援损坏 UI 的安全模式 profile。
🔥热门工具
朱雀AI检测朱雀AI检测
朱雀AI检测助手朱雀AI检测助手
LovartLovart
老鱼简历老鱼简历
WritePass官网WritePass官网
面多多面多多
CursorCursor
星月写作星月写作
零感AI零感AI
墨得问题墨得问题