DSH 多 Agent 管线管理内核:定义管线、推送任务、自动路由、台账三振、巡检自愈、面板归档与打包复用,与具体业务无关。
- 语言
- TypeScript
- License
- MIT
- 分支
- master
安装
$ dsh plugin --profile web add github:not-big-dog/DSH-pipeline-kernel在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程
对话式安装
帮我安装 DeepSeek Harness 插件 not-big-dog/DSH-pipeline-kernel:先查看仓库 https://github.com/not-big-dog/DSH-pipeline-kernel.git 确认安全性,然后执行安装命令并验证插件加载成功。
把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。
一句话定位
DSH 多 Agent 协作的"管线管理内核"——把 supervisor → designer → prompter → reviewer 这类单向任务链抽象成可定义、可部署、可巡检的"管线"(pipelines 表里的一行配置),提供任务板、台账、注册表、自动路由、巡检自愈、控制面板与打包复用能力,但内核本身不绑定任何具体业务。
核心能力
- 管线一等公民与归档:定义/部署/反定义管线(
pipeline_define/pipeline_deploy/pipeline_undefine),归档(pipeline_archive/pipeline_unarchive/pipeline_purge)只打标记、可恢复 - 任务板与自动路由:推送/领取/完成/取消/查询(
pipeline_push/pipeline_claim/pipeline_done/pipeline_cancel/pipeline_list),完成时按route:<角色|UID>标记自动路由下一环 - 角色注册与播种:
pipeline_seed给未注册角色建会话并写注册表,节点目录按 chain 自动编号(节点0=主管,节点1..N=业务角色) - 台账与三振:
pipeline_ledger_write/pipeline_ledger_list记录交付物变更;pipeline_strike累计 rework 次数达到阈值自动给任务打 blocked - 巡检自愈与 Web 面板:watchdog 默认 5 分钟扫一次唤醒空闲目标并自愈僵尸任务;Web 右下角胶囊展开右侧全高边栏(活动/管线/新建/归档四标签,1 秒轮询快照)
- 打包复用与斜杠命令:
pipeline_pack把整条管线打成 JSON+MD,配合pipeline-create的fromPack一键恢复定义并播种;/pipeline gate|status|pack三子命令
技术实现
- 语言: TypeScript(src/)+ Node.js ESM(编译产物在 lib/)
- 关键依赖:
@deepseek-ai/cordis(4.x 插件框架)、@deepseek-ai/dsh-storage-domain(域表 JSON 后端)、@deepseek-ai/dsh-tools(defineTool 工具定义)、@deepseek-ai/dsh-agent+@deepseek-ai/dsh-llm(会话运行时,封装在lib/agent-runtime.js窄适配层里) - 架构模式: Cordis 双面插件;node 端走标准 Cordis 规范
name + Config (zod Schemastery) + inject + apply,注册 20 个pipeline_*工具 + 1 个/pipeline斜杠命令 + 6 个 Web 端点;client 端用ctx.locale.register注册中英词典并挂载 React 控制面板到 body portal - 入口文件:
lib/index.js(node 端 Cordis apply)+src/client/index.tsx(浏览器端挂载入口)
适用场景
需要在 DSH 上编排多 Agent 单向任务链(典型如:supervisor 收集需求 → designer 出方案 → prompter 写提示词 → reviewer 审 → 生成交付物),希望统一看任务进度、管交付清单、跨会话自动路由与提醒的场景。普通"单 Agent + 单次问答"用不到这个插件;超过两个会话、且彼此需要按角色接力的项目最适合装。
前置依赖与兼容性
| 依赖 | 最低版本 | 说明 |
|---|---|---|
| DSH(deepseek-harness) | 0.1.0-rc.8 | package.json peerDependencies 锁 ^0.1.0-rc.8,rc.8 之前会因 @deepseek-ai/cordis 4.x、webServer/workspaceRegistry/agentDefaultModel 等服务名变化而装不上 |
| Node.js | ^22.19.0 || >=24.0.0 | package.json#engines.node;低于 22.19 会因 zod 4 与内置 fetch 行为差异导致工具校验失败 |
| 平台 | macOS / Windows / Linux | lib/web.js:317-334 的 openFolder 在三平台分别调 open / explorer / xdg-open;其余逻辑纯 ESM + node:fs/node:path,无平台相关代码 |
| 原生模块 | 无 | 不引入 node-pty / better-sqlite3 等原生模块;只用 node:fs node:path node:os node:child_process node:crypto node:url 等内置模块 |
安装方式
dsh plugin --profile web add github:not-big-dog/DSH-pipeline-kernel
配置项
所有配置走 cordis.patch.yml 的 pipeline-kernel 节点(默认写在 ~/.dsh/profiles/web/cordis.patch.yml),重启 dsh web 生效。
| 配置 | 类型 | 说明 | 默认值 |
|---|---|---|---|
projectRoot | 字符串 | 全局工作区根(管线 projectRoot 缺省时回退到这里),所有 inboxDir/产物/打包路径都必须在它之内 | process.cwd() |
inboxDir | 字符串 | 角色收件箱根目录(相对工作区),pipeline_push 落盘任务单到这里 | exchange/收件箱 |
defaultPipeline | 字符串 | 任务 tags 没标 pipeline:<id> 时归属到的默认管线 id(注意:只是默认值,没有自动建定义) | default |
watchdogEnabled | 布尔 | 是否开启无人值守巡检(自愈 + 唤醒 + 静止汇报) | true |
watchdogIntervalMs | 数字(毫秒) | 巡检 tick 间隔 | 300000(5 分钟) |
watchdogStallMs | 数字(毫秒) | 全链静止多长时间视为"卡住"开始汇报主管 | 1800000(30 分钟) |
watchdogWakeCooldownMs | 数字(毫秒) | 同一任务被补唤醒的最短冷却 | 600000(10 分钟) |
watchdogReportCooldownMs | 数字(毫秒) | 同一管线汇报主管的最短冷却 | 1800000(30 分钟) |
strikeOut | 数字 | rework 计数阈值;超过此数任务被打 blocked 并建议人工介入 | 3 |
常见问题
Q: 安装之后已有的会话里怎么没有 pipeline_* 工具?
A: 老会话的工具目录在会话创建时就被冻结了,重启 dsh web 只对新会话生效。需要把现有会话关掉、重开一个新会话,让它从更新后的 host 拿工具清单。
Q: 我用 pipeline_define 报 BAD_INPUT 非法管线 id,是什么规则?
A: 管线 id 必须匹配 ^[A-Za-z0-9_-]{1,64}$(见 lib/deploy.js:38)。不能包含 /、\、空格、中文、空字符串;带点或 .. 也会被拒,因为 id 同时会被当作注册表 key 和路径片段,禁止路径穿越。
Q: 控制面板里看到"未注册"的角色,能直接跑任务吗?
A: 不能。"未注册"指 registry 表里 pipeline/role → sessionId 这一行缺失;任务会被投递,但收件箱里的任务单没人处理、watchdog 也唤不醒。必须先 pipeline_seed(角色定义里带 preset)或手动 pipeline_register。
Q: 角色会话是 supervisor 常驻还是 supervisor 按需创建?
A: 按定义。每个角色(包括 supervisor)由 pipeline_seed 调用宿主 agents.create + agentPresets.mount 各创建一个会话;不常驻、不复用。seed 会校验已注册会话的 cwd 与当前管线工作区是否一致,不一致视为撞车残留会清掉重播。
Q: 三振机制怎么算一次"重做"?
A: 看任务 tags 里的 attempt:<n>,n 越大代表该任务被打回重做越多。pipeline_strike {taskId} 读到 n ≥ strikeOut(管线定义里可覆写,回退全局 config)就把 status 改成 blocked 并返回"建议升级人工或换方向"提示。attempt 不需要手工维护,路由回退或 rework 流程里加上即可。
Q: 打包出来的 *.pack.json / *.pack.md 是干嘛的?
A: pipeline_pack 跑的产物——*.pack.json 是机器可读的全节点管线定义(含 roles/chain/gates/skill 清单/文档模板清单),*.pack.md 是人读的"绿色可复用全节点管线文档"。把这两个文件拿到别的项目,用 Web 路由 POST /plugins/pipeline-kernel/pipeline-create、body 带 fromPack: "<路径>",就能一键恢复定义、播种会话并建齐节点目录(见 lib/web.js:106-173)。
Q: 面板点"打开文件夹"不工作?
A: 路径白名单校验。看面板给的路径是不是工作区内的——lib/workspace.js:77-87 用 isWithin 强制要求路径在任意已知管线工作区内,绝对路径或 .. 都会被 BAD_INPUT 拒。如果文件夹路径明明合法却仍然失败,可能是 explorer/open/xdg-open 命令在系统上不存在(headless Linux 服务器常见)。
Q: 内核数据存在哪里?能跨设备同步吗?
A: 数据走宿主 ctx.storageDomain(JSON 后端,4 张表:pipelines / registry / tasks / ledger)。落盘路径由 DSH 宿主决定,DSH rc.8 通常在 ~/.dsh/profiles/web/domains/pipeline_kernel/。能拷目录就能跨设备,但不要两个设备同时启同一个 profile 写——内核没有跨进程锁。
上手难度
进阶 — 用户必须理解 DSH 的 agent/session 模型、preset 体系和多会话协作语义,并自己用 pipeline_define 写第一份管线定义(roles/chain/gates),否则装上也只是面板里一直"暂无管线"。
已知问题与限制
- 路径硬约束:
artifactRoot与inboxDir必须是工作区下相对路径且不能逃出projectRoot(lib/workspace.js:18-30),否则pipeline_define会抛BAD_INPUT - 管线 id 与角色名硬约束:必须匹配
^[A-Za-z0-9_-]{1,64}$(lib/deploy.js:38、lib/pipeline.js:17-22),含中文/点号/空格的 id 会被拒 - 域版本号固定:
kernelDomain写死version: 1(lib/domain.js:90),添加新字段不 bump 版本;如果未来 bump 了版本,旧数据会因为 JSON 后端的 unit 头校验被拒打开,需要做迁移 - Web 控制面板只读
?archived=1才显示归档管线:lib/web.js:48与lib/snapshot.js:19,主视图不包含归档箱 - 巡检不感知 host 重启:watchdog 跑在 DSH 进程内,进程崩溃后再启动时 watchdog 状态丢失,
pipeline_reconcile可手动兜底(lib/tools.js:561-584) - 节点目录在打包复用时一次性建齐、新建管线只建主管目录(节点1..N 由主管写完文档后调
pipeline_mkdirs或首次pipeline_push触发),不会主动催主管补建
DeepSeek Harness (DSH) 插件(Cordis)| 多 Agent 管线管理内核:任务板 / 台账 / 部署 / 注册表 / 巡检 / 打包复用 / 控制面板 A DSH (DeepSeek Harness) Cordis plugin — the management kernel for multi-agent pipelines: task board / ledger / deployment / registry / watchdog / packaging & reuse / control panel.
pipeline-kernel 是管线无关的管理内核:管线 = 配置数据(pipelines 表一行,用 pipeline_define 定义),内核不绑定任何具体业务。默认无预置管线,由使用者自行定义与部署。
The kernel is pipeline-agnostic: a pipeline is just a config row (defined via pipeline_define); no business is baked in. There is no preset pipeline — define and deploy your own.
中文
定位
- 内核 = 管线无关的管理能力(通讯 / 台账 / UI 三大职责,见
docs/);管线 = 数据(配置行) - 业务能力(生图、视频等)是管线内部设置,不进内核
- 多语言:UI 与文档自动跟随 DSH 语言设置(中文 / English)
安装
// C:\Users\<you>\.dsh\profiles\web\package.json → dependencies
"dsh-pipeline-kernel": "link:<本包路径>"
// bundles 列表加入 "dsh-pipeline-kernel"
或 dsh plugin --profile web add <本包路径>。重启 dsh web 后,新会话带 pipeline_* 工具(存量会话工具目录固定,需重建会话)。
依赖要求(v0.9+):宿主
deepseek-harness 0.1.0-rc.8及以上(本插件自身锁定^0.1.0-rc.8,cordis 4.x)。开发/CI 用pnpm install --frozen-lockfile。
快速开始
- 定义管线:
pipeline_define {id:"my-pipe", roles:{supervisor:{preset:"pipeline-supervisor"}, ...}, chain:["supervisor",...], gates:{...}} - 起链:
pipeline_deploy {pipelineId:"my-pipe"} - 播种角色会话:
pipeline_seed {pipelineId:"my-pipe"}(按定义给未注册角色创建会话,自动写注册表) - 投任务:
pipeline_push {title, description, tags:["target:<角色>","task:<编号>","attempt:1"]} - 流转:
pipeline_list→pipeline_claim→pipeline_done {result:"done route:<角色|UID> 产物:..."}(内核自动路由下一环) - 看全景:
pipeline_status
控制面板(Web UI)
右下角 pipeline 胶囊按钮 → 展开右侧全高侧栏:
- 活动:各管线运行摘要(角色状态 / 进行中任务 / 最近完成 / 失败置顶)
- 管线:管线一等实体(Graph 缩略图 / KPI / 打包产物);点击任务展开 Task Inspector
- 新建:定义新管线(工作文件夹必选,走系统目录选择器)
- 归档:冷存储——归档不删除数据,可恢复;永久删除仅在归档箱内、需输入管线 id 确认
巡检(watchdog)
v0.8 起 默认开启(无需配置):每 5 分钟扫描 open 任务补唤醒(同任务 10 分钟冷却)、done 但路由未完成(僵尸)自愈补投、全链静止 30 分钟汇报主管。无管线/无任务时零噪音。如需调整或关闭,在 cordis.patch.yml 覆写:
# c:\users\<you>\.dsh\profiles\web\cordis.patch.yml
pipeline-kernel:
watchdogEnabled: false # 关闭巡检(默认 true)
watchdogIntervalMs: 300000 # 巡检周期(默认 5 分钟)
watchdogStallMs: 1800000 # 全链静止判定(默认 30 分钟)
watchdogWakeCooldownMs: 600000 # 同任务补唤醒冷却(默认 10 分钟)
watchdogReportCooldownMs: 1800000
文档索引
| 文档 | 内容 |
|---|---|
docs/管线定义规范.md | 管线定义字段与拓扑规范(roles/chain/gates/entry…) |
docs/内核接口文档.md | 内核工具与端点清单(pipeline_* / HTTP 路由) |
docs/内核设计文档.md | 架构与职责划分 |
docs/UI-方案-K7-边栏设计.md | 控制面板 UI 方案 |
License
MIT
English
Positioning
- Kernel = pipeline-agnostic management (communication / ledger / UI — see
docs/); pipeline = data (a config row) - Business capabilities (image generation, video, …) belong inside the pipeline, not the kernel
- Bilingual: the UI and docs follow the DSH language setting (中文 / English)
Install
// C:\Users\<you>\.dsh\profiles\web\package.json → dependencies
"dsh-pipeline-kernel": "link:<path-to-this-package>"
// add "dsh-pipeline-kernel" to the bundles list
Or dsh plugin --profile web add <path-to-this-package>. After restarting dsh web, new sessions get the pipeline_* tools (existing sessions keep their fixed tool catalog — recreate them).
Dependency requirement (v0.9+): host
deepseek-harness 0.1.0-rc.8or newer (this plugin pins^0.1.0-rc.8itself; cordis 4.x). Dev/CI usepnpm install --frozen-lockfile.
Quick start
- Define a pipeline:
pipeline_define {id:"my-pipe", roles:{supervisor:{preset:"pipeline-supervisor"}, ...}, chain:["supervisor",...], gates:{...}} - Deploy:
pipeline_deploy {pipelineId:"my-pipe"} - Seed role sessions:
pipeline_seed {pipelineId:"my-pipe"}(creates sessions for unregistered roles, writes the registry) - Push a task:
pipeline_push {title, description, tags:["target:<role>","task:<id>","attempt:1"]} - Flow:
pipeline_list→pipeline_claim→pipeline_done {result:"done route:<role|UID> artifacts:..."}(auto-routes to the next link) - Overview:
pipeline_status
Control panel (Web UI)
The pipeline pill at the bottom-right expands into a full-height sidebar:
- Activity: per-pipeline run summary (role states / in-progress tasks / recently completed / failures on top)
- Pipelines: pipelines as first-class entities (graph thumbnail / KPI / packs); clicking a task opens the Task Inspector
- New: define a new pipeline (working folder required, picked via the system directory picker)
- Archive: cold storage — archiving never deletes data and is reversible; permanent deletion lives only in the archive, requiring the pipeline id to confirm
Watchdog
On by default since v0.8 (no config needed): every 5 minutes it re-wakes open tasks (10-minute cooldown per task), self-heals zombie tasks (done but routing never finished), and reports stalled chains to the supervisor after 30 minutes. Zero noise with no pipelines/tasks. Tune or disable in cordis.patch.yml:
# c:\users\<you>\.dsh\profiles\web\cordis.patch.yml
pipeline-kernel:
watchdogEnabled: false # turn watchdog off (default true)
watchdogIntervalMs: 300000 # tick interval (default 5 min)
watchdogStallMs: 1800000 # chain-stall threshold (default 30 min)
watchdogWakeCooldownMs: 600000 # per-task wake cooldown (default 10 min)
watchdogReportCooldownMs: 1800000
Docs
| Doc | Content |
|---|---|
docs/管线定义规范.md | Pipeline definition schema & topology (roles/chain/gates/entry…) |
docs/内核接口文档.md | Kernel tool & endpoint reference (pipeline_* / HTTP routes) |
docs/内核设计文档.md | Architecture & responsibilities |
docs/UI-方案-K7-边栏设计.md | Control panel UI design |
License
MIT
收录徽章
[](https://deepseek-plugin.org/plugins/not-big-dog/DSH-pipeline-kernel)把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。