dsh-plugin-org
DeepSeek Harness plugin: mount the org agent harness (team dispatch / task queue / tools) into dsh as callable tools.
- Stars
- 0
- Language
- TypeScript
- Created
- Oct 6, 2026
- Updated
- Oct 7, 2026
Introduction
dsh-plugin-org
DeepSeek Harness(dsh)插件:把 org 组织型 Agent Harness 挂进 dsh —— 团队派单 / 专家直连 / 长程任务队列 / 原创性自检, 以 可调用工具 形式交给 AI;另附 MCP stdio 服务,任何支持 MCP 的宿主 (含 dsh)都能直挂。
这是什么 / 为什么
- dsh 的设计是 Everything is a Plugin(Cordis 内核):插件向
ctx注入 可逆效应(服务 / 事件 / 工具)。 - org 是一个完整独立的组织型 harness(监督回路 · 工厂铸造 · 任务队列 · 工具环)。
- 本插件做且只做一件事:把 org 的能力面(8 个操作)注册成 dsh 工具, 底层全部代理到未改动的 org CLI —— 不重造轮子,不侵入双方。
- 附带
SKILL.md:教 AI 正确操作 org(含三条铁律与常见坑)。
工具表(8)
| 工具 | 说明 | 特性 |
|---|---|---|
org_status | 工作区/专家/注册表状态 | 只读 |
org_ask | 专家直连提问(可续会话) | 秒~分钟级 |
org_run | 团队派单(分解→…→沉淀) | 长程(≤20min 超时) |
org_task_submit | 长任务入队(票据秒回) | 推荐长任务路径 |
org_task_list / org_task_show | 队列观测 / journal 时间线 | 只读 |
org_task_control | cancel / pause / resume / retry | SIGSTOP/SIGCONT 语义 |
org_plag | 原创性/查重自检(7 字滑窗 + LCS) | 交付前质控 |
所有工具返回 canonical 无损 JSON:{ok, code, stdout, stderr, durationMs, command, workspace}。
安装与集成
路径 1 · dsh 插件(主目标)
# 以你的 dsh 版本为准(developer preview,安装形状可能变化):
dsh plugin add github.com/myh2026/dsh-plugin-org # 或本地路径安装
# 或在 profiles 的 bundles 里登记本包后由 Cordis 装载
插件入口:src/index.ts 的 apply(ctx, config) —— 逐工具
ctx.tools.register({name, description, parameters, output, execute}),
返回 disposer 由 Cordis 管理可逆卸载。
⚠ dsh 处于 developer preview(存在破坏性变更):如遇字段命名差异 (如
parameters↔inputSchema),以实际@deepseek-ai/*包类型对齐; 源码中所有版本相关处均标注[ALIGN]。
路径 2 · MCP 兼容层(任何宿主)
mcp-server 命令:ORG_CLI=/path/to/org node --experimental-strip-types src/mcp-server.ts
- 协议:JSON-RPC 2.0 · 换行分帧(与 org 自家 MCP 桥同口径)
- 方法:
initialize·tools/list·tools/call·ping - 把上述命令登记到宿主的 MCP 服务配置即得全部 8 工具。
环境
| 变量 | 说明 |
|---|---|
ORG_CLI | org 启动器路径(缺省 org on PATH) |
ORG_CLI_ARGS | 前缀参数(如 ORG_CLI=bun ORG_CLI_ARGS="cli/org.ts") |
ORG_WORKSPACE | 默认工作区 |
本地冒烟(无需任何 AI 宿主)
ORG_CLI=/usr/local/bin/org ORG_WORKSPACE=/root/org-lab bun test/smoke-mcp.ts
实测输出(首跑):
✓ initialize: 2024-11-05 · dsh-plugin-org
✓ tools/list: 8 工具
✓ tools/call org_status · isError=false
✓ org_status · 2552ms · exit=0 · ws=/root/org-lab
🏁 MCP 冒烟通过
设计纪律
- 零依赖(仅 node 内建);Node ≥20 / Bun 均可跑。
- org 侧零改动:插件是入口,不是分叉。
- 失败不抛出:一切结果结构化,诚实优先(
isError+ 原因文本)。 - 工具面收敛:8 个以观测/控制/交付质控为主的原子操作,拒绝把 GUI 塞进工具。
许可
MIT。org 本体见 myh2026/org。
实机集成实录(2026-10-06 · 真机全链穿越 ✅)
环境:iSH/Alpine aarch64(iPad)· Node 22 jitless 定制版 · dsh 0.2.0-rc.2(bun add 安装 534 包)。
穿越链路:dsh headless(真 DeepSeek 模型)→ 我们的 8 工具 → 真调用 org_status → 真数据 → 中文总结答复。
[fetch-stream-override] undici fetch installed
[dsh-plugin-org] mounted · 8 tools registered · workspace=/root/org-lab
dsh: reasoning: I need to summarize in two lines of Chinese.
/root/org-lab 工作区 registry 为空…git 注册表有 214 次提交记录…v0.5.47 的子进程清理与任务孤儿治理修复。
四条硬核经验(都踩过一遍)
inject是命名导出:插件里访问ctx.tools前必须export const inject = ["tools"](否则Error: cannot get property "tools" without inject——Cordis 服务注入纪律)。- patch 行支持绝对路径名:
name: /abs/path/dist/index.js会直转file://导入, 绕开 bare 名解析面(最省事的本地接驳方式)。 - profile 是注入面:
$DSH_HOME/profiles/<名>/(首用自动初始化); 正式安装走dsh plugin --profile <名> add <包>(pnpm 面)。 - 受限 Node 的流式坑:某些定制 Node 的 fetch 垫片无
body流 → dsh 的 SSE 传输 必炸(TRANSPORT: DeepSeek Messages transport failed)。解法:extras/ish-stream-fetch.cjs(undici 覆盖全局 fetch),启动加node --require …/ish-stream-fetch.cjs …。
复现命令(参考)
bun add @deepseek-ai/dsh # 或用官方 npx/npm
cat > /tmp/org.patch.yml <<'YML'
- insert:
- id: org-plugin
name: /abs/path/to/dsh-plugin-org/dist/index.js
config:
workspace: /path/to/your/org/workspace
YML
DSH_HOME=~/.dsh ORG_CLI=org DEEPSEEK_API_KEY=… \
node --require ./extras/ish-stream-fetch.cjs \
node_modules/@deepseek-ai/dsh/lib/bin.js headless --patch /tmp/org.patch.yml "查看工作区状态并用两行概括"