@deepseek-ai/dsh-compaction-basic 0.1.7-alpha.2 → 0.1.7-rc.2

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.i18n.yaml CHANGED
@@ -1,6 +1,100 @@
1
- # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
- # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
- # after editing either side, bring the other along and re-record with:
1
+ # Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/compaction/compaction-basic/README.md
5
- README.md: e0a7d90fecf308fa9f83bf87c2bfb5c4ff13f2e3
6
- README.zh.md: 32d4f528e46206c5939dda038b710e01ce912d99
5
+ /:
6
+ en: 4c3172f95eb524e1
7
+ zh: dd92ec1300ad9cbe
8
+ /deepseek-ai-dsh-compaction-basic:
9
+ en: 3ba5f9e37ab36328
10
+ zh: 2390a55415d4c27b
11
+ /deepseek-ai-dsh-compaction-basic/summary:
12
+ en: 31202d573182cc31
13
+ zh: e0a0c96f67a9c1ba
14
+ /deepseek-ai-dsh-compaction-basic/table-of-contents:
15
+ en: d152484eb41ac6b4
16
+ zh: bda879a892f240f0
17
+ /deepseek-ai-dsh-compaction-basic/use-this-package:
18
+ en: b40fa08b8ad55cca
19
+ zh: f8765a6f199c8c7b
20
+ /deepseek-ai-dsh-compaction-basic/use-this-package/what-you-get:
21
+ en: eb8e340061f72b98
22
+ zh: 327a51037b2d1adf
23
+ /deepseek-ai-dsh-compaction-basic/use-this-package/smallest-working-composition:
24
+ en: 4cb73d7a57908948
25
+ zh: 7ba2ddc4c76e4957
26
+ /deepseek-ai-dsh-compaction-basic/use-this-package/tuning-when-condensation-starts:
27
+ en: 3446c54c062d7e34
28
+ zh: fb502c941e508ae0
29
+ /deepseek-ai-dsh-compaction-basic/use-this-package/what-happens-when-condensation-runs:
30
+ en: c872a8ef069596f0
31
+ zh: b3a48e309ae830d4
32
+ /deepseek-ai-dsh-compaction-basic/use-this-package/on-demand-condensation-with-compact:
33
+ en: 4c5067e4c57ca708
34
+ zh: 1c0e70319b9b2112
35
+ /deepseek-ai-dsh-compaction-basic/use-this-package/trimming-oversized-tool-outputs:
36
+ en: 1d6a74c0dc874dc8
37
+ zh: bcfa95549308c030
38
+ /deepseek-ai-dsh-compaction-basic/understand-the-implementation:
39
+ en: deb655b3b1860576
40
+ zh: 79f56e41a9dfe01f
41
+ /deepseek-ai-dsh-compaction-basic/understand-the-implementation/design-philosophy:
42
+ en: 54945a18965f12a8
43
+ zh: fecd5d4fc2f2e6d6
44
+ /deepseek-ai-dsh-compaction-basic/understand-the-implementation/automatic-triggers-and-overflow-recovery:
45
+ en: d62d65547dd0b2dc
46
+ zh: 5c21671f16d94f5a
47
+ /deepseek-ai-dsh-compaction-basic/understand-the-implementation/summarization-mechanics:
48
+ en: 967531b71453eb88
49
+ zh: c7919b46e36763e6
50
+ /deepseek-ai-dsh-compaction-basic/understand-the-implementation/the-region-transaction:
51
+ en: f4330f6bff22d400
52
+ zh: 46e16c51bb66a0f7
53
+ /deepseek-ai-dsh-compaction-basic/understand-the-implementation/config-resolution:
54
+ en: 246736aa86d3013d
55
+ zh: 35e261927ba0699c
56
+ /deepseek-ai-dsh-compaction-basic/understand-the-implementation/source-map:
57
+ en: bd9d1e01ec833593
58
+ zh: cbadca50d8e9ed07
59
+ /deepseek-ai-dsh-compaction-basic/further-exploration:
60
+ en: 84b5b81eb9b5965d
61
+ zh: 7000af0fa502fcc1
62
+ /deepseek-ai-dsh-compaction-basic/model-experience:
63
+ en: 215e7ba838619b7b
64
+ zh: a311da3843709f90
65
+ /deepseek-ai-dsh-compaction-basic/model-experience/conversation-history:
66
+ en: 2e1148dd0f39a281
67
+ zh: cd68c9fff63534af
68
+ /deepseek-ai-dsh-compaction-basic/model-experience/conversation-history/what-the-model-sees:
69
+ en: 8d4325e6659bc314
70
+ zh: f80e69305b39f4a3
71
+ /deepseek-ai-dsh-compaction-basic/model-experience/conversation-history/what-the-model-sees/conversation-checkpoint-preamble:
72
+ en: 129d1eaba2519330
73
+ zh: 3ec517bdc6cb5ae3
74
+ /deepseek-ai-dsh-compaction-basic/model-experience/conversation-history/token-effect:
75
+ en: 872515a75b5a9726
76
+ zh: c0045e1972bbac4e
77
+ /deepseek-ai-dsh-compaction-basic/model-experience/conversation-history/kv-cache-effect:
78
+ en: a22b43f321843aee
79
+ zh: a5960da1bef34441
80
+ /deepseek-ai-dsh-compaction-basic/model-experience/auxiliary-summarizer-request:
81
+ en: 7169bd02a7a6c396
82
+ zh: 7c62e3d4a97c73f7
83
+ /deepseek-ai-dsh-compaction-basic/model-experience/auxiliary-summarizer-request/what-the-model-sees:
84
+ en: b7afcf1cc1c85c40
85
+ zh: a112c5b3984c31dc
86
+ /deepseek-ai-dsh-compaction-basic/model-experience/auxiliary-summarizer-request/what-the-model-sees/compaction-instruction-final-user-message:
87
+ en: 39a362ee4890dbdb
88
+ zh: 3b98699120b1548e
89
+ /deepseek-ai-dsh-compaction-basic/model-experience/auxiliary-summarizer-request/token-effect:
90
+ en: 5e0679cb7cb4291a
91
+ zh: c9df8ebc526b05d9
92
+ /deepseek-ai-dsh-compaction-basic/model-experience/auxiliary-summarizer-request/kv-cache-effect:
93
+ en: d31d3e3d46542c91
94
+ zh: 5a42f873993e0c79
95
+ /deepseek-ai-dsh-compaction-basic/known-limitations-and-deferred-work:
96
+ en: 8f459fa26e079883
97
+ zh: 4acdcefa71ebb409
98
+ /deepseek-ai-dsh-compaction-basic/known-limitations-and-deferred-work/dev-note:
99
+ en: 1fec7b90c3b68c49
100
+ zh: ad9ae54a598846d0
package/README.md CHANGED
@@ -116,7 +116,7 @@ Pressure policy resolves capacity from the adapter that owns the durable route.
116
116
 
