@mastra/memory 1.19.1-alpha.0 → 1.20.0-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.
Files changed (51) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/{chunk-D4J4XPGM.cjs → chunk-3Q3LOVQP.cjs} +9 -2
  3. package/dist/chunk-3Q3LOVQP.cjs.map +1 -0
  4. package/dist/{chunk-BCYGTJF2.js → chunk-BCWFD5J7.js} +51 -9
  5. package/dist/chunk-BCWFD5J7.js.map +1 -0
  6. package/dist/{chunk-IRMLP4QH.cjs → chunk-SMKIROLC.cjs} +74 -32
  7. package/dist/chunk-SMKIROLC.cjs.map +1 -0
  8. package/dist/{chunk-LSJJAJAF.js → chunk-VKRZ3O5X.js} +9 -3
  9. package/dist/chunk-VKRZ3O5X.js.map +1 -0
  10. package/dist/{constants-PJXB7ZIS.cjs → constants-D6W7OWCP.cjs} +8 -8
  11. package/dist/{constants-PJXB7ZIS.cjs.map → constants-D6W7OWCP.cjs.map} +1 -1
  12. package/dist/constants-SPS7MR4D.js +3 -0
  13. package/dist/{constants-XEHPYRDJ.js.map → constants-SPS7MR4D.js.map} +1 -1
  14. package/dist/docs/SKILL.md +1 -1
  15. package/dist/docs/assets/SOURCE_MAP.json +52 -52
  16. package/dist/docs/references/docs-memory-multi-user-threads.md +1 -1
  17. package/dist/docs/references/docs-memory-observational-memory.md +2 -2
  18. package/dist/docs/references/docs-memory-storage.md +1 -1
  19. package/dist/docs/references/reference-memory-observational-memory.md +1 -1
  20. package/dist/docs/references/reference-storage-dsql.md +1 -1
  21. package/dist/docs/references/reference-storage-redis.md +1 -1
  22. package/dist/index.cjs +39246 -9273
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +39209 -9218
  26. package/dist/index.js.map +1 -1
  27. package/dist/{observational-memory-CSI3OZXQ.js → observational-memory-E6F7NKJP.js} +4 -4
  28. package/dist/{observational-memory-CSI3OZXQ.js.map → observational-memory-E6F7NKJP.js.map} +1 -1
  29. package/dist/{observational-memory-RWXMKXJP.cjs → observational-memory-LGCWMUEM.cjs} +31 -31
  30. package/dist/{observational-memory-RWXMKXJP.cjs.map → observational-memory-LGCWMUEM.cjs.map} +1 -1
  31. package/dist/processors/index.cjs +29 -29
  32. package/dist/processors/index.js +2 -2
  33. package/dist/processors/observational-memory/message-utils.d.ts +1 -0
  34. package/dist/processors/observational-memory/message-utils.d.ts.map +1 -1
  35. package/dist/processors/observational-memory/observation-strategies/async-buffer.d.ts.map +1 -1
  36. package/dist/processors/observational-memory/observation-strategies/sync.d.ts.map +1 -1
  37. package/dist/processors/observational-memory/observation-turn/step.d.ts.map +1 -1
  38. package/dist/processors/observational-memory/observer-runner.d.ts +11 -0
  39. package/dist/processors/observational-memory/observer-runner.d.ts.map +1 -1
  40. package/dist/processors/observational-memory/types.d.ts +7 -3
  41. package/dist/processors/observational-memory/types.d.ts.map +1 -1
  42. package/dist/tools/om-tools.d.ts +1 -12
  43. package/dist/tools/om-tools.d.ts.map +1 -1
  44. package/dist/tools/working-memory.d.ts +2 -8
  45. package/dist/tools/working-memory.d.ts.map +1 -1
  46. package/package.json +7 -8
  47. package/dist/chunk-BCYGTJF2.js.map +0 -1
  48. package/dist/chunk-D4J4XPGM.cjs.map +0 -1
  49. package/dist/chunk-IRMLP4QH.cjs.map +0 -1
  50. package/dist/chunk-LSJJAJAF.js.map +0 -1
  51. package/dist/constants-XEHPYRDJ.js +0 -3
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkD4J4XPGM_cjs = require('./chunk-D4J4XPGM.cjs');
3
+ var chunk3Q3LOVQP_cjs = require('./chunk-3Q3LOVQP.cjs');
4
4
  var features = require('@mastra/core/features');
