dsh-orchestrator:在 DSH 里统一编排多智能体与会话外任务

前言

在 DeepSeek Harness(DSH)里做复杂自动化时,常见做法是:在单个会话里靠模型自己记状态,或手工开多个聊天窗口、另起终端跑命令。前者难以并行、也难以追踪「哪条聊天在跑、哪条命令在哪台机器上执行」;后者缺少统一视图,也不方便让当前会话通过工具去 spawn、prompt、取消其它 agent。

下面介绍社区插件 dsh-orchestrator(npm 包名 @lucagiftzek/dsh-orchestrator)。它在依赖 dsh-better-sidebar 的前提下增加 Orchestrate 侧栏页,并提供 14 个 orch_* 工具、四类可追踪任务、可配置的 runner 与 provider 卡片,以及带密钥保护的 machine API,把「多 agent 聊天」和「命令 / 抓取 / HTTP / agent 型任务」收拢到同一套设置驱动的工作流里。

这是什么

dsh-orchestrator 由维护者 lucagiftzek 发布,分类属于 DSH 社区目录中的「工作流」。一句话定位:为 DSH 提供 Agent swarm + task orchestration——在 Orchestrate 页里创建、列表、prompt、fork(拆分会话)、fan-out 与取消 agent 聊天;创建并跟踪 command、scrape、http、agent 四类任务;在 local、ssh 或远程 tool server 上执行命令;展示外部集成状态卡片;并通过 machine API 供其它主机把本机当作 runner。

插件声明依赖 DSH >= 0.1.1-rc.1、Node >= 22.5、web profile,且需 dsh-better-sidebar 作为 Tab 宿主。当前 npm 版本为 0.1.1(以 package.json 为准)。runners、providers、预设、并发上限与 API secret 等均写在 Settings → Orchestrator(或 cordis 配置行),代码中不硬编码主机、命令或凭据。

核心功能

Orchestrate 侧栏页

安装并重启 dsh-web 后,在侧栏 + 菜单中打开 Orchestrate。页内分为五块:

区块 作用
agents 列出 live / cold 聊天,支持 quick prompt、stop、带 transcript 的 chat 抽屉(含 fork、cancel),以及带 fan-out 的 + new agent
tasks 列出任务状态、runner、运行中任务的 live output(自动轮询),可取消;+ new task 覆盖四种类型
runners 执行目标及健康探测
providers 集成状态卡片(例如可选 HPC allocation 的 headline、队列、collector 健康等)
api machine API 密钥管理、curl 示例与 tool-server 契约说明

Tab 上的 badge 统计当前活跃工作(运行中的 agent + 运行中的 task)。

会话工具(orch_*)

通过标准 ctx.tools 注册,与会话内其它核心工具行为一致。README 列出的工具包括:

工具 用途
orch_status 一屏总览:agents、按状态分的 tasks、runners、providers
orch_agents_list 列出聊天(含搜索)
orch_agent_status 单个聊天运行状态与最近 user/assistant 文本
orch_agent_prompt 向指定聊天投递消息(id、唯一前缀或精确标题);cold 聊天可恢复
orch_agent_spawn 创建聊天,可选首条 prompt;count 配合 {i} 做 fan-out
orch_agent_fork 将会话已完成轮次 fork 到新 session 再 prompt
orch_agent_cancel 取消当前轮(队列中工作保留)
orch_task_create 创建并运行任务
orch_task_list / orch_task_status / orch_task_output 列表 / 查看 / 读输出
orch_task_cancel 取消任务(杀 runner 进程或取消 agent 轮次)
orch_runners runner 清单与健康探测
orch_providers provider 状态卡片

任务类型

type 主要 spec 输出
command command, cwd, runner, timeoutMs stdout + stderr(有上限)
scrape urls[], extract, selector, attribute, pattern 等 每 URL 状态与提取数据的 JSON 行
http url, method, body, headers, expectStatus, timeoutMs 响应体(有上限)
agent prompt, count, forkOf, promptExisting, preset, cwd 等 聊天本身; settled 后为 assistant 答案

全局并发上限与排队、取消、可修剪的持久历史与审计事件日志均适用。任务会 best-effort 镜像到 ctx.jobs,以便出现在内置 Background Tasks 视图。command 任务可流式写入 stdout/stderr;scrape 在 settle 前会记录 per-URL 进度行。

Runners 与 Providers