117
117
  ### Summarization mechanics
118
118
 
119
- A direct `ctx.llm.stream()` call uses the configured provider/model pair and cap, falling back to the latest logged request target and then the `AgentOptions` pair, without running the loop-only `agent/request` extension point. The call replays the derived `system/message` at surface node 0 as the leading entry of `messages`, followed by the shadowed-region messages (including a shadowed in-history `system/message` in its surface position), and carries the header's tools verbatim — including image references, which the selected adapter must resolve or explicitly reject — and appends the compaction instruction as the final user message, so it reuses the provider's warm prefix cache instead of invalidating it. An empty-content system head contributes no message but remains outside the compacted range. The final instruction is a frozen `RequestUserInput` without durable identity or source; the replayed history and persisted checkpoint remain durable messages. The call sets `GenerateOptions.purpose` to `compaction`; only returned text enters the checkpoint, excluding reasoning and tool calls. Image output fails with `UNSUPPORTED_CONTENT` rather than disappearing. The replacement user message frames the summary with `<compacted-summary>` tags; the raw summary remains on the `compaction/summary` event.
119
+ A direct `ctx.llm.stream()` call uses the configured provider/model pair and cap, falling back to the latest logged request target and then the `AgentOptions` pair, without running the loop-only `agent/request` extension point. The call replays the derived `system/message` at surface node 0 as the leading entry of `messages`, followed by the shadowed-region messages (including a shadowed in-history `system/message` in its surface position), and supplies the header's active tools for route-specific projection. The selected adapter must resolve image references in the replayed messages or explicitly reject them. The call appends the compaction instruction as the final user message, preserving the provider's warm prefix where projection permits. An empty-content system head contributes no message but remains outside the compacted range. The final instruction is a frozen `RequestUserInput` without durable identity or source; the replayed history and persisted checkpoint remain durable messages. The call sets `GenerateOptions.purpose` to `compaction`; only returned text enters the checkpoint, excluding reasoning and tool calls. Image output fails with `UNSUPPORTED_CONTENT` rather than disappearing. The replacement user message frames the summary with `<compacted-summary>` tags; the raw summary remains on the `compaction/summary` event. The call also carries `Session.toolHistory()` so the runtime can project deferred and retained definitions; a prefix missing update messages uses active declarations without developer updates.
120
120
 
