@mastra/core 1.21.0 → 1.22.0-alpha.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.
Files changed (166) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/agent/agent.d.ts.map +1 -1
  3. package/dist/agent/index.cjs +13 -13
  4. package/dist/agent/index.js +2 -2
  5. package/dist/agent/message-list/adapters/AIV5Adapter.d.ts.map +1 -1
  6. package/dist/agent/message-list/conversion/output-converter.d.ts.map +1 -1
  7. package/dist/agent/message-list/index.cjs +18 -18
  8. package/dist/agent/message-list/index.js +1 -1
  9. package/dist/agent/message-list/message-list.d.ts.map +1 -1
  10. package/dist/{chunk-5WJWEAD2.cjs → chunk-2G5U5LCK.cjs} +148 -17
  11. package/dist/chunk-2G5U5LCK.cjs.map +1 -0
  12. package/dist/{chunk-CSD7PXFP.js → chunk-2VC36BDH.js} +5 -5
  13. package/dist/{chunk-CSD7PXFP.js.map → chunk-2VC36BDH.js.map} +1 -1
  14. package/dist/{chunk-7ONDK22Y.js → chunk-3RAYTSPI.js} +16 -9
  15. package/dist/chunk-3RAYTSPI.js.map +1 -0
  16. package/dist/{chunk-IZNWC32Y.js → chunk-46DASRFB.js} +4 -4
  17. package/dist/{chunk-IZNWC32Y.js.map → chunk-46DASRFB.js.map} +1 -1
  18. package/dist/{chunk-YPMF3QLA.cjs → chunk-AVRRH42W.cjs} +233 -233
  19. package/dist/chunk-AVRRH42W.cjs.map +1 -0
  20. package/dist/{chunk-QYCMMBOV.js → chunk-B7PS7GR7.js} +147 -17
  21. package/dist/{chunk-QYCMMBOV.js.map → chunk-B7PS7GR7.js.map} +1 -1
  22. package/dist/{chunk-6ZRIEGLG.cjs → chunk-BFOGUVFL.cjs} +5 -5
  23. package/dist/{chunk-6ZRIEGLG.cjs.map → chunk-BFOGUVFL.cjs.map} +1 -1
  24. package/dist/{chunk-UWYGTSWV.cjs → chunk-DOPULILR.cjs} +34 -30
  25. package/dist/chunk-DOPULILR.cjs.map +1 -0
  26. package/dist/{chunk-UDRSF2TK.cjs → chunk-DTQCQXSX.cjs} +55 -55
  27. package/dist/{chunk-UDRSF2TK.cjs.map → chunk-DTQCQXSX.cjs.map} +1 -1
  28. package/dist/{chunk-ZEZNT32H.js → chunk-EFXVHFAI.js} +12 -4
  29. package/dist/chunk-EFXVHFAI.js.map +1 -0
  30. package/dist/{chunk-UBRTW3SO.cjs → chunk-FHQY4G2O.cjs} +12 -3
  31. package/dist/chunk-FHQY4G2O.cjs.map +1 -0
  32. package/dist/{chunk-WG4GNZZZ.js → chunk-FXONBE4Y.js} +3 -3
  33. package/dist/{chunk-WG4GNZZZ.js.map → chunk-FXONBE4Y.js.map} +1 -1
  34. package/dist/{chunk-LOA2BVRK.js → chunk-HJBVUY76.js} +230 -230
  35. package/dist/chunk-HJBVUY76.js.map +1 -0
  36. package/dist/{chunk-NT2E64KG.cjs → chunk-HVE6QR4G.cjs} +6 -6
  37. package/dist/{chunk-NT2E64KG.cjs.map → chunk-HVE6QR4G.cjs.map} +1 -1
  38. package/dist/{chunk-3FASTXAM.cjs → chunk-JZBAUINL.cjs} +85 -77
  39. package/dist/chunk-JZBAUINL.cjs.map +1 -0
  40. package/dist/{chunk-OBXLCUSC.cjs → chunk-K7TAXUW5.cjs} +6 -6
  41. package/dist/{chunk-OBXLCUSC.cjs.map → chunk-K7TAXUW5.cjs.map} +1 -1
  42. package/dist/{chunk-56RUNELD.js → chunk-M5PKEDYH.js} +3 -3
  43. package/dist/{chunk-56RUNELD.js.map → chunk-M5PKEDYH.js.map} +1 -1
  44. package/dist/{chunk-NRA3BO5W.js → chunk-MOVQYN2F.js} +34 -30
  45. package/dist/chunk-MOVQYN2F.js.map +1 -0
  46. package/dist/{chunk-WI4KUV2M.js → chunk-NB435LXG.js} +4 -4
  47. package/dist/{chunk-WI4KUV2M.js.map → chunk-NB435LXG.js.map} +1 -1
  48. package/dist/{chunk-UOJUR3HB.cjs → chunk-O2FAC2JL.cjs} +186 -185
  49. package/dist/{chunk-UOJUR3HB.cjs.map → chunk-O2FAC2JL.cjs.map} +1 -1
  50. package/dist/{chunk-Z5ABABPJ.js → chunk-PBVPRLDI.js} +17 -10
  51. package/dist/chunk-PBVPRLDI.js.map +1 -0
  52. package/dist/{chunk-4ALVPSUM.cjs → chunk-PCDPQEYH.cjs} +7 -7
  53. package/dist/{chunk-4ALVPSUM.cjs.map → chunk-PCDPQEYH.cjs.map} +1 -1
  54. package/dist/{chunk-F3T776ZA.js → chunk-PJRKKSYW.js} +25 -13
  55. package/dist/chunk-PJRKKSYW.js.map +1 -0
  56. package/dist/{chunk-TLEMLJH7.cjs → chunk-QF4KRWYU.cjs} +64 -52
  57. package/dist/chunk-QF4KRWYU.cjs.map +1 -0
  58. package/dist/{chunk-KXITWMFN.js → chunk-RZISMMDM.js} +4 -4
  59. package/dist/{chunk-KXITWMFN.js.map → chunk-RZISMMDM.js.map} +1 -1
  60. package/dist/{chunk-HFH7JKN3.js → chunk-U63DZ6E6.js} +4 -4
  61. package/dist/{chunk-HFH7JKN3.js.map → chunk-U63DZ6E6.js.map} +1 -1
  62. package/dist/{chunk-63ZXVPM5.cjs → chunk-WTV62NHE.cjs} +10 -10
  63. package/dist/{chunk-63ZXVPM5.cjs.map → chunk-WTV62NHE.cjs.map} +1 -1
  64. package/dist/{chunk-P2JYPYF6.cjs → chunk-YYPOSWKA.cjs} +23 -16
  65. package/dist/chunk-YYPOSWKA.cjs.map +1 -0
  66. package/dist/datasets/index.cjs +17 -17
  67. package/dist/datasets/index.js +2 -2
  68. package/dist/docs/SKILL.md +1 -1
  69. package/dist/docs/assets/SOURCE_MAP.json +263 -245
  70. package/dist/evals/index.cjs +5 -5
  71. package/dist/evals/index.js +2 -2
  72. package/dist/evals/scoreTraces/index.cjs +3 -3
  73. package/dist/evals/scoreTraces/index.js +1 -1
  74. package/dist/harness/index.cjs +11 -11
  75. package/dist/harness/index.js +6 -6
  76. package/dist/index.cjs +2 -2
  77. package/dist/index.js +1 -1
  78. package/dist/llm/index.cjs +36 -20
  79. package/dist/llm/index.d.ts +5 -4
  80. package/dist/llm/index.d.ts.map +1 -1
  81. package/dist/llm/index.js +5 -5
  82. package/dist/llm/model/gateways/base.d.ts +5 -0
  83. package/dist/llm/model/gateways/base.d.ts.map +1 -1
  84. package/dist/llm/model/gateways/constants.d.ts +1 -0
  85. package/dist/llm/model/gateways/constants.d.ts.map +1 -1
  86. package/dist/llm/model/gateways/index.d.ts +1 -0
  87. package/dist/llm/model/gateways/index.d.ts.map +1 -1
  88. package/dist/llm/model/gateways/mastra.d.ts +25 -0
  89. package/dist/llm/model/gateways/mastra.d.ts.map +1 -0
  90. package/dist/llm/model/provider-registry.d.ts.map +1 -1
  91. package/dist/llm/model/provider-types.generated.d.ts +1 -0
  92. package/dist/llm/model/registry-generator.d.ts.map +1 -1
  93. package/dist/llm/model/router.d.ts +4 -2
  94. package/dist/llm/model/router.d.ts.map +1 -1
  95. package/dist/loop/index.cjs +14 -14
  96. package/dist/loop/index.js +1 -1
  97. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
  98. package/dist/mastra/index.cjs +2 -2
  99. package/dist/mastra/index.d.ts.map +1 -1
  100. package/dist/mastra/index.js +1 -1
  101. package/dist/mastra-2EQZYM7C.js +3 -0
  102. package/dist/mastra-2EQZYM7C.js.map +1 -0
  103. package/dist/mastra-XPBVZO54.cjs +12 -0
  104. package/dist/mastra-XPBVZO54.cjs.map +1 -0
  105. package/dist/memory/index.cjs +14 -14
  106. package/dist/memory/index.js +1 -1
  107. package/dist/models-dev-DA5OEOGQ.js +3 -0
  108. package/dist/{models-dev-IF67OFXR.js.map → models-dev-DA5OEOGQ.js.map} +1 -1
  109. package/dist/models-dev-HDA3INHC.cjs +12 -0
  110. package/dist/{models-dev-ARAO7S6W.cjs.map → models-dev-HDA3INHC.cjs.map} +1 -1
  111. package/dist/netlify-6PWJPWSI.cjs +12 -0
  112. package/dist/{netlify-XPEVGT6A.cjs.map → netlify-6PWJPWSI.cjs.map} +1 -1
  113. package/dist/netlify-EENUHCAW.js +3 -0
  114. package/dist/{netlify-G5DNBXIP.js.map → netlify-EENUHCAW.js.map} +1 -1
  115. package/dist/processor-provider/index.cjs +10 -10
  116. package/dist/processor-provider/index.js +1 -1
  117. package/dist/processors/index.cjs +44 -44
  118. package/dist/processors/index.js +1 -1
  119. package/dist/provider-registry-TQS5D74S.js +3 -0
  120. package/dist/{provider-registry-MQVQ6NJP.js.map → provider-registry-TQS5D74S.js.map} +1 -1
  121. package/dist/provider-registry-VE7OCGGU.cjs +40 -0
  122. package/dist/{provider-registry-ZAJJQN5I.cjs.map → provider-registry-VE7OCGGU.cjs.map} +1 -1
  123. package/dist/{registry-generator-BRPCL2LG.js → registry-generator-QMLHG25G.js} +10 -3
  124. package/dist/registry-generator-QMLHG25G.js.map +1 -0
  125. package/dist/{registry-generator-PUWKZKVW.cjs → registry-generator-VNYH6GDH.cjs} +10 -3
  126. package/dist/registry-generator-VNYH6GDH.cjs.map +1 -0
  127. package/dist/relevance/index.cjs +3 -3
  128. package/dist/relevance/index.js +1 -1
  129. package/dist/storage/index.cjs +74 -74
  130. package/dist/storage/index.js +1 -1
  131. package/dist/stream/index.cjs +11 -11
  132. package/dist/stream/index.js +2 -2
  133. package/dist/tool-loop-agent/index.cjs +4 -4
  134. package/dist/tool-loop-agent/index.js +1 -1
  135. package/dist/vector/index.cjs +7 -7
  136. package/dist/vector/index.js +1 -1
  137. package/dist/workflows/evented/index.cjs +10 -10
  138. package/dist/workflows/evented/index.js +1 -1
  139. package/dist/workflows/index.cjs +24 -24
  140. package/dist/workflows/index.js +1 -1
  141. package/dist/workspace/index.cjs +68 -68
  142. package/dist/workspace/index.js +1 -1
  143. package/dist/workspace/sandbox/local-process-manager.d.ts.map +1 -1
  144. package/package.json +6 -6
  145. package/src/llm/model/provider-types.generated.d.ts +1 -0
  146. package/dist/chunk-3FASTXAM.cjs.map +0 -1
  147. package/dist/chunk-5WJWEAD2.cjs.map +0 -1
  148. package/dist/chunk-7ONDK22Y.js.map +0 -1
  149. package/dist/chunk-F3T776ZA.js.map +0 -1
  150. package/dist/chunk-LOA2BVRK.js.map +0 -1
  151. package/dist/chunk-NRA3BO5W.js.map +0 -1
  152. package/dist/chunk-P2JYPYF6.cjs.map +0 -1
  153. package/dist/chunk-TLEMLJH7.cjs.map +0 -1
  154. package/dist/chunk-UBRTW3SO.cjs.map +0 -1
  155. package/dist/chunk-UWYGTSWV.cjs.map +0 -1
  156. package/dist/chunk-YPMF3QLA.cjs.map +0 -1
  157. package/dist/chunk-Z5ABABPJ.js.map +0 -1
  158. package/dist/chunk-ZEZNT32H.js.map +0 -1
  159. package/dist/models-dev-ARAO7S6W.cjs +0 -12
  160. package/dist/models-dev-IF67OFXR.js +0 -3
  161. package/dist/netlify-G5DNBXIP.js +0 -3
  162. package/dist/netlify-XPEVGT6A.cjs +0 -12
  163. package/dist/provider-registry-MQVQ6NJP.js +0 -3
  164. package/dist/provider-registry-ZAJJQN5I.cjs +0 -40
  165. package/dist/registry-generator-BRPCL2LG.js.map +0 -1
  166. package/dist/registry-generator-PUWKZKVW.cjs.map +0 -1
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var chunkYPMF3QLA_cjs = require('./chunk-YPMF3QLA.cjs');
3
+ var chunkAVRRH42W_cjs = require('./chunk-AVRRH42W.cjs');
4
4
  var chunkX7SJO3JJ_cjs = require('./chunk-X7SJO3JJ.cjs');