Runners(在 Settings 中声明):

  • local:本机 bash -lc <command>,环境做了 scrub(例如无 SSH_AUTH_SOCK、不继承密钥类 secret)
  • ssh:ssh <target> -- <command>,target、二进制、超时等为运维配置
  • http:远程 tool server,契约为 POST {url} {kind, spec, timeoutMs} → {ok, status, output, detail};任意运行本插件的主机在 /dsh-orchestrator/api/remote/run 提供该接口;鉴权 token 通过调用时读取的 env(secretEnv),不写入存储

选择顺序:显式 runner id → 配置的 default → 在已启用 runner 间 round-robin。

Providers:

  • hpc(可选):自建的 HPC allocation 状态服务,读 {url}/health 与 {url}/state
  • http:任意 JSON 状态端点,常见键如 ok / health / status / headline 会高亮展示

Machine API

提供 secret 保护的 machine API:可 prompt 聊天、spawn agent、创建任务,并对外提供 tool-server 契约,使其它主机能把本机当作执行面。Orchestrate 页的 api 区块负责密钥管理与示例 curl。

安装与启用

环境要求:DSH >= 0.1.1-rc.1、Node >= 22.5、web profile、dsh-better-sidebar(若尚未安装 Tab 宿主,需先装)。

若尚未安装侧栏宿主,可先执行(README 原文):

dsh plugin --profile web add dsh-better-sidebar   # the tab host, skip if installed

再安装 orchestrator(npm 或 GitHub 二选一):

dsh plugin --profile web add @lucagiftzek/dsh-orchestrator
# or from GitHub: dsh plugin --profile web add github:lucagiftzek/dsh-orchestrator

包声明了 dsh.bundle,dsh plugin add 后会出现在 dsh.profile.bundles。仓库中 lib/ 已提交,无需本地 build。

重启 dsh-web:客户端部分刷新浏览器即可挂载;宿主侧(tools、settings namespace、API route)需要重启。README 说明完整步骤见 cordis.patch.yml。

挂载后可用仓库脚本做宿主侧校验(可选 port、secret):

bash scripts/verify-host.sh [port] [secret]

会检查 health、dashboard 形状、trust fence、CSRF gate,以及在提供 secret 时的 machine probe 往返。

典型用法

  1. 从 Tab 管理 swarm:在 agents 区 spawn 多个 agent,用 fan-out 把同质工作拆到 {i} 插值的多个聊天;在抽屉里看 transcript、fork 分支会话或 cancel 当前轮。
  2. 从 Tab 或工具跑任务:在 tasks 新建 command(指定 runner 与 cwd)、scrape(多 URL 确定性提取,无模型参与 loop)、http 或 agent 任务;运行中在 Tab 或 orch_task_output 看 live output。
  3. 在会话里编排:对当前 DSH 会话说明目标,让模型调用 orch_agent_spawn / orch_task_create / orch_status 等,无需离开聊天即可完成跨 agent、跨 runner 的编排。
  4. 多机协作:在一台机器配置 http runner 指向另一台已安装本插件且暴露 /dsh-orchestrator/api/remote/run 的 tool server,用 env 中的 secret 鉴权,把命令或任务 fan-out 到远程 box。

以上步骤均来自 README 描述的能力组合;具体 Settings 字段与安全模型(trust fence、kill switches 等)以 README 的 Settings reference、Security model、Kill switches 章节为准。

适用场景与注意

适合谁:需要在 DSH web 侧统一管理多个 agent 会话、并在 local / ssh / 远程 plugin 实例上跑命令或结构化抓取/HTTP 的开发者;希望会话内工具与侧栏 UI 共用同一套状态与审计日志的团队。

权限与安全:任务与 runner 以 当前 dsh 进程权限 执行;local runner 仍会 scrub 部分环境,但 ssh 与远程调用取决于你的 target 与 secret 配置。安装前应阅读仓库 LICENSE、Security model 与源码,确认 machine API secret、CSRF 与 kill switch 是否符合你的部署边界。插件来自社区目录 SkillHub 插件页,与 DeepSeek / 幻方无官方从属关系;DSH 生态理念是「一切皆插件」,本文仅介绍该插件在 README 中声明的行为。

结尾

dsh-orchestrator 把 Orchestrate 页、orch_* 工具、四类任务、三类 runner、provider 卡片与 machine API 连成一条设置驱动的工作流线,适合在 DSH 里做 agent swarm 与会话外自动化。进一步了解安装细节与配置项,见 GitHub 仓库 lucagiftzek/dsh-orchestrator 与目录页 https://www.skillhub.cn/plugins/lucagiftzek/dsh-orchestrator。

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