p2coder/dsh-task-control 预览 preview

p2coder/dsh-task-control

在输入区暂停/恢复/取消正在运行的对话任务:强制暂停立即中断并记住被中断的工具,安全暂停等工具/推理完成后再落地,恢复时需确认;默认暂停粒度可在设置中配置(出厂 safe wait)。

Project Overview项目介绍

This is a native plugin built exclusively for DSH Web. It adds core task control capabilities: pausing, resuming, and canceling in-progress tasks. It supports multiple pause modes including safe wait, safe stop, and force pause, and resumes execution from the exact pause point to avoid redoing completed work. The current release is built and tested for DSH v0.1.1-rc.2, the latest stable DSH Web version at time of release. To install the plugin, run the command dsh plugin --profile web add github:p2coder/dsh-task-control via the DSH CLI, then fully restart the DSH Web server and refresh your browser page after installation completes.

After installation, three permanent control buttons will appear next to the input bar when a task is running. The buttons are for pause, resume, and cancel respectively, and change color to indicate whether they are available for click. You can trigger controls via buttons or use slash commands for specific pause modes, including /pause force for immediate interrupt and /resume to continue. You can also adjust your default pause mode in the DSH settings panel under "Task Control", and changes take effect immediately after saving. This plugin also exposes an API for other DSH plugins to consume, letting third-party plugins check task state and control task flow.

All task pause state is stored by default in the ~/.dsh/task-control/ directory, so state persists across DSH restarts and will not be lost when you close the app. You can change the storage directory by setting the DSH_TASK_CONTROL_STATE_DIR environment variable if needed. The plugin is released under the open source MIT license, so it is free to use, modify, and distribute. There are several important caveats to note: force pause can leave partial side effects from in-progress tools, pause only applies to the current task round, and dispatched sub-agents will not be paused by a parent task pause. The UI polls for state updates every 2 seconds, and you need to restart DSH Web after modifying the plugin code.

dsh-task-control 是专为 DSH Web 开发的原生插件,为 DSH 任务增加了暂停、恢复和取消能力,支持安全暂停与强制暂停等多种暂停模式,恢复任务时可从断点处继续执行,不会重复已完成的工作。该插件当前适配最新的 DSH v0.1.1-rc.2 版本,可通过 DSH CLI 执行 dsh plugin --profile web add github:p2coder/dsh-task-control 安装,安装后需完整重启 dsh web 并刷新浏览器页面生效。

安装完成后,任务运行时输入框旁会显示三个常驻控制按钮,分别对应暂停、恢复、取消功能,灰色按钮表示当前不可用,黑色按钮可点击触发操作。除可视化按钮操作外,用户也可以通过斜杠命令调用不同模式的暂停、恢复、取消操作,还能在设置面板中修改默认暂停模式,保存后立即生效。该插件还开放了API供其他DSH插件调用,支持第三方插件获取任务状态、控制任务流转。

任务暂停状态默认保存在 ~/.dsh/task-control/ 目录,重启 DSH 后状态也不会丢失,用户可通过环境变量 DSH_TASK_CONTROL_STATE_DIR 修改存储目录。该插件采用 MIT 许可证开源免费使用,使用中需要注意不同暂停模式的限制:比如强制暂停可能导致工具产生部分副作用,暂停仅控制当前回合,发送新消息会开启新回合。子代理不会被父任务暂停,状态同步每2秒轮询一次,修改插件后需重启dsh web。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:p2coder/dsh-task-control

把 p2coder/dsh-task-control 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-task-control

Awesome DSH Plugin

English | 中文

dsh-task-control 鲸鱼娘宣传图

为 DSH Web 增加任务暂停、恢复和取消能力。支持安全暂停与强制暂停,恢复时从暂停点继续,不重复已完成的工作。

当前适配 DSH v0.1.1-rc.2(最新版本)。

安装

dsh plugin --profile web add github:p2coder/dsh-task-control

安装后请完整重启 dsh web,然后刷新浏览器页面。

快速使用

任务运行时,输入框旁会显示三个常驻按钮:

按钮 作用 可用状态
⏸ 暂停 按默认粒度暂停任务 运行中
▶ 恢复 从暂停点继续 已暂停
⏹ 取消 立即终止当前回合 运行中或已暂停

灰色按钮表示当前不可用,黑色按钮表示可点击。

暂停、恢复、取消按钮的位置与状态

暂停模式

模式 行为 适合场景
safe wait(默认) 等待推理和工具自然完成后暂停 长任务、迁移、测试
safe stop 工具完成后暂停;可中断当前推理 希望更快暂停
force 立即中断推理及在途工具 紧急停止

在「设置 → 任务控制」中修改默认模式,保存后立即生效:

任务暂停粒度配置步骤

命令

命令 说明
/pause 按设置中的默认模式暂停
/pause force 强制暂停
/pause safe wait 安全暂停,不中断推理
/pause safe stop 安全暂停,可中断推理
/resume 恢复任务
/resume confirm rerun 重新执行被中断或未派发的工具后恢复
/resume confirm skip 跳过该工具后恢复
/cancel 取消当前回合

通过斜杠命令调用任务控制

供其他插件调用

通过 ctx.get("taskControl") 获取服务:

API 作用
pause(sessionId, options?) 暂停任务
resume(sessionId, options?) 恢复任务
cancel(sessionId) 取消任务
state(sessionId) 查询 idle、running 或 offline 状态及暂停信息

暂停状态保存在 ~/.dsh/task-control/,重启后不会丢失。测试时可用 DSH_TASK_CONTROL_STATE_DIR 修改存储目录。

注意事项

情况 说明
强制暂停 工具可能已产生部分副作用;恢复前可选择重新执行、跳过或保持暂停
safe wait 的未派发工具 恢复时需要选择重新执行或跳过
暂停期间发送新消息 会开启新回合;暂停只控制当前回合
定时提醒 dsh-schedule 到期后仍会唤醒
子代理 已派发的子代理不会被父任务暂停
状态同步 浏览器每 2 秒轮询一次,修改插件后需重启 dsh web

测试

node test/host-smoke.mjs
← 上一个 Prev dsh-moon-light 下一个 Next dsh-101 →