@mastra/memory 1.41.3-alpha.0 → 1.41.3-alpha.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.
@@ -41651,7 +41651,11 @@ ${workingMemory}`;
41651
41651
  updateMessageToHideWorkingMemoryV2(message) {
41652
41652
  const newMessage = { ...message };
41653
41653
  if (message.content && typeof message.content === "object" && !Array.isArray(message.content)) newMessage.content = { ...message.content };
41654
- if (typeof newMessage.content?.content === "string" && newMessage.content.content.length > 0) newMessage.content.content = removeWorkingMemoryTags(newMessage.content.content).trim();
41654
+ const hideTags = (text) => {
41655
+ const cleaned = removeWorkingMemoryTags(text);
41656
+ return cleaned === text ? text : cleaned.trim();
41657
+ };
41658
+ if (typeof newMessage.content?.content === "string" && newMessage.content.content.length > 0) newMessage.content.content = hideTags(newMessage.content.content);
41655
41659
  if (Array.isArray(newMessage.content?.parts)) {
41656
41660
  if (Array.isArray(newMessage.content.toolInvocations)) newMessage.content.toolInvocations = removeWorkingMemoryToolInvocations(newMessage.content.toolInvocations);
41657
41661
  const lastOriginalPart = newMessage.content.parts.at(-1);
@@ -41661,7 +41665,7 @@ ${workingMemory}`;
41661
41665
  const text = typeof part.text === "string" ? part.text : "";
41662
41666
  return {
41663
41667
  ...part,
41664
- text: removeWorkingMemoryTags(text).trim()
41668
+ text: hideTags(text)
41665
41669
  };
41666
41670
  }
41667
41671
  return part;
@@ -43384,4 +43388,4 @@ Object.defineProperty(exports, "wrapInObservationGroup", {
43384
43388
  }
43385
43389
  });
43386
43390
 
43387
- //# sourceMappingURL=src-ibq9d-g9.cjs.map
43391
+ //# sourceMappingURL=src-CKA5LbDL.cjs.map