dsh-trellis 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -14
- package/lib/breadcrumb.js +2 -1
- package/lib/commands.js +12 -1
- package/lib/wait-tool.js +11 -6
- package/lib/working-directory.js +22 -0
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -10,12 +10,12 @@ DeepSeek Harness (dsh) host 插件:把 [Trellis](https://github.com/mindfold-a
|
|
|
10
10
|
|
|
11
11
|
非 Trellis 项目不注入面包屑;命令只有被用户显式调用时才会检查并返回“未初始化 Trellis”。
|
|
12
12
|
|
|
13
|
-
这是 Trellis DSH 适配的**可选伴侣插件**,不是使用 `trellis init --dsh`
|
|
13
|
+
这是 Trellis DSH 适配的**可选伴侣插件**,不是使用 `trellis init --dsh` 的前置条件。存在 `trellis_wait` 时可使用 continuable 后台派发和事件汇合。未安装插件时,只有工具 schema 明确支持 `run_in_background` 的旧宿主才设置 `run_in_background: false`;DSH `0.2.1-alpha.2` 已移除该参数,统一立即返回 child ID,应让父会话结束当前轮、由原生完成通知唤醒,或直接在主会话完成工作。收到 child ID 不代表依赖步骤通过;没有可用的事件汇合或可靠原生通知路径时不要派发。所有路径都禁止 sleep 或轮询,Trellis CLI 不会自动安装任何 DSH profile 插件。
|
|
14
14
|
|
|
15
15
|
## 安装
|
|
16
16
|
|
|
17
17
|
```powershell
|
|
18
|
-
# 装进实际使用的 profile
|
|
18
|
+
# 装进实际使用的 profile;CLI 修改在下次启动时加载
|
|
19
19
|
dsh plugin --profile web add dsh-trellis
|
|
20
20
|
dsh plugin --profile headless add dsh-trellis
|
|
21
21
|
|
|
@@ -27,14 +27,14 @@ dsh plugin --profile tui add dsh-trellis
|
|
|
27
27
|
|
|
28
28
|
DSH `0.2.0-rc.2` 的 macOS / Windows 桌面端可在菜单栏“Manage dsh command”中安装或管理内置 `dsh` 命令,无需单独安装 Node 或 pnpm。先用 `dsh --version` 确认 PATH 中实际调用的版本;旧的全局 CLI 可能与桌面端不同。桌面端默认使用 `desktop` profile,其他 profile 仍需分别安装。
|
|
29
29
|
|
|
30
|
-
新版本刚发布时,插件页预览的版本可能与安装器最终选择的版本不同。需要本版插件 `0.1.
|
|
30
|
+
新版本刚发布时,插件页预览的版本可能与安装器最终选择的版本不同。需要本版插件 `0.1.13` 时,在插件页输入 `dsh-trellis@0.1.13`,或显式安装到实际使用的 profile:
|
|
31
31
|
|
|
32
32
|
```powershell
|
|
33
|
-
dsh plugin --profile desktop add dsh-trellis@0.1.
|
|
33
|
+
dsh plugin --profile desktop add dsh-trellis@0.1.13
|
|
34
34
|
# Web / headless 用户将 desktop 替换为对应 profile 名称。
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
DSH
|
|
37
|
+
DSH `0.2.0-rc.2` 发布说明曾引入 pnpm 11;其默认新版本等待期为 24 小时,裸包名可能暂时解析到较旧版本。不要仅凭“RC.2”推断其他版本的包管理器:以实际宿主和解析结果为准。显式版本安装仍须通过版本准入,不需要关闭全局等待期或绕过兼容性检查。参见 [DSH 0.2.0-rc.2 更新说明](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.0-rc.2) 与 [pnpm 11 发布说明](https://pnpm.io/blog/releases/11.0)。
|
|
38
38
|
|
|
39
39
|
日常升级命令:
|
|
40
40
|
|
|
@@ -43,7 +43,7 @@ dsh plugin --profile web update dsh-trellis
|
|
|
43
43
|
dsh plugin --profile headless update dsh-trellis
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
对 `tui` profile 使用同样的 update
|
|
46
|
+
对 `tui` profile 使用同样的 update。CLI 在进程外修改 profile 后,应重启对应 DSH 进程。`0.2.1-alpha.3` 起,运行中的插件管理器可对满足 HMR 条件的包执行代码热替换;无法热替换时会提示需要重启,以实际结果为准。整包/组件开关只证明卸载与重挂,不等同于包代码已更新。更换 DSH 宿主 release 后,还需按页面提示刷新浏览器,避免旧 Web 壳连接新宿主。参见[插件管理器生命周期](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-rc.2/packages/boot/plugin-manager/README.md)。
|
|
47
47
|
|
|
48
48
|
DSH `0.1.6-alpha.2` 也可从 Web 侧栏“插件 → 添加插件”安装包。Web 安装后需要手动启用;CLI `add` 默认启用。安装命令仍是 `dsh plugin --profile <name> add <package>`,无需增加额外安装脚本。
|
|
49
49
|
|
|
@@ -57,18 +57,31 @@ pnpm run build:client
|
|
|
57
57
|
dsh plugin --profile headless add file:C:/path/to/dsh-trellis
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
`file:` 插件会作为 profile 内的 pnpm 快照安装;拉取源码更新后,尤其是版本新增文件时,需要先 remove 再 add 刷新该 profile
|
|
60
|
+
`file:` 插件会作为 profile 内的 pnpm 快照安装;拉取源码更新后,尤其是版本新增文件时,需要先 remove 再 add 刷新该 profile。外部 CLI 刷新快照后重启对应进程,不要假定源码目录变化会自动热更新。
|
|
61
61
|
|
|
62
|
-
配套要求:项目的 Trellis 平台需包含 dsh(`trellis init --dsh`,见 Trellis-DeepSeekHarness 适配分支),且 `.trellis/scripts` 需包含读取原生 `DSH_SESSION_ID`
|
|
62
|
+
配套要求:项目的 Trellis 平台需包含 dsh(`trellis init --dsh`,见 Trellis-DeepSeekHarness 适配分支),且 `.trellis/scripts` 需包含读取原生 `DSH_SESSION_ID` 的适配(已含在同一分支)。现有 `engines.dsh` 和 Host peer 范围已接纳 `0.2.1-rc.2`,无需为每个预发布标签追加范围。`0.2.1-alpha.4` 起宿主优先检查显式 `engines.dsh`,仅未声明时才回退 DSH peer;其 `includePrerelease: true` 规则与 npm 默认匹配不同。通过准入不等于实际兼容,不应使用 `allow-version` 绕过缺失的 API。开发基线固定为 `0.2.0-rc.1`,隔离回归覆盖开发章节的十二个明确宿主,不代表测试了范围内所有版本。Web 配置只在具备对应 client surface 的 profile 中加载。参见[官方版本声明迁移说明](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-rc.2/docs/upgrade-guide/v0.2.1-alpha.3/plugin-engines-dsh/guide.md)。
|
|
63
63
|
|
|
64
64
|
运行时需要 profile 提供 `sessionProjections` 服务;该依赖由插件的 `inject` 声明。自定义或精简 profile 若未组装此服务,需先加载 `@deepseek-ai/dsh-session-projection`,否则插件会等待依赖,不会退回直接扫描历史。
|
|
65
65
|
|
|
66
|
+
### 0.1.13:DSH 0.2.1-rc.2 兼容回归
|
|
67
|
+
|
|
68
|
+
- 补齐 alpha.3 / alpha.4 / alpha.5 / RC.1 / RC.2 的隔离回归与 Windows/Linux CI 目标,按各版实际发布的 Cordis、Schemastery、Include 和 Loader 精确配对;未知宿主直接拒绝,不猜测依赖组合。
|
|
69
|
+
- 新增版本准入声明和依赖矩阵回归。保留 `0.2.0-rc.1` 开发基线、现有 peer / engine 范围及插件运行时代码,不新增清单格式、安装脚本或强制升级路径。
|
|
70
|
+
- 修正安装、热替换、AgentPreset、SDK 会话和技能缓存边界说明。本版仅更新插件仓库;不改 Trellis 模板、现有项目或另行跟进的上游 PR。实际验证范围见 [RC.2 验证记录](docs/validation-dsh-0.2.1-rc.2.md),远端 CI 与发布状态以对应标签和 npm 为准。
|
|
71
|
+
|
|
66
72
|
### 0.1.11:DSH 0.2.0-rc.2 兼容验证
|
|
67
73
|
|
|
68
74
|
- 增加 `0.2.0-rc.2` 隔离回归与 Windows/Linux CI 目标;本地 RC.1 / RC.2 均为 130 项通过、无失败或跳过,RC.2 独立 Web profile 验收通过。
|
|
69
75
|
- 现有 `^0.2.0-rc.1` 已覆盖 RC.2,无需扩展 peer 或新增运行时补丁。开发基线仍为锁定的 RC.1。
|
|
70
76
|
- 补充桌面内置 CLI、profile 区别及显式版本安装说明。本版不包含 Trellis CLI 的归档与嵌套身份补丁,它们在独立适配分支中维护。范围与限制见[RC.2 验证记录](docs/validation-dsh-0.2.0-rc.2.md);远端 CI 和发布状态以对应标签为准。
|
|
71
77
|
|
|
78
|
+
### 0.1.12:DSH 0.2.1-alpha.2 适配
|
|
79
|
+
|
|
80
|
+
- 面包屑和两条命令按每次调用读取 agent 作用域的 `workingDirectory.ensure()`,支持切换项目/worktree及目录恢复;仅旧宿主没有服务时才使用原始 `header.cwd`。目录验证失败不偷偷回退旧项目,原生 session ID 不随目录改变。
|
|
81
|
+
- `trellis_wait` 只证明匹配的执行结算;完成通知投递另由宿主负责。兼容字段 `settlementNoticeQueued=false` 表示未证明入队,**不表示确认未投递**。通过依赖门禁前仍需检查子代理报告或 transcript;inactive 快照保持 unknown。
|
|
82
|
+
- 为 DSH、Cordis 和 Schemastery 显式声明已验证 alpha peer 范围,保留 RC 开发基线及旧宿主范围;移除无直接用途的 `dsh-invariants` 开发依赖。新增 alpha.2 精确工具链隔离回归与 CI 目标,不升级本机 DSH。
|
|
83
|
+
- alpha 用户可显式安装 `dsh-trellis@0.1.12`。Trellis 模板在独立适配工作区同步,不包含在 npm 插件包中,也不是官方 Trellis npm 升级;现有项目的 workflow 不会被插件自动改写。测试结果及边界见 [alpha.2 验证记录](docs/validation-dsh-0.2.1-alpha.2.md),远端 CI 与发布状态以对应标签为准。
|
|
84
|
+
|
|
72
85
|
### 0.1.10:DSH 0.2.0-rc.1 适配
|
|
73
86
|
|
|
74
87
|
- 七项 DSH peer 和 `engines.dsh` 新增 `^0.2.0-rc.1`;旧的 `^0.1.7-rc.1` 不接纳 0.2。开发依赖及锁文件升级到 0.2,Windows/Linux CI 配置继续覆盖四条旧宿主线。使用 0.2 宿主时请安装插件 0.1.10 或更新版本,0.1.9 不包含这项适配。
|
|
@@ -139,8 +152,11 @@ Headless、rc.6 或需要声明部署默认值时,仍可在 profile 的 `cordi
|
|
|
139
152
|
- **注入去重**(`lib/breadcrumb-projection.js`):投影仅保存面包屑的事件序号和 source/content 指纹,与 DSH 已维护的 `session.surface.nodes` 一起确定最后可见面包屑。恢复、分叉和重载均从 projection 重建;不缓存“本进程最后注入”的临时判断,也不扫描完整事件历史。
|
|
140
153
|
- **会话身份**:DSH 原生提供 `DSH_SESSION_ID = agent.session.header.id`,并先丢弃环境中已有的 `DSH_*` 再重建受管命名空间。Trellis beta 因此会在同时看到 `DSH_SHELL=1` 与 `DSH_SESSION_ID` 时优先解析当前 DSH 身份,即使没有插件也不会被外层 host 继承的 `TRELLIS_CONTEXT_ID` 串任务。插件通过 `shellEnv` 为每次执行额外生成 `DSH_TRELLIS_CONTEXT_ID = dsh_<session-id>`,用于转发可能不同于 shell 自身 session 的子代理身份;主会话与子代理仍各自保留 DSH 身份,子代理通过派发 prompt 首行的 `Active task:` 和角色 prelude 取得父任务上下文。
|
|
141
154
|
- **Headless 会话**:默认每次 `dsh --profile headless` 调用都会创建新 DSH session。需要跨轮保留 active-task 指针时,应保持同一会话,或在支持的宿主上用 `--session-id` 明确继续已有会话;不能把多个未指定身份的独立调用当成同一 session。
|
|
142
|
-
-
|
|
143
|
-
-
|
|
155
|
+
- **工作目录**:优先读取当前 agent 的可选 `workingDirectory` 服务,跟随宿主提交的目录切换/恢复;仅服务不存在时回退 session header。服务故障不会触发旧目录操作。切换目录不会替换会话身份,不会复制任务指针;新目录按同一身份查找自己的指针。
|
|
156
|
+
- **取消与生命周期**:命令和 `trellis_wait` 都继承 DSH invocation 的 `AbortSignal`;取消后命令不会继续尝试另一个 Python 启动器,等待工具也会立即注销临时事件监听器。结算事件不能单独证明父会话通知入队,因此 `settlementNoticeQueued` 保守返回 false(未验证);仅从 catalog 看到 inactive 时保持 `unknown`,不猜任务通过。插件卸载或 Settings 重挂时,还会取消自己的活跃等待和待消费面包屑,不删除用户消息或任务记录。
|
|
157
|
+
- **子代理并发**:主会话先做独立工作,需要汇合时用 `trellis_wait` 等待直接 continuable 子代理的结算。以实际工具目录、schema 和 PTC/SDK 绑定为准,不假定它一定是顶层直接可调用的模型工具。无插件时根据实际工具 schema 选择旧宿主前台参数,或 alpha.2 的父会话 yield/原生通知路径;不存在可靠事件路径时主会话直接做工作。SDK 的 `session/wait` 不是可以假定存在的模型工具。所有路径都必须检查结果后才能推进依赖步骤。
|
|
158
|
+
- **AgentPreset 与 SDK**:新宿主通过 `agentPreset` 组合子代理策略,不再发送移除的 `persona` / `toolFilter`;模型侧仅在宿主公开可用列表时使用 `agent_preset`,fork 保持宿主原生的预设继承,不自行拼接身份。SDK `session/resume` 恢复原生 session ID、历史和有效目录,本身不派发模型回合;初始化的模型路由不是新的 Trellis 身份。插件不保存或搬运模型凭据。参见[预设迁移](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-rc.2/docs/upgrade-guide/v0.2.1-alpha.1/subagent-preset-composition/guide.md)与[SDK 契约](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-rc.2/packages/sdk/server/README.md)。
|
|
159
|
+
- **技能目录刷新**:alpha.5 的技能缓存修正响应插件管理器变化,不等于任意磁盘 `SKILL.md` 修改或外部 CLI 更新都会推送刷新。执行 `trellis init/update` 后,按宿主的预设切换或重连路径刷新技能目录;本插件不增加全局缓存失效补丁。可选 Discover 使用独立插件索引,并非 Trellis marketplace gitlink;普通包安装无需创建索引。参见[技能缓存](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-rc.2/packages/client/ui-skill/README.md)和[插件索引](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-rc.2/docs/user/guide/plugin-market.md)。
|
|
144
160
|
|
|
145
161
|
## 开发
|
|
146
162
|
|
|
@@ -150,17 +166,29 @@ pnpm run build:client
|
|
|
150
166
|
pnpm test # node --test test/*.test.js
|
|
151
167
|
pnpm run test:compat 0.1.5-rc.2 # 临时副本中安装旧宿主并运行同一套测试
|
|
152
168
|
pnpm run test:compat 0.1.7-rc.2 # RC.2 动态工具与面包屑集成回归
|
|
153
|
-
pnpm run test:compat 0.2.0-rc.2 #
|
|
154
|
-
|
|
169
|
+
pnpm run test:compat 0.2.0-rc.2 # 保留 0.2.0 RC.2 回归
|
|
170
|
+
pnpm run test:compat 0.2.1-alpha.2 # 新工作目录与统一 activation 契约
|
|
171
|
+
pnpm run test:compat 0.2.1-rc.2 # 当前 RC.2 隔离回归
|
|
172
|
+
pnpm run test:compat # 默认跑全部十二个显式目标
|
|
155
173
|
```
|
|
156
174
|
|
|
157
|
-
GitHub Actions 配置在 Windows / Linux 的 Node 24 环境执行锁定的 `0.2.0-rc.1`
|
|
175
|
+
GitHub Actions 配置在 Windows / Linux 的 Node 24 环境执行锁定的 `0.2.0-rc.1` 安装、客户端构建、测试、其余十一个宿主的隔离回归及打包检查。测试覆盖真实 Session/projection 的恢复、分叉、压缩和 checkpoint,临时项目的精确绑定与任务错误恢复,以及新版真实 Loader 的 volatile 更新、子代理目录/查询/驻留状态;新版专属测试在旧宿主明确跳过。另有编译客户端 React 渲染、slot 生命周期、原子保存与拒绝写入测试。配置了 CI 目标不等于远端 CI 已运行,结果以对应提交为准。
|
|
158
176
|
|
|
159
177
|
RC.2 集成用例运行真实 AgentLoop、Loader、ToolRuntime 和 Session,以本地脚本化模型响应验证三种 `toolUpdate` 能力:不支持、`addition-only`、`in-history`。覆盖插件启停的工具增删消息、Settings 重挂不重复注入、混合历史的恢复/分叉投影,以及 surface 替换后重建工具基线并重新注入面包屑。等待工具另覆盖目录损坏/不存在及卸载期间查询失败的错误保留与监听器清理。该验证不调用外部模型,也不替代 Web 浏览器或真实子代理派发验收;详情见 [2026-09-28 验证记录](https://github.com/SajoLuo/dsh-trellis/blob/main/docs/validation-dsh-0.1.7-rc.2.md)。
|
|
160
178
|
|
|
161
179
|
0.2 集成用例另以真实 AgentLoop / ToolRuntime / Session 和实际 `trellis_wait` 验证失败工具历史的补齐顺序、错误分类、监听器清理及继续会话的消息配对。只注入 scheduler 故障和本地模型响应,不增加运行时补丁或自动重试;旧宿主按 `ToolCallRecovery` 能力明确跳过。还覆盖“目录查询期间收到成功结算、随后查询失败”的竞争,查询错误不能被伪装成成功。
|
|
162
180
|
|
|
163
|
-
`test:compat` 不改当前 checkout
|
|
181
|
+
`test:compat` 不改当前 checkout 的依赖,临时副本保留在系统临时目录并打印路径供检查。十二个目标采用以下明确配对,不按“非最新版本”猜测;未知宿主必须先核对官方包并补齐测试。
|
|
182
|
+
|
|
183
|
+
| DSH 目标 | Cordis | Schemastery | Include | Loader |
|
|
184
|
+
|---|---|---|---|---|
|
|
185
|
+
| 0.1.5-rc.2、0.1.6-alpha.2 | 4.0.2 | 3.18.2 | 1.0.7 | 1.0.3 |
|
|
186
|
+
| 0.1.7-rc.1 / rc.2、0.2.0-rc.1 / rc.2 | 4.0.4 | 3.18.4 | 1.0.9 | 1.0.5 |
|
|
187
|
+
| 0.2.1-alpha.2 | 4.0.5-alpha.1 | 3.18.5-alpha.1 | 1.0.10-alpha.1 | 1.0.6-alpha.1 |
|
|
188
|
+
| 0.2.1-alpha.3 / alpha.4 / alpha.5 | 4.0.5-alpha.2 | 3.18.5-alpha.2 | 1.0.10-alpha.2 | 1.0.6-alpha.2 |
|
|
189
|
+
| 0.2.1-rc.1 / rc.2 | 4.0.5 | 3.18.5 | 1.0.10 | 1.0.6 |
|
|
190
|
+
|
|
191
|
+
发布前还应使用隔离 `DSH_HOME` 启动真实 Web profile,验证配置保存/读回、整包及组件开关、重新挂载和卸载;不复用个人凭据或会话。代码 HMR、外部 CLI 快照刷新和浏览器跨宿主 release 刷新是不同验收项,不能用一次开关测试代替。当前结果与未覆盖项见 [2026-10-18 验证记录](docs/validation-dsh-0.2.1-rc.2.md)。
|
|
164
192
|
|
|
165
193
|
Host half 是直接由 `main` 加载的 ESM JavaScript;Web half 通过 tsdown 生成 DSH lazy-CJS factory 到 `lib/client.js`。`pnpm pack` 会在 prepack 阶段自动重建客户端 bundle。
|
|
166
194
|
|
package/lib/breadcrumb.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
7
7
|
import { resolveTrellisState, sanitizeContextKey } from "./workflow.js";
|
|
8
8
|
import { nodeFs } from "./node-fs.js";
|
|
9
|
+
import { resolveWorkingDirectory } from "./working-directory.js";
|
|
9
10
|
|
|
10
11
|
export const SOURCE_KIND = "dsh-trellis";
|
|
11
12
|
export const SOURCE_FORM = "breadcrumb";
|
|
@@ -98,7 +99,7 @@ export function createBreadcrumbComposer(resolved, ctx, dependencies = {}) {
|
|
|
98
99
|
if (resolved.maxBytes <= 0 || !Number.isFinite(resolved.maxBytes))
|
|
99
100
|
return undefined;
|
|
100
101
|
if (hasSkipKeyword(messages, resolved.skipKeyword)) return undefined;
|
|
101
|
-
const cwd = agent
|
|
102
|
+
const cwd = await resolveWorkingDirectory(ctx, agent, signal);
|
|
102
103
|
const sessionId = agent.session.header.id ?? "";
|
|
103
104
|
const contextKey =
|
|
104
105
|
sessionId === "" ? "" : `dsh_${sanitizeContextKey(sessionId)}`;
|
package/lib/commands.js
CHANGED
|
@@ -16,6 +16,7 @@ import { join } from "node:path";
|
|
|
16
16
|
import { findProjectRoot } from "./workflow.js";
|
|
17
17
|
import { nodeFs } from "./node-fs.js";
|
|
18
18
|
import { dshContextKey } from "./session-env.js";
|
|
19
|
+
import { resolveWorkingDirectory } from "./working-directory.js";
|
|
19
20
|
|
|
20
21
|
const execFileAsync = promisify(execFile);
|
|
21
22
|
|
|
@@ -119,7 +120,17 @@ export function registerCommands(ctx, resolved, dependencies = {}) {
|
|
|
119
120
|
};
|
|
120
121
|
|
|
121
122
|
const withProject = async (invocation, fn) => {
|
|
122
|
-
|
|
123
|
+
let cwd;
|
|
124
|
+
try {
|
|
125
|
+
cwd = await resolveWorkingDirectory(ctx, invocation.agent, invocation.signal);
|
|
126
|
+
} catch (error) {
|
|
127
|
+
return {
|
|
128
|
+
kind: "error",
|
|
129
|
+
text: invocation.signal?.aborted
|
|
130
|
+
? "Trellis command cancelled."
|
|
131
|
+
: `Cannot resolve the current DSH working directory: ${error?.message ?? String(error)}`,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
123
134
|
const root = await findProjectRoot(cwd, resolved.projectRootMarkers, fs);
|
|
124
135
|
if (root === null) {
|
|
125
136
|
return {
|
package/lib/wait-tool.js
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Trellis dispatches role agents in DSH's default background mode so the main
|
|
5
5
|
* agent can keep doing independent work. When that work is exhausted, this
|
|
6
6
|
* tool provides a native synchronization point: it waits for `subagent/end`,
|
|
7
|
-
* which
|
|
8
|
-
*
|
|
7
|
+
* which proves execution settlement, not delivery of a parent notice (alpha.2
|
|
8
|
+
* delivery is best effort and caller-owned activations may omit it entirely).
|
|
9
|
+
* It deliberately replaces shell sleeps and polling loops.
|
|
9
10
|
*
|
|
10
11
|
* @module dsh-trellis/wait-tool
|
|
11
12
|
*/
|
|
@@ -79,7 +80,8 @@ function settledResult(subagentId, info) {
|
|
|
79
80
|
assistantOutputBlocks: Array.isArray(info?.lastAssistantMessage)
|
|
80
81
|
? info.lastAssistantMessage.length
|
|
81
82
|
: 0,
|
|
82
|
-
|
|
83
|
+
// Compatibility field: false means unverified, not proven non-delivery.
|
|
84
|
+
settlementNoticeQueued: false,
|
|
83
85
|
};
|
|
84
86
|
}
|
|
85
87
|
|
|
@@ -144,7 +146,10 @@ export function registerWaitTool(ctx) {
|
|
|
144
146
|
runId: { type: "string", required: true },
|
|
145
147
|
provider: { type: "string", required: true },
|
|
146
148
|
assistantOutputBlocks: { type: "number", required: true },
|
|
147
|
-
settlementNoticeQueued: {
|
|
149
|
+
settlementNoticeQueued: {
|
|
150
|
+
type: "boolean", required: true,
|
|
151
|
+
description: "Compatibility field: false means notice delivery is unverified, not proven absent.",
|
|
152
|
+
},
|
|
148
153
|
},
|
|
149
154
|
},
|
|
150
155
|
render(_args, value) {
|
|
@@ -160,14 +165,14 @@ export function registerWaitTool(ctx) {
|
|
|
160
165
|
return [
|
|
161
166
|
{
|
|
162
167
|
type: "text",
|
|
163
|
-
text: `subagent ${value.subagentId} settled with ${value.outcome} (${value.stopReason}); do not treat this gate as passed;
|
|
168
|
+
text: `subagent ${value.subagentId} settled with ${value.outcome} (${value.stopReason}); do not treat this gate as passed; settlement notice delivery is unverified`,
|
|
164
169
|
},
|
|
165
170
|
];
|
|
166
171
|
}
|
|
167
172
|
return [
|
|
168
173
|
{
|
|
169
174
|
type: "text",
|
|
170
|
-
text: `subagent ${value.subagentId} completed;
|
|
175
|
+
text: `subagent ${value.subagentId} completed; settlement notice delivery is unverified; inspect its report or transcript before passing a dependent gate`,
|
|
171
176
|
},
|
|
172
177
|
];
|
|
173
178
|
},
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isAbsolute } from "node:path";
|
|
2
|
+
|
|
3
|
+
/** Resolve each operation's current directory without changing session identity. */
|
|
4
|
+
export async function resolveWorkingDirectory(ctx, agent, signal) {
|
|
5
|
+
signal?.throwIfAborted();
|
|
6
|
+
const owner = agent?.ctx ?? ctx;
|
|
7
|
+
const service = agent ? owner.get?.("workingDirectory") : undefined;
|
|
8
|
+
if (service === undefined) {
|
|
9
|
+
return agent?.session?.header?.cwd ?? process.cwd();
|
|
10
|
+
}
|
|
11
|
+
// An available service owns validation/recovery. Never hide its failures by
|
|
12
|
+
// falling back to the original project and inspecting the wrong task.
|
|
13
|
+
if (typeof service.ensure !== "function") {
|
|
14
|
+
throw new Error("DSH workingDirectory service does not support ensure().");
|
|
15
|
+
}
|
|
16
|
+
const cwd = await service.ensure(agent, signal);
|
|
17
|
+
signal?.throwIfAborted();
|
|
18
|
+
if (typeof cwd !== "string" || !isAbsolute(cwd)) {
|
|
19
|
+
throw new Error("DSH workingDirectory service returned an invalid directory.");
|
|
20
|
+
}
|
|
21
|
+
return cwd;
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-trellis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Trellis workflow integration for DeepSeek Harness: per-turn workflow-state breadcrumbs, utility commands, and native session identity.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
"test:compat": "node scripts/test-compat.mjs"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@deepseek-ai/cordis": "^4.0.2",
|
|
59
|
-
"@deepseek-ai/dsh-commands": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
60
|
-
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
61
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
62
|
-
"@deepseek-ai/dsh-settings": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
63
|
-
"@deepseek-ai/dsh-shell-env": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
64
|
-
"@deepseek-ai/dsh-subagent": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
65
|
-
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1",
|
|
66
|
-
"@deepseek-ai/schemastery": "^3.18.2"
|
|
58
|
+
"@deepseek-ai/cordis": "^4.0.2 || ^4.0.5-alpha.1",
|
|
59
|
+
"@deepseek-ai/dsh-commands": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1 || ^0.2.1-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1 || ^0.2.1-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1 || ^0.2.1-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1 || ^0.2.1-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-shell-env": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1 || ^0.2.1-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-subagent": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1 || ^0.2.1-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1 || ^0.2.1-alpha.2",
|
|
66
|
+
"@deepseek-ai/schemastery": "^3.18.2 || ^3.18.5-alpha.1"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"@deepseek-ai/cordis": {
|
|
@@ -110,7 +110,6 @@
|
|
|
110
110
|
"@deepseek-ai/dsh-commands": "0.2.0-rc.1",
|
|
111
111
|
"@deepseek-ai/dsh-home-paths": "0.2.0-rc.1",
|
|
112
112
|
"@deepseek-ai/dsh-http-proxy": "0.2.0-rc.1",
|
|
113
|
-
"@deepseek-ai/dsh-invariants": "0.2.0-rc.1",
|
|
114
113
|
"@deepseek-ai/dsh-llm": "0.2.0-rc.1",
|
|
115
114
|
"@deepseek-ai/dsh-sandbox": "0.2.0-rc.1",
|
|
116
115
|
"@deepseek-ai/dsh-scope": "0.2.0-rc.1",
|
|
@@ -130,11 +129,12 @@
|
|
|
130
129
|
"@deepseek-ai/schemastery": "3.18.4",
|
|
131
130
|
"react": "19.2.8",
|
|
132
131
|
"react-dom": "19.2.8",
|
|
132
|
+
"semver": "7.8.5",
|
|
133
133
|
"tsdown": "^0.22.2",
|
|
134
134
|
"@deepseek-ai/dsh-ptc-runtime": "0.2.0-rc.1"
|
|
135
135
|
},
|
|
136
136
|
"engines": {
|
|
137
137
|
"node": ">=24",
|
|
138
|
-
"dsh": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1"
|
|
138
|
+
"dsh": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1 || ^0.1.3-alpha.1 || ^0.1.5-alpha.1 || ^0.1.6-alpha.2 || ^0.1.7-rc.1 || ^0.2.0-rc.1 || ^0.2.1-alpha.2"
|
|
139
139
|
}
|
|
140
140
|
}
|