Yuki-takuya-kun/dsh-engine-switch ↗★ 0
dsh-engine-switch
A pure runtime that routes DeepSeek Harness sessions to pluggable loop engines by agent-preset. Ships no engine; downstream plugins register engines via ctx.engineSwitch.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Yuki-takuya-kun/dsh-engine-switch说明文档
阅读完整 README ↗dsh-engine-switch
English | 中文
纯「引擎切换运行时/容器」:按预设(agent-preset)把 DeepSeek Harness(DSH) 顶层会话主循环路由到可插拔的「引擎」。
🚧 预发布版 —— 暂不可用。 路由/swap 主链路未做端到端验证。请勿用于生产环境。
它是什么
一个标准 + 运行时,让「预设」与「引擎」可连接,且「引擎」与「会话」互相透明:
- 引擎 = 一个实现 DSH
Agent接口的驱动(与原生 ReactLoop 同接口),由下游插件注册。 - 本插件不内置任何引擎、任何预设。它只定义「引擎如何接入」的契约,并提供三件事:preset → 引擎路由、空白会话内 swap、引擎预设落地。
透明性:
- 引擎无感知预设——
makeAgent不收 preset,只收session/options/engineConfig。 - 会话无感知 switch——session 只驱动一个
Agent,换引擎 = 空白期内换驱动它的 Agent。
安装
dsh plugin --profile web add github:Yuki-takuya-kun/dsh-engine-switch
# 再装至少一个下游引擎插件,例如:
dsh plugin --profile web add github:/dsh-engine-claude-code
启用
编辑 ~/.dsh/profiles/web/cordis.patch.yml:
- id: dsh-engine-switch
config:
enabled: true
# 可选:把某个预设指到某引擎
# engineByPreset:
# research: claude-code
重启 web 应用。下游引擎注册的预设会出现在预设列表;选中它 → 该引擎,选其它 → DeepSeek。
下游如何注册引擎
下游插件 inject: ["engineSwitch"]:
export const inject = ["engineSwitch"];
export function apply(ctx) {
ctx.engineSwitch.register({
id: "claude-code", // 引擎 id = 预设目录名
name: "Claude Code",
description: "…",
presetDir: fileURLToPath(new URL("./presets/claude-code/", import.meta.url)),
makeAgent(loopCtx, id, options, session, engineConfig) {
return new ClaudeCodeAgent(loopCtx, id, options, session, engineConfig);
},
});
}
presetDir 里放 agent.cordis.yml + preset.yml,框架会把它落地到 ~/.dsh/.agent-presets//。完整契约见 Engine API。