DeepSeek Harness plugin

deepseek-orchestrator

DeepSeek 多角色自动编排 dsh 插件:干活用 v4-flash,思考用 v4-pro(max effort),独立审查角色,规则路由自动分级,无手动切换。设置界面经 dsh 官方 settings.plugin.item 插槽呈现在 Web 设置页「插件配置」分区。

Jump to install

Source facts

Repository
hwc66626/deepseek-orchestrator
Latest update
Aug 18, 2026
Category
Workflow & Automation
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-21

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/hwc66626/deepseek-orchestrator
Plugin: deepseek-orchestrator
Author: hwc66626

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

DeepSeek Orchestrator — 干活 / 思考 / 审查 三角色自动编排 dsh 插件

基于 DeepSeek V4 API 的多角色流水线插件:干活用轻量模型、思考用大型模型、独立审查模型把关,由零成本规则路由器自动分级调度——全程无手动切换、不暂停对话,审查不通过还会自动回流修复。

> 先说清楚:装上就能用,你不需要启动任何服务器,也不需要管理任何常驻进程。 > 本插件按 dsh(DeepSeek Harness)官方插件机制发布:一条命令装进 dsh 后,模型在对话中直接调用 ds_auto 等工具,图形设置界面自动出现在 dsh Web UI 侧边栏(官方 registerSidebarTab 槽位)——不弹独立网页、不占额外端口。引擎零依赖,CLI / MCP 两条通用路径保留给其他宿主。

flowchart LR
    A[任务输入] --> R{规则路由器<br/>0 token 离线打分}
    R -->|L1 轻量| W1[执行者 v4-flash<br/>关思考]
    R -->|L2 标准| T1[思考者 v4-pro high]
    R -->|L3 深度| T2[思考者 v4-pro max]
    T1 --> W2[执行者 v4-flash]
    T2 --> W3[执行者 v4-flash]
    W1 --> V0[轻审查 可选]
    W2 --> V1[审查者 v4-pro high]
    W3 --> V1
    V1 -->|fail| W2
    V1 -->|pass| OUT[最终成果 + 全链路 trace]
    V0 --> OUT

为什么

直接对话用单模型有两个极端:用大模型做"改个变量名"太贵太慢;用小模型做"架构设计/疑难排查"质量不够。业界开源方案(RouteLLM、LiteLLM Router、Semantic Router)验证了"按任务难度自动分配强弱模型"能大幅降本。本插件把这一思路落到 DeepSeek 上,并进一步拆出独立审查角色 + 自动修复回流,形成完整生产线。

角色矩阵(默认配置)

角色模型思考模式职责
thinker 思考者deepseek-v4-proon(L2=high / L3=max方案设计、任务分解、风险识别
worker 执行者deepseek-v4-flashoff代码生成、改写、翻译——低精度高吞吐,省钱
reviewer 审查者deepseek-v4-proon / high独立审查,输出 pass/fail + 问题清单
lightReviewer 轻审查deepseek-v4-flashon / highL1 任务可选的省钱审查

三级流水线(自动路由)

级别典型任务流水线修复回流
L1 轻量执行重命名、格式化、翻译、错别字work1 轮(需开启轻审查)
L2 标准流水线常规功能开发、普通 bugthink(high) → work → review≤2 轮
L3 深度流水线架构设计、跨模块重构、疑难并发 bug、安全审计think(max) → work → review≤3 轮

路由完全离线(正则信号 + 尺寸启发式,0 token 0 延迟)。想看某任务会被怎么分,用 route 命令预览;想强制分级,加 --hint L3

怎么用

唯一前置:环境变量 DEEPSEEK_API_KEYplatform.deepseek.com 获取),或装进 dsh 后在 Web 设置页 → 插件配置 → DeepSeek 编排器 卡片里填写。要求 Node.js ≥ 18,无需 npm install(零依赖)。

方式一:装进 dsh(DeepSeek Harness,官方插件机制,推荐)

