dsh-mnemon 0.4.3 → 0.4.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
@@ -24,7 +24,7 @@
24
24
  <p align="center">
25
25
  <a href="./docs/en/capabilities.md"><strong>Explore the capability map</strong></a> ·
26
26
  <a href="./docs/en/getting-started.md">Start in five minutes</a> ·
27
- <a href="./docs/en/releases/v0.4.3.md">Read the v0.4.3 notes</a> ·
27
+ <a href="./docs/en/releases/v0.4.4.md">Read the v0.4.4 notes</a> ·
28
28
  <a href="https://github.com/omdsh-dev/dsh-mnemon/blob/e6ca446e45bdd17991f3c7c98560456de465282b/docs/assets/media/dsh-mnemon-memory-system-demo.mp4">Watch the widescreen demo</a>
29
29
  </p>
30
30
 
@@ -42,6 +42,8 @@ v0.4.2 restores optional `displayMode: builtin` as a conversation placement for
42
42
 
43
43
  v0.4.3 aligns the collapsed Memory System icon with neighboring sidebar controls while preserving the expanded appearance. See the [patch release notes](./docs/en/releases/v0.4.3.md).
44
44
 
45
+ v0.4.4 fixes session history failures on older DSH hosts by supporting both session projection contracts. Newer hosts and existing projection checkpoints remain compatible. See the [patch release notes](./docs/en/releases/v0.4.4.md).
46
+
45
47
  ## Understand the scope in 30 seconds
46
48
 
47
49
  | Tier | Keep here | How it reaches the Agent | Managed by |
@@ -216,7 +218,7 @@ See [Operations, security, and troubleshooting](./docs/en/operations.md) for bac
216
218
  | Back up, update, or troubleshoot | [Operations](./docs/en/operations.md) |
217
219
  | Integrate tools, commands, or RPC | [Interface reference](./docs/en/interfaces.md) |
218
220
  | Build a Layer, Adapter, Strategy, Guard, or MemorySource extension | [Extension guide](./docs/en/extensions.md) |
219
- | Review the release | [v0.4.3 release notes](./docs/en/releases/v0.4.3.md) |
221
+ | Review the release | [v0.4.4 release notes](./docs/en/releases/v0.4.4.md) |
220
222
 
221
223
  See the [documentation hub](./docs/en/README.md) for the full map.
222
224
 
package/README.zh-CN.md CHANGED
@@ -24,7 +24,7 @@
24
24
  <p align="center">
25
25
  <a href="./docs/zh-CN/capabilities.md"><strong>先看能力地图</strong></a> ·
26
26
  <a href="./docs/zh-CN/getting-started.md">5 分钟开始</a> ·
27
- <a href="./docs/zh-CN/releases/v0.4.3.md">v0.4.3 升级说明</a> ·
27
+ <a href="./docs/zh-CN/releases/v0.4.4.md">v0.4.4 升级说明</a> ·
28
28
  <a href="https://github.com/omdsh-dev/dsh-mnemon/blob/e6ca446e45bdd17991f3c7c98560456de465282b/docs/assets/media/dsh-mnemon-memory-system-demo.mp4">观看宽屏实机演示</a>
29
29
  </p>
30
30
 
@@ -42,6 +42,8 @@ v0.4.2 恢复可选 `displayMode: builtin`,只将 Sidebar 优先迭代的共
42
42
 
43
43
  v0.4.3 让折叠后的记忆系统图标与侧栏相邻控件对齐,并保留原有展开样式。详见[补丁发布说明](./docs/zh-CN/releases/v0.4.3.md)。
44
44
 
45
+ v0.4.4 同时支持新旧 DSH 会话投影接口,修复旧版宿主读取会话历史失败的问题,并保持新版宿主和已有投影检查点兼容。详见[补丁发布说明](./docs/zh-CN/releases/v0.4.4.md)。
46
+
45
47
  ## 30 秒理解能力边界
46
48
 