121
121
  ### The region transaction
122
122
 
@@ -184,7 +184,7 @@ Replacing rather than append-only. Each checkpoint invalidates reuse from the fi
184
184
 
185
185
  #### What the model sees
186
186
 
187
- The summarization model receives the conversation replayed verbatim — the same system prompt, tool schemas, and messages the last routed request sent for the shadowed region — followed by one final user message: the compaction instruction below. The conversation model never sees this private request or its reasoning; only returned text is stored.
187
+ The summarization model receives the system prompt and shadowed-region history, with tool declarations and developer updates projected for its route, followed by one final user message: the compaction instruction below. The conversation model never sees this private request or its reasoning; only returned text is stored.
188
188
 
189
189
  ##### Compaction instruction (final user message)
190
190
 
package/README.zh.md CHANGED
@@ -116,7 +116,7 @@ kind: "package-reference"
116
116
 
117
117
  ### 摘要机制
118
118
 
119
- 直接 `ctx.llm.stream()` 调用使用已配置的提供方/模型对与上限,回退到最新已记录请求目标,然后再回退到 `AgentOptions` 对,而不运行仅用于 agent loop 的 `agent/request` 扩展点。该调用将 surface 节点 0 处派生的 `system/message` 作为 `messages` 的首项回放,后接已遮蔽区域消息(包括位于其 surface 位置的被遮蔽历史内 `system/message`),并逐字携带 header 的工具——包括所选适配器必须解析或明确拒绝的图片引用——并将压缩指令作为最后一条 user 消息追加,从而复用提供方的热前缀 cache,而非使它失效。空内容系统头节点不贡献消息,但仍处于压缩范围之外。最终指令是冻结的 `RequestUserInput`,不含持久身份或来源;回放历史和持久化检查点仍然使用持久消息。调用将 `GenerateOptions.purpose` 设为 `compaction`;只有返回文本进入检查点,推理与工具调用都会被排除。图片输出会以 `UNSUPPORTED_CONTENT` 失败,而不是消失。替换 user 消息用 `<compacted-summary>` 标签框定摘要;原始摘要保留在 `compaction/summary` 事件上。
119
+ 直接 `ctx.llm.stream()` 调用使用已配置的提供方/模型对与上限,回退到最新已记录请求目标,然后再回退到 `AgentOptions` 对,而不运行仅用于 agent loop 的 `agent/request` 扩展点。该调用将 surface 节点 0 处派生的 `system/message` 作为 `messages` 的首项回放,后接已遮蔽区域消息(包括位于其 surface 位置的被遮蔽历史内 `system/message`),并提供 header 的有效工具供路由特定投影使用。所选适配器必须解析回放消息中的图片引用或明确拒绝它们。调用将压缩指令作为最后一条 user 消息追加,在投影允许时保留提供方的热前缀 cache。空内容系统头节点不贡献消息,但仍处于压缩范围之外。最终指令是冻结的 `RequestUserInput`,不含持久身份或来源;回放历史和持久化检查点仍然使用持久消息。调用将 `GenerateOptions.purpose` 设为 `compaction`;只有返回文本进入检查点,推理与工具调用都会被排除。图片输出会以 `UNSUPPORTED_CONTENT` 失败,而不是消失。替换 user 消息用 `<compacted-summary>` 标签框定摘要;原始摘要保留在 `compaction/summary` 事件上。 调用还携带 `Session.toolHistory()`,供运行时投影延迟和保留定义;若前缀缺少更新消息,则使用有效声明且不发送 developer 更新。
120
120
 
121
121
  ### 区域事务
122
122
 
@@ -184,7 +184,7 @@ This is an automatically generated checkpoint condensing an earlier span of the
184
184
 
185
185
  #### 模型看到的内容
186
186
 
187
- 摘要模型会接收逐字回放的会话:与上次已路由请求为已遮蔽区域发送的相同系统提示词、工具 schema 与消息,后面跟随一条最终 user 消息,即下方压缩指令。会话模型绝不会看到该私有请求或其推理;只有返回文本会被存储。
187
+ 摘要模型接收系统提示词与已遮蔽区域的历史,其中工具声明和 developer 更新按其路由投影,后面跟随一条最终 user 消息,即下方压缩指令。会话模型绝不会看到该私有请求或其推理;只有返回文本会被存储。
188
188
 
189
189
  ##### 压缩指令(最终 user 消息)
190
190
 
