@lmzhen/dsh-tool-memory 0.1.0-rc.43 → 0.1.0-rc.45

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 (2) hide show
  1. package/lib/index.js +4 -2
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -6,6 +6,8 @@ import { defineTool } from "@deepseek-ai/dsh-tools";
6
6
  * @module @lmzhen/dsh-tool-memory
7
7
  */
8
8
  const name = "tool-memory";
9
+ /** Max characters of each echoed memory entry (single source for the Config default and the runtime slice). */
10
+ const DEFAULT_ENTRY_PREVIEW_CHARS = 200;
9
11
  const inject = [
10
12
  "tools",
11
13
  "systemPrompt",
@@ -40,7 +42,7 @@ function effectiveSessionPolicy(ctx, session) {
40
42
  }
41
43
  const Config = z.object({
42
44
  memoryEnabled: z.boolean().default(true),
43
- entryPreviewChars: z.number().default(200)
45
+ entryPreviewChars: z.number().default(DEFAULT_ENTRY_PREVIEW_CHARS)
44
46
  });
45
47
  async function apply(ctx, rawConfig) {
46
48
  if (!rawConfig.memoryEnabled) return;
@@ -65,7 +67,7 @@ async function apply(ctx, rawConfig) {
65
67
  return {
66
68
  ok: result.ok,
67
69
  message: result.message,
68
- entries: result.entries.map((entry) => entry.slice(0, rawConfig.entryPreviewChars ?? 200)),
70
+ entries: result.entries.map((entry) => entry.slice(0, rawConfig.entryPreviewChars ?? DEFAULT_ENTRY_PREVIEW_CHARS)),
69
71
  chars: result.chars,
70
72
  limit: result.limit
71
73
  };
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.1.0-rc.43",
4
+ "version": "0.1.0-rc.45",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -39,15 +39,15 @@
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
40
  "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
41
41
  "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
42
- "@lmzhen/dsh-memory": "^0.1.0-rc.43",
43
- "@lmzhen/dsh-memory-files": "^0.1.0-rc.43"
42
+ "@lmzhen/dsh-memory": "^0.1.0-rc.45",
43
+ "@lmzhen/dsh-memory-files": "^0.1.0-rc.45"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
47
47
  "@deepseek-ai/dsh-tools": "^0.1.0-rc.6",
48
48
  "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.6",
49
49
  "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.0-rc.6",
50
- "@lmzhen/dsh-memory": "^0.1.0-rc.43",
51
- "@lmzhen/dsh-memory-files": "^0.1.0-rc.43"
50
+ "@lmzhen/dsh-memory": "^0.1.0-rc.45",
51
+ "@lmzhen/dsh-memory-files": "^0.1.0-rc.45"
52
52
  }
53
53
  }