mr-memory 2.22.0 → 2.22.2

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 +9 -19
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -638,6 +638,8 @@ const memoryRouterPlugin = {
638
638
  await runOpenClawConfigSet("agents.defaults.memorySearch.sources", JSON.stringify(["memory"]), true);
639
639
  // Disable experimental session memory
640
640
  await runOpenClawConfigSet("agents.defaults.memorySearch.experimental.sessionMemory", "false", true);
641
+ // Disable re-indexing on every search (MR handles memory, no need to re-embed constantly)
642
+ await runOpenClawConfigSet("agents.defaults.memorySearch.sync.onSearch", "false", true);
641
643
  } catch {
642
644
  // Non-fatal — config optimization is best-effort
643
645
  }
@@ -648,6 +650,7 @@ const memoryRouterPlugin = {
648
650
  try {
649
651
  await runOpenClawConfigSet("agents.defaults.memorySearch.sources", JSON.stringify(["memory", "sessions"]), true);
650
652
  await runOpenClawConfigSet("agents.defaults.memorySearch.experimental.sessionMemory", "true", true);
653
+ await runOpenClawConfigSet("agents.defaults.memorySearch.sync.onSearch", "true", true);
651
654
  } catch {
652
655
  // Non-fatal
653
656
  }
@@ -712,27 +715,14 @@ const memoryRouterPlugin = {
712
715
  .description("Update mr-memory plugin and restore memory settings")
713
716
  .action(async () => {
714
717
  try {
715
- // 1. Update the npm package
718
+ // 1. Update the npm package via OpenClaw's built-in plugin updater
716
719
  console.log("Updating mr-memory plugin...");
717
- const { execSync } = await import("node:child_process");
718
- const extensionDir = (await import("node:path")).join(
719
- (await import("node:os")).homedir(),
720
- ".openclaw",
721
- "extensions",
722
- "mr-memory",
723
- );
724
- // Remove old install
725
- try {
726
- await (await import("node:fs/promises")).rm(extensionDir, { recursive: true, force: true });
727
- } catch { /* may not exist */ }
728
-
729
- // Reinstall from npm
730
720
  const base = resolveOpenClawInvocation();
731
- const installArgs = [...base.args, "plugins", "install", "mr-memory"];
732
- execSync(`${base.command} ${installArgs.slice(base.args.length === 0 ? 0 : 1).join(" ")}`, {
733
- stdio: "inherit",
734
- env: process.env,
735
- });
721
+ const { execSync } = await import("node:child_process");
722
+ const updateCmd = base.args.length > 0
723
+ ? `${base.command} ${base.args.join(" ")} plugins update mr-memory`
724
+ : `openclaw plugins update mr-memory`;
725
+ execSync(updateCmd, { stdio: "inherit", env: process.env });
736
726
 
737
727
  // 2. Restore memory search settings (in case OC update reset them)
738
728
  if (memoryKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mr-memory",
3
- "version": "2.22.0",
3
+ "version": "2.22.2",
4
4
  "description": "MemoryRouter persistent memory plugin for OpenClaw — your AI remembers every conversation",
5
5
  "type": "module",
6
6
  "files": [