package/lib/index.js CHANGED
@@ -313,6 +313,7 @@ async function summarizeWithLlm(ctx, config, input, agent, signal) {
313
313
  provider: target.provider,
314
314
  model: target.model,
315
315
  messages,
316
+ toolHistory: agent.session.toolHistory(),
316
317
  ...input.tools === void 0 ? {} : { tools: [...input.tools] },
317
318
  maxTokens: config.maxTokens,
318
319
  sessionId: agent.session.id,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-compaction-basic",
3
3
  "description": "Token-meter-driven compaction policy and LLM summarization backend for the DeepSeek Harness",
4
- "version": "0.1.7-alpha.2",
4
+ "version": "0.1.7-rc.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -28,13 +28,13 @@
28
28
  "license": "MIT",
29
29
  "peerDependencies": {
30
30
  "@deepseek-ai/cordis": "~4.0.4",
31
- "@deepseek-ai/dsh-agent": "0.1.7-alpha.2",
32
- "@deepseek-ai/dsh-commands": "0.1.7-alpha.2",
33
- "@deepseek-ai/dsh-compaction": "0.1.7-alpha.2",
34
- "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.1.7-alpha.2",
35
- "@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
36
- "@deepseek-ai/dsh-token-meter": "0.1.7-alpha.2",
37
- "@deepseek-ai/dsh-session": "0.1.7-alpha.2"
31
+ "@deepseek-ai/dsh-agent": "0.1.7-rc.2",
32
+ "@deepseek-ai/dsh-commands": "0.1.7-rc.2",
33
+ "@deepseek-ai/dsh-compaction": "0.1.7-rc.2",
34
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.1.7-rc.2",
35
+ "@deepseek-ai/dsh-session": "0.1.7-rc.2",
36
+ "@deepseek-ai/dsh-token-meter": "0.1.7-rc.2",
37
+ "@deepseek-ai/dsh-llm": "0.1.7-rc.2"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@deepseek-ai/dsh-compaction-tool-result-pruner": {
@@ -42,26 +42,26 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@deepseek-ai/dsh-util-values": "0.1.7-alpha.2",
45
+ "@deepseek-ai/dsh-util-values": "0.1.7-rc.2",
46
46
  "@deepseek-ai/schemastery": "~3.18.4"
47
47
  },
48
48
  "devDependencies": {
49
+ "@deepseek-ai/cordis-plugin-include": "~1.0.9",
49
50
  "@deepseek-ai/cordis": "~4.0.4",
50
51
  "@deepseek-ai/cordis-plugin-loader": "~1.0.5",
51
- "@deepseek-ai/dsh-agent": "0.1.7-alpha.2",
52
- "@deepseek-ai/dsh-agent-loop": "0.1.7-alpha.2",
53
- "@deepseek-ai/cordis-plugin-include": "~1.0.9",
54
- "@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-alpha.2",
55
- "@deepseek-ai/dsh-commands": "0.1.7-alpha.2",
56
- "@deepseek-ai/dsh-compaction": "0.1.7-alpha.2",
57
- "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.1.7-alpha.2",
58
- "@deepseek-ai/dsh-invariants": "0.1.7-alpha.2",
59
- "@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
60
- "@deepseek-ai/dsh-llm-retry": "0.1.7-alpha.2",
61
- "@deepseek-ai/dsh-session": "0.1.7-alpha.2",
62
- "@deepseek-ai/dsh-tools": "0.1.7-alpha.2",
63
- "@deepseek-ai/dsh-compaction-image-offload": "0.1.7-alpha.2",
64
- "@deepseek-ai/dsh-token-meter": "0.1.7-alpha.2",
65
- "@deepseek-ai/dsh-session-projection": "0.1.7-alpha.2"
52
+ "@deepseek-ai/dsh-agent": "0.1.7-rc.2",
53
+ "@deepseek-ai/dsh-agent-loop": "0.1.7-rc.2",
54
+ "@deepseek-ai/dsh-commands": "0.1.7-rc.2",
55
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-rc.2",
56
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.1.7-rc.2",
57
+ "@deepseek-ai/dsh-compaction": "0.1.7-rc.2",
58
+ "@deepseek-ai/dsh-invariants": "0.1.7-rc.2",
59
+ "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
60
+ "@deepseek-ai/dsh-session": "0.1.7-rc.2",
61
+ "@deepseek-ai/dsh-llm-retry": "0.1.7-rc.2",
62
+ "@deepseek-ai/dsh-session-projection": "0.1.7-rc.2",
63
+ "@deepseek-ai/dsh-token-meter": "0.1.7-rc.2",
64
+ "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
65
+ "@deepseek-ai/dsh-compaction-image-offload": "0.1.7-rc.2"
66
66
  }
67
67
  }