dsh-trellis
Trellis workflow integration for DeepSeek Harness: per-turn workflow-state breadcrumbs, utility commands, and native session identity.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SajoLuo/dsh-trellis说明文档
阅读完整 README ↗dsh-trellis
DeepSeek Harness (dsh) host 插件:把 Trellis 工作流带进 dsh,并尽量沿用 DSH 原生能力补齐 Codex / Claude Code 级体验:
- 每轮 workflow-state 面包屑注入 — 在每个
agent/pre-step,解析项目.trellis/workflow.md的[workflow-state:*]块 + 活跃任务状态(no_task / planning / in_progress),把对应面包屑注入会话(与dsh-agent-instructions的注入管道相同)。未变化不重复注入;被压缩后自动重注入;提示词里出现独立单词no-trellis可跳过当轮。 - 隔离的原生会话上下文身份 — 从当前 agent 的 DSH 原生 session header 生成受管的
DSH_TRELLIS_CONTEXT_ID,让task.py start/create/current解析到会话级 active-task 指针,并在子代理身份不同于 shell 自身 session 时优先使用被转发的身份;插件命令启动的子进程也显式使用同一个 DSH 身份。 - 原生子代理同步 — 安装插件后,Trellis 角色可用 DSH continuable 后台子代理;主会话先继续独立工作,耗尽后调用事件驱动的
trellis_wait。它监听 DSH 的subagent/end,只在原生 settlement notice 已排入父会话后返回,不用 shell sleep、轮询或job_output。 /trellis命令 —/trellis-status(活跃任务 + git 状态)、/trellis-finish(只读检查 + 安全收尾清单,不提前清 active-task 指针)。命令输出不进模型历史;真正的会话收尾走技能面/trellis-finish-work,由技能先归档再写 journal。
非 Trellis 项目不注入面包屑;命令只有被用户显式调用时才会检查并返回“未初始化 Trellis”。
这是 Trellis DSH 适配的可选伴侣插件,不是使用 trellis init --dsh 的前置条件。workflow 会按能力选择路径:存在 trellis_wait 时才使用 continuable 后台派发和事件汇合;未安装插件时,依赖结果的子代理从一开始就用 run_in_background: false 前台派发。两条路径都禁止 sleep 或轮询,Trellis CLI 也不会自动安装任何 DSH profile 插件。
安装
# 装进实际使用的 profile(均在该 profile 下次启动时生效)
dsh plugin --profile web add dsh-trellis
dsh plugin --profile headless add dsh-trellis
# 如果你维护独立的 tui profile,也需要装进该 profile
dsh plugin --profile tui add dsh-trellis
dsh plugin 会把插件安装到指定 profile;每个实际使用的 profile 都需要单独安装。升级到 npm 上的最新版本:
dsh plugin --profile web update dsh-trellis
dsh plugin --profile headless update dsh-trellis
对 tui profile 使用同样的 update,并在该 profile 下次启动时生效。
如果要从源码开发或验证尚未发布的版本,可以改用本地 file: 安装:
git clone https://github.com/SajoLuo/dsh-trellis.git
cd dsh-trellis
pnpm install --frozen-lockfile
dsh plugin --profile headless add file:C:/path/to/dsh-trellis
file: 插件会作为 profile 内的 pnpm 快照安装;拉取源码更新后,尤其是版本新增文件时,需要先 remove 再 add 刷新该 profile。
配套要求:项目的 Trellis 平台需包含 dsh(trellis init --dsh,见 Trellis-DeepSeekHarness 适配分支),且 需包含读取原生 的适配(已含在同一分支)。插件目标版本为 DSH ;升级 DSH 时应重跑本仓测试。