@mastra/core 1.0.0-beta.15 → 1.0.0-beta.17

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 (188) hide show
  1. package/CHANGELOG.md +178 -0
  2. package/dist/agent/index.cjs +8 -8
  3. package/dist/agent/index.js +1 -1
  4. package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
  5. package/dist/{chunk-DRJTNGI4.cjs → chunk-3AISNGWY.cjs} +7 -7
  6. package/dist/{chunk-DRJTNGI4.cjs.map → chunk-3AISNGWY.cjs.map} +1 -1
  7. package/dist/{chunk-GXMJ5URG.cjs → chunk-4M75INXO.cjs} +14 -14
  8. package/dist/{chunk-GXMJ5URG.cjs.map → chunk-4M75INXO.cjs.map} +1 -1
  9. package/dist/{chunk-RA2CHJCY.cjs → chunk-4QYTF4ZB.cjs} +36 -36
  10. package/dist/chunk-4QYTF4ZB.cjs.map +1 -0
  11. package/dist/{chunk-4HP7CS6L.js → chunk-5YYAQUEF.js} +3 -3
  12. package/dist/chunk-5YYAQUEF.js.map +1 -0
  13. package/dist/{chunk-YV43YEZ6.js → chunk-6RFJWX4V.js} +4 -4
  14. package/dist/chunk-6RFJWX4V.js.map +1 -0
  15. package/dist/{chunk-DDK3URK2.cjs → chunk-6ZKYNY3H.cjs} +105 -84
  16. package/dist/chunk-6ZKYNY3H.cjs.map +1 -0
  17. package/dist/{chunk-D2IFWD7A.js → chunk-7CDELQD6.js} +10 -10
  18. package/dist/chunk-7CDELQD6.js.map +1 -0
  19. package/dist/{chunk-4J4M2Q5R.js → chunk-ABMWK6JU.js} +5 -5
  20. package/dist/{chunk-4J4M2Q5R.js.map → chunk-ABMWK6JU.js.map} +1 -1
  21. package/dist/{chunk-37YWZMBX.js → chunk-AIJLACR2.js} +9 -5
  22. package/dist/chunk-AIJLACR2.js.map +1 -0
  23. package/dist/chunk-DMX7MC4N.js +3 -0
  24. package/dist/{chunk-GXSERFAG.js.map → chunk-DMX7MC4N.js.map} +1 -1
  25. package/dist/{chunk-LOV5NNGK.cjs → chunk-G6YCU7HJ.cjs} +31 -54
  26. package/dist/chunk-G6YCU7HJ.cjs.map +1 -0
  27. package/dist/{chunk-CBQ6WDUJ.js → chunk-GPC7WOLN.js} +4 -4
  28. package/dist/{chunk-CBQ6WDUJ.js.map → chunk-GPC7WOLN.js.map} +1 -1
  29. package/dist/{chunk-BCUKD2XG.js → chunk-HGWVTZWK.js} +12 -34
  30. package/dist/chunk-HGWVTZWK.js.map +1 -0
  31. package/dist/{chunk-BAZHNX5P.js → chunk-I55X7FYN.js} +6 -6
  32. package/dist/{chunk-BAZHNX5P.js.map → chunk-I55X7FYN.js.map} +1 -1
  33. package/dist/{chunk-XJB7J4UT.js → chunk-JBEKXEX6.js} +5 -5
  34. package/dist/{chunk-XJB7J4UT.js.map → chunk-JBEKXEX6.js.map} +1 -1
  35. package/dist/{chunk-ZGIVAQRI.js → chunk-JQM64OZF.js} +2 -2
  36. package/dist/chunk-JQM64OZF.js.map +1 -0
  37. package/dist/{chunk-CBY37FTP.cjs → chunk-N6HPK6I3.cjs} +15 -15
  38. package/dist/{chunk-CBY37FTP.cjs.map → chunk-N6HPK6I3.cjs.map} +1 -1
  39. package/dist/{chunk-6HJFCSJ4.cjs → chunk-O4YSWWLB.cjs} +5 -5
  40. package/dist/chunk-O4YSWWLB.cjs.map +1 -0
  41. package/dist/{chunk-IRTICXRZ.cjs → chunk-OHQ4PC6P.cjs} +22 -44
  42. package/dist/chunk-OHQ4PC6P.cjs.map +1 -0
  43. package/dist/{chunk-3HDRO3GG.js → chunk-RC7RN5MY.js} +26 -49
  44. package/dist/chunk-RC7RN5MY.js.map +1 -0
  45. package/dist/{chunk-S23TNDXG.cjs → chunk-RGX4NX5L.cjs} +190 -98
  46. package/dist/chunk-RGX4NX5L.cjs.map +1 -0
  47. package/dist/chunk-ROOVGRNA.cjs +4 -0
  48. package/dist/{chunk-X4RMXTXF.cjs.map → chunk-ROOVGRNA.cjs.map} +1 -1
  49. package/dist/{chunk-BC2VKOH4.cjs → chunk-SDR22R4D.cjs} +20 -20
  50. package/dist/{chunk-BC2VKOH4.cjs.map → chunk-SDR22R4D.cjs.map} +1 -1
  51. package/dist/{chunk-T2LVULCK.cjs → chunk-SGRMJZMJ.cjs} +18 -18
  52. package/dist/{chunk-T2LVULCK.cjs.map → chunk-SGRMJZMJ.cjs.map} +1 -1
  53. package/dist/{chunk-HAYBGFPA.js → chunk-SJ3MF5G2.js} +4 -4
  54. package/dist/{chunk-HAYBGFPA.js.map → chunk-SJ3MF5G2.js.map} +1 -1
  55. package/dist/{chunk-IHISDRFV.js → chunk-SRQTDHF5.js} +189 -97
  56. package/dist/chunk-SRQTDHF5.js.map +1 -0
  57. package/dist/{chunk-2OOMJRXZ.cjs → chunk-UT6MASE5.cjs} +3 -3
  58. package/dist/{chunk-2OOMJRXZ.cjs.map → chunk-UT6MASE5.cjs.map} +1 -1
  59. package/dist/{chunk-H2NHG7QL.cjs → chunk-VW7YQWDW.cjs} +9 -5
  60. package/dist/chunk-VW7YQWDW.cjs.map +1 -0
  61. package/dist/{chunk-AR5CF3IN.js → chunk-WDXYPI3P.js} +3 -3
  62. package/dist/{chunk-AR5CF3IN.js.map → chunk-WDXYPI3P.js.map} +1 -1
  63. package/dist/{chunk-CBVHOGXX.cjs → chunk-XR7RX2PS.cjs} +9 -9
  64. package/dist/chunk-XR7RX2PS.cjs.map +1 -0
  65. package/dist/{chunk-NGWTSHNA.js → chunk-YORDI4E7.js} +70 -49
  66. package/dist/chunk-YORDI4E7.js.map +1 -0
  67. package/dist/{chunk-O2CAMK4A.cjs → chunk-ZSZOYPSJ.cjs} +2 -2
  68. package/dist/chunk-ZSZOYPSJ.cjs.map +1 -0
  69. package/dist/evals/index.cjs +19 -19
  70. package/dist/evals/index.js +2 -2
  71. package/dist/evals/scoreTraces/index.cjs +5 -5
  72. package/dist/evals/scoreTraces/index.cjs.map +1 -1
  73. package/dist/evals/scoreTraces/index.js +2 -2
  74. package/dist/evals/scoreTraces/index.js.map +1 -1
  75. package/dist/evals/types.d.ts +0 -2
  76. package/dist/evals/types.d.ts.map +1 -1
  77. package/dist/index.cjs +2 -2
  78. package/dist/index.js +1 -1
  79. package/dist/integration/index.cjs +2 -2
  80. package/dist/integration/index.js +1 -1
  81. package/dist/llm/index.cjs +11 -11
  82. package/dist/llm/index.js +3 -3
  83. package/dist/llm/model/provider-types.generated.d.ts +89 -43
  84. package/dist/loop/index.cjs +2 -2
  85. package/dist/loop/index.js +1 -1
  86. package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
  87. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts +1 -1
  88. package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
  89. package/dist/mastra/hooks.d.ts.map +1 -1
  90. package/dist/mastra/index.cjs +2 -2
  91. package/dist/mastra/index.d.ts.map +1 -1
  92. package/dist/mastra/index.js +1 -1
  93. package/dist/mcp/index.cjs +3 -0
  94. package/dist/mcp/index.cjs.map +1 -1
  95. package/dist/mcp/index.d.ts +2 -0
  96. package/dist/mcp/index.d.ts.map +1 -1
  97. package/dist/mcp/index.js +3 -0
  98. package/dist/mcp/index.js.map +1 -1
  99. package/dist/mcp/types.d.ts +2 -0
  100. package/dist/mcp/types.d.ts.map +1 -1
  101. package/dist/memory/index.cjs +11 -11
  102. package/dist/memory/index.js +1 -1
  103. package/dist/netlify-3MHHJG2E.js +3 -0
  104. package/dist/{netlify-J4QPOROO.js.map → netlify-3MHHJG2E.js.map} +1 -1
  105. package/dist/netlify-5Y33S7WL.cjs +12 -0
  106. package/dist/{netlify-CUYK2MZ2.cjs.map → netlify-5Y33S7WL.cjs.map} +1 -1
  107. package/dist/observability/index.cjs +11 -11
  108. package/dist/observability/index.js +1 -1
  109. package/dist/observability/types/tracing.d.ts +2 -1
  110. package/dist/observability/types/tracing.d.ts.map +1 -1
  111. package/dist/processors/index.cjs +37 -37
  112. package/dist/processors/index.js +1 -1
  113. package/dist/processors/processors/structured-output.d.ts +1 -0
  114. package/dist/processors/processors/structured-output.d.ts.map +1 -1
  115. package/dist/provider-registry-AUJKATCF.cjs +40 -0
  116. package/dist/{provider-registry-7O7FJ4BS.cjs.map → provider-registry-AUJKATCF.cjs.map} +1 -1
  117. package/dist/provider-registry-LUBC7RIO.js +3 -0
  118. package/dist/{provider-registry-6CIGRQVZ.js.map → provider-registry-LUBC7RIO.js.map} +1 -1
  119. package/dist/provider-registry.json +186 -94
  120. package/dist/relevance/index.cjs +3 -3
  121. package/dist/relevance/index.js +1 -1
  122. package/dist/server/types.d.ts +28 -0
  123. package/dist/server/types.d.ts.map +1 -1
  124. package/dist/storage/base.d.ts +76 -29
  125. package/dist/storage/base.d.ts.map +1 -1
  126. package/dist/storage/constants.cjs +14 -14
  127. package/dist/storage/constants.js +1 -1
  128. package/dist/storage/index.cjs +92 -92
  129. package/dist/storage/index.js +2 -2
  130. package/dist/storage/mock.d.ts +0 -2
  131. package/dist/storage/mock.d.ts.map +1 -1
  132. package/dist/storage/types.d.ts +0 -24
  133. package/dist/storage/types.d.ts.map +1 -1
  134. package/dist/stream/aisdk/v5/compat/consume-stream.d.ts +4 -1
  135. package/dist/stream/aisdk/v5/compat/consume-stream.d.ts.map +1 -1
  136. package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
  137. package/dist/stream/base/output.d.ts.map +1 -1
  138. package/dist/stream/index.cjs +9 -9
  139. package/dist/stream/index.js +1 -1
  140. package/dist/test-utils/llm-mock.cjs +4 -4
  141. package/dist/test-utils/llm-mock.js +1 -1
  142. package/dist/tool-loop-agent/index.cjs +4 -4
  143. package/dist/tool-loop-agent/index.js +1 -1
  144. package/dist/tools/index.cjs +4 -4
  145. package/dist/tools/index.d.ts +1 -0
  146. package/dist/tools/index.d.ts.map +1 -1
  147. package/dist/tools/index.js +1 -1
  148. package/dist/tools/is-vercel-tool.cjs +2 -2
  149. package/dist/tools/is-vercel-tool.js +1 -1
  150. package/dist/tools/tool.d.ts +4 -4
  151. package/dist/tools/tool.d.ts.map +1 -1
  152. package/dist/tools/types.d.ts +3 -1
  153. package/dist/tools/types.d.ts.map +1 -1
  154. package/dist/utils/zod-utils.d.ts +7 -1
  155. package/dist/utils/zod-utils.d.ts.map +1 -1
  156. package/dist/utils.cjs +27 -27
  157. package/dist/utils.js +2 -2
  158. package/dist/workflows/evented/index.cjs +10 -10
  159. package/dist/workflows/evented/index.js +1 -1
  160. package/dist/workflows/index.cjs +23 -23
  161. package/dist/workflows/index.js +1 -1
  162. package/dist/workflows/workflow.d.ts.map +1 -1
  163. package/package.json +4 -4
  164. package/src/llm/model/provider-types.generated.d.ts +89 -43
  165. package/dist/chunk-37YWZMBX.js.map +0 -1
  166. package/dist/chunk-3HDRO3GG.js.map +0 -1
  167. package/dist/chunk-4HP7CS6L.js.map +0 -1
  168. package/dist/chunk-6HJFCSJ4.cjs.map +0 -1
  169. package/dist/chunk-BCUKD2XG.js.map +0 -1
  170. package/dist/chunk-CBVHOGXX.cjs.map +0 -1
  171. package/dist/chunk-D2IFWD7A.js.map +0 -1
  172. package/dist/chunk-DDK3URK2.cjs.map +0 -1
  173. package/dist/chunk-GXSERFAG.js +0 -3
  174. package/dist/chunk-H2NHG7QL.cjs.map +0 -1
  175. package/dist/chunk-IHISDRFV.js.map +0 -1
  176. package/dist/chunk-IRTICXRZ.cjs.map +0 -1
  177. package/dist/chunk-LOV5NNGK.cjs.map +0 -1
  178. package/dist/chunk-NGWTSHNA.js.map +0 -1
  179. package/dist/chunk-O2CAMK4A.cjs.map +0 -1
  180. package/dist/chunk-RA2CHJCY.cjs.map +0 -1
  181. package/dist/chunk-S23TNDXG.cjs.map +0 -1
  182. package/dist/chunk-X4RMXTXF.cjs +0 -4
  183. package/dist/chunk-YV43YEZ6.js.map +0 -1
  184. package/dist/chunk-ZGIVAQRI.js.map +0 -1
  185. package/dist/netlify-CUYK2MZ2.cjs +0 -12
  186. package/dist/netlify-J4QPOROO.js +0 -3
  187. package/dist/provider-registry-6CIGRQVZ.js +0 -3
  188. package/dist/provider-registry-7O7FJ4BS.cjs +0 -40
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
 