47
49
  | 层级 | 适合保存 | 如何进入 Agent 上下文 | 由谁管理 |
@@ -216,7 +218,7 @@ dsh plugin --profile headless add "link:/absolute/path/to/dsh-mnemon"
216
218
  | 备份、更新或排障 | [运维指南](./docs/zh-CN/operations.md) |
217
219
  | 接入工具、命令或 RPC | [接口参考](./docs/zh-CN/interfaces.md) |
218
220
  | 开发 Layer、Adapter、Strategy、Guard 或 MemorySource 扩展 | [扩展开发指南](./docs/zh-CN/extensions.md) |
219
- | 查看本次升级 | [v0.4.3 发布说明](./docs/zh-CN/releases/v0.4.3.md) |
221
+ | 查看本次升级 | [v0.4.4 发布说明](./docs/zh-CN/releases/v0.4.4.md) |
220
222
 
221
223
  完整目录见[文档中心](./docs/zh-CN/README.md)。
222
224
 
package/lib/index.js CHANGED
@@ -10819,6 +10819,10 @@ const tokenUsageStateSchema = z$1.object({
10819
10819
  buckets: tokenUsageSchema
10820
10820
  }).strict().nullable()
10821
10821
  }).strict();
10822
+ const tokenUsageWire = {
10823
+ viewSchema: tokenUsageSchema.nullable(),
10824
+ view: (state) => state.descriptorSeen ? state.totals : null
10825
+ };
10822
10826
  const emptyTokenUsage = () => ({
10823
10827
  uncachedInputTokens: 0,
10824
10828
  outputTokens: 0,
@@ -10844,17 +10848,19 @@ function usageBuckets(value) {
10844
10848
  };
10845
10849
  }
10846
10850
  function usageSample(event) {
10847
- const turn = nonnegativeInteger(event.data.turn);
10848
- const step = nonnegativeInteger(event.data.step);
10851
+ if (typeof event.data !== "object" || event.data === null || Array.isArray(event.data)) return void 0;
10852
+ const data = event.data;
10853
+ const turn = nonnegativeInteger(data.turn);
10854
+ const step = nonnegativeInteger(data.step);
10849
10855
  if (turn === void 0 || step === void 0) return void 0;
10850
10856
  let rawUsage;
10851
10857
  if (event.type === "assistant/chunk") {
10852
- const chunk = event.data.chunk;
10858
+ const chunk = data.chunk;
10853
10859
  if (typeof chunk !== "object" || chunk === null || Array.isArray(chunk)) return void 0;
10854
10860
  const record = chunk;
10855
10861
  if (record.type !== "usage") return void 0;
10856
10862
  rawUsage = record.usage;
10857
- } else if (event.type === "assistant/message") rawUsage = event.data.usage;
10863
+ } else if (event.type === "assistant/message") rawUsage = data.usage;
10858
10864
  else return;
10859
10865
  const buckets = usageBuckets(rawUsage);
10860
10866
  return buckets === void 0 ? void 0 : {
@@ -10883,6 +10889,7 @@ const mnemonSubagentTokenUsageProjectionDefinition = {
10883
10889
  key: "mnemonSubagentTokenUsage",
10884
10890
  stateVersion: 1,
10885
10891
  stateSchema: tokenUsageStateSchema,
10892
+ schema: tokenUsageWire.viewSchema,
10886
10893
  init: () => ({
10887
10894
  descriptorSeen: false,
10888
10895
  totals: emptyTokenUsage(),
@@ -10905,10 +10912,8 @@ const mnemonSubagentTokenUsageProjectionDefinition = {
10905
10912
  last: sample
10906
10913
  };
10907
10914
  },
10908
- wire: {
10909
- viewSchema: tokenUsageSchema.nullable(),
10910
- view: (state) => state.descriptorSeen ? state.totals : null
10911
- }
10915
+ view: tokenUsageWire.view,
10916
+ wire: tokenUsageWire
10912
10917
  };
10913
10918
  /** Register lazily when the optional DSH projection service is present. */
10914
10919
  function registerMnemonSubagentTokenUsageProjection(ctx) {
@@ -8,7 +8,7 @@
8
8
  * and resets at every durable descriptor.
9
9
  */
10
10
  import { z } from 'zod';
11
- import type { HostContextShape, HostSessionEvent } from './contracts.ts';
11
+ import type { HostContextShape } from './contracts.ts';
12
12
  export interface MnemonTokenUsageProjection {
13
13
  uncachedInputTokens: number;
14
14
  outputTokens: number;
@@ -24,6 +24,10 @@ export interface MnemonSubagentTokenUsageState {
24
24
  buckets: MnemonTokenUsageProjection;
25
25
  } | null;
26
26
  }
27
+ interface ProjectionEvent {
28
+ type: string;
29
+ data: unknown;
30
+ }
27
31
  /** Wire key consumed only by Mnemon's subagent-catalog compatibility shim. */
28
32
  export declare const MNEMON_SUBAGENT_TOKEN_USAGE_KEY = "mnemonSubagentTokenUsage";
29
33
  /**
@@ -35,12 +39,15 @@ export declare const mnemonSubagentTokenUsageProjectionDefinition: {
35
39
  readonly key: "mnemonSubagentTokenUsage";
36
40
  readonly stateVersion: 1;
37
41
  readonly stateSchema: z.ZodType<MnemonSubagentTokenUsageState, unknown, z.core.$ZodTypeInternals<MnemonSubagentTokenUsageState, unknown>>;
42
+ readonly schema: z.ZodNullable<z.ZodType<MnemonTokenUsageProjection, unknown, z.core.$ZodTypeInternals<MnemonTokenUsageProjection, unknown>>>;
38
43
  readonly init: () => MnemonSubagentTokenUsageState;
39
- readonly apply: (state: MnemonSubagentTokenUsageState, event: HostSessionEvent) => MnemonSubagentTokenUsageState;
44
+ readonly apply: (state: MnemonSubagentTokenUsageState, event: ProjectionEvent) => MnemonSubagentTokenUsageState;
45
+ readonly view: (state: MnemonSubagentTokenUsageState) => MnemonTokenUsageProjection | null;
40
46
  readonly wire: {
41
- readonly viewSchema: z.ZodNullable<z.ZodType<MnemonTokenUsageProjection, unknown, z.core.$ZodTypeInternals<MnemonTokenUsageProjection, unknown>>>;
42
- readonly view: (state: MnemonSubagentTokenUsageState) => MnemonTokenUsageProjection | null;
47
+ viewSchema: z.ZodNullable<z.ZodType<MnemonTokenUsageProjection, unknown, z.core.$ZodTypeInternals<MnemonTokenUsageProjection, unknown>>>;
48
+ view: (state: MnemonSubagentTokenUsageState) => MnemonTokenUsageProjection | null;
43
49
  };
44
50
  };
45
51
  /** Register lazily when the optional DSH projection service is present. */
46
52
  export declare function registerMnemonSubagentTokenUsageProjection(ctx: HostContextShape): void;
53
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mnemon",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Composable three-tier memory control plane for DeepSeek Harness: persistent runtime context, searchable project documents, pluggable long-term memory, guarded strategies, WebUI, and headless tools.",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -165,6 +165,8 @@
165
165
  "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
166
166
  "@deepseek-ai/dsh-session": "0.1.1-rc.2",
167
167
  "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.1-rc.2",
168
+ "@deepseek-ai/dsh-session-projection": "0.1.1-rc.2",
169
+ "@deepseek-ai/dsh-session-projection-legacy": "npm:@deepseek-ai/dsh-session-projection@0.1.0-rc.8",
168
170
  "@deepseek-ai/dsh-session-query": "0.1.1-rc.2",
169
171
  "@deepseek-ai/dsh-subagent": "0.1.1-rc.2",
170
172
  "@deepseek-ai/dsh-subagent-spawn-in-process": "0.1.1-rc.2",