DeepSeek Harness 插件

Sev7een/dsh-plugin-automations

Star 数 ★ 2 分类 工作流与自动化 收录于 2026-08-14

设置页定时任务:支持准点或 DeepSeek 谷时段执行、单次/每日重复,并持久化任务状态。

安装

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:Sev7een/dsh-plugin-automations

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

English | 简体中文

dsh-plugin-automations

为 DeepSeek Harness Web Profile 提供定时任务:支持仅一次执行或标准六字段 Cron 周期,并可选择准点执行或谷时段执行。

功能特性

  • 设置页“定时任务”表单与任务列表,每 5 秒轮询一次。
  • 两种执行方式:准点执行和空闲执行(谷时段)。
  • 两种调度类型:仅一次和标准六字段 Cron;Cron 使用宿主进程本地时区。
  • when_idle 仅在北京时间高峰 09:00-12:00、14:00-18:00 之外执行;高峰期内自动顺延至下一个谷时段。
  • 可选 Session 标题模板支持全部任务字段和 Moment 风格的日期格式,例如 Daily Feed · {{scheduledAt:YYYY-MM-DD}}。
  • 使用 ctx.storageDomain 持久化任务状态。
  • 单一串行 Scheduler pump,先持久化 running 再启动 Runner。
  • 每次执行使用独立 Session,并继承默认 Agent preset、模型和 Host workspace root。
  • 固定 30 分钟执行超时,并在启动时明确恢复 host_interrupted 任务。
  • 严格校验 JSON、请求大小、同源 Origin 和自定义 mutation header。
  • 自动化消息标记为 { kind: 'plugin', plugin: 'dsh-plugin-automations' },不伪装成直接人类输入。

完整行为契约见 SDD.zh-CN.md。

安装

dsh plugin add(推荐)

将插件安装到 Web profile,安装后重启 DSH。

从 GitHub 安装
dsh plugin --profile web add github:Sev7een/dsh-plugin-automations
从 npm 安装

软件包发布到 npm 后使用:

dsh plugin --profile web add dsh-plugin-automations

如果通过 npx 运行 DSH,请使用:

npx @deepseek-ai/dsh plugin --profile web add github:Sev7een/dsh-plugin-automations

检查组合配置并重新启动 Web 应用:

dsh --profile web --dump-config
dsh web

启动后进入 设置 → 定时任务。

从本地源码安装(开发)

git clone https://github.com/Sev7een/dsh-plugin-automations.git
dsh plugin --profile web add ./dsh-plugin-automations

卸载

dsh plugin --profile web remove dsh-plugin-automations

使用说明

执行方式

模式 行为
on_time 准点执行 到期后创建独立 DSH Session 并立即执行。
when_idle 空闲执行 仅在北京时间谷时段执行;高峰期到期的任务等待到下一个谷时段。

调度类型

调度类型 行为
once 仅一次 进入终态后不再执行。
cron 每个 occurrence 进入终态后计算下一次匹配时间;失败的 occurrence 不自动重试。

HTTP API

  • POST /dsh-scheduled-tasks/api/v1/tasks
    • Content-Type: application/json
    • X-DSH-Scheduled-Tasks: 1
    • Body:{ prompt, schedule, mode, sessionTitleTemplate? }
  • GET /dsh-scheduled-tasks/api/v1/tasks
curl -X POST http://127.0.0.1:3080/dsh-scheduled-tasks/api/v1/tasks \
  -H 'Content-Type: application/json' \
  -H 'X-DSH-Scheduled-Tasks: 1' \
  -d '{
    "prompt": "check project tests",
    "schedule": { "type": "cron", "expression": "0 0 8 * * *" },
    "mode": "on_time",
    "sessionTitleTemplate": "Daily Feed · {{scheduledAt:YYYY-MM-DD}}"
  }'

MVP 不提供编辑、删除、暂停、取消、重试或分页接口。

开发

npm install --legacy-peer-deps
npm run check
npm test
npm run build
npm pack --dry-run

当前本地开发需要 --legacy-peer-deps,因为公开的 @deepseek-ai/dsh-storage-domain 仍携带旧版 peer range,而当前 DSH Web bundle 使用更新版本。

许可

MIT

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。