mr-memory 2.20.2 → 2.22.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.
- package/index.ts +41 -4
- package/package.json +1 -1
- package/upload.ts +1 -1
package/index.ts
CHANGED
|
@@ -364,7 +364,6 @@ const memoryRouterPlugin = {
|
|
|
364
364
|
},
|
|
365
365
|
body: JSON.stringify({
|
|
366
366
|
messages: contextPayload,
|
|
367
|
-
session_id: ctx.sessionKey,
|
|
368
367
|
density,
|
|
369
368
|
...(embeddings && { embeddings }),
|
|
370
369
|
}),
|
|
@@ -466,7 +465,7 @@ const memoryRouterPlugin = {
|
|
|
466
465
|
contextPayload.push({ role: "user", content: cleanedPrompt });
|
|
467
466
|
}
|
|
468
467
|
|
|
469
|
-
// 4. Call /v1/memory/prepare
|
|
468
|
+
// 4. Call /v1/memory/prepare (no session_id — always search core vault)
|
|
470
469
|
|
|
471
470
|
const res = await fetch(`${endpoint}/v1/memory/prepare`, {
|
|
472
471
|
method: "POST",
|
|
@@ -476,7 +475,6 @@ const memoryRouterPlugin = {
|
|
|
476
475
|
},
|
|
477
476
|
body: JSON.stringify({
|
|
478
477
|
messages: contextPayload,
|
|
479
|
-
session_id: ctx.sessionKey,
|
|
480
478
|
density,
|
|
481
479
|
...(embeddings && { embeddings }),
|
|
482
480
|
}),
|
|
@@ -599,7 +597,6 @@ const memoryRouterPlugin = {
|
|
|
599
597
|
},
|
|
600
598
|
body: JSON.stringify({
|
|
601
599
|
messages: toStore,
|
|
602
|
-
session_id: ctx.sessionKey,
|
|
603
600
|
model: "unknown",
|
|
604
601
|
...(embeddings && { embeddings }),
|
|
605
602
|
}),
|
|
@@ -711,6 +708,46 @@ const memoryRouterPlugin = {
|
|
|
711
708
|
}
|
|
712
709
|
});
|
|
713
710
|
|
|
711
|
+
mr.command("update")
|
|
712
|
+
.description("Update mr-memory plugin and restore memory settings")
|
|
713
|
+
.action(async () => {
|
|
714
|
+
try {
|
|
715
|
+
// 1. Update the npm package
|
|
716
|
+
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
|
+
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
|
+
});
|
|
736
|
+
|
|
737
|
+
// 2. Restore memory search settings (in case OC update reset them)
|
|
738
|
+
if (memoryKey) {
|
|
739
|
+
console.log("\nRestoring memory settings...");
|
|
740
|
+
await optimizeMemorySearchConfig();
|
|
741
|
+
console.log(" ✓ Session memory scanning disabled (MR handles this)");
|
|
742
|
+
console.log(" ✓ Workspace file search kept active");
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
console.log("\n✅ mr-memory updated. Restart gateway to apply: openclaw gateway restart");
|
|
746
|
+
} catch (err) {
|
|
747
|
+
console.error(`Update failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
|
|
714
751
|
// Density commands
|
|
715
752
|
for (const [name, desc] of [
|
|
716
753
|
["xhigh", "Set density to xhigh (160 results, ~50k tokens)"],
|
package/package.json
CHANGED
package/upload.ts
CHANGED
|
@@ -451,7 +451,7 @@ export async function runUpload(params: {
|
|
|
451
451
|
}
|
|
452
452
|
if (currentBatch.length > 0) batches.push(currentBatch);
|
|
453
453
|
|
|
454
|
-
console.log(`\nSending ${allLines.length}
|
|
454
|
+
console.log(`\nSending ${allLines.length} chunks in ${batches.length} batches...`);
|
|
455
455
|
|
|
456
456
|
let totalProcessed = 0;
|
|
457
457
|
let totalFailed = 0;
|