@ray1270/dsh-task-stack
A persistent multi-step task stack for DeepSeek Harness agents: focus_task / focus_complete / read_focus plus a /focus command, with zero automatic prompt injection 适合需要让Agent具备任务拆解、状态追踪和焦点管理能力的场景。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Ray1270/dsh-task-stack方式 A:作为 profile bundle 安装(常规使用)
## 配置
在 profile patch 层的该行 `config:` 下配置,全部可选;Cordis 会在插件启动**之前**校验,越界直接拒绝加载该插件并在启动日志里指出字段(不会静默夹紧成另一个策略)。
| 字段 | 默认 | 约束 | 含义 |
| --- | --- | --- | --- |
| `stateDir` | `.dsh/task-stack` | 非空、**相对**路径 | 状态文件目录,相对会话工作区 |
| `maxStackDepth` | `20` | 整数 ≥ 1 | 栈上最多同时开着的任务数;超过则 `focus_task` 拒绝 |
| `historyLimit` | `100` | 整数 ≥ 1 | `history` 最多保留多少条完成记录,从最旧的开始裁剪 |
| `statePruneDays` | `0` | 整数 ≥ 0(0 = 不清理) | 插件加载时删除超过这么多天没写过的会话状态文件 |
```yaml
- insert:
- id: @ray1270/dsh-task-stack
name: @ray1270/dsh-task-stack
config:
stateDir: .dsh/task-stack
maxStackDepth: 20
historyLimit: 100
statePruneDays: 30 # 可选:清掉一个月没动过的会话
statePruneDays 是尽力而为的维护动作,以 process.cwd() 为工作区、在插件加载后异步执行,只删 stateDir 里直接存放的 *.json:
- 文件的 mtime 就是它最后一次写入时间;
- 目录不存在、没有任何文件要删 → 静默跳过,不是错误;
- 崩在写入中途留下的
*.tmp不删(留给人工注意); - 每个删除都走同一把 per-file 锁,不会和正在进行的 read-modify-write 交错;
- 清理慢或失败只写一行日志,绝不影响插件激活。