@mastra/memory 1.37.1-alpha.1 → 1.37.1-alpha.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.
@@ -24416,10 +24416,10 @@ function filterObservedMessages(opts) {
24416
24416
  const msg = allMessages[i];
24417
24417
  if (msg?.id && msg.id !== "om-continuation" && !preserveMessageIds.has(msg.id) && !hasPendingToolResultPair(msg, pendingToolResultIds)) messagesToRemove.push(msg.id);
24418
24418
  }
24419
- if (messagesToRemove.length > 0) messageList.removeByIds(messagesToRemove);
24419
+ if (messagesToRemove.length > 0) messageList.removeByIds(messagesToRemove, { pruned: true });
24420
24420
  const unobserved = getUnobservedPartsPreservingToolCallPairs(markerMessage);
24421
24421
  if (unobserved.length === 0) {
24422
- if (markerMessage.id) messageList.removeByIds([markerMessage.id]);
24422
+ if (markerMessage.id) messageList.removeByIds([markerMessage.id], { pruned: true });
24423
24423
  } else if (unobserved.length < (markerMessage.content?.parts?.length ?? 0)) markerMessage.content.parts = unobserved;
24424
24424
  } else if (record) {
24425
24425
  const pendingToolResultIds = collectPendingToolResultIds(allMessages, observedIds);
@@ -24446,7 +24446,7 @@ function filterObservedMessages(opts) {
24446
24446
  }
24447
24447
  }
24448
24448
  }
24449
- if (messagesToRemove.length > 0) messageList.removeByIds(messagesToRemove);
24449
+ if (messagesToRemove.length > 0) messageList.removeByIds(messagesToRemove, { pruned: true });
24450
24450
  }
24451
24451
  }
24452
24452
  function getBufferedChunks(record) {
@@ -28870,7 +28870,7 @@ var ObservationStep = class {
28870
28870
  this.turn.setRecord(activation.record);
28871
28871
  if (activation.activated) {
28872
28872
  activated = true;
28873
- if (activation.activatedMessageIds?.length) messageList.removeByIds(activation.activatedMessageIds);
28873
+ if (activation.activatedMessageIds?.length) messageList.removeByIds(activation.activatedMessageIds, { pruned: true });
28874
28874
  await om.resetBufferingState({
28875
28875
  threadId,
28876
28876
  resourceId,
@@ -32465,7 +32465,7 @@ ${formattedMessages}
32465
32465
  preserveMessageIds
32466
32466
  });
32467
32467
  if (messageList) {
32468
- if (idsToRemoveList.length > 0) messageList.removeByIds(idsToRemoveList);
32468
+ if (idsToRemoveList.length > 0) messageList.removeByIds(idsToRemoveList, { pruned: true });
32469
32469
  return messageList.get.all.db();
32470
32470
  }
32471
32471
  this.removeIdsFromArray(allMsgs, idsToRemoveList);
@@ -32490,7 +32490,7 @@ ${formattedMessages}
32490
32490
  } else if (unobservedParts.length < (markerMsg.content?.parts?.length ?? 0)) markerMsg.content.parts = unobservedParts;
32491
32491
  }
32492
32492
  if (messageList) {
32493
- if (idsToRemove.length > 0) messageList.removeByIds(idsToRemove);
32493
+ if (idsToRemove.length > 0) messageList.removeByIds(idsToRemove, { pruned: true });
32494
32494
  if (messagesToSave.length > 0) await this.persistMessages(messagesToSave, threadId, resourceId);
32495
32495
  omDebug(`[OM:cleanupMarker] removed ${idsToRemove.length} messages, saved ${messagesToSave.length}`);
32496
32496
  return messageList.get.all.db();
@@ -36900,4 +36900,4 @@ Object.defineProperty(exports, "wrapInObservationGroup", {
36900
36900
  }
36901
36901
  });
36902
36902
 
36903
- //# sourceMappingURL=src-BcRCGtUY.cjs.map
36903
+ //# sourceMappingURL=src-DTJFmjDz.cjs.map