3
- var chunkSSB4AVHU_cjs = require('./chunk-SSB4AVHU.cjs');
4
3
  var chunkL3NKIMF5_cjs = require('./chunk-L3NKIMF5.cjs');
5
- var chunkLOV5NNGK_cjs = require('./chunk-LOV5NNGK.cjs');
4
+ var chunkSSB4AVHU_cjs = require('./chunk-SSB4AVHU.cjs');
5
+ var chunkG6YCU7HJ_cjs = require('./chunk-G6YCU7HJ.cjs');
6
6
  var chunkEMLEZXTQ_cjs = require('./chunk-EMLEZXTQ.cjs');
7
7
  var chunkNESKUIRE_cjs = require('./chunk-NESKUIRE.cjs');
8
8
  var chunkFVQTJUBD_cjs = require('./chunk-FVQTJUBD.cjs');
9
- var chunkGXMJ5URG_cjs = require('./chunk-GXMJ5URG.cjs');
10
- var chunkT2LVULCK_cjs = require('./chunk-T2LVULCK.cjs');
9
+ var chunk4M75INXO_cjs = require('./chunk-4M75INXO.cjs');
10
+ var chunkSGRMJZMJ_cjs = require('./chunk-SGRMJZMJ.cjs');
11
11
  var chunk4D4KB75Y_cjs = require('./chunk-4D4KB75Y.cjs');
