@dsh-routines/bundle
dsh-routines — scheduled agents for DSH: run a prompt on a cron, get the digest where you already are (file digests, chatnode delivery, unattended-safe)
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Jesse-njx/dsh-routines说明文档
阅读完整 README ↗dsh-routines
DSH 的定时 Agent —— 按 cron 跑一个 prompt,把摘要送到你已经在的地方。
dsh-routines 是 DeepSeek Harness 的插件 bundle。routine(例程) 是一个「命名 prompt + 调度 + 投递」,以纯 YAML 文件存放 —— 可人工 diff、可 git 提交。调度器把每个到期例程通过 headless runner 作为独立的一次性会话启动(完整会话日志 = 免费审计,之后可用 dsh-replay 回放),然后投递摘要:最后一条 assistant 消息较短时直接用它,否则对会话日志做一次性摘要调用。
┌──────────────────────┐ 每日 02:00 ┌──────────────────────────────┐
│ dsh --profile ops │ ─────────────▶ │ dsh --profile headless │
│ 调度器 tick │ 独立会话,cwd │ "跑测试套件,……" │
│ 读取 .dsh/routines │ = 例程 cwd, │ 审批策略: never │
│ /*.yaml │ 审批: never) └──────────────┬───────────────┘
└──────────────────────┘ │ 运行记录: 状态、
│ 摘要 + 运行记录 │ 摘要、会话 id、
▼ │ 被拒绝的权限
.dsh/routines/runs/.json (+ .md) ──► file 投递(始终开启)
ctx.chatnode(可选) ──► chatnode 投递(软依赖)
旗舰示例 —— 夜间测试分诊
凌晨 2 点跑测试套件、诊断最高优先级失败、在项目里留下摘要的例程;装了会话节点后,摘要还会发到微信,你回复即可批准后续操作(v0.2;v0.1 投递到文件,装了节点也可投递 chatnode)。
# ~/work/projectx/.dsh/routines/nightly-tests.yaml
name: nightly-tests
schedule: "0 2 * * *" # 5 段 cron;也支持 "@daily"、"every 4h"
timezone: Asia/Shanghai # 显式指定,不静默使用宿主机时区
prompt: |
Run the test suite. If anything fails, diagnose the top failure
and draft a fix on a branch. Summarize in `;该 profile 必须支持一次性运行(包含 headless bundle,或同样安装本 bundle —— 运行 overlay 无论如何都会禁用嵌套的调度器)。
### 调度宿主
调度器在安装了本 bundle 的 profile 内 tick,所以也可以把 bundle 加进你的 `web` profile,web 应用运行期间例程就会触发:
```console
dsh plugin --profile web add @dsh-routines/bundle
保持进程存活即可触发调度;dsh --profile ops(无内参)即守护模式(CLI 保持安静,调度器掌管进程生命周期)。
例程文件
例程位于两个被监听的目录(改动热重载;非法文件会被报告,不会让 store 崩溃):
| 目录 | 作用域 |
|---|---|
/.dsh/routines/*.yaml | 项目例程(同名覆盖全局) |
~/.dsh/routines/*.yaml | 全局例程 |
| 字段 | 默认 | 含义 |
|---|---|---|
name | —(必填) | [a-z0-9][a-z0-9-]*,≤ 64 字符 |
schedule | —(必填) | 0 2 * * *、@daily、@hourly、@weekly、@monthly、@yearly、、 |