@lmzhen/dsh-tool-memory 0.32.5 → 0.33.0

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.
Files changed (3) hide show
  1. package/README.md +10 -10
  2. package/lib/index.js +2 -1
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # @lmzhen/dsh-tool-memory
2
2
 
3
- > Agent 写记忆的工具。
3
+ Model-facing `memory` tool plus durable-memory guidance and snapshot sections for the system prompt.
4
4
 
5
- ## 你会看到
5
+ ## Tool contract
6
6
 
7
- 你对 Agent 说“记住…”,它写入项目记忆/用户画像。
7
+ `target` selects `memory` for agent notes or `user` for stable user-profile facts. Actions are `add`, `replace`, and `remove`. `facts` and `content` are aliases; supplying different non-blank values for both is rejected.
8
8
 
9
- ## 什么时候会用到
9
+ Use one `operations` array for a batch. The batch is evaluated against the final result so removal/replacement can free budget before additions. Add requires content; replace requires matching old text and new content; remove requires matching old text. Empty batches and malformed operations are rejected before approval.
10
10
 
11
- 你想让 Agent 跨会话记住事实/偏好时。
11
+ ## Defaults and boundaries
12
12
 
13
- ## 默认 / 前提
13
+ - `memoryEnabled`: default `true`; disabling removes the model tool and prompt sections while retaining an explicit refusal runner for previously staged writes.
14
+ - `entryPreviewChars`: default 200 characters per entry in the tool response; this does not truncate stored content.
15
+ - `memoryChars` and `userChars`: enforced by the selected provider, not by this tool; see [memory-files](../memory-files/README.md).
14
16
 
15
- all/分层预设才有;host 没有。
17
+ When ordinary approval is enabled, a write can return `pending_id` instead of executing immediately. An effective platform session policy of `never` bypasses staging as designed.
16
18
 
17
- ## 边界
18
-
19
- 审批开启时会先进入待批。
19
+ Guidance and snapshot injection require the optional `systemPrompt` service. Without it, the write tool still works but memory context is not injected. Successful writes through the memory registry refresh the snapshot, including graph and background-review writes.
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { effectiveSessionPolicy } from "@lmzhen/dsh-evolution-approval";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { defineTool } from "@deepseek-ai/dsh-tools";
4
- import { MEMORY_GUIDANCE_SECTION_ORDER, clampedNumber, payloadText, resolveExecOrigins, unwrapLive } from "@lmzhen/dsh-evolution-core";
4
+ import { MEMORY_GUIDANCE_SECTION_ORDER, clampedNumber, payloadText, registerOwnerSettings, resolveExecOrigins, unwrapLive } from "@lmzhen/dsh-evolution-core";
5
5
  //#region lib/types/index.js
6
6
  /**
7
7
  * Model-facing memory tool and runtime-context memory snapshot.
@@ -32,6 +32,7 @@ const Config = z.object({
32
32
  entryPreviewChars: z.number().min(1).default(DEFAULT_ENTRY_PREVIEW_CHARS).volatile()
33
33
  });
34
34
  async function apply(ctx, rawConfig = {}) {
35
+ registerOwnerSettings(ctx, "tool-memory", Config);
35
36
  ctx.inject(["settings"], (injected) => {
36
37
  const settings = injected.settings;
37
38
  if (typeof settings?.configure !== "function") return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-tool-memory",
3
3
  "description": "Model-facing memory tool and prompt context (community build)",
4
- "version": "0.32.5",
4
+ "version": "0.33.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,22 +27,22 @@
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
29
  "@deepseek-ai/schemastery": "^3.18.5",
30
- "@lmzhen/dsh-evolution-approval": "^0.32.5",
31
- "@lmzhen/dsh-evolution-core": "^0.32.5"
30
+ "@lmzhen/dsh-evolution-approval": "^0.33.0",
31
+ "@lmzhen/dsh-evolution-core": "^0.33.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@deepseek-ai/cordis": "^4.0.5",
35
35
  "@deepseek-ai/dsh-tools": "^0.2.1-rc.2",
36
36
  "@deepseek-ai/dsh-system-prompt": "^0.2.1-rc.2",
37
- "@lmzhen/dsh-memory": "^0.32.5"
37
+ "@lmzhen/dsh-memory": "^0.33.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@deepseek-ai/dsh-tools": "^0.2.1-rc.2",
41
41
  "@deepseek-ai/dsh-system-prompt": "^0.2.1-rc.2",
42
42
  "@deepseek-ai/dsh-agent-loop-testkit": "^0.2.1-rc.2",
43
- "@lmzhen/dsh-evolution-approval": "^0.32.5",
44
- "@lmzhen/dsh-memory": "^0.32.5",
45
- "@lmzhen/dsh-memory-files": "^0.32.5"
43
+ "@lmzhen/dsh-evolution-approval": "^0.33.0",
44
+ "@lmzhen/dsh-memory": "^0.33.0",
45
+ "@lmzhen/dsh-memory-files": "^0.33.0"
46
46
  },
47
47
  "engines": {
48
48
  "dsh": ">=0.2.1-rc.2 <0.2.2-0"