@mastra/memory 1.37.0-alpha.0 → 1.37.0-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.
@@ -28511,17 +28511,17 @@ var ObservationTurn = class {
28511
28511
  * proactively while the agent is idle, rather than waiting for the next turn.
28512
28512
  * The returned record does not wait for that background buffering pass to finish.
28513
28513
  */
28514
- async end() {
28514
+ async end(messageList = this.messageList) {
28515
28515
  if (this._ended) throw new Error("Turn already ended");
28516
28516
  this._ended = true;
28517
- const unsavedInput = this.messageList.get.input.db();
28518
- const unsavedOutput = this.messageList.get.response.db();
28517
+ const unsavedInput = messageList.get.input.db();
28518
+ const unsavedOutput = messageList.get.response.db();
28519
28519
  const unsavedMessages = [...unsavedInput, ...unsavedOutput];
28520
28520
  if (unsavedMessages.length > 0) await this.om.persistMessages(unsavedMessages, this.threadId, this.resourceId);
28521
28521
  const asyncObservationEnabled = this.om.buffering.isAsyncObservationEnabled();
28522
28522
  const bufferOnIdle = this.om.getObservationConfig().bufferOnIdle;
28523
28523
  if (asyncObservationEnabled && bufferOnIdle) {
28524
- const allMessages = getObservableMessages(this.messageList);
28524
+ const allMessages = getObservableMessages(messageList);
28525
28525
  const record = this._record;
28526
28526
  const idleMessages = selectSafeBufferPrefix(this.om.getUnobservedMessages(allMessages, record));
28527
28527
  if (idleMessages.length > 0) this.om.trackBackgroundWork(this.om.buffer({
@@ -32920,7 +32920,7 @@ var ObservationalMemoryProcessor = class {
32920
32920
  if (parseMemoryRequestContext(requestContext)?.memoryConfig?.readOnly) return messageList;
32921
32921
  const turn = asLiveTurn(state.__omTurn) ?? this.turn;
32922
32922
  const liveTurn = turn && !turn.ended ? turn : void 0;
32923
- if (liveTurn) await liveTurn.end();
32923
+ if (liveTurn) await liveTurn.end(messageList);
32924
32924
  this.turn = void 0;
32925
32925
  state.__omTurn = void 0;
32926
32926
  if (!liveTurn) {
@@ -35476,4 +35476,4 @@ Notes:
35476
35476
  //#endregion
35477
35477
  export { formatMessagesForObserver as A, OBSERVATION_CONTEXT_PROMPT_THREAD as B, SUMMARIZE_THREAD_DEFAULTS as C, buildObserverPrompt as D, OBSERVER_SYSTEM_PROMPT as E, parseAnchorId as F, StaleKnowledgeSemanticIndexError as G, getObservationContextPrompt as H, stripEphemeralAnchorIds as I, SUBCONSCIOUS_ACTIVITY_STATE_ID as J, SubconsciousRemindExtractor as K, OBSERVATIONAL_MEMORY_DEFAULTS as L, optimizeObservationsForContext as M, parseObserverOutput as N, buildObserverSystemPrompt as O, injectAnchorIds as P, Extractor as Q, OBSERVATION_CONTEXT_INSTRUCTIONS as R, deepMergeWorkingMemory as S, TokenCounter as T, Subconscious as U, OBSERVATION_CONTINUATION_HINT as V, KnowledgeSemanticIndexCoordinator as W, publishSubconsciousActivity as X, buildSubconsciousActivitySnapshot as Y, renderSubconsciousActivity as Z, reconcileObservationGroupsFromReflection as _, extractWorkingMemoryContent as a, wrapInObservationGroup as b, getObservationsAsOf as c, WORKING_MEMORY_STATE_ID as d, WORKING_MEMORY_STATE_PROCESSOR_ID as f, parseObservationGroups as g, deriveObservationGroupProvenance as h, WorkingMemory as i, hasCurrentTaskSection as j, extractCurrentTask as k, ObservationalMemoryProcessor as l, combineObservationGroupRanges as m, MessageHistory$1 as n, extractWorkingMemoryTags as o, WorkingMemoryStateProcessor as p, ModelByInputTokens as q, SemanticRecall as r, removeWorkingMemoryTags as s, Memory as t, ObservationalMemory as u, renderObservationGroupsForReflection as v, summarizeConversation as w, WorkingMemoryExtractor as x, stripObservationGroups as y, OBSERVATION_CONTEXT_PROMPT as z };
35478
35478
 
35479
- //# sourceMappingURL=src-C_ZgETf8.js.map
35479
+ //# sourceMappingURL=src-BaiJf9y9.js.map