mr-memory 3.0.1 → 3.1.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 (2) hide show
  1. package/index.ts +7 -3
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -36,7 +36,7 @@ function stripMediaReferences(text: string): string {
36
36
  /** Wrap raw memory context in XML tags with a strong instruction */
37
37
  /** Wrap API response in extraction markers so we can strip it next turn. */
38
38
  function wrapForInjection(context: string): string {
39
- return `<mr-memory>\n${stripMediaReferences(context)}\n</mr-memory>`;
39
+ return `<memory_context>\n${stripMediaReferences(context)}\n</memory_context>`;
40
40
  }
41
41
 
42
42
  /** Strip previous memory injections from message text to prevent stacking.
@@ -483,7 +483,7 @@ const memoryRouterPlugin = {
483
483
  `memoryrouter: injected ${data.memories_found || 0} memories (${data.memory_tokens || 0} tokens)`,
484
484
  );
485
485
  const wrapped = wrapForInjection(data.context);
486
- return { appendSystemPrompt: wrapped };
486
+ return { appendSystemContext: wrapped };
487
487
  }
488
488
  } catch {
489
489
  // Silent fail on tool iterations — don't block the agent
@@ -596,7 +596,7 @@ const memoryRouterPlugin = {
596
596
  `memoryrouter: injected ${data.memories_found || 0} memories (${data.memory_tokens || 0} tokens)`,
597
597
  );
598
598
  const wrapped = wrapForInjection(data.context);
599
- return { prependContext: wrapped };
599
+ return { appendSystemContext: wrapped };
600
600
  } else {
601
601
  log(`memoryrouter: prepare returned no context (memories_found=${data.memories_found || 0})`);
602
602
  }
@@ -827,6 +827,8 @@ const memoryRouterPlugin = {
827
827
  try {
828
828
  // Disable built-in memory entirely — MR replaces it with custom tools
829
829
  await runOpenClawConfigSet("agents.defaults.memorySearch.enabled", "false", true);
830
+ // Disable compaction memory flush — MR handles memory storage
831
+ await runOpenClawConfigSet("agents.defaults.compaction.memoryFlush.enabled", "false", true);
830
832
  } catch {
831
833
  // Non-fatal — config optimization is best-effort
832
834
  }
@@ -843,6 +845,8 @@ const memoryRouterPlugin = {
843
845
  await runOpenClawConfigSet("agents.defaults.memorySearch.experimental.sessionMemory", "true", true);
844
846
  // Restore sync on search
845
847
  await runOpenClawConfigSet("agents.defaults.memorySearch.sync.onSearch", "true", true);
848
+ // Restore compaction memory flush
849
+ await runOpenClawConfigSet("agents.defaults.compaction.memoryFlush.enabled", "true", true);
846
850
  } catch {
847
851
  // Non-fatal
848
852
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mr-memory",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "MemoryRouter persistent memory plugin for OpenClaw — your AI remembers every conversation",
5
5
  "type": "module",
6
6
  "files": [