@lmzhen/dsh-tool-memory 0.3.67 → 0.3.69

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 +18 -0
  2. package/package.json +7 -7
package/lib/index.js CHANGED
@@ -73,6 +73,24 @@ async function apply(ctx, rawConfig = {}) {
73
73
  chars: 0,
74
74
  limit: 0
75
75
  };
76
+ const target = normalized.target;
77
+ if (target !== "memory" && target !== "user") return {
78
+ ok: false,
79
+ message: `memory: "target" must be "memory" or "user" (got ${String(target)}); refusing the write.`,
80
+ entries: [],
81
+ chars: 0,
82
+ limit: 0
83
+ };
84
+ for (const field of ["facts", "old_text"]) {
85
+ const value = normalized[field];
86
+ if (value !== void 0 && value !== null && typeof value !== "string") return {
87
+ ok: false,
88
+ message: `memory: "${field}" must be a string (got ${typeof value}); refusing the write.`,
89
+ entries: [],
90
+ chars: 0,
91
+ limit: 0
92
+ };
93
+ }
76
94
  const result = normalized.operations ? await ctx.memory.applyBatch(normalized.target, normalized.operations) : await ctx.memory.applyBatch(normalized.target, [{
77
95
  action: normalized.action ?? "add",
78
96
  facts: normalized.facts,
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.3.67",
4
+ "version": "0.3.69",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -31,23 +31,23 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
33
  "@deepseek-ai/schemastery": "^3.18.1",
34
- "@lmzhen/dsh-evolution-approval": "^0.3.67",
35
- "@lmzhen/dsh-evolution-core": "^0.3.67"
34
+ "@lmzhen/dsh-evolution-approval": "^0.3.69",
35
+ "@lmzhen/dsh-evolution-core": "^0.3.69"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
40
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
41
41
  "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
42
- "@lmzhen/dsh-memory": "^0.3.67"
42
+ "@lmzhen/dsh-memory": "^0.3.69"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
46
46
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
47
47
  "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
48
48
  "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.1-rc.2",
49
- "@lmzhen/dsh-evolution-approval": "^0.3.67",
50
- "@lmzhen/dsh-memory": "^0.3.67",
51
- "@lmzhen/dsh-memory-files": "^0.3.67"
49
+ "@lmzhen/dsh-evolution-approval": "^0.3.69",
50
+ "@lmzhen/dsh-memory": "^0.3.69",
51
+ "@lmzhen/dsh-memory-files": "^0.3.69"
52
52
  }
53
53
  }