@lmzhen/dsh-tool-memory 0.3.68 → 0.3.70
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/lib/index.js +20 -2
- package/package.json +14 -14
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 { clampedNumber, resolveOrigins } from "@lmzhen/dsh-evolution-core";
|
|
4
|
+
import { MEMORY_GUIDANCE_SECTION_ORDER, clampedNumber, resolveOrigins } 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.
|
|
@@ -45,7 +45,7 @@ async function apply(ctx, rawConfig = {}) {
|
|
|
45
45
|
if (systemPrompt) {
|
|
46
46
|
ctx.effect(() => systemPrompt.section({
|
|
47
47
|
name: "evolution:memory-guidance",
|
|
48
|
-
order:
|
|
48
|
+
order: MEMORY_GUIDANCE_SECTION_ORDER,
|
|
49
49
|
text: MEMORY_GUIDANCE
|
|
50
50
|
}), "tool-memory.memory-guidance");
|
|
51
51
|
ctx.effect(() => systemPrompt.context({
|
|
@@ -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.
|
|
4
|
+
"version": "0.3.70",
|
|
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.
|
|
35
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
34
|
+
"@lmzhen/dsh-evolution-approval": "^0.3.70",
|
|
35
|
+
"@lmzhen/dsh-evolution-core": "^0.3.70"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
38
|
+
"@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
|
|
39
39
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
40
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
41
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.
|
|
42
|
-
"@lmzhen/dsh-memory": "^0.3.
|
|
40
|
+
"@deepseek-ai/dsh-tools": "^0.1.5-rc.2",
|
|
41
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2",
|
|
42
|
+
"@lmzhen/dsh-memory": "^0.3.70"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
46
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
47
|
-
"@deepseek-ai/dsh-system-prompt": "^0.1.
|
|
48
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.
|
|
49
|
-
"@lmzhen/dsh-evolution-approval": "^0.3.
|
|
50
|
-
"@lmzhen/dsh-memory": "^0.3.
|
|
51
|
-
"@lmzhen/dsh-memory-files": "^0.3.
|
|
45
|
+
"@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
|
|
46
|
+
"@deepseek-ai/dsh-tools": "^0.1.5-rc.2",
|
|
47
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.2",
|
|
48
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.5-rc.2",
|
|
49
|
+
"@lmzhen/dsh-evolution-approval": "^0.3.70",
|
|
50
|
+
"@lmzhen/dsh-memory": "^0.3.70",
|
|
51
|
+
"@lmzhen/dsh-memory-files": "^0.3.70"
|
|
52
52
|
}
|
|
53
53
|
}
|