npm install -g @deepseek-ai/dsh     # 已装可跳过
dsh plugin --profile web add github:hwc66626/deepseek-orchestrator
dsh web                              # 重启 dsh 加载插件(插件安装后需重启才生效)

装好后两件事自动发生:

1. 模型多了 8 个工具ds_auto / ds_route / ds_think / ds_work / ds_review / ds_config / ds_doctor / ds_ping。你只管在对话里说: > 用 DeepSeek 流水线帮我实现一个防抖函数,要有单测 2. Web 设置页多出「DeepSeek 编排器」配置卡片:打开设置 → 插件配置分区即可看到。API Key(只写不回显)、角色模型、思考力度、修复轮数、路由分数线、超时重试、轻量审查开关,全部图形化编辑,带「恢复默认 / 放弃修改 / 保存」与非法值拦截。

图形界面走的是 dsh 官方设置插件机制:Host 半侧(dsh/host.js)用 installSettingsSection 注册 deepseek-orchestrator 设置命名空间并服务数据,浏览器半侧(dsh/client.js)经官方 settings.plugin.item 插槽注册卡片、读写一律走官方 settingsScope 服务(带 revision 乐观并发控制)。两侧以命名空间自动配对,不弹独立网页、不占用任何端口、关掉 dsh 即停。

跨宿主无缝切换的底气:所有配置(API Key、角色模型、阈值)都存在 ~/.deepseek-orchestrator/——用户目录、宿主无关。今天用 dsh、明天换 Claude Code、后天换 Cursor,配置零搬迁,宿主里不留任何状态;换宿主只是换个入口,流水线行为完全一致(同一份 CLI、同一份 MCP 工具、同一份 SKILL 协议)。

方式二:命令行直接用(任何终端环境)

export DEEPSEEK_API_KEY=sk-xxxxxxxx

node bin/ds-orch.js route  "把 utils.js 里的 getuser 重命名成 getUser"   # 只看路由决策(不花钱)
node bin/ds-orch.js auto   "实现一个带限流的重试封装"                    # 全自动流水线
node bin/ds-orch.js auto   "设计订单模块架构" --hint L3                  # 强制深度流水线(等价写法 --hint=L3)
node bin/ds-orch.js auto   "改造这个模块" --context ./src/foo.js         # 附加上下文
node bin/ds-orch.js think  "如何拆分这个单体应用" --context ./notes.md
node bin/ds-orch.js work   "按计划实现步骤 1" --plan plan.json --context ./src/foo.js
node bin/ds-orch.js review "原任务" --output result.py

方式三(可选进阶):MCP 服务器接入

若宿主原生支持 MCP(Claude Code、Cursor、Cline 等),可把 [mcp-config.example.json](mcp-config.example.json) 并入宿主 MCP 配置。注意:MCP 服务器由宿主自动作为子进程拉起,你同样不需要手动启动;装了 dsh 插件(方式一)的话无需 MCP,工具已原生注册。

方式四:作为代码库引入

const { runAuto } = require('./src/orchestrator');
const result = await runAuto('实现一个防抖函数,含单测', { hint: 'L2' });
console.log(result.output, result.finalVerdict, result.trace);

命令一览(CLI / dsh 工具 / MCP 工具三通道同名同义)

命令 / ds_* 工具何时用
setup安装向导:交互式或 --api-key sk-xxx 非交互写入配置文件
doctor / ds_doctor环境体检:Node 版本/密钥/停用模型名/阈值倒置,零 token
set / get / unset手动读写单项配置(键同环境变量名)
auto / ds_auto默认入口:自动分级 → 思考 → 执行 → 审查 → 修复回流
route / ds_route预览路由决策(不调 API、不花钱)
think / ds_think直通思考者(只要方案不要执行)
work / ds_work直通执行者(已有方案,只要快速干活)
review / ds_review直通审查者(独立把关已有成果物)
config / ds_config查看角色矩阵/阈值/配置文件来源(不泄露密钥)

手动设置(装完第一步)

