@lmzhen/dsh-tool-memory 0.2.0 → 0.2.1

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 +8 -0
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -314,6 +314,14 @@ async function apply(ctx, rawConfig) {
314
314
  order: 150,
315
315
  text: () => snapshotText
316
316
  });
317
+ const refreshSnapshot = async () => {
318
+ try {
319
+ snapshotText = await ctx.memory.renderContext();
320
+ } catch {}
321
+ };
322
+ ctx.effect(() => ctx.on("evolution/memory-applied", () => {
323
+ refreshSnapshot();
324
+ }), "tool-memory.snapshot-refresh");
317
325
  async function executeCore(normalized) {
318
326
  const result = normalized.operations ? await ctx.memory.applyBatch(normalized.target, normalized.operations) : await ctx.memory.applyBatch(normalized.target, [{
319
327
  action: normalized.action ?? "add",
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.2.0",
4
+ "version": "0.2.1",
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.1-rc.2",
41
41
  "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
42
- "@lmzhen/dsh-memory": "^0.2.0",
43
- "@lmzhen/dsh-memory-files": "^0.2.0"
42
+ "@lmzhen/dsh-memory": "^0.2.1",
43
+ "@lmzhen/dsh-memory-files": "^0.2.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
47
47
  "@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
48
48
  "@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
49
49
  "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.1-rc.2",
50
- "@lmzhen/dsh-memory": "^0.2.0",
51
- "@lmzhen/dsh-memory-files": "^0.2.0"
50
+ "@lmzhen/dsh-memory": "^0.2.1",
51
+ "@lmzhen/dsh-memory-files": "^0.2.1"
52
52
  }
53
53
  }