5
5
  var chunkZCBG4ZQT_cjs = require('./chunk-ZCBG4ZQT.cjs');
6
- var chunkOBXLCUSC_cjs = require('./chunk-OBXLCUSC.cjs');
7
- var chunkUWYGTSWV_cjs = require('./chunk-UWYGTSWV.cjs');
6
+ var chunkK7TAXUW5_cjs = require('./chunk-K7TAXUW5.cjs');
7
+ var chunkDOPULILR_cjs = require('./chunk-DOPULILR.cjs');
8
8
  var chunkY3APFUXZ_cjs = require('./chunk-Y3APFUXZ.cjs');
9
9
  var chunkCFMZZDO2_cjs = require('./chunk-CFMZZDO2.cjs');
10
10
  var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
11
- var chunk3FASTXAM_cjs = require('./chunk-3FASTXAM.cjs');
11
+ var chunkJZBAUINL_cjs = require('./chunk-JZBAUINL.cjs');
12
12
  var chunkTDTG2WDG_cjs = require('./chunk-TDTG2WDG.cjs');
13
13
  var chunk22FSGATE_cjs = require('./chunk-22FSGATE.cjs');
14
14
  var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
@@ -1306,7 +1306,7 @@ var ProcessorRunner = class _ProcessorRunner {
1306
1306
  writer
1307
1307
  });
