@stardustlc/dsh-dream 0.3.2 → 0.3.3

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.en.md CHANGED
@@ -10,7 +10,9 @@ Humans consolidate memories by replaying the day during sleep — dsh-dream give
10
10
 
11
11
  ## Compatibility
12
12
 
13
- Adapted to the session contracts in `@deepseek-ai/dsh@0.1.3-alpha.1`. Follows the cordis patch-bundle model (`cordis.patch.yml` + `dsh.bundle.patch`), with no runtime imports of `@deepseek-ai/*` internals. Reads v0/v1/v2 plaintext JSONL and multi-frame zstd, legacy packed chunks, and v2 embedded streams. When migrations retain older generations, only the newest canonical file is selected per session.
13
+ Verified with official `@deepseek-ai/dsh@0.1.5-rc.1` and Node `24.16.0` on 2026-09-11: all 18 components load alongside Modlens, with passing tool-schema, skill-registration and offline read-only invocation checks. Uses the `cordis.patch.yml` + `dsh.bundle.patch` bundle model. Node requirements match this Harness release: 22.19 or later within 22.x, or 24 or later. Live external-service workflows require separate configuration and validation.
14
+
15
+ Reads v0/v1/v2/v3 plaintext JSONL and multi-frame zstd, legacy packed chunks and v2/v3 embedded streams. Only the newest canonical file is selected per session. PTC child calls retain tool names without double counting; system prompts, reasoning, tool arguments and result bodies are excluded.
14
16
 
15
17
  Default data directories follow `DSH_HOME`: `sessions` for session logs and `.dsh-dream` for the journal. Without `DSH_HOME`, the base is `~/.dsh`. Explicit `sessionsRoot` and `journalDir` settings take precedence.
16
18
 
package/README.md CHANGED
@@ -10,7 +10,9 @@
10
10
 
11
11
  ## 兼容性
12
12
 
13
- 按 `@deepseek-ai/dsh@0.1.3-alpha.1` 的会话接口适配。遵循 cordis 组合包补丁模型(`cordis.patch.yml` + `dsh.bundle.patch`),运行时不 import 任何 `@deepseek-ai/*` 内部模块。支持 v0/v1/v2 的普通 JSONL 与多帧 zstd、旧 packed-chunk 行和 v2 内嵌 stream。升级留下多个代际文件时,每个会话只读取最新规范文件。
13
+ 已在官方 `@deepseek-ai/dsh@0.1.5-rc.1`、Node `24.16.0` 上验证(2026-09-11):18 个组件与 Modlens 同载,工具 schema、技能注册及离线只读调用检查通过。采用 `cordis.patch.yml` + `dsh.bundle.patch` 组合包模型。Node 要求与该版本 Harness 一致:22.19 及以上的 22.x,或 24 及以上。外部服务的实际业务操作需按各组件配置单独验证。
14
+
15
+ 支持 v0/v1/v2/v3 的普通 JSONL 与多帧 zstd、旧 packed-chunk 行及 v2/v3 内嵌 stream;升级留下多代文件时只读取每个会话的最新规范文件。PTC 子工具调用保留工具名且不重复计数,不提取系统提示、推理、工具参数或结果正文。
14
16
 
15
17
  默认从 `DSH_HOME/sessions` 读取会话、在 `DSH_HOME/.dsh-dream` 保存日记;未设置 `DSH_HOME` 时使用 `~/.dsh`。配置中的 `sessionsRoot`、`journalDir` 始终优先。
16
18
 
package/lib/sessions.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * DSH 会话日志读取:兼容 v0/v1/v2 的 JSONL 与多帧 zstd。
2
+ * DSH 会话日志读取:兼容 v0/v1/v2/v3 的 JSONL 与多帧 zstd。
3
3
  * 首个逻辑行是会话头({ type: 'session', ... }),其后每行一条存储记录({ type, seq, time, data })。
4
4
  * 本模块只读不写;损坏帧/行一律容错跳过。
5
5
  *
@@ -92,7 +92,7 @@ export function digestSessionFile(filePath, maxUserMessages) {
92
92
  const first = JSON.parse(lines[0]);
93
93
  if (first.type !== 'session')
94
94
  return null;
95
- if (first.version !== undefined && ![0, 1, 2].includes(first.version))
95
+ if (first.version !== undefined && ![0, 1, 2, 3].includes(first.version))
96
96
  return null;
97
97
  header = {
98
98
  id: String(first.id ?? ''),
@@ -156,7 +156,7 @@ export function digestSessionFile(filePath, maxUserMessages) {
156
156
  const time = typeof rec.time === 'number' ? rec.time : typeof rec.time0 === 'number' ? rec.time0 : null;
157
157
  if (time !== null && (digest.endedAt === null || time > digest.endedAt))
158
158
  digest.endedAt = time;
159
- // v2 把流式片段内嵌进 message/attempt;v0 的独立打包行继续兼容。
159
+ // v2/v3 把流式片段内嵌进 message/attempt;v0 的独立打包行继续兼容。
160
160
  if ((type === 'assistant/message' || type === 'assistant/attempt') && typeof data === 'object' && data !== null) {
161
161
  const stream = data.stream;
162
162
  if (Array.isArray(stream))
@@ -182,7 +182,8 @@ export function digestSessionFile(filePath, maxUserMessages) {
182
182
  digest.assistantTail.shift();
183
183
  }
184
184
  }
185
- else if (type === 'tool/call') {
185
+ else if (type === 'tool/call' || type === 'tool/code-dispatch-start' || type === 'tool/ptc-dispatch-start') {
186
+ // PTC 子调用只记录开始事件,避免与完成事件重复计算;不提取参数或结果正文。
186
187
  if (typeof data === 'object' && data !== null)
187
188
  appendToolName(data.name);
188
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stardustlc/dsh-dream",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "DSH 做梦插件:agent 在会话间隙回放近期对话(dream_digest)、反思并写入梦境日记(dream_save/journal/recall),高频教训幂等桥接进 AGENTS.md(dream_bridge),六工具含健康自检。多帧 zstd 会话读取,默认隐私脱敏,零运行时依赖。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -43,7 +43,7 @@
43
43
  ],
44
44
  "license": "MIT",
45
45
  "engines": {
46
- "node": ">=22.13"
46
+ "node": "^22.19.0 || >=24.0.0"
47
47
  },
48
48
  "dependencies": {},
49
49
  "devDependencies": {