5
5
  var llm = require('@mastra/core/llm');
6
6
  var memory = require('@mastra/core/memory');
@@ -676,6 +676,7 @@ function filterObservedMessages(opts) {
676
676
  const { messageList, record } = opts;
677
677
  const allMessages = messageList.get.all.db();
678
678
  const useMarkerBoundaryPruning = opts.useMarkerBoundaryPruning ?? true;
679
+ const preserveMessageIds = opts.preserveMessageIds ?? /* @__PURE__ */ new Set();
679
680
  let markerMessageIndex = -1;
680
681
  let markerMessage = null;
681
682
  for (let i = allMessages.length - 1; i >= 0; i--) {
@@ -691,7 +692,7 @@ function filterObservedMessages(opts) {
691
692
  const messagesToRemove = [];
692
693
  for (let i = 0; i < markerMessageIndex; i++) {
693
694
  const msg = allMessages[i];
694
- if (msg?.id && msg.id !== "om-continuation") {
695
+ if (msg?.id && msg.id !== "om-continuation" && !preserveMessageIds.has(msg.id)) {
695
696
  messagesToRemove.push(msg.id);
696
697
  }
697
698
  }
@@ -710,7 +711,7 @@ function filterObservedMessages(opts) {
710
711
  const lastObservedAt = record.lastObservedAt;
711
712
  const messagesToRemove = [];
712
713
  for (const msg of allMessages) {
713
- if (!msg?.id || msg.id === "om-continuation") continue;
714
+ if (!msg?.id || msg.id === "om-continuation" || preserveMessageIds.has(msg.id)) continue;
714
715
  if (observedIds.has(msg.id)) {
715
716
  messagesToRemove.push(msg.id);
716
717
  continue;
@@ -1834,7 +1835,7 @@ var ResourceScopedObservationStrategy = class extends ObservationStrategy {
1834
1835
  }
1835
1836
  }
1836
1837
  async observe(_existingObservations, _messages) {
1837
- const maxTokensPerBatch = this.observationConfig.maxTokensPerBatch ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.maxTokensPerBatch;
1838
+ const maxTokensPerBatch = this.observationConfig.maxTokensPerBatch ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.maxTokensPerBatch;
1838
1839
  const orderedThreadIds = this.threadOrder.filter((tid) => this.threadsWithMessages.has(tid));
1839
1840
  const batches = [];
1840
1841
  let currentBatch = {
@@ -2276,11 +2277,15 @@ var ObservationStep = class {
2276
2277
  });
2277
2278
  if (!didThresholdCleanup) {
2278
2279
  const fallbackCursor = this.turn.record.threadId ? memory.getThreadOMMetadata((await om.getStorage().getThreadById({ threadId: this.turn.record.threadId }))?.metadata)?.lastObservedMessageCursor : void 0;
2280
+ const pendingMessageIds = new Set(
2281
+ [...messageList.get.input.db(), ...messageList.get.response.db()].map((msg) => msg.id).filter(Boolean)
2282
+ );
2279
2283
  filterObservedMessages({
2280
2284
  messageList,
2281
2285
  record: this.turn.record,
2282
2286
  useMarkerBoundaryPruning: this.stepNumber === 0,
2283
- fallbackCursor
2287
+ fallbackCursor,
2288
+ preserveMessageIds: pendingMessageIds
2284
2289
  });
2285
2290
  }
2286
2291
  this._context = {
@@ -4108,6 +4113,41 @@ var ObserverRunner = class {
4108
4113
  }
4109
4114
  return agent$1;
4110
4115
  }
4116
+ /**
4117
+ * Extract a router-style model ID (`provider/model`) from a model config.
4118
+ * Handles strings, LanguageModel objects, and function-based models.
4119
+ */
4120
+ extractModelRouterId(model, requestContext) {
4121
+ if (typeof model === "string") return model;
4122
+ if (typeof model === "function") {
4123
+ if (!requestContext) return void 0;
4124
+ try {
4125
+ const resolved = model({ requestContext });
4126
+ if (resolved instanceof Promise) return void 0;
4127
+ return this.extractModelRouterId(resolved);
4128
+ } catch {
4129
+ return void 0;
4130
+ }
4131
+ }
4132
+ const obj = model;
4133
+ if (typeof obj.provider === "string" && typeof obj.modelId === "string") {
4134
+ return `${obj.provider}/${obj.modelId}`;
4135
+ }
4136
+ return void 0;
4137
+ }
4138
+ /**
4139
+ * Resolve the attachment filter for a given model. When set to `'auto'`,
4140
+ * the provider capabilities registry is consulted to decide whether the
4141
+ * model accepts multimodal input.
4142
+ */
4143
+ resolveAttachmentFilter(model, requestContext) {
4144
+ const raw = this.observationConfig.observeAttachments;
4145
+ if (raw !== "auto") return raw;
4146
+ const routerId = this.extractModelRouterId(model, requestContext);
4147
+ if (!routerId) return true;
4148
+ const supports = llm.modelSupportsAttachments(routerId);
4149
+ return supports ?? true;
4150
+ }
4111
4151
  async withAbortCheck(fn, abortSignal) {
4112
4152
  if (abortSignal?.aborted) {
4113
4153
  throw new Error("The operation was aborted.");
@@ -4125,6 +4165,7 @@ var ObserverRunner = class {
4125
4165
  const inputTokens = this.tokenCounter.countMessages(messagesToObserve);
4126
4166
  const resolvedModel = options?.model ? { model: options.model } : this.resolveModel(inputTokens);
4127
4167
  const agent = this.createAgent(resolvedModel.model);
4168
+ const attachmentFilter = this.resolveAttachmentFilter(resolvedModel.model, options?.requestContext);
4128
4169
  const observerMessages = [
4129
4170
  {
4130
4171
  role: "user",
@@ -4134,7 +4175,7 @@ var ObserverRunner = class {
4134
4175
  })
4135
4176
  },
4136
4177
  buildObserverHistoryMessage(messagesToObserve, {
4137
- attachmentFilter: this.observationConfig.observeAttachments
4178
+ attachmentFilter
4138
4179
  })
4139
4180
  ];
4140
4181
  const doGenerate = async () => {
@@ -4221,6 +4262,7 @@ var ObserverRunner = class {
4221
4262
  );
4222
4263
  const resolvedModel = model ? { model } : this.resolveModel(inputTokens);
4223
4264
  const agent = this.createAgent(resolvedModel.model, true);
4265
+ const multiThreadAttachmentFilter = this.resolveAttachmentFilter(resolvedModel.model, requestContext);
4224
4266
  const observerMessages = [
4225
4267
  {
4226
4268
  role: "user",
@@ -4233,7 +4275,7 @@ var ObserverRunner = class {
4233
4275
  )
4234
4276
  },
4235
4277
  buildMultiThreadObserverHistoryMessage(messagesByThread, threadOrder, {
4236
- attachmentFilter: this.observationConfig.observeAttachments
4278
+ attachmentFilter: multiThreadAttachmentFilter
4237
4279
  })
4238
4280
  ];
4239
4281
  for (const msgs of messagesByThread.values()) {
@@ -7100,16 +7142,16 @@ var ObservationalMemory = class _ObservationalMemory {
7100
7142
  this.onIndexObservations = config.onIndexObservations;
7101
7143
  this.mastra = config.mastra;
7102
7144
  const resolveModel = (model, defaultModel) => model === "default" ? defaultModel : model;
7103
- const observationModel = resolveModel(config.model, chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.model) ?? resolveModel(config.observation?.model, chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.model) ?? resolveModel(config.reflection?.model, chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.model) ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.model;
7104
- const reflectionModel = resolveModel(config.model, chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.model) ?? resolveModel(config.reflection?.model, chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.model) ?? resolveModel(config.observation?.model, chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.model) ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.model;
7105
- const messageTokens = config.observation?.messageTokens ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens;
7106
- const observationTokens = config.reflection?.observationTokens ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.observationTokens;
7145
+ const observationModel = resolveModel(config.model, chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.model) ?? resolveModel(config.observation?.model, chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.model) ?? resolveModel(config.reflection?.model, chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.model) ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.model;
7146
+ const reflectionModel = resolveModel(config.model, chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.model) ?? resolveModel(config.reflection?.model, chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.model) ?? resolveModel(config.observation?.model, chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.model) ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.model;
7147
+ const messageTokens = config.observation?.messageTokens ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens;
7148
+ const observationTokens = config.reflection?.observationTokens ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.observationTokens;
7107
7149
  const isSharedBudget = config.shareTokenBudget ?? false;
7108
7150
  const isDefaultModelSelection = (model) => model === void 0 || model === "default" || model instanceof ModelByInputTokens;
7109
7151
  const observationSelectedModel = config.model ?? config.observation?.model ?? config.reflection?.model;
7110
7152
  const reflectionSelectedModel = config.model ?? config.reflection?.model ?? config.observation?.model;
7111
- const observationDefaultMaxOutputTokens = config.observation?.modelSettings?.maxOutputTokens ?? (isDefaultModelSelection(observationSelectedModel) ? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.modelSettings.maxOutputTokens : void 0);
7112
- const reflectionDefaultMaxOutputTokens = config.reflection?.modelSettings?.maxOutputTokens ?? (isDefaultModelSelection(reflectionSelectedModel) ? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.modelSettings.maxOutputTokens : void 0);
7153
+ const observationDefaultMaxOutputTokens = config.observation?.modelSettings?.maxOutputTokens ?? (isDefaultModelSelection(observationSelectedModel) ? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.modelSettings.maxOutputTokens : void 0);
7154
+ const reflectionDefaultMaxOutputTokens = config.reflection?.modelSettings?.maxOutputTokens ?? (isDefaultModelSelection(reflectionSelectedModel) ? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.modelSettings.maxOutputTokens : void 0);
7113
7155
  const totalBudget = messageTokens + observationTokens;
7114
7156
  const userExplicitlyConfiguredAsync = config.observation?.bufferTokens !== void 0 || config.observation?.bufferActivation !== void 0 || config.reflection?.bufferActivation !== void 0;
7115
7157
  const asyncBufferingDisabled = config.observation?.bufferTokens === false || config.scope === "resource" && !userExplicitlyConfiguredAsync;
@@ -7142,21 +7184,21 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
7142
7184
  messageTokens: isSharedBudget ? { min: messageTokens, max: totalBudget } : messageTokens,
7143
7185
  shareTokenBudget: isSharedBudget,
7144
7186
  modelSettings: {
7145
- temperature: config.observation?.modelSettings?.temperature ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.modelSettings.temperature,
7187
+ temperature: config.observation?.modelSettings?.temperature ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.modelSettings.temperature,
7146
7188
  ...observationDefaultMaxOutputTokens !== void 0 ? { maxOutputTokens: observationDefaultMaxOutputTokens } : {}
7147
7189
  },
7148
- providerOptions: config.observation?.providerOptions ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.providerOptions,
7149
- maxTokensPerBatch: config.observation?.maxTokensPerBatch ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.maxTokensPerBatch,
7190
+ providerOptions: config.observation?.providerOptions ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.providerOptions,
7191
+ maxTokensPerBatch: config.observation?.maxTokensPerBatch ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.maxTokensPerBatch,
7150
7192
  bufferTokens: asyncBufferingDisabled ? void 0 : resolveBufferTokens(
7151
- config.observation?.bufferTokens ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferTokens,
7152
- config.observation?.messageTokens ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens
7193
+ config.observation?.bufferTokens ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferTokens,
7194
+ config.observation?.messageTokens ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens
7153
7195
  ),
7154
- bufferActivation: asyncBufferingDisabled ? void 0 : config.observation?.bufferActivation ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferActivation,
7196
+ bufferActivation: asyncBufferingDisabled ? void 0 : config.observation?.bufferActivation ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferActivation,
7155
7197
  activateAfterIdle: parseActivationTTL(observationActivateAfterIdle, observationActivateAfterIdlePath),
7156
7198
  activateOnProviderChange: config.observation?.activateOnProviderChange ?? config.activateOnProviderChange ?? false,
7157
7199
  blockAfter: asyncBufferingDisabled ? void 0 : resolveBlockAfter(
7158
- config.observation?.blockAfter ?? (config.observation?.bufferTokens ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferTokens ? 1.2 : void 0),
7159
- config.observation?.messageTokens ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens
7200
+ config.observation?.blockAfter ?? (config.observation?.bufferTokens ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferTokens ? 1.2 : void 0),
7201
+ config.observation?.messageTokens ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens
7160
7202
  ),
7161
7203
  previousObserverTokens: config.observation?.previousObserverTokens ?? 2e3,
7162
7204
  instruction: config.observation?.instruction,
@@ -7168,16 +7210,16 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
7168
7210
  observationTokens,
7169
7211
  shareTokenBudget: isSharedBudget,
7170
7212
  modelSettings: {
7171
- temperature: config.reflection?.modelSettings?.temperature ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.modelSettings.temperature,
7213
+ temperature: config.reflection?.modelSettings?.temperature ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.modelSettings.temperature,
7172
7214
  ...reflectionDefaultMaxOutputTokens !== void 0 ? { maxOutputTokens: reflectionDefaultMaxOutputTokens } : {}
7173
7215
  },
7174
- providerOptions: config.reflection?.providerOptions ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.providerOptions,
7175
- bufferActivation: asyncBufferingDisabled ? void 0 : config?.reflection?.bufferActivation ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.bufferActivation,
7216
+ providerOptions: config.reflection?.providerOptions ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.providerOptions,
7217
+ bufferActivation: asyncBufferingDisabled ? void 0 : config?.reflection?.bufferActivation ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.bufferActivation,
7176
7218
  activateAfterIdle: parseActivationTTL(config.reflection?.activateAfterIdle, "reflection.activateAfterIdle"),
7177
7219
  activateOnProviderChange: config.reflection?.activateOnProviderChange ?? false,
7178
7220
  blockAfter: asyncBufferingDisabled ? void 0 : resolveBlockAfter(
7179
- config.reflection?.blockAfter ?? (config.reflection?.bufferActivation ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.bufferActivation ? 1.2 : void 0),
7180
- config.reflection?.observationTokens ?? chunkD4J4XPGM_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.observationTokens
7221
+ config.reflection?.blockAfter ?? (config.reflection?.bufferActivation ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.bufferActivation ? 1.2 : void 0),
7222
+ config.reflection?.observationTokens ?? chunk3Q3LOVQP_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.observationTokens
7181
7223
  ),
7182
7224
  instruction: config.reflection?.instruction
7183
7225
  };
@@ -7941,11 +7983,11 @@ ${unreflectedContent}` : bufferedReflection;
7941
7983
  optimized = addRelativeTimeToObservations(optimized, currentDate);
7942
7984
  }
7943
7985
  const messages = [
7944
- `${chunkD4J4XPGM_cjs.OBSERVATION_CONTEXT_PROMPT}
7986
+ `${chunk3Q3LOVQP_cjs.OBSERVATION_CONTEXT_PROMPT}
7945
7987
 
7946
- ${chunkD4J4XPGM_cjs.OBSERVATION_CONTEXT_INSTRUCTIONS}${retrieval ? `
7988
+ ${chunk3Q3LOVQP_cjs.OBSERVATION_CONTEXT_INSTRUCTIONS}${retrieval ? `
7947
7989
 
7948
- ${chunkD4J4XPGM_cjs.OBSERVATION_RETRIEVAL_INSTRUCTIONS}` : ""}`
7990
+ ${chunk3Q3LOVQP_cjs.OBSERVATION_RETRIEVAL_INSTRUCTIONS}` : ""}`
7949
7991
  ];
7950
7992
  if (unobservedContextBlocks) {
7951
7993
  messages.push(
@@ -9574,7 +9616,7 @@ function injectObservationContextMessages({
9574
9616
  createdAt: /* @__PURE__ */ new Date(0),
9575
9617
  content: {
9576
9618
  format: 2,
9577
- parts: [{ type: "text", text: `<system-reminder>${chunkD4J4XPGM_cjs.OBSERVATION_CONTINUATION_HINT}</system-reminder>` }]
9619
+ parts: [{ type: "text", text: `<system-reminder>${chunk3Q3LOVQP_cjs.OBSERVATION_CONTINUATION_HINT}</system-reminder>` }]
9578
9620
  },
9579
9621
  threadId,
9580
9622
  resourceId
@@ -9841,5 +9883,5 @@ exports.stripEphemeralAnchorIds = stripEphemeralAnchorIds;
9841
9883
  exports.stripObservationGroups = stripObservationGroups;
9842
9884
  exports.truncateStringByTokens = truncateStringByTokens;
9843
9885
  exports.wrapInObservationGroup = wrapInObservationGroup;
9844
- //# sourceMappingURL=chunk-IRMLP4QH.cjs.map
9845
- //# sourceMappingURL=chunk-IRMLP4QH.cjs.map
9886
+ //# sourceMappingURL=chunk-SMKIROLC.cjs.map
9887
+ //# sourceMappingURL=chunk-SMKIROLC.cjs.map