1308
1308
  const mutations = messageList.stopRecording();
1309
- if (processResult instanceof chunkUWYGTSWV_cjs.MessageList) {
1309
+ if (processResult instanceof chunkDOPULILR_cjs.MessageList) {
1310
1310
  if (processResult !== messageList) {
1311
1311
  throw new chunk4U7ZLI36_cjs.MastraError({
1312
1312
  category: "USER",
@@ -1600,7 +1600,7 @@ var ProcessorRunner = class _ProcessorRunner {
1600
1600
  retryCount
1601
1601
  });
1602
1602
  let mutations;
1603
- if (result instanceof chunkUWYGTSWV_cjs.MessageList) {
1603
+ if (result instanceof chunkDOPULILR_cjs.MessageList) {
1604
1604
  if (result !== messageList) {
1605
1605
  throw new chunk4U7ZLI36_cjs.MastraError({
1606
1606
  category: "USER",
@@ -1970,7 +1970,7 @@ var ProcessorRunner = class _ProcessorRunner {
1970
1970
  writer
1971
1971
  });
1972
1972
  const mutations = messageList.stopRecording();
1973
- if (result instanceof chunkUWYGTSWV_cjs.MessageList) {
1973
+ if (result instanceof chunkDOPULILR_cjs.MessageList) {
1974
1974
  if (result !== messageList) {
1975
1975
  throw new chunk4U7ZLI36_cjs.MastraError({
1976
1976
  category: "USER",
@@ -2042,7 +2042,7 @@ var ProcessorRunner = class _ProcessorRunner {
2042
2042
  processor,
2043
2043
  stepNumber
2044
2044
  }) {
2045
- if (result instanceof chunkUWYGTSWV_cjs.MessageList) {
2045
+ if (result instanceof chunkDOPULILR_cjs.MessageList) {
2046
2046
  if (result !== messageList) {
2047
2047
  throw new chunk4U7ZLI36_cjs.MastraError({
2048
2048
  category: "USER",
@@ -2077,7 +2077,7 @@ var ProcessorRunner = class _ProcessorRunner {
2077
2077
  }
2078
2078
  const { model: _model, ...rest } = result;
2079
2079
  if (result.model) {
2080
- const resolvedModel = await chunk3FASTXAM_cjs.resolveModelConfig(result.model);
2080
+ const resolvedModel = await chunkJZBAUINL_cjs.resolveModelConfig(result.model);
2081
2081
  const isSupported = isSupportedLanguageModel(resolvedModel);
2082
2082
  if (!isSupported) {
2083
2083
  throw new chunk4U7ZLI36_cjs.MastraError({
@@ -3284,7 +3284,7 @@ var MastraModelOutput = class extends chunkC5WSRMJD_cjs.MastraBase {
3284
3284
  );
3285
3285
  const responseMessages = self.messageList.get.response.aiV4.core();
3286
3286
  const lastResponseMessage = responseMessages[responseMessages.length - 1];
3287
- const outputText = lastResponseMessage ? chunkUWYGTSWV_cjs.coreContentToString(lastResponseMessage.content) : "";
3287
+ const outputText = lastResponseMessage ? chunkDOPULILR_cjs.coreContentToString(lastResponseMessage.content) : "";
3288
3288
  if (lastStep && outputText && outputText !== originalText) {
3289
3289
  lastStep.text = outputText;
3290
3290
  }
@@ -4656,7 +4656,7 @@ function convertMastraChunkToAISDKv5({
4656
4656
  if (mode === "generate") {
4657
4657
  return {
4658
4658
  type: "file",
4659
- file: new chunkUWYGTSWV_cjs.DefaultGeneratedFile({
4659
+ file: new chunkDOPULILR_cjs.DefaultGeneratedFile({
4660
4660
  data: chunk.payload.data,
4661
4661
  mediaType: chunk.payload.mimeType
4662
4662
  })
@@ -4664,7 +4664,7 @@ function convertMastraChunkToAISDKv5({
4664
4664
  }
4665
4665
  return {
4666
4666
  type: "file",
4667
- file: new chunkUWYGTSWV_cjs.DefaultGeneratedFileWithType({
4667
+ file: new chunkDOPULILR_cjs.DefaultGeneratedFileWithType({
4668
4668
  data: chunk.payload.data,
4669
4669
  mediaType: chunk.payload.mimeType
4670
4670
  })
@@ -8699,7 +8699,7 @@ function createStepFromProcessor(processor) {
8699
8699
  phase,
8700
8700
  // Auto-create MessageList from messages if not provided
8701
8701
  // This enables running processor workflows from the UI where messageList can't be serialized
8702
- messageList: messageList ?? (Array.isArray(messages) ? new chunkUWYGTSWV_cjs.MessageList().add(messages, "input").addSystem(systemMessages ?? []) : void 0),
8702
+ messageList: messageList ?? (Array.isArray(messages) ? new chunkDOPULILR_cjs.MessageList().add(messages, "input").addSystem(systemMessages ?? []) : void 0),
8703
8703
  stepNumber,
8704
8704
  systemMessages,
8705
8705
  streamParts,
@@ -8756,7 +8756,7 @@ function createStepFromProcessor(processor) {
8756
8756
  messageList: checkedMessageList,
8757
8757
  systemMessages: systemMessages ?? []
8758
8758
  });
8759
- if (result instanceof chunkUWYGTSWV_cjs.MessageList) {
8759
+ if (result instanceof chunkDOPULILR_cjs.MessageList) {
8760
8760
  if (result !== checkedMessageList) {
8761
8761
  throw new chunk4U7ZLI36_cjs.MastraError({
8762
8762
  category: "USER" /* USER */,
@@ -8939,7 +8939,7 @@ function createStepFromProcessor(processor) {
8939
8939
  messageList: passThrough.messageList,
8940
8940
  result: passThrough.result ?? defaultResult
8941
8941
  });
8942
- if (result instanceof chunkUWYGTSWV_cjs.MessageList) {
8942
+ if (result instanceof chunkDOPULILR_cjs.MessageList) {
8943
8943
  if (result !== passThrough.messageList) {
8944
8944
  throw new chunk4U7ZLI36_cjs.MastraError({
8945
8945
  category: "USER" /* USER */,
@@ -9006,7 +9006,7 @@ function createStepFromProcessor(processor) {
9006
9006
  systemMessages: systemMessages ?? [],
9007
9007
  steps: steps ?? []
9008
9008
  });
9009
- if (result instanceof chunkUWYGTSWV_cjs.MessageList) {
9009
+ if (result instanceof chunkDOPULILR_cjs.MessageList) {
9010
9010
  if (result !== checkedMessageList) {
9011
9011
  throw new chunk4U7ZLI36_cjs.MastraError({
9012
9012
  category: "USER" /* USER */,
@@ -11517,7 +11517,7 @@ var MastraScorer = class _MastraScorer {
11517
11517
  }
11518
11518
  });
11519
11519
  }
11520
- const resolvedModel = await chunk3FASTXAM_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
11520
+ const resolvedModel = await chunkJZBAUINL_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
11521
11521
  const judgeModel = resolvedModel.modelId;
11522
11522
  const judge = new Agent({
11523
11523
  id: "judge",
@@ -13160,9 +13160,19 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
13160
13160
  modelSettings: { ...currentStep.modelSettings, maxRetries: modelConfig.maxRetries },
13161
13161
  includeRawChunks,
13162
13162
  structuredOutput: currentStep.structuredOutput,
13163
- // Merge headers: modelConfig headers first, then modelSettings overrides them
13164
- // Only create object if there are actual headers to avoid passing empty {}
13165
- headers: modelHeaders || currentStep.modelSettings?.headers ? { ...modelHeaders, ...currentStep.modelSettings?.headers } : void 0,
13163
+ // Merge headers: memory context first, then modelConfig headers, then modelSettings overrides
13164
+ // x-thread-id / x-resource-id enable server-side memory enrichment (e.g. Memory Gateway)
13165
+ headers: (() => {
13166
+ const memoryHeaders = {};
13167
+ if (_internal?.threadId) memoryHeaders["x-thread-id"] = _internal.threadId;
13168
+ if (_internal?.resourceId) memoryHeaders["x-resource-id"] = _internal.resourceId;
13169
+ const merged = {
13170
+ ...memoryHeaders,
13171
+ ...modelHeaders,
13172
+ ...currentStep.modelSettings?.headers
13173
+ };
13174
+ return Object.keys(merged).length > 0 ? merged : void 0;
13175
+ })(),
13166
13176
  methodType,
13167
13177
  generateId: _internal?.generateId,
13168
13178
  onResult: ({
@@ -13214,7 +13224,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
13214
13224
  }
13215
13225
  });
13216
13226
  let transportResolver;
13217
- if (currentStep.model instanceof chunk3FASTXAM_cjs.ModelRouterLanguageModel) {
13227
+ if (currentStep.model instanceof chunkJZBAUINL_cjs.ModelRouterLanguageModel) {
13218
13228
  const routerModel = currentStep.model;
13219
13229
  transportResolver = () => routerModel._getStreamTransport();
13220
13230
  }
@@ -13581,7 +13591,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
13581
13591
  toolInvocation: {
13582
13592
  state: "result",
13583
13593
  toolCallId: toolCall.toolCallId,
13584
- toolName: chunkUWYGTSWV_cjs.sanitizeToolName(toolCall.toolName),
13594
+ toolName: chunkDOPULILR_cjs.sanitizeToolName(toolCall.toolName),
13585
13595
  args: toolCall.args,
13586
13596
  result: toolCall.error?.message ?? toolCall.error
13587
13597
  },
@@ -13616,7 +13626,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
13616
13626
  toolInvocation: {
13617
13627
  state: "result",
13618
13628
  toolCallId: toolCall.toolCallId,
13619
- toolName: chunkUWYGTSWV_cjs.sanitizeToolName(toolCall.toolName),
13629
+ toolName: chunkDOPULILR_cjs.sanitizeToolName(toolCall.toolName),
13620
13630
  args: toolCall.args,
13621
13631
  result: toolCall.result
13622
13632
  },
@@ -13673,7 +13683,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
13673
13683
  toolInvocation: {
13674
13684
  state: "result",
13675
13685
  toolCallId: toolCall.toolCallId,
13676
- toolName: chunkUWYGTSWV_cjs.sanitizeToolName(toolCall.toolName),
13686
+ toolName: chunkDOPULILR_cjs.sanitizeToolName(toolCall.toolName),
13677
13687
  args: toolCall.args,
13678
13688
  result: toolCall.result
13679
13689
  },
@@ -15246,7 +15256,7 @@ async function prepareMemoryStep({
15246
15256
  );
15247
15257
  }
15248
15258
  } else {
15249
- const messageList = new chunkUWYGTSWV_cjs.MessageList({
15259
+ const messageList = new chunkDOPULILR_cjs.MessageList({
15250
15260
  threadId: thread?.id,
15251
15261
  resourceId: thread?.resourceId
15252
15262
  });
@@ -15303,7 +15313,7 @@ async function saveMessagesWithProcessors(memory, messages, processorRunner, con
15303
15313
  await memory.saveMessages({ messages });
15304
15314
  return;
15305
15315
  }
15306
- const messageList = new chunkUWYGTSWV_cjs.MessageList();
15316
+ const messageList = new chunkDOPULILR_cjs.MessageList();
15307
15317
  for (const msg of messages) {
15308
15318
  messageList.add(msg, "response");
15309
15319
  }
@@ -16741,7 +16751,7 @@ async function networkLoop({
16741
16751
  "resumeData": "string"
16742
16752
  }
16743
16753
  `;
16744
- const messageList = new chunkUWYGTSWV_cjs.MessageList();
16754
+ const messageList = new chunkDOPULILR_cjs.MessageList();
16745
16755
  messageList.addSystem(systemInstructions);
16746
16756
  messageList.add(task, "user");
16747
16757
  const result = llm.stream({
@@ -17382,7 +17392,7 @@ var AgentLegacyHandler = class {
17382
17392
  methodType: methodType === "generate" ? "generateLegacy" : "streamLegacy",
17383
17393
  memoryConfig
17384
17394
  });
17385
- let messageList = new chunkUWYGTSWV_cjs.MessageList({
17395
+ let messageList = new chunkDOPULILR_cjs.MessageList({
17386
17396
  threadId,
17387
17397
  resourceId,
17388
17398
  generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
@@ -17541,7 +17551,7 @@ var AgentLegacyHandler = class {
17541
17551
  result: resToLog,
17542
17552
  threadId
17543
17553
  });
17544
- const messageListResponses = new chunkUWYGTSWV_cjs.MessageList({
17554
+ const messageListResponses = new chunkDOPULILR_cjs.MessageList({
17545
17555
  threadId,
17546
17556
  resourceId,
17547
17557
  generateMessageId: this.capabilities.mastra?.generateId?.bind(this.capabilities.mastra),
@@ -18717,7 +18727,7 @@ var prepareToolsStepOutputSchema = v4.z.object({
18717
18727
  var prepareMemoryStepOutputSchema = v4.z.object({
18718
18728
  threadExists: v4.z.boolean(),
18719
18729
  thread: storageThreadSchema.optional(),
18720
- messageList: v4.z.instanceof(chunkUWYGTSWV_cjs.MessageList),
18730
+ messageList: v4.z.instanceof(chunkDOPULILR_cjs.MessageList),
18721
18731
  /** Shared processor states map that persists across loop iterations for both input and output processors */
18722
18732
  processorStates: v4.z.instanceof(Map),
18723
18733
  /** Tripwire data when input processor triggered abort */
@@ -18759,7 +18769,7 @@ function createPrepareMemoryStep({
18759
18769
  execute: async ({ ...rest }) => {
18760
18770
  const observabilityContext = chunkW6PDQCCN_cjs.resolveObservabilityContext(rest);
18761
18771
  const thread = threadFromArgs;
18762
- const messageList = new chunkUWYGTSWV_cjs.MessageList({
18772
+ const messageList = new chunkDOPULILR_cjs.MessageList({
18763
18773
  threadId: thread?.id,
18764
18774
  resourceId,
18765
18775
  generateMessageId: capabilities.generateMessageId,
@@ -18785,7 +18795,7 @@ function createPrepareMemoryStep({
18785
18795
  }
18786
18796
  return {
18787
18797
  threadExists: false,
18788
- thread: void 0,
18798
+ thread,
18789
18799
  messageList,
18790
18800
  processorStates,
18791
18801
  tripwire: tripwire2
@@ -20091,7 +20101,7 @@ ${errorMessages}`,
20091
20101
  */
20092
20102
  async resolveModelConfig(modelConfig, requestContext) {
20093
20103
  try {
20094
- return await chunk3FASTXAM_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
20104
+ return await chunkJZBAUINL_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
20095
20105
  } catch (error) {
20096
20106
  const mastraError = new chunk4U7ZLI36_cjs.MastraError({
20097
20107
  id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
@@ -20411,7 +20421,7 @@ ${errorMessages}`,
20411
20421
  }) {
20412
20422
  const observabilityContext = chunkW6PDQCCN_cjs.resolveObservabilityContext(rest);
20413
20423
  const llm = await this.getLLM({ requestContext, model });
20414
- const normMessage = new chunkUWYGTSWV_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
20424
+ const normMessage = new chunkDOPULILR_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
20415
20425
  if (!normMessage) {
20416
20426
  throw new Error(`Could not generate title from input ${JSON.stringify(message)}`);
20417
20427
  }
@@ -20434,7 +20444,7 @@ ${errorMessages}`,
20434
20444
  const systemInstructions = await this.resolveTitleInstructions(requestContext, instructions);
20435
20445
  let text = "";
20436
20446
  if (isSupportedLanguageModel(llm.getModel())) {
20437
- const messageList = new chunkUWYGTSWV_cjs.MessageList().add(
20447
+ const messageList = new chunkDOPULILR_cjs.MessageList().add(
20438
20448
  [
20439
20449
  {
20440
20450
  role: "system",
@@ -20487,7 +20497,7 @@ ${errorMessages}`,
20487
20497
  async genTitle(userMessage, requestContext, observabilityContext, model, instructions) {
20488
20498
  try {
20489
20499
  if (userMessage) {
20490
- const normMessage = new chunkUWYGTSWV_cjs.MessageList().add(userMessage, "user").get.all.ui().at(-1);
20500
+ const normMessage = new chunkDOPULILR_cjs.MessageList().add(userMessage, "user").get.all.ui().at(-1);
20491
20501
  if (normMessage) {
20492
20502
  return await this.generateTitleFromUserMessage({
20493
20503
  message: normMessage,
@@ -20592,7 +20602,7 @@ ${errorMessages}`,
20592
20602
  if (!workspace) {
20593
20603
  return convertedWorkspaceTools;
20594
20604
  }
20595
- const workspaceTools = chunkYPMF3QLA_cjs.createWorkspaceTools(workspace);
20605
+ const workspaceTools = chunkAVRRH42W_cjs.createWorkspaceTools(workspace);
20596
20606
  if (Object.keys(workspaceTools).length > 0) {
20597
20607
  this.logger.debug("Adding workspace tools", { agent: this.name, tools: Object.keys(workspaceTools), runId });
20598
20608
  for (const [toolName, tool2] of Object.entries(workspaceTools)) {
@@ -20644,7 +20654,7 @@ ${errorMessages}`,
20644
20654
  if (!workspace?.skills) {
20645
20655
  return convertedSkillTools;
20646
20656
  }
20647
- const skillTools = chunkYPMF3QLA_cjs.createSkillTools(workspace.skills);
20657
+ const skillTools = chunkAVRRH42W_cjs.createSkillTools(workspace.skills);
20648
20658
  if (Object.keys(skillTools).length > 0) {
20649
20659
  this.logger.debug("Adding skill tools", { agent: this.name, tools: Object.keys(skillTools), runId });
20650
20660
  for (const [toolName, tool2] of Object.entries(skillTools)) {
@@ -22185,7 +22195,7 @@ ${effectiveInstructions}`;
22185
22195
  const resolvedModel = await this.resolveModelConfig(selection, requestContext);
22186
22196
  this.assertSupportsPreparedModels(resolvedModel);
22187
22197
  let headers;
22188
- if (resolvedModel instanceof chunk3FASTXAM_cjs.ModelRouterLanguageModel) {
22198
+ if (resolvedModel instanceof chunkJZBAUINL_cjs.ModelRouterLanguageModel) {
22189
22199
  headers = resolvedModel.config?.headers;
22190
22200
  }
22191
22201
  return [
@@ -22217,7 +22227,7 @@ ${effectiveInstructions}`;
22217
22227
  throw mastraError;
22218
22228
  }
22219
22229
  let headers;
22220
- if (model instanceof chunk3FASTXAM_cjs.ModelRouterLanguageModel) {
22230
+ if (model instanceof chunkJZBAUINL_cjs.ModelRouterLanguageModel) {
22221
22231
  headers = model.config?.headers;
22222
22232
  }
22223
22233
  return {
@@ -22259,13 +22269,15 @@ ${effectiveInstructions}`;
22259
22269
  });
22260
22270
  const resourceId = resourceIdFromContext || options.memory?.resource || snapshotMemoryInfo?.resourceId;
22261
22271
  const memoryConfig = options.memory?.options;
22262
- if (resourceId && threadFromArgs && !this.hasOwnMemory()) {
22263
- this.logger.warn("No memory is configured but resourceId and threadId were passed in args", { agent: this.name });
22264
- }
22265
22272
  const llm = await this.getLLM({
22266
22273
  requestContext,
22267
22274
  model: options.model
22268
22275
  });
22276
+ const resolvedModel = llm.getModel();
22277
+ const isGatewayModel = resolvedModel instanceof chunkJZBAUINL_cjs.ModelRouterLanguageModel && resolvedModel.gatewayId === "mastra";
22278
+ if (resourceId && threadFromArgs && !this.hasOwnMemory() && !isGatewayModel) {
22279
+ this.logger.warn("No memory is configured but resourceId and threadId were passed in args", { agent: this.name });
22280
+ }
22269
22281
  if ("structuredOutput" in options && options.structuredOutput?.schema && !options.structuredOutput?.model) {
22270
22282
  const structuredOutputModel = llm.getModel();
22271
22283
  const targetProvider = structuredOutputModel.provider;
@@ -24501,7 +24513,7 @@ var TokenLimiterProcessor = class _TokenLimiterProcessor {
24501
24513
  return new TiktokenClass(this.customEncoding);
24502
24514
  });
24503
24515
  } else {
24504
- this.encoderPromise = chunkYPMF3QLA_cjs.getTiktoken();
24516
+ this.encoderPromise = chunkAVRRH42W_cjs.getTiktoken();
24505
24517
  }
24506
24518
  }
24507
24519
  return this.encoderPromise;
@@ -25408,7 +25420,7 @@ var ToolSearchProcessor = class {
25408
25420
  minScore: options.search?.minScore ?? 0
25409
25421
  };
25410
25422
  this.ttl = options.ttl ?? 36e5;
25411
- this.bm25Index = new chunkYPMF3QLA_cjs.BM25Index({}, TOOL_SEARCH_TOKENIZE_OPTIONS);
25423
+ this.bm25Index = new chunkAVRRH42W_cjs.BM25Index({}, TOOL_SEARCH_TOKENIZE_OPTIONS);
25412
25424
  this.indexTools();
25413
25425
  if (this.ttl > 0) {
25414
25426
  this.scheduleCleanup();
@@ -26393,7 +26405,7 @@ var SemanticRecall = class {
26393
26405
  */
26394
26406
  formatCrossThreadMessages(messages, currentThreadId) {
26395
26407
  let result = ``;
26396
- const v1Messages = new chunkUWYGTSWV_cjs.MessageList().add(messages, "memory").get.all.v1();
26408
+ const v1Messages = new chunkDOPULILR_cjs.MessageList().add(messages, "memory").get.all.v1();
26397
26409
  let lastYmd = null;
26398
26410
  for (const msg of v1Messages) {
26399
26411
  const date = msg.createdAt;
@@ -26835,7 +26847,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
26835
26847
  );
26836
26848
  }
26837
26849
  if (typeof config.embedder === "string") {
26838
- this.embedder = new chunk3FASTXAM_cjs.ModelRouterEmbeddingModel(config.embedder);
26850
+ this.embedder = new chunkJZBAUINL_cjs.ModelRouterEmbeddingModel(config.embedder);
26839
26851
  } else {
26840
26852
  this.embedder = config.embedder;
26841
26853
  }
@@ -26848,7 +26860,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
26848
26860
  }
26849
26861
  if (config.embedder) {
26850
26862
  if (typeof config.embedder === "string") {
26851
- this.embedder = new chunk3FASTXAM_cjs.ModelRouterEmbeddingModel(config.embedder);
26863
+ this.embedder = new chunkJZBAUINL_cjs.ModelRouterEmbeddingModel(config.embedder);
26852
26864
  } else {
26853
26865
  this.embedder = config.embedder;
26854
26866
  }
@@ -26888,7 +26900,7 @@ https://mastra.ai/en/docs/memory/overview`
26888
26900
  }
26889
26901
  setEmbedder(embedder, embedderOptions) {
26890
26902
  if (typeof embedder === "string") {
26891
- this.embedder = new chunk3FASTXAM_cjs.ModelRouterEmbeddingModel(embedder);
26903
+ this.embedder = new chunkJZBAUINL_cjs.ModelRouterEmbeddingModel(embedder);
26892
26904
  } else {
26893
26905
  this.embedder = embedder;
26894
26906
  }
@@ -27337,7 +27349,7 @@ var MockMemory = class extends MastraMemory {
27337
27349
  } = {}) {
27338
27350
  super({
27339
27351
  name: "mock",
27340
- storage: storage || new chunkOBXLCUSC_cjs.InMemoryStore(),
27352
+ storage: storage || new chunkK7TAXUW5_cjs.InMemoryStore(),
27341
27353
  options: {
27342
27354
  ...options,
27343
27355
  workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : options?.workingMemory,
@@ -27648,5 +27660,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
27648
27660
  exports.validateStepResumeData = validateStepResumeData;
27649
27661
  exports.validateStepStateData = validateStepStateData;
27650
27662
  exports.validateStepSuspendData = validateStepSuspendData;
27651
- //# sourceMappingURL=chunk-TLEMLJH7.cjs.map
27652
- //# sourceMappingURL=chunk-TLEMLJH7.cjs.map
27663
+ //# sourceMappingURL=chunk-QF4KRWYU.cjs.map
27664
+ //# sourceMappingURL=chunk-QF4KRWYU.cjs.map