dsh-trellis 0.1.3 → 0.1.4

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 CHANGED
@@ -44,18 +44,21 @@ dsh plugin --profile headless add file:C:/path/to/dsh-trellis
44
44
 
45
45
  `file:` 插件会作为 profile 内的 pnpm 快照安装;拉取源码更新后,尤其是版本新增文件时,需要先 remove 再 add 刷新该 profile。
46
46
 
47
- 配套要求:项目的 Trellis 平台需包含 dsh(`trellis init --dsh`,见 Trellis-DeepSeekHarness 适配分支),且 `.trellis/scripts` 需包含读取原生 `DSH_SESSION_ID` 的适配(已含在同一分支)。v0.1.3 的 Host peer 范围显式覆盖 DSH `0.1.0-rc.6+`、`0.1.1-rc.1+` 与 `0.1.2-alpha.1+` 三条已知预发布线,避免 npm 的 prerelease 语义把新版 Host 误判为不兼容;Host 侧 Settings 桥同时兼容 rc.8 的包级 helper 与 alpha.2/alpha.3 的 provider 方法。本仓开发依赖仍固定在 `0.1.0-rc.8`,Web 配置卡片只在具备 settings/client surface 的 profile 中加载。
48
-
49
- ### DSH rc.8 对齐说明
50
-
51
- - 已采用:command lifecycle 的 `recordInput`、command attachment envelope 的 fail-closed 输入检查、`subagent/end` 的 run/provider/final-output 元数据、rc.8 的 report-before-settlement 与 idle-parent 原生唤醒语义。
52
- - 已接入:Host `dsh-trellis` settings namespace 与 `dsh.client` 浏览器卡片。保存值写入 DSH 的 `settings.yaml` 用户层,并实时重挂插件 runtime;settings provider 单独重载时退回 loader 配置,插件自身卸载时则不会错误重挂 runtime。没有 settings 服务的 profile 继续使用原有 loader 配置。DSH 0.1.2 alpha 已将可选 Settings 生命周期迁到 `settings.installSection()`;插件会在运行时选择对应 API,不再静态导入已移除的 helper。
53
- - 保持可选:`trellis_wait` 仍是“父会话还在当前轮里、需要明确同步点”时的工具;已经 yield 的父会话直接由 DSH 原生 settlement notice 唤醒。
54
- - 暂不接入:Agent Teams 在 rc.8 仍位于 `packages/experimental` 且不随正式 npm family 发布。Trellis 不应为此引入私有依赖;等它进入公开稳定面后再评估共享 task board / mailbox 映射。
55
-
56
- ## 配置
57
-
58
- DSH rc.8 Web profile 直接打开“设置 → 插件 → 插件配置 → Trellis 工作流”。保存内容进入该 DSH_HOME 的 `settings.yaml`,优先级高于 profile 组合层并立即生效。
47
+ 配套要求:项目的 Trellis 平台需包含 dsh(`trellis init --dsh`,见 Trellis-DeepSeekHarness 适配分支),且 `.trellis/scripts` 需包含读取原生 `DSH_SESSION_ID` 的适配(已含在同一分支)。Host peer 范围显式覆盖 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+` 五条已知预发布线,避免 npm 的 prerelease 语义把新版 Host 误判为不兼容;本仓开发与回归基线固定在 `0.1.5-alpha.2`。Host 侧 Settings 桥同时兼容旧版包级 helper 与当前 provider 方法,Web 配置卡片只在具备 settings/client surface 的 profile 中加载。
48
+
49
+ ### DSH 0.1.5-alpha.2 对齐说明
50
+
51
+ - 已适配:Session V3 通过 `eventAt()` / `snapshotEvents()` 读取可见事件,并保留旧 session collection 回退;插件不直接读取磁盘会话日志,因此不需要自行迁移 V3 文件格式。
52
+ - 已核对:插件不依赖 0.1.5 移除的 `ctx.agent` 或可构造 `Inbox`;pre-step 从事件载荷取得 agent,工具从 `exec.agent` 取得调用方,待处理消息只使用 `agent.inbox` 当前公开的 `nextStep`、`prepend`、`replace` 与 `remove`。
53
+ - 已采用:command lifecycle 的 `recordInput`、command attachment envelope 的 fail-closed 输入检查、`subagent/end` 的 run/provider/final-output 元数据,以及 report-before-settlement 与 idle-parent 原生唤醒语义。
54
+ - 已接入:Host `dsh-trellis` settings namespace 与 `dsh.client` 浏览器卡片。保存值写入 DSH 的 `settings.yaml` 用户层,并实时重挂插件 runtime;settings provider 单独重载时退回 loader 配置,插件自身卸载时则不会错误重挂 runtime。没有 settings 服务的 profile 继续使用原有 loader 配置。当前可选 Settings 生命周期由 `settings.installSection()` 承担;插件仍在运行时兼容旧版 helper。
55
+ - 已对齐:`dsh.client.inject` 指向的三个 DSH client 包与 React 都只作为浏览器构建输入保留在 `devDependencies`,发布安装不会重复解析 Web 壳已经提供的模块。
56
+ - 保持可选:`trellis_wait` 仍是“父会话还在当前轮里、需要明确同步点”时的工具;已经 yield 的父会话直接由 DSH 原生 settlement notice 唤醒。
57
+ - 保持直接归属:`trellis_wait` 继续使用 `listChildren(parent.id)` 验证 direct continuable child;这与 0.1.5 修正后的可继续子代理归属一致,不会把子代理误当作根会话参与调度。
58
+
59
+ ## 配置
60
+
61
+ 支持 Settings provider 的 DSH Web profile 可直接打开“设置 → 插件 → 插件配置 → Trellis 工作流”。保存内容进入该 DSH_HOME 的 `settings.yaml`,优先级高于 profile 组合层并立即生效。
59
62
 
60
63
  Headless、rc.6 或需要声明部署默认值时,仍可在 profile 的 `cordis.patch.yml` 里覆盖(整行替换);Web 卡片的“恢复配置文件值”会清除用户层字段并重新继承这里的值:
61
64
 
package/lib/breadcrumb.js CHANGED
@@ -61,10 +61,26 @@ export function isBreadcrumbMessage(message) {
61
61
  );
62
62
  }
63
63
 
64
+ /** Read one session event across the current and legacy DSH session APIs. */
65
+ export function sessionEventAt(session, seq) {
66
+ if (typeof session.eventAt === "function") return session.eventAt(seq);
67
+ if (typeof session.events?.get === "function") return session.events.get(seq);
68
+ return session.events?.[seq];
69
+ }
70
+
64
71
  /** Whether the same breadcrumb payload is already visible in the session surface. */
65
72
  export function isBreadcrumbVisible(agent, digest) {
66
- const visibleSeqs = new Set(agent.session.surface.nodes);
67
- for (const [seq, event] of agent.session.events.entries()) {
73
+ const { session } = agent;
74
+ const visibleSeqs = new Set(session.surface.nodes);
75
+ // Current DSH sessions, including Session V3, expose an immutable on-demand
76
+ // snapshot. Keep the legacy collection fallback for older versions covered
77
+ // by our peer range.
78
+ const events =
79
+ typeof session.snapshotEvents === "function"
80
+ ? session.snapshotEvents()
81
+ : session.events;
82
+ for (const [fallbackSeq, event] of events.entries()) {
83
+ const seq = event?.seq ?? fallbackSeq;
68
84
  if (!visibleSeqs.has(seq) || event.type !== "user/message") continue;
69
85
  const source = event.data?.source;
70
86
  if (
package/lib/index.js CHANGED
@@ -22,7 +22,11 @@
22
22
  import { isDeepStrictEqual } from "node:util";
23
23
  import * as settingsModule from "@deepseek-ai/dsh-settings";
24
24
  import { Config, resolveConfig } from "./config.js";
25
- import { createBreadcrumbComposer, isBreadcrumbMessage } from "./breadcrumb.js";
25
+ import {
26
+ createBreadcrumbComposer,
27
+ isBreadcrumbMessage,
28
+ sessionEventAt,
29
+ } from "./breadcrumb.js";
26
30
  import { registerCommands } from "./commands.js";
27
31
  import { registerSessionEnv } from "./session-env.js";
28
32
  import { installSettingsSectionCompat } from "./settings-compat.js";
@@ -133,9 +137,9 @@ function registerBreadcrumb(ctx, resolved) {
133
137
  const syncInbox = (agent, desired) => {
134
138
  const pending = agent.inbox.nextStep.filter(isBreadcrumbMessage);
135
139
  const alreadySupplied =
136
- desired === undefined ||
137
- agent.session.surface.nodes.some((seq) => {
138
- const event = agent.session.events[seq];
140
+ desired === undefined ||
141
+ agent.session.surface.nodes.some((seq) => {
142
+ const event = sessionEventAt(agent.session, seq);
139
143
  return (
140
144
  event?.type === "user/message" &&
141
145
  event.data !== undefined &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-trellis",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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",
@@ -53,18 +53,14 @@
53
53
  "prepack": "pnpm run build:client"
54
54
  },
55
55
  "peerDependencies": {
56
- "@deepseek-ai/cordis": "^4.0.1",
57
- "@deepseek-ai/dsh-commands": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1",
58
- "@deepseek-ai/dsh-client-locale": "^0.1.0-rc.8 || ^0.1.1-rc.1 || ^0.1.2-alpha.1",
59
- "@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.8 || ^0.1.1-rc.1 || ^0.1.2-alpha.1",
60
- "@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.0-rc.8 || ^0.1.1-rc.1 || ^0.1.2-alpha.1",
61
- "@deepseek-ai/dsh-llm": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1",
62
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1",
63
- "@deepseek-ai/dsh-shell-env": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1",
64
- "@deepseek-ai/dsh-subagent": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1",
65
- "@deepseek-ai/dsh-tools": "^0.1.0-rc.6 || ^0.1.1-rc.1 || ^0.1.2-alpha.1",
66
- "@deepseek-ai/schemastery": "^3.18.1",
67
- "react": "^18.2.0"
56
+ "@deepseek-ai/cordis": "^4.0.2",
57
+ "@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",
58
+ "@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",
59
+ "@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",
60
+ "@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",
61
+ "@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",
62
+ "@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",
63
+ "@deepseek-ai/schemastery": "^3.18.2"
68
64
  },
69
65
  "peerDependenciesMeta": {
70
66
  "@deepseek-ai/cordis": {
@@ -73,15 +69,6 @@
73
69
  "@deepseek-ai/dsh-commands": {
74
70
  "optional": true
75
71
  },
76
- "@deepseek-ai/dsh-client-locale": {
77
- "optional": true
78
- },
79
- "@deepseek-ai/dsh-client-ui-settings": {
80
- "optional": true
81
- },
82
- "@deepseek-ai/dsh-client-ui-settings-plugins": {
83
- "optional": true
84
- },
85
72
  "@deepseek-ai/dsh-llm": {
86
73
  "optional": true
87
74
  },
@@ -97,23 +84,38 @@
97
84
  "@deepseek-ai/dsh-tools": {
98
85
  "optional": true
99
86
  },
100
- "@deepseek-ai/schemastery": {
101
- "optional": true
102
- },
103
- "react": {
104
- "optional": true
105
- }
87
+ "@deepseek-ai/schemastery": {
88
+ "optional": true
89
+ }
106
90
  },
107
- "devDependencies": {
108
- "@deepseek-ai/cordis": "^4.0.1",
109
- "@deepseek-ai/dsh-commands": "0.1.0-rc.8",
110
- "@deepseek-ai/dsh-llm": "0.1.0-rc.8",
111
- "@deepseek-ai/dsh-settings": "0.1.0-rc.8",
112
- "@deepseek-ai/dsh-shell-env": "0.1.0-rc.8",
113
- "@deepseek-ai/dsh-subagent": "0.1.0-rc.8",
114
- "@deepseek-ai/dsh-tools": "0.1.0-rc.8",
115
- "@deepseek-ai/schemastery": "^3.18.1",
116
- "react": "^18.2.0",
91
+ "devDependencies": {
92
+ "@deepseek-ai/cordis": "^4.0.2",
93
+ "@deepseek-ai/dsh-attachment": "0.1.5-alpha.2",
94
+ "@deepseek-ai/dsh-agent": "0.1.5-alpha.2",
95
+ "@deepseek-ai/dsh-client-locale": "0.1.5-alpha.2",
96
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.5-alpha.2",
97
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.5-alpha.2",
98
+ "@deepseek-ai/dsh-code-runtime": "0.1.5-alpha.2",
99
+ "@deepseek-ai/dsh-commands": "0.1.5-alpha.2",
100
+ "@deepseek-ai/dsh-home-paths": "0.1.5-alpha.2",
101
+ "@deepseek-ai/dsh-invariants": "0.1.5-alpha.2",
102
+ "@deepseek-ai/dsh-llm": "0.1.5-alpha.2",
103
+ "@deepseek-ai/dsh-sandbox": "0.1.5-alpha.2",
104
+ "@deepseek-ai/dsh-scope": "0.1.5-alpha.2",
105
+ "@deepseek-ai/dsh-session": "0.1.5-alpha.2",
106
+ "@deepseek-ai/dsh-session-persistence": "0.1.5-alpha.2",
107
+ "@deepseek-ai/dsh-session-projection": "0.1.5-alpha.2",
108
+ "@deepseek-ai/dsh-shell": "0.1.5-alpha.2",
109
+ "@deepseek-ai/dsh-settings": "0.1.5-alpha.2",
110
+ "@deepseek-ai/dsh-shell-env": "0.1.5-alpha.2",
111
+ "@deepseek-ai/dsh-subprocess": "0.1.5-alpha.2",
112
+ "@deepseek-ai/dsh-subagent": "0.1.5-alpha.2",
113
+ "@deepseek-ai/dsh-system-prompt": "0.1.5-alpha.2",
114
+ "@deepseek-ai/dsh-tools": "0.1.5-alpha.2",
115
+ "@deepseek-ai/dsh-user-approval": "0.1.5-alpha.2",
116
+ "@deepseek-ai/dsh-util-time": "0.1.5-alpha.2",
117
+ "@deepseek-ai/schemastery": "^3.18.2",
118
+ "react": "19.2.8",
117
119
  "tsdown": "^0.22.2"
118
120
  }
119
121
  }