rulemux 的 DeepSeek Harness 插件:通过 rulemux inject --agent dsh 取当前工作区渲染出的规则,在每次会话的首条用户消息时把输出注入一次。规则不往工作区写任何文件;只有技能会落盘。
安装
# npm 包(预构建)
dsh plugin --profile web add rulemux-dsh
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:cq-guojia/rulemux#path:/dsh-plugin
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
DeepSeek Harness (dsh) plugin for rulemux.
rulemux keeps your rule files in one place and delivers them to each agent. dsh is plugin-first and
does not scan a rules directory on its own, so this plugin is the delivery: it asks the rulemux
CLI for the rules rendered for the current workspace (rulemux inject --agent dsh) and injects that
text into the session once, at the first user turn — the same rules, the same token cost as a host
that reads a rules directory natively, because it is the same renderer.
For rules, nothing is written into your workspace — no .dsh/rules, no copies, no residue to
clean up: the rules travel from your source files straight into the session.
Skills are the one exception (since plugin 0.5.0 / CLI 0.5.0). dsh has a native skills
subsystem, and skills load progressively (name+description at session start, full text only when
called by name) — so, unlike rules, they cannot be injected: they must exist as real files. The
plugin therefore runs rulemux sync --hook --agent dsh when a session starts, and copies land as
__rulemux__<skill-name>/ in <git-root>/.dsh/skills (workspace scope) and/or ~/.dsh/skills
(user scope). Your own skills are never touched, and .agents/skills (a cross-framework convention
dir) is never written. A failed sync is logged and the session continues — rules are unaffected.
Install
dsh plugin --profile <name> add rulemux-dsh
That is the whole thing — the plugin is published on npm. Installing straight from git also works (no npm involved), which is handy for testing an unreleased change:
dsh plugin --profile <name> add "github:cq-guojia/rulemux#path:/dsh-plugin"
The host half needs no build: index.mjs is plain ESM. The details-page panel is bundled into
lib/client.js, and that artifact is committed — so a git install still needs no allowBuilds
approval (see “Build” below if you change src/client/).
Restart dsh after installing — the plugin mounts on the next start.
What you see in dsh
- Plugin list: an icon and a title, in the language of your UI (English / Chinese).
- Plugin detail page: an informational panel — the config file path
~/.rulemux/config.toml(with a copy button), what you need to edit by hand, a minimal example, and a button that opens the project on GitHub.
It does not save anything. ~/.rulemux/config.toml is the single source of truth and you edit
it in your own editor. dsh's own settings document is not a second home for it: the official config
form can only store values in dsh's document (the active profile's Cordis patch), and a plugin on
the detail page has no session context — it cannot read a file off your disk. So the panel tells you
where the file is and what it looks like, and the editing stays where it always was.
Build (only for the details-page panel)
npm install
npm run build # -> lib/client.js (re-run and commit the artifact after changing src/client/)
npm run typecheck
The flow you get
dsh plugin --profile <p> add "github:cq-guojia/rulemux#path:/dsh-plugin"
# restart dsh → ~/.rulemux/config.toml now exists (see below)
# edit it → add your [[source]] / [[skill_source]] entries
# open ONE session → the rules are injected, the skills synced
No throwaway "chat once so it can create the config" session: readiness starts at load, before any session exists.
At dsh startup: three steps, all or nothing
This package declares no dependencies on purpose: a hard rulemux dependency would make the
whole dsh plugin add fail whenever the registry mirror lags — an install-time failure you cannot
act on. dsh runs no install scripts either, so instead the plugin makes itself ready when it loads,
i.e. when dsh starts, and it does exactly three things. Every one of them must hold; otherwise the
session fails with an error.
- The CLI is there and can do the job.
rulemuxis resolved (a dependency copy if one exists, elsePATH) and its reported version must satisfy>=0.4.2— the first release whose config parser accepts the line-trailing#comments thatrulemux initwrites and the docs use. An older CLI (e.g. 0.3.1–0.4.1) knowsdshbut then fails to parse such a config, so it must not be trusted. Only when the version is entirely unreadable does the check fall back to whetherrulemux --helplists thedshagent (the guard for a binary whose--versionlies). A CLI that fails is upgraded withpnpm add -g, falling back tonpm install -gand finallynpm install -g --force(which overrides arulemuxbinary that was copied onto PATH by hand, the usual cause of anEEXIST), and re-checked afterwards. If it still fails, that is a failure, not a success. - This plugin is loaded. Nothing to check: the fact that this code runs at all is the proof.
- The config exists.
~/.rulemux/config.toml, created withrulemux init --agent dshwhen it is missing. An existing config counts as success and is never overwritten.
Because steps 1 and 3 need no workspace, they run at load; step 2 is the load itself.
Failures are loud and actionable: the error names the step that failed, carries the raw output, and says where to fix it (then restart the session to retry). There is deliberately no "succeeded halfway" notice — a half-ready plugin is useless, and it must not look healthy.
Asking for the rules is separate, and never fails the session
rulemux inject --agent dsh runs once per session — it needs the session's workspace, which does
not exist at load time. A non-zero exit is logged (console.error, which lands in dsh's log) and
the session carries on without an injected block.
A config with no [[source]] yet — or one whose sources do not cover this workspace — lands here
too: the CLI prints nothing and exits 0, so nothing is injected. That is a normal outcome, not a
readiness failure: it has no bearing on the three steps above.
What it does
- At load (dsh startup) → starts the three-step readiness chain, so
~/.rulemux/config.tomlis there before you need it. Atagent/session-start→ makes sure that chain has run before the first turn, and starts the one-per-session skills sync. agent/pre-step→ on the first turn that carries user input, awaits the skills sync (so the first model step sees the skills on disk), then runsrulemux inject --agent dshand injects its stdout as recalled material. It asks once per session and only re-asks if a later compaction provably dropped the block — never every turn.- Skills → one
rulemux sync --hook --agent dshper session; real copies into<git-root>/.dsh/skills/~/.dsh/skillsas__rulemux__<skill-name>/; a failed sync is logged, never fatal. For rules it still writes nothing anywhere, so there is no per-workspace state to keep in sync — and nothing left behind when you stop using it (skill copies are converged byrulemux uninstall, exactly like every other agent).
Requirements
- Node 18+ (plain ESM) — dsh's own runtime satisfies this.
- Network and permission for a global install, only if
rulemuxis missing or too old. - A rulemux config (
~/.rulemux/config.toml) whose[[source]]entries cover the workspace; it is created for you at dsh startup, then it is yours to fill in.
License
MIT — same as rulemux.
链接
同类插件
yjh051108/dsh-routing-suite★ 7031
一个仓库三件套:DSH 插件包的运行时注入器(注入、热重载、卸载、开发侧挂区一键转正、路由自愈,外带设置页插件管理:列出、卸载、拖入文件夹内化)、任务感知的思维模式路由 agent 预设(router-standard / router-spec / router-react)、以及分级两级任务协议(commit_star / lock_stage / revise_do / edit_plan / mark_task / redteam_verdict 六个工具,任务状态落盘)。注入器实现直接在库内,安装的是它自己的行为而不是一份依赖清单。
strukto-ai/mirage#dsh★ 3963
把文件系统与 bash 提供者换成 mirage 虚拟工作区:文件工具与 shell 命令作用于挂载的资源(RAM、S3、Redis、Slack、Gmail、Notion、Postgres)而非宿主磁盘,支持按挂载点设置读/写/执行模式、按命令选择沙箱(进程内 monty、pyodide、quickjs;远程 docker、e2b、daytona),并可在虚拟终端中安装 CLI(git、gh、slack、linear、ntn、gws,或自行注册的程序树)作为命令头词。
first-fluke/oh-my-agent#dsh★ 1496
在工具执行前后以及尝试结束当前轮次时运行项目 OMA 检查。随插件安装 OMA CLI 依赖,并在首次使用时初始化未配置的项目。需要 Node.js 22+;首次初始化需要网络连接和项目目录写入权限。
MichengAI/dsh-skills-manager★ 641
在设置里管理本地 DSH 技能,并只读查看公共 Agent 技能。
hust-open-atom-club/oh-dsh★ 327
社区发行版:TUI、桌面端与 Web UI 统一体验,分层安装、一步到位。
Fishquito7/dsh-skill-mcp-panel★ 294
在 DSH Web 设置中管理技能与 MCP 服务器:技能卡片热启停、工作区作用域、分组、批量迁移与拖拽导入,以及 stdio/HTTP MCP 增删改查、连接测试、密钥脱敏,并附带统一 dsh-panel 命令行。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。