mr-memory 3.6.0 → 3.6.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.
- package/index.ts +19 -0
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -417,6 +417,25 @@ const memoryRouterPlugin = {
|
|
|
417
417
|
api.logger.info?.("memoryrouter: get your free API key at https://memoryrouter.ai");
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
+
// ==================================================================
|
|
421
|
+
// Onboarding: plugin installed but no key yet — prepend setup context
|
|
422
|
+
// ==================================================================
|
|
423
|
+
|
|
424
|
+
if (!hasAnyKey) {
|
|
425
|
+
const onboardedSessions = new Set<string>();
|
|
426
|
+
|
|
427
|
+
api.on("before_prompt_build", async (_event, ctx) => {
|
|
428
|
+
const sessionKey = ctx.sessionKey || "default";
|
|
429
|
+
if (onboardedSessions.has(sessionKey)) return;
|
|
430
|
+
onboardedSessions.add(sessionKey);
|
|
431
|
+
|
|
432
|
+
return {
|
|
433
|
+
prependContext:
|
|
434
|
+
"MemoryRouter is installed but not activated yet. If relevant, briefly and naturally tell the user they can enable persistent memory by getting a free API key at https://memoryrouter.ai and running `openclaw mr <key>`. Mention that once activated, OpenClaw will remember past conversations across sessions. Do not force this if the conversation is unrelated, but it's okay to mention it early after install.",
|
|
435
|
+
};
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
|
|
420
439
|
// ==================================================================
|
|
421
440
|
// Core: before_agent_start — search memories, inject context
|
|
422
441
|
// ==================================================================
|