12
12
  var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
13
- var chunkBC2VKOH4_cjs = require('./chunk-BC2VKOH4.cjs');
14
- var chunkO2CAMK4A_cjs = require('./chunk-O2CAMK4A.cjs');
13
+ var chunkSDR22R4D_cjs = require('./chunk-SDR22R4D.cjs');
14
+ var chunkZSZOYPSJ_cjs = require('./chunk-ZSZOYPSJ.cjs');
15
15
  var chunk4U7ZLI36_cjs = require('./chunk-4U7ZLI36.cjs');
16
16
  var chunkKJBMTK5B_cjs = require('./chunk-KJBMTK5B.cjs');
17
- var chunk6HJFCSJ4_cjs = require('./chunk-6HJFCSJ4.cjs');
17
+ var chunkO4YSWWLB_cjs = require('./chunk-O4YSWWLB.cjs');
18
18
  var chunkUVHSM2GU_cjs = require('./chunk-UVHSM2GU.cjs');
19
19
  var chunk4WQYXT2I_cjs = require('./chunk-4WQYXT2I.cjs');
20
20
  var chunkDGV2FWB4_cjs = require('./chunk-DGV2FWB4.cjs');
@@ -529,7 +529,8 @@ function prepareToolsAndToolChoice({
529
529
  // src/stream/aisdk/v5/compat/consume-stream.ts
530
530
  async function consumeStream({
531
531
  stream,
532
- onError
532
+ onError,
533
+ logger
533
534
  }) {
534
535
  const reader = stream.getReader();
535
536
  try {
@@ -538,7 +539,7 @@ async function consumeStream({
538
539
  if (done) break;
539
540
  }
540
541
  } catch (error) {
541
- console.error("consumeStream error", error);
542
+ logger?.error("consumeStream error", error);
542
543
  onError?.(error);
543
544
  } finally {
544
545
  reader.releaseLock();
@@ -557,6 +558,7 @@ var StructuredOutputProcessor = class {
557
558
  isStructuringAgentStreamStarted = false;
558
559
  jsonPromptInjection;
559
560
  providerOptions;
561
+ logger;
560
562
  constructor(options) {
561
563
  if (!options.schema) {
562
564
  throw new chunk4U7ZLI36_cjs.MastraError({
@@ -579,6 +581,7 @@ var StructuredOutputProcessor = class {
579
581
  this.fallbackValue = options.fallbackValue;
580
582
  this.jsonPromptInjection = options.jsonPromptInjection;
581
583
  this.providerOptions = options.providerOptions;
584
+ this.logger = options.logger;
582
585
  this.structuringAgent = new Agent({
583
586
  id: "structured-output-structurer",
584
587
  name: "structured-output-structurer",
@@ -744,14 +747,14 @@ The input text may be in any format (sentences, bullet points, paragraphs, etc.)
744
747
  const message = `[StructuredOutputProcessor] ${context}: ${error}`;
745
748
  switch (this.errorStrategy) {
746
749
  case "strict":
747
- console.error(message);
750
+ this.logger?.error(message);
748
751
  abort(message);
749
752
  break;
750
753
  case "warn":
751
- console.warn(message);
754
+ this.logger?.warn(message);
752
755
  break;
753
756
  case "fallback":
754
- console.info(`${message} (using fallback)`);
757
+ this.logger?.info(`${message} (using fallback)`);
755
758
  break;
756
759
  }
757
760
  }
@@ -1749,7 +1752,7 @@ var ProcessorRunner = class _ProcessorRunner {
1749
1752
  }
1750
1753
  const { model: _model, ...rest } = result;
1751
1754
  if (result.model) {
1752
- const resolvedModel = await chunkGXMJ5URG_cjs.resolveModelConfig(result.model);
1755
+ const resolvedModel = await chunk4M75INXO_cjs.resolveModelConfig(result.model);
1753
1756
  const isSupported = isSupportedLanguageModel(resolvedModel);
1754
1757
  if (!isSupported) {
1755
1758
  throw new chunk4U7ZLI36_cjs.MastraError({
@@ -2484,7 +2487,6 @@ var AISDKV5OutputStream = class {
2484
2487
  async getFullOutput() {
2485
2488
  await this.consumeStream({
2486
2489
  onError: (error) => {
2487
- console.error(error);
2488
2490
  throw error;
2489
2491
  }
2490
2492
  });
@@ -3901,7 +3903,8 @@ var MastraModelOutput = class extends chunkDGV2FWB4_cjs.MastraBase {
3901
3903
  try {
3902
3904
  await consumeStream({
3903
3905
  stream: this.#baseStream,
3904
- onError: options?.onError
3906
+ onError: options?.onError,
3907
+ logger: this.logger
3905
3908
  });
3906
3909
  } catch (error) {
3907
3910
  options?.onError?.(error);
@@ -3913,7 +3916,7 @@ var MastraModelOutput = class extends chunkDGV2FWB4_cjs.MastraBase {
3913
3916
  async getFullOutput() {
3914
3917
  await this.consumeStream({
3915
3918
  onError: (error) => {
3916
- console.error(error);
3919
+ this.logger.error("Error consuming stream", error);
3917
3920
  throw error;
3918
3921
  }
3919
3922
  });
@@ -5342,7 +5345,7 @@ var createTimeTravelExecutionParams = (params) => {
5342
5345
  result = void 0;
5343
5346
  }
5344
5347
  if (result) {
5345
- const formattedResult = chunkBC2VKOH4_cjs.removeUndefinedValues(result);
5348
+ const formattedResult = chunkSDR22R4D_cjs.removeUndefinedValues(result);
5346
5349
  stepResults[stepId] = formattedResult;
5347
5350
  }
5348
5351
  });
@@ -5816,7 +5819,7 @@ async function executeLoop(engine, params) {
5816
5819
  const evalSpan = loopSpan?.createChildSpan({
5817
5820
  type: "workflow_conditional_eval" /* WORKFLOW_CONDITIONAL_EVAL */,
5818
5821
  name: `condition: '${entry.loopType}'`,
5819
- input: chunkBC2VKOH4_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
5822
+ input: chunkSDR22R4D_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
5820
5823
  attributes: {
5821
5824
  conditionIndex: iteration
5822
5825
  },
@@ -6897,7 +6900,7 @@ async function executeStep(engine, params) {
6897
6900
  runId,
6898
6901
  resourceId,
6899
6902
  workflowId,
6900
- mastra: engine.mastra ? chunkO2CAMK4A_cjs.wrapMastra(engine.mastra, { currentSpan: stepSpan }) : void 0,
6903
+ mastra: engine.mastra ? chunkZSZOYPSJ_cjs.wrapMastra(engine.mastra, { currentSpan: stepSpan }) : void 0,
6901
6904
  requestContext,
6902
6905
  inputData,
6903
6906
  state: executionContext.state,
@@ -7809,7 +7812,7 @@ function createStep(params, agentOptions) {
7809
7812
  component: params.component
7810
7813
  };
7811
7814
  }
7812
- if (params instanceof chunk6HJFCSJ4_cjs.Tool) {
7815
+ if (params instanceof chunkO4YSWWLB_cjs.Tool) {
7813
7816
  if (!params.inputSchema || !params.outputSchema) {
7814
7817
  throw new Error("Tool must have input and output schemas defined");
7815
7818
  }
@@ -8217,7 +8220,7 @@ function cloneStep(step, opts) {
8217
8220
  };
8218
8221
  }
8219
8222
  function isProcessor(obj) {
8220
- return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof chunk6HJFCSJ4_cjs.Tool) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
8223
+ return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof Agent) && !(obj instanceof chunkO4YSWWLB_cjs.Tool) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
8221
8224
  }
8222
8225
  function createWorkflow(params) {
8223
8226
  return new Workflow(params);
@@ -9220,7 +9223,7 @@ var Run = class {
9220
9223
  outputOptions,
9221
9224
  perStep
9222
9225
  }) {
9223
- const workflowSpan = chunkO2CAMK4A_cjs.getOrCreateSpan({
9226
+ const workflowSpan = chunkZSZOYPSJ_cjs.getOrCreateSpan({
9224
9227
  type: "workflow_run" /* WORKFLOW_RUN */,
9225
9228
  name: `workflow run: '${this.workflowId}'`,
9226
9229
  entityType: "workflow_run" /* WORKFLOW_RUN */,
@@ -9281,7 +9284,7 @@ var Run = class {
9281
9284
  */
9282
9285
  async startAsync(args) {
9283
9286
  this._start(args).catch((err) => {
9284
- console.error(`[Workflow ${this.workflowId}] Background execution failed:`, err);
9287
+ this.mastra?.getLogger()?.error(`[Workflow ${this.workflowId}] Background execution failed:`, err);
9285
9288
  });
9286
9289
  return { runId: this.runId };
9287
9290
  }
@@ -9330,7 +9333,7 @@ var Run = class {
9330
9333
  try {
9331
9334
  await writer.close();
9332
9335
  } catch (err) {
9333
- console.error("Error closing stream:", err);
9336
+ this.mastra?.getLogger()?.error("Error closing stream:", err);
9334
9337
  } finally {
9335
9338
  writer.releaseLock();
9336
9339
  }
@@ -9388,7 +9391,7 @@ var Run = class {
9388
9391
  try {
9389
9392
  await writer.close();
9390
9393
  } catch (err) {
9391
- console.error("Error closing stream:", err);
9394
+ this.mastra?.getLogger()?.error("Error closing stream:", err);
9392
9395
  } finally {
9393
9396
  writer.releaseLock();
9394
9397
  }
@@ -9480,7 +9483,7 @@ var Run = class {
9480
9483
  controller.close();
9481
9484
  }
9482
9485
  } catch (err) {
9483
- console.error("Error closing stream:", err);
9486
+ self.mastra?.getLogger()?.error("Error closing stream:", err);
9484
9487
  }
9485
9488
  };
9486
9489
  const executionResultsPromise = self._start({
@@ -9601,7 +9604,7 @@ var Run = class {
9601
9604
  controller.close();
9602
9605
  }
9603
9606
  } catch (err) {
9604
- console.error("Error closing stream:", err);
9607
+ self.mastra?.getLogger()?.error("Error closing stream:", err);
9605
9608
  }
9606
9609
  };
9607
9610
  const executionResultsPromise = self._resume({
@@ -9653,14 +9656,22 @@ var Run = class {
9653
9656
  const nestedWatchCb = (event) => {
9654
9657
  if (event.runId === this.runId) {
9655
9658
  const { event: nestedEvent, workflowId } = event.data;
9656
- void this.pubsub.publish(`workflow.events.v2.${this.runId}`, {
9657
- type: "watch",
9658
- runId: this.runId,
9659
- data: {
9660
- ...nestedEvent,
9661
- ...nestedEvent.payload?.id ? { payload: { ...nestedEvent.payload, id: `${workflowId}.${nestedEvent.payload.id}` } } : {}
9662
- }
9663
- });
9659
+ if (nestedEvent.type.startsWith("data-") && nestedEvent.data !== void 0) {
9660
+ void this.pubsub.publish(`workflow.events.v2.${this.runId}`, {
9661
+ type: "watch",
9662
+ runId: this.runId,
9663
+ data: nestedEvent
9664
+ });
9665
+ } else {
9666
+ void this.pubsub.publish(`workflow.events.v2.${this.runId}`, {
9667
+ type: "watch",
9668
+ runId: this.runId,
9669
+ data: {
9670
+ ...nestedEvent,
9671
+ ...nestedEvent.payload?.id ? { payload: { ...nestedEvent.payload, id: `${workflowId}.${nestedEvent.payload.id}` } } : {}
9672
+ }
9673
+ });
9674
+ }
9664
9675
  }
9665
9676
  };
9666
9677
  void this.pubsub.subscribe(`workflow.events.v2.${this.runId}`, wrappedCb);
@@ -9760,7 +9771,7 @@ var Run = class {
9760
9771
  requestContextToUse.set(key, value);
9761
9772
  }
9762
9773
  });
9763
- const workflowSpan = chunkO2CAMK4A_cjs.getOrCreateSpan({
9774
+ const workflowSpan = chunkZSZOYPSJ_cjs.getOrCreateSpan({
9764
9775
  type: "workflow_run" /* WORKFLOW_RUN */,
9765
9776
  name: `workflow run: '${this.workflowId}'`,
9766
9777
  entityType: "workflow_run" /* WORKFLOW_RUN */,
@@ -9872,7 +9883,7 @@ var Run = class {
9872
9883
  requestContextToUse.set(key, value);
9873
9884
  }
9874
9885
  }
9875
- const workflowSpan = chunkO2CAMK4A_cjs.getOrCreateSpan({
9886
+ const workflowSpan = chunkZSZOYPSJ_cjs.getOrCreateSpan({
9876
9887
  type: "workflow_run" /* WORKFLOW_RUN */,
9877
9888
  name: `workflow run: '${this.workflowId}'`,
9878
9889
  entityType: "workflow_run" /* WORKFLOW_RUN */,
@@ -9966,7 +9977,7 @@ var Run = class {
9966
9977
  requestContextToUse.set(key, value);
9967
9978
  }
9968
9979
  }
9969
- const workflowSpan = chunkO2CAMK4A_cjs.getOrCreateSpan({
9980
+ const workflowSpan = chunkZSZOYPSJ_cjs.getOrCreateSpan({
9970
9981
  type: "workflow_run" /* WORKFLOW_RUN */,
9971
9982
  name: `workflow run: '${this.workflowId}'`,
9972
9983
  input: inputData,
@@ -10045,7 +10056,7 @@ var Run = class {
10045
10056
  controller.close();
10046
10057
  }
10047
10058
  } catch (err) {
10048
- console.error("Error closing stream:", err);
10059
+ self.mastra?.getLogger()?.error("Error closing stream:", err);
10049
10060
  }
10050
10061
  };
10051
10062
  const executionResultsPromise = self._timeTravel({
@@ -10490,7 +10501,8 @@ async function processOutputStream({
10490
10501
  options,
10491
10502
  controller,
10492
10503
  responseFromModel,
10493
- includeRawChunks
10504
+ includeRawChunks,
10505
+ logger
10494
10506
  }) {
10495
10507
  for await (const chunk of outputStream._getBaseStream()) {
10496
10508
  if (!chunk) {
@@ -10573,7 +10585,7 @@ async function processOutputStream({
10573
10585
  abortSignal: options?.abortSignal
10574
10586
  });
10575
10587
  } catch (error2) {
10576
- console.error("Error calling onInputStart", error2);
10588
+ logger?.error("Error calling onInputStart", error2);
10577
10589
  }
10578
10590
  }
10579
10591
  if (isControllerOpen(controller)) {
@@ -10592,7 +10604,7 @@ async function processOutputStream({
10592
10604
  abortSignal: options?.abortSignal
10593
10605
  });
10594
10606
  } catch (error2) {
10595
- console.error("Error calling onInputDelta", error2);
10607
+ logger?.error("Error calling onInputDelta", error2);
10596
10608
  }
10597
10609
  }
10598
10610
  if (isControllerOpen(controller)) {
@@ -10782,7 +10794,7 @@ async function processOutputStream({
10782
10794
  }
10783
10795
  }
10784
10796
  }
10785
- function executeStreamWithFallbackModels(models) {
10797
+ function executeStreamWithFallbackModels(models, logger) {
10786
10798
  return async (callback) => {
10787
10799
  let index = 0;
10788
10800
  let finalResult;
@@ -10806,7 +10818,7 @@ function executeStreamWithFallbackModels(models) {
10806
10818
  throw err;
10807
10819
  }
10808
10820
  attempt++;
10809
- console.error(`Error executing model ${modelConfig.model.modelId}, attempt ${attempt}====`, err);
10821
+ logger?.error(`Error executing model ${modelConfig.model.modelId}, attempt ${attempt}====`, err);
10810
10822
  if (attempt > maxRetries) {
10811
10823
  break;
10812
10824
  }
@@ -10816,7 +10828,7 @@ function executeStreamWithFallbackModels(models) {
10816
10828
  }
10817
10829
  }
10818
10830
  if (typeof finalResult === "undefined") {
10819
- console.error("Exhausted all fallback models and reached the maximum number of retries.");
10831
+ logger?.error("Exhausted all fallback models and reached the maximum number of retries.");
10820
10832
  throw new Error("Exhausted all fallback models and reached the maximum number of retries.");
10821
10833
  }
10822
10834
  return finalResult;
@@ -10857,11 +10869,15 @@ function createLLMExecutionStep({
10857
10869
  inputSchema: llmIterationOutputSchema,
10858
10870
  outputSchema: llmIterationOutputSchema,
10859
10871
  execute: async ({ inputData, bail, tracingContext }) => {
10872
+ modelSpanTracker?.startStep();
10860
10873
  let modelResult;
10861
10874
  let warnings;
10862
10875
  let request;
10863
10876
  let rawResponse;
10864
- const { outputStream, callBail, runState, stepTools } = await executeStreamWithFallbackModels(models)(async (modelConfig, isLastModel) => {
10877
+ const { outputStream, callBail, runState, stepTools } = await executeStreamWithFallbackModels(
10878
+ models,
10879
+ logger
10880
+ )(async (modelConfig, isLastModel) => {
10865
10881
  const model = modelConfig.model;
10866
10882
  const modelHeaders = modelConfig.headers;
10867
10883
  if (initialSystemMessages) {
@@ -10947,7 +10963,7 @@ function createLLMExecutionStep({
10947
10963
  stepTools: tools
10948
10964
  };
10949
10965
  }
10950
- console.error("Error in processInputStep processors:", error);
10966
+ logger?.error("Error in processInputStep processors:", error);
10951
10967
  throw error;
10952
10968
  }
10953
10969
  }
@@ -10989,7 +11005,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
10989
11005
  }
10990
11006
  }
10991
11007
  if (isSupportedLanguageModel(currentStep.model)) {
10992
- modelResult = chunkO2CAMK4A_cjs.executeWithContextSync({
11008
+ modelResult = chunkZSZOYPSJ_cjs.executeWithContextSync({
10993
11009
  span: modelSpanTracker?.getTracingContext()?.currentSpan,
10994
11010
  fn: () => execute({
10995
11011
  runId,
@@ -11073,10 +11089,11 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
11073
11089
  warnings,
11074
11090
  request,
11075
11091
  rawResponse
11076
- }
11092
+ },
11093
+ logger
11077
11094
  });
11078
11095
  } catch (error) {
11079
- console.error("Error in LLM Execution Step", error);
11096
+ logger?.error("Error in LLM Execution Step", error);
11080
11097
  if (providerUtilsV5.isAbortError(error) && options?.abortSignal?.aborted) {
11081
11098
  await options?.onAbort?.({
11082
11099
  steps: inputData?.output?.steps ?? []
@@ -11210,7 +11227,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
11210
11227
  if (error instanceof TripWire) {
11211
11228
  processOutputStepTripwire = error;
11212
11229
  } else {
11213
- console.error("Error in processOutputStep processors:", error);
11230
+ logger?.error("Error in processOutputStep processors:", error);
11214
11231
  throw error;
11215
11232
  }
11216
11233
  }
@@ -11476,7 +11493,8 @@ function createToolCallStep({
11476
11493
  runId,
11477
11494
  streamState,
11478
11495
  modelSpanTracker,
11479
- _internal
11496
+ _internal,
11497
+ logger
11480
11498
  }) {
11481
11499
  return createStep({
11482
11500
  id: "toolCallStep",
@@ -11543,7 +11561,7 @@ function createToolCallStep({
11543
11561
  try {
11544
11562
  await saveQueueManager.flushMessages(messageList, threadId, memoryConfig);
11545
11563
  } catch (error) {
11546
- console.error("Error removing tool suspension metadata:", error);
11564
+ logger?.error("Error removing tool suspension metadata:", error);
11547
11565
  }
11548
11566
  }
11549
11567
  }
@@ -11567,7 +11585,7 @@ function createToolCallStep({
11567
11585
  }
11568
11586
  await saveQueueManager.flushMessages(messageList, threadId, memoryConfig);
11569
11587
  } catch (error) {
11570
- console.error("Error flushing messages before suspension:", error);
11588
+ logger?.error("Error flushing messages before suspension:", error);
11571
11589
  }
11572
11590
  };
11573
11591
  if (inputData.providerExecuted) {
@@ -11588,7 +11606,7 @@ function createToolCallStep({
11588
11606
  abortSignal: options?.abortSignal
11589
11607
  });
11590
11608
  } catch (error) {
11591
- console.error("Error calling onInputAvailable", error);
11609
+ logger?.error("Error calling onInputAvailable", error);
11592
11610
  }
11593
11611
  }
11594
11612
  if (!tool2.execute) {
@@ -11611,7 +11629,7 @@ function createToolCallStep({
11611
11629
  const needsApprovalResult = await tool2.needsApprovalFn(args);
11612
11630
  toolRequiresApproval = needsApprovalResult;
11613
11631
  } catch (error) {
11614
- console.error(`Error evaluating needsApprovalFn for tool ${inputData.toolName}:`, error);
11632
+ logger?.error(`Error evaluating needsApprovalFn for tool ${inputData.toolName}:`, error);
11615
11633
  toolRequiresApproval = true;
11616
11634
  }
11617
11635
  }
@@ -11716,7 +11734,7 @@ function createToolCallStep({
11716
11734
  abortSignal: options?.abortSignal
11717
11735
  });
11718
11736
  } catch (error) {
11719
- console.error("Error calling onOutput", error);
11737
+ logger?.error("Error calling onOutput", error);
11720
11738
  }
11721
11739
  }
11722
11740
  return { result, ...inputData };
@@ -12408,7 +12426,7 @@ var MastraLLMVNext = class extends chunkDGV2FWB4_cjs.MastraBase {
12408
12426
  const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
12409
12427
  if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
12410
12428
  this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
12411
- await chunkBC2VKOH4_cjs.delay(10 * 1e3);
12429
+ await chunkSDR22R4D_cjs.delay(10 * 1e3);
12412
12430
  }
12413
12431
  },
12414
12432
  onFinish: async (props) => {
@@ -13618,7 +13636,7 @@ var AgentLegacyHandler = class {
13618
13636
  if (process.env.NODE_ENV !== "test") {
13619
13637
  this.capabilities.logger.debug(`[Agents:${this.capabilities.name}] - Starting generation`, { runId });
13620
13638
  }
13621
- const agentSpan = chunkO2CAMK4A_cjs.getOrCreateSpan({
13639
+ const agentSpan = chunkZSZOYPSJ_cjs.getOrCreateSpan({
13622
13640
  type: "agent_run" /* AGENT_RUN */,
13623
13641
  name: `agent run: '${this.capabilities.id}'`,
13624
13642
  entityType: "agent" /* AGENT */,
@@ -14690,7 +14708,10 @@ function createMapResultsStep({
14690
14708
  requestContext: result.requestContext
14691
14709
  }) : capabilities.outputProcessors : []);
14692
14710
  if (options.structuredOutput?.model) {
14693
- const structuredProcessor = new StructuredOutputProcessor(options.structuredOutput);
14711
+ const structuredProcessor = new StructuredOutputProcessor({
14712
+ ...options.structuredOutput,
14713
+ logger: capabilities.logger
14714
+ });
14694
14715
  effectiveOutputProcessors = effectiveOutputProcessors ? [...effectiveOutputProcessors, structuredProcessor] : [structuredProcessor];
14695
14716
  }
14696
14717
  const effectiveInputProcessors = options.inputProcessors || (capabilities.inputProcessors ? typeof capabilities.inputProcessors === "function" ? await capabilities.inputProcessors({
@@ -15796,7 +15817,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
15796
15817
  */
15797
15818
  listTools({ requestContext = new chunkUVHSM2GU_cjs.RequestContext() } = {}) {
15798
15819
  if (typeof this.#tools !== "function") {
15799
- return chunkBC2VKOH4_cjs.ensureToolProperties(this.#tools);
15820
+ return chunkSDR22R4D_cjs.ensureToolProperties(this.#tools);
15800
15821
  }
15801
15822
  const result = this.#tools({ requestContext, mastra: this.#mastra });
15802
15823
  return resolveMaybePromise(result, (tools) => {
@@ -15814,7 +15835,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
15814
15835
  this.logger.error(mastraError.toString());
15815
15836
  throw mastraError;
15816
15837
  }
15817
- return chunkBC2VKOH4_cjs.ensureToolProperties(tools);
15838
+ return chunkSDR22R4D_cjs.ensureToolProperties(tools);
15818
15839
  });
15819
15840
  }
15820
15841
  /**
@@ -15846,7 +15867,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
15846
15867
  });
15847
15868
  });
15848
15869
  } else {
15849
- llm = new chunkT2LVULCK_cjs.MastraLLMV1({
15870
+ llm = new chunkSGRMJZMJ_cjs.MastraLLMV1({
15850
15871
  model: resolvedModel,
15851
15872
  mastra: this.#mastra,
15852
15873
  options: { tracingPolicy: this.#options?.tracingPolicy }
@@ -15871,7 +15892,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
15871
15892
  */
15872
15893
  async resolveModelConfig(modelConfig, requestContext) {
15873
15894
  try {
15874
- return await chunkGXMJ5URG_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
15895
+ return await chunk4M75INXO_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
15875
15896
  } catch (error) {
15876
15897
  const mastraError = new chunk4U7ZLI36_cjs.MastraError({
15877
15898
  id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
@@ -16218,7 +16239,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
16218
16239
  tracingPolicy: this.#options?.tracingPolicy,
16219
16240
  requireApproval: toolObj.requireApproval
16220
16241
  };
16221
- const convertedToCoreTool = chunkBC2VKOH4_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
16242
+ const convertedToCoreTool = chunkSDR22R4D_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
16222
16243
  convertedMemoryTools[toolName] = convertedToCoreTool;
16223
16244
  }
16224
16245
  }
@@ -16373,7 +16394,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
16373
16394
  tracingPolicy: this.#options?.tracingPolicy,
16374
16395
  requireApproval: tool2.requireApproval
16375
16396
  };
16376
- return [k, chunkBC2VKOH4_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
16397
+ return [k, chunkSDR22R4D_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
16377
16398
  })
16378
16399
  );
16379
16400
  const assignedToolEntriesConverted = Object.fromEntries(
@@ -16423,7 +16444,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
16423
16444
  tracingPolicy: this.#options?.tracingPolicy,
16424
16445
  requireApproval: toolObj.requireApproval
16425
16446
  };
16426
- const convertedToCoreTool = chunkBC2VKOH4_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
16447
+ const convertedToCoreTool = chunkSDR22R4D_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
16427
16448
  toolsForRequest[toolName] = convertedToCoreTool;
16428
16449
  }
16429
16450
  }
@@ -16468,7 +16489,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
16468
16489
  tracingPolicy: this.#options?.tracingPolicy,
16469
16490
  requireApproval: tool2.requireApproval
16470
16491
  };
16471
- const convertedToCoreTool = chunkBC2VKOH4_cjs.makeCoreTool(rest, options, "client-tool", autoResumeSuspendedTools);
16492
+ const convertedToCoreTool = chunkSDR22R4D_cjs.makeCoreTool(rest, options, "client-tool", autoResumeSuspendedTools);
16472
16493
  toolsForRequest[toolName] = convertedToCoreTool;
16473
16494
  }
16474
16495
  }
@@ -16506,7 +16527,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
16506
16527
  subAgentResourceId: z8.z.string().describe("The resource ID of the agent").optional()
16507
16528
  });
16508
16529
  const modelVersion = (await agent.getModel({ requestContext })).specificationVersion;
16509
- const toolObj = chunk6HJFCSJ4_cjs.createTool({
16530
+ const toolObj = chunkO4YSWWLB_cjs.createTool({
16510
16531
  id: `agent-${agentName}`,
16511
16532
  description: agent.getDescription() || `Agent: ${agentName}`,
16512
16533
  inputSchema: agentInputSchema,
@@ -16638,7 +16659,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
16638
16659
  tracingContext,
16639
16660
  tracingPolicy: this.#options?.tracingPolicy
16640
16661
  };
16641
- convertedAgentTools[`agent-${agentName}`] = chunkBC2VKOH4_cjs.makeCoreTool(
16662
+ convertedAgentTools[`agent-${agentName}`] = chunkSDR22R4D_cjs.makeCoreTool(
16642
16663
  toolObj,
16643
16664
  options,
16644
16665
  void 0,
@@ -16669,7 +16690,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
16669
16690
  inputData: workflow.inputSchema,
16670
16691
  ...workflow.stateSchema ? { initialState: workflow.stateSchema } : {}
16671
16692
  });
16672
- const toolObj = chunk6HJFCSJ4_cjs.createTool({
16693
+ const toolObj = chunkO4YSWWLB_cjs.createTool({
16673
16694
  id: `workflow-${workflowName}`,
16674
16695
  description: workflow.description || `Workflow: ${workflowName}`,
16675
16696
  inputSchema: extendedInputSchema,
@@ -16817,7 +16838,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
16817
16838
  tracingContext,
16818
16839
  tracingPolicy: this.#options?.tracingPolicy
16819
16840
  };
16820
- convertedWorkflowTools[`workflow-${workflowName}`] = chunkBC2VKOH4_cjs.makeCoreTool(
16841
+ convertedWorkflowTools[`workflow-${workflowName}`] = chunkSDR22R4D_cjs.makeCoreTool(
16821
16842
  toolObj,
16822
16843
  options,
16823
16844
  void 0,
@@ -16847,7 +16868,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
16847
16868
  let mastraProxy = void 0;
16848
16869
  const logger = this.logger;
16849
16870
  if (this.#mastra) {
16850
- mastraProxy = chunkBC2VKOH4_cjs.createMastraProxy({ mastra: this.#mastra, logger });
16871
+ mastraProxy = chunkSDR22R4D_cjs.createMastraProxy({ mastra: this.#mastra, logger });
16851
16872
  }
16852
16873
  const assignedTools = await this.listAssignedTools({
16853
16874
  runId,
@@ -17087,7 +17108,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
17087
17108
  throw mastraError;
17088
17109
  }
17089
17110
  let headers;
17090
- if (resolvedModel instanceof chunkGXMJ5URG_cjs.ModelRouterLanguageModel) {
17111
+ if (resolvedModel instanceof chunk4M75INXO_cjs.ModelRouterLanguageModel) {
17091
17112
  headers = resolvedModel.config?.headers;
17092
17113
  }
17093
17114
  return [
@@ -17133,7 +17154,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
17133
17154
  throw mastraError;
17134
17155
  }
17135
17156
  let headers;
17136
- if (model2 instanceof chunkGXMJ5URG_cjs.ModelRouterLanguageModel) {
17157
+ if (model2 instanceof chunk4M75INXO_cjs.ModelRouterLanguageModel) {
17137
17158
  headers = model2.config?.headers;
17138
17159
  }
17139
17160
  return {
@@ -17193,7 +17214,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
17193
17214
  const targetProvider = structuredOutputModel.provider;
17194
17215
  const targetModelId = structuredOutputModel.modelId;
17195
17216
  if (targetProvider.includes("openai") || targetModelId.includes("openai")) {
17196
- if (chunkBC2VKOH4_cjs.isZodType(options.structuredOutput.schema) && targetModelId) {
17217
+ if (chunkSDR22R4D_cjs.isZodType(options.structuredOutput.schema) && targetModelId) {
17197
17218
  const modelInfo = {
17198
17219
  provider: targetProvider,
17199
17220
  modelId: targetModelId,
@@ -17212,7 +17233,7 @@ var Agent = class extends chunkDGV2FWB4_cjs.MastraBase {
17212
17233
  }
17213
17234
  const runId = options.runId || this.#mastra?.generateId() || crypto2.randomUUID();
17214
17235
  const instructions = options.instructions || await this.getInstructions({ requestContext });
17215
- const agentSpan = chunkO2CAMK4A_cjs.getOrCreateSpan({
17236
+ const agentSpan = chunkZSZOYPSJ_cjs.getOrCreateSpan({
17216
17237
  type: "agent_run" /* AGENT_RUN */,
17217
17238
  name: `agent run: '${this.id}'`,
17218
17239
  entityType: "agent" /* AGENT */,
@@ -20520,7 +20541,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
20520
20541
  );
20521
20542
  }
20522
20543
  if (typeof config.embedder === "string") {
20523
- this.embedder = new chunkGXMJ5URG_cjs.ModelRouterEmbeddingModel(config.embedder);
20544
+ this.embedder = new chunk4M75INXO_cjs.ModelRouterEmbeddingModel(config.embedder);
20524
20545
  } else {
20525
20546
  this.embedder = config.embedder;
20526
20547
  }
@@ -20556,7 +20577,7 @@ https://mastra.ai/en/docs/memory/overview`
20556
20577
  }
20557
20578
  setEmbedder(embedder) {
20558
20579
  if (typeof embedder === "string") {
20559
- this.embedder = new chunkGXMJ5URG_cjs.ModelRouterEmbeddingModel(embedder);
20580
+ this.embedder = new chunk4M75INXO_cjs.ModelRouterEmbeddingModel(embedder);
20560
20581
  } else {
20561
20582
  this.embedder = embedder;
20562
20583
  }
@@ -20620,7 +20641,7 @@ https://mastra.ai/en/docs/memory/overview`
20620
20641
  "The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
20621
20642
  );
20622
20643
  }
20623
- const mergedConfig = chunkBC2VKOH4_cjs.deepMerge(this.threadConfig, config || {});
20644
+ const mergedConfig = chunkSDR22R4D_cjs.deepMerge(this.threadConfig, config || {});
20624
20645
  if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
20625
20646
  mergedConfig.workingMemory.schema = config.workingMemory.schema;
20626
20647
  }
@@ -20858,7 +20879,7 @@ var MockMemory = class extends MastraMemory {
20858
20879
  } = {}) {
20859
20880
  super({
20860
20881
  name: "mock",
20861
- storage: storage || new chunkLOV5NNGK_cjs.InMemoryStore(),
20882
+ storage: storage || new chunkG6YCU7HJ_cjs.InMemoryStore(),
20862
20883
  options: {
20863
20884
  workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : void 0,
20864
20885
  lastMessages: enableMessageHistory ? 10 : void 0
@@ -20943,7 +20964,7 @@ var MockMemory = class extends MastraMemory {
20943
20964
  return {};
20944
20965
  }
20945
20966
  return {
20946
- updateWorkingMemory: chunk6HJFCSJ4_cjs.createTool({
20967
+ updateWorkingMemory: chunkO4YSWWLB_cjs.createTool({
20947
20968
  id: "update-working-memory",
20948
20969
  description: `Update the working memory with new information. Any data not included will be overwritten.`,
20949
20970
  inputSchema: z8__default.default.object({ memory: z8__default.default.string() }),
@@ -21141,5 +21162,5 @@ exports.validateStepInput = validateStepInput;
21141
21162
  exports.validateStepResumeData = validateStepResumeData;
21142
21163
  exports.validateStepStateData = validateStepStateData;
21143
21164
  exports.validateStepSuspendData = validateStepSuspendData;
21144
- //# sourceMappingURL=chunk-DDK3URK2.cjs.map
21145
- //# sourceMappingURL=chunk-DDK3URK2.cjs.map
21165
+ //# sourceMappingURL=chunk-6ZKYNY3H.cjs.map
21166
+ //# sourceMappingURL=chunk-6ZKYNY3H.cjs.map