方式零:dsh 侧边栏面板(最省事)——装好插件后打开 dsh Web UI(http://127.0.0.1:3080),侧边栏「DeepSeek 编排器」面板包含五个区块:令牌设置(填 API Key、改 Base URL、一键测试连接,零 token)、角色模型(三角色模型 + 思考力度)、流水线参数(修复轮数、路由阈值、超时重试,可一键恢复默认)、环境体检(一键体检)、路由预览(输入任务描述,本地零 token 试算分级)。写入的配置与 CLI 完全同源(同一份 config.js),改完命令行立即生效。

兼容性设计:配置写入为「临时文件 + 原子替换」+ 跨进程文件锁,进程中断也不会写坏文件、多面板并发保存不丢键;保留你手工编辑过的未知键;带 BOM 的配置文件(Windows 记事本保存)也能正常读取;密钥文件权限 0600、面板只显示掩码。

方式一:安装向导——一条命令完成,配置持久保存在用户目录,之后任何项目直接可用:

node bin/ds-orch.js setup                    # 交互式:逐项询问,回车保留默认
node bin/ds-orch.js setup --api-key sk-xxx   # 非交互:脚本/CI/Agent 代跑
node bin/ds-orch.js doctor                   # 体检:装完先跑这个,缺什么一目了然

方式二:手动读写单项——键名与环境变量同名,数字/布尔自动转换:

node bin/ds-orch.js set   DS_WORKER_MODEL deepseek-v4-flash
node bin/ds-orch.js set   DS_L1_REVIEW 1
node bin/ds-orch.js get   DS_L1_REVIEW        # 显示文件值 + 生效值
node bin/ds-orch.js unset DS_L1_REVIEW        # 删除,回到默认

配置文件位置(优先级:环境变量 > 配置文件 > 默认值):

1. DS_CONFIG_FILE 环境变量指定的路径 2. 用户级 ~/.deepseek-orchestrator/config.json(setup/set 默认写入这里,权限 0600) 3. 项目级 ./.deepseek-orchestrator.json(已加入 .gitignore,不会误提交)

配置文件就是普通 JSON(键同环境变量名):

{
  "DEEPSEEK_API_KEY": "sk-xxx",
  "DS_WORKER_MODEL": "deepseek-v4-flash",
  "DS_L1_REVIEW": "1"
}

配置(环境变量)

以下变量均可改用 setup/set 写入配置文件(文件优先级低于环境变量):

变量默认说明
DEEPSEEK_API_KEY必填DeepSeek API 密钥
DEEPSEEK_BASE_URLhttps://api.deepseek.com可指向代理/网关
DS_THINKER_MODELdeepseek-v4-pro思考者模型
DS_THINKER_EFFORTmaxL3 思考力度 low/high/max
DS_THINKER_EFFORT_L2highL2 思考力度(与 L3 分开控制)
DS_WORKER_MODELdeepseek-v4-flash执行者模型
DS_REVIEWER_MODELdeepseek-v4-pro审查者模型
DS_REVIEWER_EFFORThigh审查思考力度
DS_LIGHT_REVIEWER_MODELdeepseek-v4-flash轻审查模型
DS_L1_REVIEW01 为 L1 任务开启轻审查
DS_MAX_REPAIR_ROUNDS2(L3 为 3)审查不通过的修复轮数上限
DS_ROUTE_L2_SCORE20升 L2 的分数线
DS_ROUTE_L3_SCORE60升 L3 的分数线
DS_TIMEOUT_MS / DS_MAX_RETRIES600000 / 2超时与重试

> 提示:DeepSeek 2026-08 起实行峰谷定价(谷时价格为峰时一半),批量 L1 任务安排在谷时跑可再省一半。旧的 deepseek-chat / deepseek-reasoner 模型名已于 2026-07-24 停用,请勿配置。

返回结果结构(auto)

{
  "level": "L2",
  "status": "passed",
  "output": "最终成果物(含修复轮结果)",
  "plan":   { "steps": [...], "acceptance": [...] },
  "finalVerdict": "pass",
  "repairRounds": 1,
  "reviews": [ { "verdict": "fail", "score": 6, "issues": [...] }, { "verdict": "pass", "score": 9 } ],
  "warnings": [],
  "route":  { "score": 34, "matched": [...] },
  "trace":  [ { "step": "think", "model": "deepseek-v4-pro", "thinking": "on/high", "ms": 8200, "promptTokens": 1200 } ]
}

status 取值:passed 审查通过;repaired L1 修复后复审通过;repair-failed L1 修复后仍未通过;max-rounds-reached L2/L3 修满轮数仍未通过;review-unparsed 审查输出无法解析为 JSON;done 未经审查(L1 默认关闭轻审查时)。warnings:运行时告警,如某步输出被 max_tokens 截断(trace 中对应步骤会标记 truncated: true,按提示调大对应 *_MAX_TOKENS 环境变量)。

trace 完整记录每一步的模型、思考力度、耗时、token——"细致分工"全程可见、可核算成本。

测试

npm test          # 85 个用例:单元 + 流水线集成(mock 端点)+ MCP 端到端 + dsh 插件(mock Cordis 宿主)+ 配置兼容
npm run bug-hunt  # 100 轮自动化 bug 排查(结构 / 插件行为 / 引擎 fuzz / CLI 边界)

目录结构

deepseek-orchestrator/
├── dsh/                          # dsh 插件双端(package.json 的 dsh.bundles 指向这里)
│   ├── host.js                   #   Host 侧(Node):注册 ds_* 工具 + 处理面板请求
│   └── client.js                 #   Client 侧(浏览器):registerSidebarTab 侧边栏面板
├── AGENTS.md                     # 宿主 Agent 接入指引(跨宿主通用)
├── INSTRUCTIONS.md               # dsh / 其他宿主的对话内用法说明
├── package.json                  # 零依赖,node>=18,含 dsh 插件清单
├── bin/ds-orch.js                # CLI 入口(主用法)
├── src/
│   ├── config.js                 # 角色矩阵 / 三级流水线 / 阈值 / 原子写 + 文件锁
│   ├── router.js                 # 零成本规则路由器
│   ├── client.js                 # DeepSeek API 客户端(重试/退避/超时)
│   ├── orchestrator.js           # think→work→review→repair 编排
│   └── mcp-server.js             # MCP stdio 服务器(可选进阶接入)
├── skills/deepseek-orchestrator/ # SKILL.md + 路由规则 + 审查协议
├── scripts/bug-hunt.js           # 100 轮自动化 bug 排查
├── examples/                     # 快速上手示例
└── test/                         # 单元 + 集成 + MCP 端到端 + dsh 插件 + 配置兼容(85 例)

设计参考的开源项目

项目借鉴点
RouteLLM简单请求走便宜模型、困难请求走强模型的成本路由
LiteLLM基于 routing_rules 的规则路由与网关化接入
Semantic Router意图信号路由,不引入额外 LLM 调用
DeepSeek API 文档V4 模型、thinking 开关与 reasoning_effort 参数

常见问题

Q: 需要我启动服务器或常驻进程吗? 不需要。主用法是插件/CLI:每次任务起一个短命进程,跑完即退。MCP 接入(可选)也是宿主自动拉起子进程。

Q: 会话会被打断吗? 不会。CLI 在一次工具调用内完成路由与流水线,无需暂停对话、无需手动切换模型。

Q: 路由分错了怎么办?--hint 强制,或调整 DS_ROUTE_L2/L3_SCORE;也可以在 src/router.js 的信号表里增删关键词(每条都有注释与测试保护)。

Q: 审查一直不通过会死循环吗? 不会。修复轮数有上限(L2≤2、L3≤3),到达上限返回 max-rounds-reached 与遗留问题清单。

Q: 想更省钱?DS_REVIEWER_MODEL 设为 deepseek-v4-flashDS_THINKER_EFFORT_L2 降为 low、关闭 L1 轻审查;代价是复杂任务的方案与审查质量会下降。