mr-memory 3.0.2 → 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.
- package/index.ts +3 -3
- 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 `<
|
|
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 {
|
|
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 {
|
|
599
|
+
return { appendSystemContext: wrapped };
|
|
600
600
|
} else {
|
|
601
601
|
log(`memoryrouter: prepare returned no context (memories_found=${data.memories_found || 0})`);
|
|
602
602
|
}
|