@mastra/core 1.15.0-alpha.4 → 1.16.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 (168) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/dist/_types/@internal_core/dist/index.d.ts +7 -0
  3. package/dist/agent/index.cjs +8 -8
  4. package/dist/agent/index.js +1 -1
  5. package/dist/agent/workflows/prepare-stream/index.d.ts +1 -1
  6. package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
  7. package/dist/agent/workflows/prepare-stream/map-results-step.d.ts +1 -1
  8. package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
  9. package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts +1 -1
  10. package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
  11. package/dist/{chunk-ALQKGV35.js → chunk-2PSKFARX.js} +5 -5
  12. package/dist/{chunk-ALQKGV35.js.map → chunk-2PSKFARX.js.map} +1 -1
  13. package/dist/{chunk-MJKEBUMM.js → chunk-3IACFBML.js} +3 -3
  14. package/dist/{chunk-MJKEBUMM.js.map → chunk-3IACFBML.js.map} +1 -1
  15. package/dist/{chunk-LFMJYWJ7.js → chunk-3SDR4BWW.js} +10 -3
  16. package/dist/chunk-3SDR4BWW.js.map +1 -0
  17. package/dist/{chunk-JUL4UHWQ.cjs → chunk-4SE5WPZS.cjs} +6 -3
  18. package/dist/chunk-4SE5WPZS.cjs.map +1 -0
  19. package/dist/{chunk-YVFFNB2F.cjs → chunk-542IIQM4.cjs} +9 -9
  20. package/dist/{chunk-YVFFNB2F.cjs.map → chunk-542IIQM4.cjs.map} +1 -1
  21. package/dist/{chunk-ZHWQKPUV.cjs → chunk-57NZ23ZE.cjs} +39 -32
  22. package/dist/chunk-57NZ23ZE.cjs.map +1 -0
  23. package/dist/{chunk-Y6DV2OT2.js → chunk-5QV7Z7XH.js} +32 -5
  24. package/dist/chunk-5QV7Z7XH.js.map +1 -0
  25. package/dist/{chunk-FYQXIWRH.cjs → chunk-64L4MPSZ.cjs} +13 -13
  26. package/dist/{chunk-FYQXIWRH.cjs.map → chunk-64L4MPSZ.cjs.map} +1 -1
  27. package/dist/{chunk-W7I3FI2N.cjs → chunk-6W6AOWKN.cjs} +82 -82
  28. package/dist/{chunk-W7I3FI2N.cjs.map → chunk-6W6AOWKN.cjs.map} +1 -1
  29. package/dist/{chunk-CGQ7ENXU.js → chunk-7QYYD3UW.js} +7 -7
  30. package/dist/{chunk-CGQ7ENXU.js.map → chunk-7QYYD3UW.js.map} +1 -1
  31. package/dist/{chunk-ERY767HB.js → chunk-A5LEVLFM.js} +16 -8
  32. package/dist/chunk-A5LEVLFM.js.map +1 -0
  33. package/dist/{chunk-OY45D5N5.js → chunk-DQDA2GAF.js} +3 -3
  34. package/dist/{chunk-OY45D5N5.js.map → chunk-DQDA2GAF.js.map} +1 -1
  35. package/dist/{chunk-CK5R5ZNR.cjs → chunk-H2KIHE4I.cjs} +51 -9
  36. package/dist/chunk-H2KIHE4I.cjs.map +1 -0
  37. package/dist/{chunk-U3ZKCVTO.js → chunk-HQH3FILI.js} +4 -4
  38. package/dist/{chunk-U3ZKCVTO.js.map → chunk-HQH3FILI.js.map} +1 -1
  39. package/dist/{chunk-XQHRNOOO.cjs → chunk-LHNUJEV5.cjs} +23 -23
  40. package/dist/chunk-LHNUJEV5.cjs.map +1 -0
  41. package/dist/{chunk-BJYSPRTD.js → chunk-NMVEVERK.js} +3 -3
  42. package/dist/{chunk-BJYSPRTD.js.map → chunk-NMVEVERK.js.map} +1 -1
  43. package/dist/{chunk-VZWFITNF.cjs → chunk-P3Z47LFL.cjs} +13 -13
  44. package/dist/{chunk-VZWFITNF.cjs.map → chunk-P3Z47LFL.cjs.map} +1 -1
  45. package/dist/{chunk-6EG7YHGD.js → chunk-PQWKSCWD.js} +11 -4
  46. package/dist/chunk-PQWKSCWD.js.map +1 -0
  47. package/dist/{chunk-ZFVANSSN.cjs → chunk-QKZGMKBV.cjs} +13 -6
  48. package/dist/chunk-QKZGMKBV.cjs.map +1 -0
  49. package/dist/{chunk-FRPV7F7E.cjs → chunk-R5IZY5AI.cjs} +185 -185
  50. package/dist/{chunk-FRPV7F7E.cjs.map → chunk-R5IZY5AI.cjs.map} +1 -1
  51. package/dist/{chunk-ELXO2ZGY.cjs → chunk-RAPHSIIS.cjs} +68 -68
  52. package/dist/{chunk-ELXO2ZGY.cjs.map → chunk-RAPHSIIS.cjs.map} +1 -1
  53. package/dist/{chunk-K636CQJK.js → chunk-TE3EH746.js} +3 -3
  54. package/dist/{chunk-K636CQJK.js.map → chunk-TE3EH746.js.map} +1 -1
  55. package/dist/{chunk-LVA4AOT3.js → chunk-VAPRBIHM.js} +50 -8
  56. package/dist/chunk-VAPRBIHM.js.map +1 -0
  57. package/dist/{chunk-3PUUIEVX.js → chunk-VBVVGBJJ.js} +6 -3
  58. package/dist/chunk-VBVVGBJJ.js.map +1 -0
  59. package/dist/{chunk-VSGRSX3N.cjs → chunk-XAFCD3W2.cjs} +49 -22
  60. package/dist/chunk-XAFCD3W2.cjs.map +1 -0
  61. package/dist/{chunk-GU6MTO2I.js → chunk-XHXYXSH7.js} +5 -5
  62. package/dist/{chunk-GU6MTO2I.js.map → chunk-XHXYXSH7.js.map} +1 -1
  63. package/dist/{chunk-PDAZKZWB.cjs → chunk-XIC3EDT4.cjs} +3 -3
  64. package/dist/{chunk-PDAZKZWB.cjs.map → chunk-XIC3EDT4.cjs.map} +1 -1
  65. package/dist/{chunk-NI24OP2N.cjs → chunk-XZE2N5VH.cjs} +179 -171
  66. package/dist/chunk-XZE2N5VH.cjs.map +1 -0
  67. package/dist/{chunk-NYOTRFJQ.js → chunk-YQECYE7N.js} +12 -12
  68. package/dist/chunk-YQECYE7N.js.map +1 -0
  69. package/dist/{chunk-65K5KHEQ.cjs → chunk-YVVZSL6J.cjs} +7 -7
  70. package/dist/{chunk-65K5KHEQ.cjs.map → chunk-YVVZSL6J.cjs.map} +1 -1
  71. package/dist/{chunk-EYLPPZIF.js → chunk-YZZRYFTN.js} +4 -4
  72. package/dist/{chunk-EYLPPZIF.js.map → chunk-YZZRYFTN.js.map} +1 -1
  73. package/dist/{chunk-DIMION2S.cjs → chunk-Z6SLUMEY.cjs} +9 -9
  74. package/dist/{chunk-DIMION2S.cjs.map → chunk-Z6SLUMEY.cjs.map} +1 -1
  75. package/dist/datasets/dataset.d.ts +8 -1
  76. package/dist/datasets/dataset.d.ts.map +1 -1
  77. package/dist/datasets/index.cjs +17 -17
  78. package/dist/datasets/index.js +2 -2
  79. package/dist/datasets/manager.d.ts +3 -0
  80. package/dist/datasets/manager.d.ts.map +1 -1
  81. package/dist/docs/SKILL.md +1 -1
  82. package/dist/docs/assets/SOURCE_MAP.json +456 -456
  83. package/dist/evals/index.cjs +20 -20
  84. package/dist/evals/index.js +3 -3
  85. package/dist/evals/scoreTraces/index.cjs +7 -7
  86. package/dist/evals/scoreTraces/index.js +3 -3
  87. package/dist/harness/index.cjs +7 -7
  88. package/dist/harness/index.js +5 -5
  89. package/dist/index.cjs +2 -2
  90. package/dist/index.js +1 -1
  91. package/dist/llm/index.cjs +16 -16
  92. package/dist/llm/index.js +5 -5
  93. package/dist/llm/model/provider-types.generated.d.ts +22 -1
  94. package/dist/loop/index.cjs +14 -14
  95. package/dist/loop/index.js +1 -1
  96. package/dist/mastra/index.cjs +2 -2
  97. package/dist/mastra/index.js +1 -1
  98. package/dist/memory/index.cjs +14 -14
  99. package/dist/memory/index.js +1 -1
  100. package/dist/models-dev-46T4RYCV.js +3 -0
  101. package/dist/{models-dev-WCXTFBNF.js.map → models-dev-46T4RYCV.js.map} +1 -1
  102. package/dist/models-dev-IXRDPMYE.cjs +12 -0
  103. package/dist/{models-dev-DJ7R4TZH.cjs.map → models-dev-IXRDPMYE.cjs.map} +1 -1
  104. package/dist/netlify-A25PHNK2.js +3 -0
  105. package/dist/{netlify-NMYNMNGY.js.map → netlify-A25PHNK2.js.map} +1 -1
  106. package/dist/netlify-AERELDDR.cjs +12 -0
  107. package/dist/{netlify-YEHOZHML.cjs.map → netlify-AERELDDR.cjs.map} +1 -1
  108. package/dist/observability/index.cjs +18 -18
  109. package/dist/observability/index.js +1 -1
  110. package/dist/processor-provider/index.cjs +10 -10
  111. package/dist/processor-provider/index.js +1 -1
  112. package/dist/processors/index.cjs +42 -42
  113. package/dist/processors/index.js +1 -1
  114. package/dist/provider-registry-6T2HS3XM.cjs +40 -0
  115. package/dist/{provider-registry-7QEVAVHF.cjs.map → provider-registry-6T2HS3XM.cjs.map} +1 -1
  116. package/dist/provider-registry-FE4XSUID.js +3 -0
  117. package/dist/{provider-registry-S7PSD7QK.js.map → provider-registry-FE4XSUID.js.map} +1 -1
  118. package/dist/provider-registry.json +46 -4
  119. package/dist/relevance/index.cjs +3 -3
  120. package/dist/relevance/index.js +1 -1
  121. package/dist/storage/constants.cjs +56 -56
  122. package/dist/storage/constants.d.ts.map +1 -1
  123. package/dist/storage/constants.js +1 -1
  124. package/dist/storage/domains/datasets/inmemory.d.ts.map +1 -1
  125. package/dist/storage/domains/experiments/base.d.ts +2 -1
  126. package/dist/storage/domains/experiments/base.d.ts.map +1 -1
  127. package/dist/storage/domains/experiments/inmemory.d.ts +2 -1
  128. package/dist/storage/domains/experiments/inmemory.d.ts.map +1 -1
  129. package/dist/storage/index.cjs +264 -264
  130. package/dist/storage/index.js +3 -3
  131. package/dist/storage/types.d.ts +30 -0
  132. package/dist/storage/types.d.ts.map +1 -1
  133. package/dist/stream/index.cjs +8 -8
  134. package/dist/stream/index.js +1 -1
  135. package/dist/test-utils/llm-mock.cjs +4 -4
  136. package/dist/test-utils/llm-mock.js +1 -1
  137. package/dist/tool-loop-agent/index.cjs +4 -4
  138. package/dist/tool-loop-agent/index.js +1 -1
  139. package/dist/utils.cjs +23 -23
  140. package/dist/utils.js +1 -1
  141. package/dist/vector/index.cjs +7 -7
  142. package/dist/vector/index.js +1 -1
  143. package/dist/workflows/evented/index.cjs +10 -10
  144. package/dist/workflows/evented/index.js +1 -1
  145. package/dist/workflows/index.cjs +24 -24
  146. package/dist/workflows/index.js +1 -1
  147. package/package.json +10 -10
  148. package/src/llm/model/provider-types.generated.d.ts +22 -1
  149. package/dist/chunk-3PUUIEVX.js.map +0 -1
  150. package/dist/chunk-6EG7YHGD.js.map +0 -1
  151. package/dist/chunk-CK5R5ZNR.cjs.map +0 -1
  152. package/dist/chunk-ERY767HB.js.map +0 -1
  153. package/dist/chunk-JUL4UHWQ.cjs.map +0 -1
  154. package/dist/chunk-LFMJYWJ7.js.map +0 -1
  155. package/dist/chunk-LVA4AOT3.js.map +0 -1
  156. package/dist/chunk-NI24OP2N.cjs.map +0 -1
  157. package/dist/chunk-NYOTRFJQ.js.map +0 -1
  158. package/dist/chunk-VSGRSX3N.cjs.map +0 -1
  159. package/dist/chunk-XQHRNOOO.cjs.map +0 -1
  160. package/dist/chunk-Y6DV2OT2.js.map +0 -1
  161. package/dist/chunk-ZFVANSSN.cjs.map +0 -1
  162. package/dist/chunk-ZHWQKPUV.cjs.map +0 -1
  163. package/dist/models-dev-DJ7R4TZH.cjs +0 -12
  164. package/dist/models-dev-WCXTFBNF.js +0 -3
  165. package/dist/netlify-NMYNMNGY.js +0 -3
  166. package/dist/netlify-YEHOZHML.cjs +0 -12
  167. package/dist/provider-registry-7QEVAVHF.cjs +0 -40
  168. package/dist/provider-registry-S7PSD7QK.js +0 -3
@@ -3,17 +3,17 @@
3
3
  var chunkZC4FJVJZ_cjs = require('./chunk-ZC4FJVJZ.cjs');
4
4
  var chunkZCBG4ZQT_cjs = require('./chunk-ZCBG4ZQT.cjs');
5
5
  var chunkCTFO2ENI_cjs = require('./chunk-CTFO2ENI.cjs');
6
- var chunkVSGRSX3N_cjs = require('./chunk-VSGRSX3N.cjs');
6
+ var chunkXAFCD3W2_cjs = require('./chunk-XAFCD3W2.cjs');
7
7
  var chunkO6O5MD7Q_cjs = require('./chunk-O6O5MD7Q.cjs');
8
8
  var chunkY3APFUXZ_cjs = require('./chunk-Y3APFUXZ.cjs');
9
9
  var chunkCFMZZDO2_cjs = require('./chunk-CFMZZDO2.cjs');
10
- var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
11
10
  var chunkMR7ZWBL6_cjs = require('./chunk-MR7ZWBL6.cjs');
12
- var chunkW7I3FI2N_cjs = require('./chunk-W7I3FI2N.cjs');
13
- var chunkFYQXIWRH_cjs = require('./chunk-FYQXIWRH.cjs');
11
+ var chunk6W6AOWKN_cjs = require('./chunk-6W6AOWKN.cjs');
12
+ var chunk64L4MPSZ_cjs = require('./chunk-64L4MPSZ.cjs');
14
13
  var chunk6BJ7XHRH_cjs = require('./chunk-6BJ7XHRH.cjs');
15
- var chunkYVFFNB2F_cjs = require('./chunk-YVFFNB2F.cjs');
16
- var chunkJUL4UHWQ_cjs = require('./chunk-JUL4UHWQ.cjs');
14
+ var chunkOQDRPRKM_cjs = require('./chunk-OQDRPRKM.cjs');
15
+ var chunk542IIQM4_cjs = require('./chunk-542IIQM4.cjs');
16
+ var chunk4SE5WPZS_cjs = require('./chunk-4SE5WPZS.cjs');
17
17
  var chunkKJBMTK5B_cjs = require('./chunk-KJBMTK5B.cjs');
18
18
  var chunkNQXA2BUF_cjs = require('./chunk-NQXA2BUF.cjs');
19
19
  var chunkVWJ7H3MJ_cjs = require('./chunk-VWJ7H3MJ.cjs');
@@ -793,7 +793,7 @@ var StructuredOutputProcessor = class {
793
793
  }
794
794
  async processOutputStream(args) {
795
795
  const { part, state, streamParts, abort, ...rest } = args;
796
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
796
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
797
797
  const controller = state.controller;
798
798
  switch (part.type) {
799
799
  case "finish":
@@ -1090,7 +1090,7 @@ var ProcessorState = class {
1090
1090
  this.span = parentSpan?.createChildSpan({
1091
1091
  type: "processor_run" /* PROCESSOR_RUN */,
1092
1092
  name: `output stream processor: ${options.processorName}`,
1093
- entityType: chunkJUL4UHWQ_cjs.EntityType.OUTPUT_PROCESSOR,
1093
+ entityType: chunk4SE5WPZS_cjs.EntityType.OUTPUT_PROCESSOR,
1094
1094
  entityName: options.processorName,
1095
1095
  attributes: {
1096
1096
  processorExecutor: "legacy",
@@ -1267,7 +1267,7 @@ var ProcessorRunner = class _ProcessorRunner {
1267
1267
  const processorSpan = parentSpan?.createChildSpan({
1268
1268
  type: "processor_run" /* PROCESSOR_RUN */,
1269
1269
  name: `output processor: ${processor.id}`,
1270
- entityType: chunkJUL4UHWQ_cjs.EntityType.OUTPUT_PROCESSOR,
1270
+ entityType: chunk4SE5WPZS_cjs.EntityType.OUTPUT_PROCESSOR,
1271
1271
  entityId: processor.id,
1272
1272
  entityName: processor.name,
1273
1273
  attributes: {
@@ -1291,7 +1291,7 @@ var ProcessorRunner = class _ProcessorRunner {
1291
1291
  state: processorState.customState,
1292
1292
  result: result ?? defaultResult,
1293
1293
  abort,
1294
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: processorSpan }),
1294
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: processorSpan }),
1295
1295
  requestContext,
1296
1296
  retryCount,
1297
1297
  writer
@@ -1425,7 +1425,7 @@ var ProcessorRunner = class _ProcessorRunner {
1425
1425
  abort: (reason, options) => {
1426
1426
  throw new TripWire(reason || `Stream part blocked by ${processor.id}`, options, processor.id);
1427
1427
  },
1428
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: state.span }),
1428
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: state.span }),
1429
1429
  requestContext,
1430
1430
  messageList,
1431
1431
  retryCount,
@@ -1567,7 +1567,7 @@ var ProcessorRunner = class _ProcessorRunner {
1567
1567
  const processorSpan = parentSpan?.createChildSpan({
1568
1568
  type: "processor_run" /* PROCESSOR_RUN */,
1569
1569
  name: `input processor: ${processor.id}`,
1570
- entityType: chunkJUL4UHWQ_cjs.EntityType.INPUT_PROCESSOR,
1570
+ entityType: chunk4SE5WPZS_cjs.EntityType.INPUT_PROCESSOR,
1571
1571
  entityId: processor.id,
1572
1572
  entityName: processor.name,
1573
1573
  attributes: {
@@ -1585,7 +1585,7 @@ var ProcessorRunner = class _ProcessorRunner {
1585
1585
  systemMessages: currentSystemMessages,
1586
1586
  state: processorState.customState,
1587
1587
  abort,
1588
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: processorSpan }),
1588
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: processorSpan }),
1589
1589
  messageList,
1590
1590
  requestContext,
1591
1591
  retryCount
@@ -1696,7 +1696,7 @@ var ProcessorRunner = class _ProcessorRunner {
1696
1696
  */
1697
1697
  async runProcessInputStep(args) {
1698
1698
  const { messageList, stepNumber, steps, requestContext, writer } = args;
1699
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(args);
1699
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(args);
1700
1700
  const stepInput = {
1701
1701
  messageId: args.messageId,
1702
1702
  tools: args.tools,
@@ -1766,7 +1766,7 @@ var ProcessorRunner = class _ProcessorRunner {
1766
1766
  const processorSpan = currentSpan?.createChildSpan({
1767
1767
  type: "processor_run" /* PROCESSOR_RUN */,
1768
1768
  name: `input step processor: ${processor.id}`,
1769
- entityType: chunkJUL4UHWQ_cjs.EntityType.INPUT_STEP_PROCESSOR,
1769
+ entityType: chunk4SE5WPZS_cjs.EntityType.INPUT_STEP_PROCESSOR,
1770
1770
  entityId: processor.id,
1771
1771
  entityName: processor.name,
1772
1772
  attributes: {
@@ -1797,7 +1797,7 @@ var ProcessorRunner = class _ProcessorRunner {
1797
1797
  return nextMessageId;
1798
1798
  }
1799
1799
  } : {},
1800
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: processorSpan }),
1800
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: processorSpan }),
1801
1801
  retryCount: args.retryCount ?? 0,
1802
1802
  writer,
1803
1803
  abortSignal: args.abortSignal
@@ -1892,7 +1892,7 @@ var ProcessorRunner = class _ProcessorRunner {
1892
1892
  retryCount = 0,
1893
1893
  writer
1894
1894
  } = args;
1895
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(args);
1895
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(args);
1896
1896
  for (const [index, processorOrWorkflow] of this.outputProcessors.entries()) {
1897
1897
  const processableMessages = messageList.get.all.db();
1898
1898
  const idsBeforeProcessing = processableMessages.map((m) => m.id);
@@ -1932,7 +1932,7 @@ var ProcessorRunner = class _ProcessorRunner {
1932
1932
  const processorSpan = parentSpan?.createChildSpan({
1933
1933
  type: "processor_run" /* PROCESSOR_RUN */,
1934
1934
  name: `output step processor: ${processor.id}`,
1935
- entityType: chunkJUL4UHWQ_cjs.EntityType.OUTPUT_STEP_PROCESSOR,
1935
+ entityType: chunk4SE5WPZS_cjs.EntityType.OUTPUT_STEP_PROCESSOR,
1936
1936
  entityId: processor.id,
1937
1937
  entityName: processor.name,
1938
1938
  attributes: {
@@ -1956,7 +1956,7 @@ var ProcessorRunner = class _ProcessorRunner {
1956
1956
  steps,
1957
1957
  state: processorState.customState,
1958
1958
  abort,
1959
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: processorSpan }),
1959
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: processorSpan }),
1960
1960
  requestContext,
1961
1961
  retryCount,
1962
1962
  writer
@@ -2070,7 +2070,7 @@ var ProcessorRunner = class _ProcessorRunner {
2070
2070
  }
2071
2071
  const { model: _model, ...rest } = result;
2072
2072
  if (result.model) {
2073
- const resolvedModel = await chunkW7I3FI2N_cjs.resolveModelConfig(result.model);
2073
+ const resolvedModel = await chunk6W6AOWKN_cjs.resolveModelConfig(result.model);
2074
2074
  const isSupported = isSupportedLanguageModel(resolvedModel);
2075
2075
  if (!isSupported) {
2076
2076
  throw new chunk4U7ZLI36_cjs.MastraError({
@@ -2815,7 +2815,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
2815
2815
  this.#transportRef = options.transportRef;
2816
2816
  this.#returnScorerData = !!options.returnScorerData;
2817
2817
  this.runId = options.runId;
2818
- const resultSpan = chunkJUL4UHWQ_cjs.getRootExportSpan(options.tracingContext?.currentSpan);
2818
+ const resultSpan = chunk4SE5WPZS_cjs.getRootExportSpan(options.tracingContext?.currentSpan);
2819
2819
  this.traceId = resultSpan?.externalTraceId;
2820
2820
  this.spanId = resultSpan?.id;
2821
2821
  this.#model = _model;
@@ -2877,7 +2877,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
2877
2877
  } = await processorRunner.processPart(
2878
2878
  chunk,
2879
2879
  processorStates,
2880
- chunkJUL4UHWQ_cjs.resolveObservabilityContext(options),
2880
+ chunk4SE5WPZS_cjs.resolveObservabilityContext(options),
2881
2881
  options.requestContext,
2882
2882
  self.messageList,
2883
2883
  0,
@@ -3269,7 +3269,7 @@ var MastraModelOutput = class extends chunkRO47SMI7_cjs.MastraBase {
3269
3269
  };
3270
3270
  self.messageList = await self.processorRunner.runOutputProcessors(
3271
3271
  self.messageList,
3272
- chunkJUL4UHWQ_cjs.resolveObservabilityContext(options),
3272
+ chunk4SE5WPZS_cjs.resolveObservabilityContext(options),
3273
3273
  self.#options.requestContext,
3274
3274
  0,
3275
3275
  outputResultWriter,
@@ -4844,7 +4844,7 @@ var getModelOutputForTripwire = async ({
4844
4844
  messageList,
4845
4845
  ...rest
4846
4846
  }) => {
4847
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
4847
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
4848
4848
  const tripwireStream = new web.ReadableStream({
4849
4849
  start(controller) {
4850
4850
  controller.enqueue({
@@ -5496,7 +5496,7 @@ var createTimeTravelExecutionParams = (params) => {
5496
5496
  result = void 0;
5497
5497
  }
5498
5498
  if (result) {
5499
- const formattedResult = chunkYVFFNB2F_cjs.removeUndefinedValues(result);
5499
+ const formattedResult = chunk542IIQM4_cjs.removeUndefinedValues(result);
5500
5500
  stepResults[stepId] = formattedResult;
5501
5501
  }
5502
5502
  });
@@ -5588,7 +5588,7 @@ async function executeParallel(engine, params) {
5588
5588
  perStep,
5589
5589
  ...rest
5590
5590
  } = params;
5591
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
5591
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
5592
5592
  const parallelSpan = await engine.createChildSpan({
5593
5593
  parentSpan: observabilityContext.tracingContext.currentSpan,
5594
5594
  operationId: `workflow.${workflowId}.run.${runId}.parallel.${executionContext.executionPath.join("-")}.span.start`,
@@ -5666,7 +5666,7 @@ async function executeParallel(engine, params) {
5666
5666
  state: executionContext.state,
5667
5667
  tracingIds: executionContext.tracingIds
5668
5668
  },
5669
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: parallelSpan }),
5669
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: parallelSpan }),
5670
5670
  pubsub,
5671
5671
  abortController,
5672
5672
  requestContext,
@@ -5742,7 +5742,7 @@ async function executeConditional(engine, params) {
5742
5742
  perStep,
5743
5743
  ...rest
5744
5744
  } = params;
5745
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
5745
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
5746
5746
  const conditionalSpan = await engine.createChildSpan({
5747
5747
  parentSpan: observabilityContext.tracingContext.currentSpan,
5748
5748
  operationId: `workflow.${workflowId}.run.${runId}.conditional.${executionContext.executionPath.join("-")}.span.start`,
@@ -5784,7 +5784,7 @@ async function executeConditional(engine, params) {
5784
5784
  inputData: prevOutput,
5785
5785
  state: executionContext.state,
5786
5786
  retryCount: -1,
5787
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: evalSpan }),
5787
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: evalSpan }),
5788
5788
  getInitData: () => stepResults?.input,
5789
5789
  getStepResult: getStepResult.bind(null, stepResults),
5790
5790
  bail: (() => {
@@ -5905,7 +5905,7 @@ async function executeConditional(engine, params) {
5905
5905
  state: executionContext.state,
5906
5906
  tracingIds: executionContext.tracingIds
5907
5907
  },
5908
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: conditionalSpan }),
5908
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: conditionalSpan }),
5909
5909
  pubsub,
5910
5910
  abortController,
5911
5911
  requestContext,
@@ -5982,7 +5982,7 @@ async function executeLoop(engine, params) {
5982
5982
  perStep,
5983
5983
  ...rest
5984
5984
  } = params;
5985
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
5985
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
5986
5986
  const { step, condition } = entry;
5987
5987
  const loopSpan = await engine.createChildSpan({
5988
5988
  parentSpan: observabilityContext.tracingContext.currentSpan,
@@ -6018,7 +6018,7 @@ async function executeLoop(engine, params) {
6018
6018
  resume: currentResume,
6019
6019
  timeTravel: currentTimeTravel,
6020
6020
  prevOutput: result.output,
6021
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: loopSpan }),
6021
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: loopSpan }),
6022
6022
  pubsub,
6023
6023
  abortController,
6024
6024
  requestContext,
@@ -6054,7 +6054,7 @@ async function executeLoop(engine, params) {
6054
6054
  options: {
6055
6055
  type: "workflow_conditional_eval" /* WORKFLOW_CONDITIONAL_EVAL */,
6056
6056
  name: `condition: '${entry.loopType}'`,
6057
- input: chunkYVFFNB2F_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
6057
+ input: chunk542IIQM4_cjs.selectFields(result.output, ["stepResult", "output.text", "output.object", "messages"]),
6058
6058
  attributes: {
6059
6059
  conditionIndex: iteration
6060
6060
  },
@@ -6072,7 +6072,7 @@ async function executeLoop(engine, params) {
6072
6072
  inputData: result.output,
6073
6073
  state: executionContext.state,
6074
6074
  retryCount: -1,
6075
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: evalSpan }),
6075
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: evalSpan }),
6076
6076
  iterationCount: iteration + 1,
6077
6077
  getInitData: () => stepResults?.input,
6078
6078
  getStepResult: getStepResult.bind(null, stepResults),
@@ -6144,7 +6144,7 @@ async function executeForeach(engine, params) {
6144
6144
  perStep,
6145
6145
  ...rest
6146
6146
  } = params;
6147
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
6147
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
6148
6148
  const { step, opts } = entry;
6149
6149
  const results = [];
6150
6150
  const concurrency = opts.concurrency;
@@ -6220,7 +6220,7 @@ async function executeForeach(engine, params) {
6220
6220
  executionContext: { ...executionContext, foreachIndex: k },
6221
6221
  resume: resumeToUse,
6222
6222
  prevOutput: item,
6223
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: loopSpan }),
6223
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: loopSpan }),
6224
6224
  pubsub,
6225
6225
  abortController,
6226
6226
  requestContext,
@@ -6507,7 +6507,7 @@ async function executeEntry(engine, params) {
6507
6507
  perStep,
6508
6508
  ...rest
6509
6509
  } = params;
6510
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
6510
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
6511
6511
  const prevOutput = engine.getStepOutput(stepResults, prevStep);
6512
6512
  let execResults;
6513
6513
  let entryRequestContext;
@@ -6976,7 +6976,7 @@ async function executeSleep(engine, params) {
6976
6976
  outputWriter,
6977
6977
  ...rest
6978
6978
  } = params;
6979
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
6979
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
6980
6980
  let { duration, fn } = entry;
6981
6981
  const sleepSpan = await engine.createChildSpan({
6982
6982
  parentSpan: observabilityContext.tracingContext.currentSpan,
@@ -7005,7 +7005,7 @@ async function executeSleep(engine, params) {
7005
7005
  executionContext.state = state;
7006
7006
  },
7007
7007
  retryCount: -1,
7008
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: sleepSpan }),
7008
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: sleepSpan }),
7009
7009
  getInitData: () => stepResults?.input,
7010
7010
  getStepResult: getStepResult.bind(null, stepResults),
7011
7011
  // TODO: this function shouldn't have suspend probably?
@@ -7066,7 +7066,7 @@ async function executeSleepUntil(engine, params) {
7066
7066
  outputWriter,
7067
7067
  ...rest
7068
7068
  } = params;
7069
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
7069
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
7070
7070
  let { date, fn } = entry;
7071
7071
  const sleepUntilSpan = await engine.createChildSpan({
7072
7072
  parentSpan: observabilityContext.tracingContext.currentSpan,
@@ -7096,7 +7096,7 @@ async function executeSleepUntil(engine, params) {
7096
7096
  executionContext.state = state;
7097
7097
  },
7098
7098
  retryCount: -1,
7099
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: sleepUntilSpan }),
7099
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: sleepUntilSpan }),
7100
7100
  getInitData: () => stepResults?.input,
7101
7101
  getStepResult: getStepResult.bind(null, stepResults),
7102
7102
  // TODO: this function shouldn't have suspend probably?
@@ -7175,7 +7175,7 @@ async function executeStep(engine, params) {
7175
7175
  perStep,
7176
7176
  ...rest
7177
7177
  } = params;
7178
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
7178
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
7179
7179
  const stepCallId = crypto2.randomUUID();
7180
7180
  const { inputData, validationError: inputValidationError } = await validateStepInput({
7181
7181
  prevOutput,
@@ -7226,7 +7226,7 @@ async function executeStep(engine, params) {
7226
7226
  options: {
7227
7227
  name: `workflow step: '${step.id}'`,
7228
7228
  type: "workflow_step" /* WORKFLOW_STEP */,
7229
- entityType: chunkJUL4UHWQ_cjs.EntityType.WORKFLOW_STEP,
7229
+ entityType: chunk4SE5WPZS_cjs.EntityType.WORKFLOW_STEP,
7230
7230
  entityId: step.id,
7231
7231
  input: inputData,
7232
7232
  tracingPolicy: engine.options?.tracingPolicy,
@@ -7314,7 +7314,7 @@ async function executeStep(engine, params) {
7314
7314
  deprecationMessage: runCountDeprecationMessage,
7315
7315
  logger: engine.getLogger()
7316
7316
  });
7317
- return chunkJUL4UHWQ_cjs.executeWithContext({ span: stepSpan, fn: () => step.execute(proxiedData) });
7317
+ return chunk4SE5WPZS_cjs.executeWithContext({ span: stepSpan, fn: () => step.execute(proxiedData) });
7318
7318
  };
7319
7319
  let execResults;
7320
7320
  const retries = step.retries ?? executionContext.retryConfig.attempts ?? 0;
@@ -7339,7 +7339,7 @@ async function executeStep(engine, params) {
7339
7339
  requestContextUpdate: null
7340
7340
  };
7341
7341
  const isNestedWorkflow = step.component === "WORKFLOW";
7342
- const mastraForStep = engine.mastra ? isNestedWorkflow ? engine.mastra : chunkJUL4UHWQ_cjs.wrapMastra(engine.mastra, { currentSpan: stepSpan }) : void 0;
7342
+ const mastraForStep = engine.mastra ? isNestedWorkflow ? engine.mastra : chunk4SE5WPZS_cjs.wrapMastra(engine.mastra, { currentSpan: stepSpan }) : void 0;
7343
7343
  const output = await runStep({
7344
7344
  runId,
7345
7345
  resourceId,
@@ -7362,7 +7362,7 @@ async function executeStep(engine, params) {
7362
7362
  retryCount,
7363
7363
  resumeData: resumeDataToUse,
7364
7364
  suspendData: suspendDataToUse,
7365
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: stepSpan }),
7365
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: stepSpan }),
7366
7366
  getInitData: () => stepResults?.input,
7367
7367
  getStepResult: getStepResult.bind(null, stepResults),
7368
7368
  suspend: async (suspendPayload, suspendOptions) => {
@@ -7464,7 +7464,7 @@ async function executeStep(engine, params) {
7464
7464
  stepId: step.id,
7465
7465
  requestContext,
7466
7466
  disableScorers,
7467
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: stepSpan })
7467
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: stepSpan })
7468
7468
  });
7469
7469
  }
7470
7470
  if (durableResult.suspended) {
@@ -7520,7 +7520,7 @@ async function executeStep(engine, params) {
7520
7520
  }
7521
7521
  async function runScorersForStep(params) {
7522
7522
  const { engine, scorers, runId, input, output, workflowId, stepId, requestContext, disableScorers, ...rest } = params;
7523
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
7523
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
7524
7524
  let scorersToUse = scorers;
7525
7525
  if (typeof scorersToUse === "function") {
7526
7526
  try {
@@ -8093,7 +8093,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
8093
8093
  resume,
8094
8094
  timeTravel,
8095
8095
  restart,
8096
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: workflowSpan }),
8096
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: workflowSpan }),
8097
8097
  abortController: params.abortController,
8098
8098
  pubsub: params.pubsub,
8099
8099
  requestContext: currentRequestContext,
@@ -8389,7 +8389,7 @@ function createStepFromAgent(params, agentOrToolOptions) {
8389
8389
  writer,
8390
8390
  ...rest
8391
8391
  }) => {
8392
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
8392
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
8393
8393
  let streamPromise = {};
8394
8394
  streamPromise.promise = new Promise((resolve, reject) => {
8395
8395
  streamPromise.resolve = resolve;
@@ -8517,7 +8517,7 @@ function createStepFromTool(params, toolOpts) {
8517
8517
  setState,
8518
8518
  ...rest
8519
8519
  }) => {
8520
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
8520
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
8521
8521
  const toolContext = {
8522
8522
  mastra,
8523
8523
  requestContext,
@@ -8541,16 +8541,16 @@ function createStepFromProcessor(processor) {
8541
8541
  const getProcessorEntityType = (phase) => {
8542
8542
  switch (phase) {
8543
8543
  case "input":
8544
- return chunkJUL4UHWQ_cjs.EntityType.INPUT_PROCESSOR;
8544
+ return chunk4SE5WPZS_cjs.EntityType.INPUT_PROCESSOR;
8545
8545
  case "inputStep":
8546
- return chunkJUL4UHWQ_cjs.EntityType.INPUT_STEP_PROCESSOR;
8546
+ return chunk4SE5WPZS_cjs.EntityType.INPUT_STEP_PROCESSOR;
8547
8547
  case "outputStream":
8548
8548
  case "outputResult":
8549
- return chunkJUL4UHWQ_cjs.EntityType.OUTPUT_PROCESSOR;
8549
+ return chunk4SE5WPZS_cjs.EntityType.OUTPUT_PROCESSOR;
8550
8550
  case "outputStep":
8551
- return chunkJUL4UHWQ_cjs.EntityType.OUTPUT_STEP_PROCESSOR;
8551
+ return chunk4SE5WPZS_cjs.EntityType.OUTPUT_STEP_PROCESSOR;
8552
8552
  default:
8553
- return chunkJUL4UHWQ_cjs.EntityType.OUTPUT_PROCESSOR;
8553
+ return chunk4SE5WPZS_cjs.EntityType.OUTPUT_PROCESSOR;
8554
8554
  }
8555
8555
  };
8556
8556
  const getSpanNamePrefix = (phase) => {
@@ -8648,7 +8648,7 @@ function createStepFromProcessor(processor) {
8648
8648
  processorIndex: processor.processorIndex
8649
8649
  }
8650
8650
  }) : void 0;
8651
- const processorObservabilityContext = chunkJUL4UHWQ_cjs.createObservabilityContext(
8651
+ const processorObservabilityContext = chunk4SE5WPZS_cjs.createObservabilityContext(
8652
8652
  processorSpan ? { currentSpan: processorSpan } : tracingContext
8653
8653
  );
8654
8654
  const processorWriter = outputWriter ? {
@@ -8706,7 +8706,7 @@ function createStepFromProcessor(processor) {
8706
8706
  };
8707
8707
  const executePhaseWithSpan = async (fn) => {
8708
8708
  try {
8709
- const result = await chunkJUL4UHWQ_cjs.executeWithContext({ span: processorSpan, fn });
8709
+ const result = await chunk4SE5WPZS_cjs.executeWithContext({ span: processorSpan, fn });
8710
8710
  processorSpan?.end({ output: result });
8711
8711
  return result;
8712
8712
  } catch (error) {
@@ -8850,7 +8850,7 @@ function createStepFromProcessor(processor) {
8850
8850
  processorSpan2 = parentSpan.createChildSpan({
8851
8851
  type: "processor_run" /* PROCESSOR_RUN */,
8852
8852
  name: `output stream processor: ${processor.id}`,
8853
- entityType: chunkJUL4UHWQ_cjs.EntityType.OUTPUT_PROCESSOR,
8853
+ entityType: chunk4SE5WPZS_cjs.EntityType.OUTPUT_PROCESSOR,
8854
8854
  entityId: processor.id,
8855
8855
  entityName: processor.name ?? processor.id,
8856
8856
  input: { phase, totalChunks: 0 },
@@ -8867,7 +8867,7 @@ function createStepFromProcessor(processor) {
8867
8867
  totalChunks: (streamParts ?? []).length
8868
8868
  };
8869
8869
  }
8870
- const processorObservabilityContext2 = chunkJUL4UHWQ_cjs.createObservabilityContext(
8870
+ const processorObservabilityContext2 = chunk4SE5WPZS_cjs.createObservabilityContext(
8871
8871
  processorSpan2 ? { currentSpan: processorSpan2 } : baseContext.tracingContext
8872
8872
  );
8873
8873
  let result;
@@ -9613,7 +9613,7 @@ var Workflow = class extends chunkRO47SMI7_cjs.MastraBase {
9613
9613
  bail: _bail,
9614
9614
  ...rest
9615
9615
  }) {
9616
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
9616
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
9617
9617
  this.__registerMastra(mastra);
9618
9618
  const effectiveValidateInputs = validateInputs ?? this.#options.validateInputs ?? true;
9619
9619
  this.#options = {
@@ -10111,11 +10111,11 @@ var Run = class {
10111
10111
  perStep,
10112
10112
  ...rest
10113
10113
  }) {
10114
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
10115
- const workflowSpan = chunkJUL4UHWQ_cjs.getOrCreateSpan({
10114
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
10115
+ const workflowSpan = chunk4SE5WPZS_cjs.getOrCreateSpan({
10116
10116
  type: "workflow_run" /* WORKFLOW_RUN */,
10117
10117
  name: `workflow run: '${this.workflowId}'`,
10118
- entityType: chunkJUL4UHWQ_cjs.EntityType.WORKFLOW_RUN,
10118
+ entityType: chunk4SE5WPZS_cjs.EntityType.WORKFLOW_RUN,
10119
10119
  entityId: this.workflowId,
10120
10120
  input: inputData,
10121
10121
  metadata: {
@@ -10192,7 +10192,7 @@ var Run = class {
10192
10192
  tracingOptions,
10193
10193
  ...rest
10194
10194
  } = {}) {
10195
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
10195
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
10196
10196
  if (this.closeStreamAction) {
10197
10197
  return {
10198
10198
  stream: this.observeStreamLegacy().stream,
@@ -10317,7 +10317,7 @@ var Run = class {
10317
10317
  perStep,
10318
10318
  ...rest
10319
10319
  }) {
10320
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
10320
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
10321
10321
  if (this.closeStreamAction && this.streamOutput) {
10322
10322
  return this.streamOutput;
10323
10323
  }
@@ -10418,7 +10418,7 @@ var Run = class {
10418
10418
  perStep,
10419
10419
  ...rest
10420
10420
  } = {}) {
10421
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
10421
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
10422
10422
  this.closeStreamAction = async () => {
10423
10423
  };
10424
10424
  const self = this;
@@ -10547,7 +10547,7 @@ var Run = class {
10547
10547
  return this._restart(args);
10548
10548
  }
10549
10549
  async _resume(params) {
10550
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(params);
10550
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(params);
10551
10551
  const workflowsStore = await this.#mastra?.getStorage()?.getStore("workflows");
10552
10552
  const snapshot = await workflowsStore?.loadWorkflowSnapshot({
10553
10553
  workflowName: this.workflowId,
@@ -10631,10 +10631,10 @@ var Run = class {
10631
10631
  traceId: effectiveTraceId,
10632
10632
  parentSpanId: shouldUsePersistedParentSpan ? persistedTracingContext?.spanId : params.tracingOptions?.parentSpanId
10633
10633
  };
10634
- const workflowSpan = chunkJUL4UHWQ_cjs.getOrCreateSpan({
10634
+ const workflowSpan = chunk4SE5WPZS_cjs.getOrCreateSpan({
10635
10635
  type: "workflow_run" /* WORKFLOW_RUN */,
10636
10636
  name: `workflow run: '${this.workflowId}' (resumed)`,
10637
- entityType: chunkJUL4UHWQ_cjs.EntityType.WORKFLOW_RUN,
10637
+ entityType: chunk4SE5WPZS_cjs.EntityType.WORKFLOW_RUN,
10638
10638
  entityId: this.workflowId,
10639
10639
  input: resumeDataToUse,
10640
10640
  metadata: {
@@ -10698,7 +10698,7 @@ var Run = class {
10698
10698
  tracingOptions,
10699
10699
  ...rest
10700
10700
  }) {
10701
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
10701
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
10702
10702
  if (this.workflowEngineType !== "default") {
10703
10703
  throw new Error(`restart() is not supported on ${this.workflowEngineType} workflows`);
10704
10704
  }
@@ -10750,10 +10750,10 @@ var Run = class {
10750
10750
  requestContextToUse.set(key, value);
10751
10751
  }
10752
10752
  }
10753
- const workflowSpan = chunkJUL4UHWQ_cjs.getOrCreateSpan({
10753
+ const workflowSpan = chunk4SE5WPZS_cjs.getOrCreateSpan({
10754
10754
  type: "workflow_run" /* WORKFLOW_RUN */,
10755
10755
  name: `workflow run: '${this.workflowId}'`,
10756
- entityType: chunkJUL4UHWQ_cjs.EntityType.WORKFLOW_RUN,
10756
+ entityType: chunk4SE5WPZS_cjs.EntityType.WORKFLOW_RUN,
10757
10757
  entityId: this.workflowId,
10758
10758
  metadata: {
10759
10759
  resourceId: this.resourceId,
@@ -10803,7 +10803,7 @@ var Run = class {
10803
10803
  perStep,
10804
10804
  ...rest
10805
10805
  }) {
10806
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
10806
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
10807
10807
  if (!stepParam || Array.isArray(stepParam) && stepParam.length === 0) {
10808
10808
  throw new Error("Step is required and must be a valid step or array of steps");
10809
10809
  }
@@ -10847,11 +10847,11 @@ var Run = class {
10847
10847
  requestContextToUse.set(key, value);
10848
10848
  }
10849
10849
  }
10850
- const workflowSpan = chunkJUL4UHWQ_cjs.getOrCreateSpan({
10850
+ const workflowSpan = chunk4SE5WPZS_cjs.getOrCreateSpan({
10851
10851
  type: "workflow_run" /* WORKFLOW_RUN */,
10852
10852
  name: `workflow run: '${this.workflowId}'`,
10853
10853
  input: inputData,
10854
- entityType: chunkJUL4UHWQ_cjs.EntityType.WORKFLOW_RUN,
10854
+ entityType: chunk4SE5WPZS_cjs.EntityType.WORKFLOW_RUN,
10855
10855
  entityId: this.workflowId,
10856
10856
  metadata: {
10857
10857
  resourceId: this.resourceId,
@@ -10905,7 +10905,7 @@ var Run = class {
10905
10905
  perStep,
10906
10906
  ...rest
10907
10907
  }) {
10908
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
10908
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
10909
10909
  this.closeStreamAction = async () => {
10910
10910
  };
10911
10911
  const self = this;
@@ -11211,7 +11211,7 @@ var MastraScorer = class _MastraScorer {
11211
11211
  }
11212
11212
  });
11213
11213
  }
11214
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(input);
11214
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(input);
11215
11215
  let runId = input.runId;
11216
11216
  if (!runId) {
11217
11217
  runId = crypto2.randomUUID();
@@ -11264,7 +11264,7 @@ var MastraScorer = class _MastraScorer {
11264
11264
  inputSchema: z9.z.any(),
11265
11265
  outputSchema: z9.z.any(),
11266
11266
  execute: async ({ inputData, getInitData, ...rest }) => {
11267
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
11267
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
11268
11268
  const { accumulatedResults = {}, generatedPrompts = {} } = inputData;
11269
11269
  const { run } = getInitData();
11270
11270
  const context = this.createScorerContext(scorerStep.name, run, accumulatedResults);
@@ -11355,7 +11355,7 @@ var MastraScorer = class _MastraScorer {
11355
11355
  }
11356
11356
  });
11357
11357
  }
11358
- const resolvedModel = await chunkW7I3FI2N_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
11358
+ const resolvedModel = await chunk6W6AOWKN_cjs.resolveModelConfig(modelConfig, void 0, this.#mastra);
11359
11359
  const judge = new Agent({
11360
11360
  id: "judge",
11361
11361
  name: "judge",
@@ -12780,7 +12780,7 @@ function createLLMExecutionStep({
12780
12780
  const processInputStepResult = await processorRunner.runProcessInputStep({
12781
12781
  messageList,
12782
12782
  stepNumber: inputData.output?.steps?.length || 0,
12783
- ...chunkJUL4UHWQ_cjs.createObservabilityContext(stepTracingContext),
12783
+ ...chunk4SE5WPZS_cjs.createObservabilityContext(stepTracingContext),
12784
12784
  requestContext,
12785
12785
  model,
12786
12786
  steps: inputData.output?.steps || [],
@@ -12805,7 +12805,7 @@ function createLLMExecutionStep({
12805
12805
  const convertedTools = {};
12806
12806
  for (const [name, tool2] of Object.entries(currentStep.tools)) {
12807
12807
  if (chunkNQXA2BUF_cjs.isMastraTool(tool2)) {
12808
- convertedTools[name] = chunkYVFFNB2F_cjs.makeCoreTool(
12808
+ convertedTools[name] = chunk542IIQM4_cjs.makeCoreTool(
12809
12809
  tool2,
12810
12810
  {
12811
12811
  name,
@@ -12942,7 +12942,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
12942
12942
  }
12943
12943
  }
12944
12944
  if (isSupportedLanguageModel(currentStep.model)) {
12945
- modelResult = chunkJUL4UHWQ_cjs.executeWithContextSync({
12945
+ modelResult = chunk4SE5WPZS_cjs.executeWithContextSync({
12946
12946
  span: modelSpanTracker?.getTracingContext()?.currentSpan,
12947
12947
  fn: () => execute({
12948
12948
  runId,
@@ -13012,7 +13012,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
13012
13012
  }
13013
13013
  });
13014
13014
  let transportResolver;
13015
- if (currentStep.model instanceof chunkW7I3FI2N_cjs.ModelRouterLanguageModel) {
13015
+ if (currentStep.model instanceof chunk6W6AOWKN_cjs.ModelRouterLanguageModel) {
13016
13016
  const routerModel = currentStep.model;
13017
13017
  transportResolver = () => routerModel._getStreamTransport();
13018
13018
  }
@@ -13175,7 +13175,7 @@ Analyse the suspended tools: ${JSON.stringify(suspendedTools)}, using the messag
13175
13175
  finishReason: immediateFinishReason,
13176
13176
  toolCalls: toolCallInfos.length > 0 ? toolCallInfos : void 0,
13177
13177
  text: immediateText,
13178
- ...chunkJUL4UHWQ_cjs.createObservabilityContext(outputStepTracingContext),
13178
+ ...chunk4SE5WPZS_cjs.createObservabilityContext(outputStepTracingContext),
13179
13179
  requestContext,
13180
13180
  retryCount: currentRetryCount,
13181
13181
  writer: processorWriter
@@ -13290,7 +13290,7 @@ function createLLMMappingStep({ models, _internal, ...rest }, llmExecutionStep)
13290
13290
  agentName: "LLMMappingStep",
13291
13291
  processorStates: rest.processorStates
13292
13292
  }) : void 0;
13293
- const observabilityContext = chunkJUL4UHWQ_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext());
13293
+ const observabilityContext = chunk4SE5WPZS_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext());
13294
13294
  const streamWriter = rest.outputWriter ? { custom: async (data) => rest.outputWriter(data) } : void 0;
13295
13295
  async function processAndEnqueueChunk(chunk) {
13296
13296
  if (processorRunner && rest.processorStates) {
@@ -14365,12 +14365,12 @@ function workflowLoopStream({
14365
14365
  }
14366
14366
  const executionResult = resumeContext ? await run.resume({
14367
14367
  resumeData: resumeContext.resumeData,
14368
- ...chunkJUL4UHWQ_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext()),
14368
+ ...chunk4SE5WPZS_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext()),
14369
14369
  requestContext,
14370
14370
  label: toolCallId
14371
14371
  }) : await run.start({
14372
14372
  inputData: initialData,
14373
- ...chunkJUL4UHWQ_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext()),
14373
+ ...chunk4SE5WPZS_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext()),
14374
14374
  requestContext
14375
14375
  });
14376
14376
  if (executionResult.status !== "success") {
@@ -14514,7 +14514,7 @@ function loop({
14514
14514
  }
14515
14515
  const baseStream = workflowLoopStream(workflowLoopProps);
14516
14516
  const stream = rest.modelSpanTracker?.wrapStream(baseStream) ?? baseStream;
14517
- const observabilityContext = chunkJUL4UHWQ_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext());
14517
+ const observabilityContext = chunk4SE5WPZS_cjs.createObservabilityContext(rest.modelSpanTracker?.getTracingContext());
14518
14518
  modelOutput = new MastraModelOutput({
14519
14519
  model: {
14520
14520
  modelId: firstModel.model.modelId,
@@ -14647,7 +14647,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
14647
14647
  workspace,
14648
14648
  ...rest
14649
14649
  }) {
14650
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
14650
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
14651
14651
  let stopWhenToUse;
14652
14652
  if (maxSteps && typeof maxSteps === "number") {
14653
14653
  stopWhenToUse = chunkY3APFUXZ_cjs.stepCountIs(maxSteps);
@@ -14759,7 +14759,7 @@ var MastraLLMVNext = class extends chunkRO47SMI7_cjs.MastraBase {
14759
14759
  const remainingTokens = parseInt(props?.response?.headers?.["x-ratelimit-remaining-tokens"] ?? "", 10);
14760
14760
  if (!isNaN(remainingTokens) && remainingTokens > 0 && remainingTokens < 2e3) {
14761
14761
  this.logger.warn("Rate limit approaching, waiting 10 seconds", { runId });
14762
- await chunkYVFFNB2F_cjs.delay(10 * 1e3);
14762
+ await chunk542IIQM4_cjs.delay(10 * 1e3);
14763
14763
  }
14764
14764
  },
14765
14765
  onFinish: async (props) => {
@@ -14997,7 +14997,7 @@ async function prepareMemoryStep({
14997
14997
  memoryConfig,
14998
14998
  ...rest
14999
14999
  }) {
15000
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
15000
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
15001
15001
  const memory = await routingAgent.getMemory({ requestContext });
15002
15002
  let thread = await memory?.getThreadById({ threadId });
15003
15003
  if (!thread) {
@@ -15099,7 +15099,7 @@ async function saveMessagesWithProcessors(memory, messages, processorRunner, con
15099
15099
  const { requestContext, ...observabilityContext } = context ?? {};
15100
15100
  await processorRunner.runOutputProcessors(
15101
15101
  messageList,
15102
- chunkJUL4UHWQ_cjs.resolveObservabilityContext(observabilityContext),
15102
+ chunk4SE5WPZS_cjs.resolveObservabilityContext(observabilityContext),
15103
15103
  requestContext
15104
15104
  );
15105
15105
  const processedMessages = messageList.get.response.db();
@@ -16249,7 +16249,7 @@ async function createNetworkLoop({
16249
16249
  memory,
16250
16250
  context: inputDataToUse,
16251
16251
  // TODO: Pass proper tracing context when network supports tracing
16252
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: void 0 }),
16252
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: void 0 }),
16253
16253
  writer
16254
16254
  },
16255
16255
  { toolCallId, messages: [] }
@@ -16537,7 +16537,7 @@ async function networkLoop({
16537
16537
  requestContext,
16538
16538
  messageList,
16539
16539
  agentId: routingAgent.id,
16540
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(routingAgentOptions ?? {}),
16540
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(routingAgentOptions ?? {}),
16541
16541
  structuredOutput: {
16542
16542
  schema: z9__default.default.object({
16543
16543
  resumeData: z9__default.default.string()
@@ -16915,7 +16915,7 @@ async function networkLoop({
16915
16915
  messages,
16916
16916
  routingAgent,
16917
16917
  generateId: generateId2,
16918
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(routingAgentOptions ?? {}),
16918
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(routingAgentOptions ?? {}),
16919
16919
  memoryConfig: routingAgentMemoryOptions?.options
16920
16920
  });
16921
16921
  return new MastraAgentNetworkStream({
@@ -17124,16 +17124,16 @@ var AgentLegacyHandler = class {
17124
17124
  tracingOptions,
17125
17125
  ...rest
17126
17126
  }) {
17127
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
17127
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
17128
17128
  return {
17129
17129
  before: async () => {
17130
17130
  if (process.env.NODE_ENV !== "test") {
17131
17131
  this.capabilities.logger.debug(`[Agents:${this.capabilities.name}] - Starting generation`, { runId });
17132
17132
  }
17133
- const agentSpan = chunkJUL4UHWQ_cjs.getOrCreateSpan({
17133
+ const agentSpan = chunk4SE5WPZS_cjs.getOrCreateSpan({
17134
17134
  type: "agent_run" /* AGENT_RUN */,
17135
17135
  name: `agent run: '${this.capabilities.id}'`,
17136
- entityType: chunkJUL4UHWQ_cjs.EntityType.AGENT,
17136
+ entityType: chunk4SE5WPZS_cjs.EntityType.AGENT,
17137
17137
  entityId: this.capabilities.id,
17138
17138
  entityName: this.capabilities.name,
17139
17139
  input: {
@@ -17157,7 +17157,7 @@ var AgentLegacyHandler = class {
17157
17157
  requestContext,
17158
17158
  mastra: this.capabilities.mastra
17159
17159
  });
17160
- const innerObservabilityContext = chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan });
17160
+ const innerObservabilityContext = chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan });
17161
17161
  const memory = await this.capabilities.getMemory({ requestContext });
17162
17162
  const toolEnhancements = [
17163
17163
  // toolsets
@@ -17404,7 +17404,7 @@ var AgentLegacyHandler = class {
17404
17404
  instructions: titleInstructions
17405
17405
  } = this.capabilities.resolveTitleGenerationConfig(config?.generateTitle);
17406
17406
  if (shouldGenerate && !thread2.title && userMessage) {
17407
- const observabilityContext2 = chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan });
17407
+ const observabilityContext2 = chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan });
17408
17408
  promises.push(
17409
17409
  this.capabilities.genTitle(userMessage, requestContext, observabilityContext2, titleModel, titleInstructions).then((title) => {
17410
17410
  if (title) {
@@ -17474,7 +17474,7 @@ var AgentLegacyHandler = class {
17474
17474
  overrideScorers,
17475
17475
  threadId,
17476
17476
  resourceId,
17477
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan })
17477
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan })
17478
17478
  });
17479
17479
  const scoringData = {
17480
17480
  input: {
@@ -17558,7 +17558,7 @@ var AgentLegacyHandler = class {
17558
17558
  writableStream,
17559
17559
  methodType,
17560
17560
  tracingOptions,
17561
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(args)
17561
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(args)
17562
17562
  });
17563
17563
  let messageList;
17564
17564
  let thread;
@@ -17723,7 +17723,7 @@ var AgentLegacyHandler = class {
17723
17723
  return tripwireResult;
17724
17724
  }
17725
17725
  const { experimental_output, output, agentSpan, ...llmOptions } = beforeResult;
17726
- const observabilityContext = chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan });
17726
+ const observabilityContext = chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan });
17727
17727
  let finalOutputProcessors = mergedGenerateOptions.outputProcessors;
17728
17728
  if (!output || experimental_output) {
17729
17729
  const result2 = await llmToUse.__text({
@@ -18011,7 +18011,7 @@ var AgentLegacyHandler = class {
18011
18011
  }
18012
18012
  const { onFinish, runId, output, experimental_output, agentSpan, messageList, requestContext, ...llmOptions } = beforeResult;
18013
18013
  const overrideScorers = mergedStreamOptions.scorers;
18014
- const observabilityContext = chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan });
18014
+ const observabilityContext = chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan });
18015
18015
  if (!output || experimental_output) {
18016
18016
  this.capabilities.logger.debug(`Starting agent ${this.capabilities.name} llm stream call`, {
18017
18017
  runId
@@ -18337,7 +18337,7 @@ function createMapResultsStep({
18337
18337
  const modelOutput = await getModelOutputForTripwire({
18338
18338
  tripwire: memoryData.tripwire,
18339
18339
  runId,
18340
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan }),
18340
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan }),
18341
18341
  options,
18342
18342
  model: agentModel,
18343
18343
  messageList: memoryData.messageList
@@ -18391,7 +18391,7 @@ function createMapResultsStep({
18391
18391
  methodType: modelMethodType,
18392
18392
  agentId,
18393
18393
  requestContext: result.requestContext,
18394
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan }),
18394
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan }),
18395
18395
  runId,
18396
18396
  toolChoice: result.toolChoice,
18397
18397
  tools: result.tools,
@@ -18543,7 +18543,7 @@ function createPrepareMemoryStep({
18543
18543
  inputSchema: z9.z.object({}),
18544
18544
  outputSchema: prepareMemoryStepOutputSchema,
18545
18545
  execute: async ({ ...rest }) => {
18546
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
18546
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
18547
18547
  const thread = threadFromArgs;
18548
18548
  const messageList = new chunkO6O5MD7Q_cjs.MessageList({
18549
18549
  threadId: thread?.id,
@@ -18679,13 +18679,21 @@ function createPrepareToolsStep({
18679
18679
  resourceId,
18680
18680
  runId,
18681
18681
  requestContext,
18682
- ...chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan }),
18682
+ ...chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan }),
18683
18683
  outputWriter: options.outputWriter,
18684
18684
  methodType,
18685
18685
  memoryConfig: options.memory?.options,
18686
18686
  autoResumeSuspendedTools: options.autoResumeSuspendedTools,
18687
18687
  delegation: options.delegation
18688
18688
  });
18689
+ const toolNames = Object.keys(convertedTools);
18690
+ if (toolNames.length > 0) {
18691
+ agentSpan?.update({
18692
+ attributes: {
18693
+ availableTools: toolNames
18694
+ }
18695
+ });
18696
+ }
18689
18697
  return {
18690
18698
  convertedTools
18691
18699
  };
@@ -18728,7 +18736,7 @@ function createStreamStep({
18728
18736
  ...validatedInputData,
18729
18737
  outputProcessors: processors,
18730
18738
  returnScorerData,
18731
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(observabilityContext),
18739
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(observabilityContext),
18732
18740
  requireToolApproval,
18733
18741
  toolCallConcurrency,
18734
18742
  resumeContext,
@@ -19772,7 +19780,7 @@ ${errorMessages}`,
19772
19780
  */
19773
19781
  listTools({ requestContext = new chunk5WBEMKE2_cjs.RequestContext() } = {}) {
19774
19782
  if (typeof this.#tools !== "function") {
19775
- return chunkYVFFNB2F_cjs.ensureToolProperties(this.#tools);
19783
+ return chunk542IIQM4_cjs.ensureToolProperties(this.#tools);
19776
19784
  }
19777
19785
  const result = this.#tools({
19778
19786
  requestContext,
@@ -19793,7 +19801,7 @@ ${errorMessages}`,
19793
19801
  this.logger.error(mastraError.toString());
19794
19802
  throw mastraError;
19795
19803
  }
19796
- return chunkYVFFNB2F_cjs.ensureToolProperties(tools);
19804
+ return chunk542IIQM4_cjs.ensureToolProperties(tools);
19797
19805
  });
19798
19806
  }
19799
19807
  /**
@@ -19839,7 +19847,7 @@ ${errorMessages}`,
19839
19847
  });
19840
19848
  });
19841
19849
  } else {
19842
- llm = new chunkFYQXIWRH_cjs.MastraLLMV1({
19850
+ llm = new chunk64L4MPSZ_cjs.MastraLLMV1({
19843
19851
  model: modelInfo,
19844
19852
  mastra: this.#mastra,
19845
19853
  options: { tracingPolicy: this.#options?.tracingPolicy }
@@ -19865,7 +19873,7 @@ ${errorMessages}`,
19865
19873
  */
19866
19874
  async resolveModelConfig(modelConfig, requestContext) {
19867
19875
  try {
19868
- return await chunkW7I3FI2N_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
19876
+ return await chunk6W6AOWKN_cjs.resolveModelConfig(modelConfig, requestContext, this.#mastra);
19869
19877
  } catch (error) {
19870
19878
  const mastraError = new chunk4U7ZLI36_cjs.MastraError({
19871
19879
  id: "AGENT_GET_MODEL_MISSING_MODEL_INSTANCE",
@@ -20191,7 +20199,7 @@ ${errorMessages}`,
20191
20199
  instructions,
20192
20200
  ...rest
20193
20201
  }) {
20194
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
20202
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
20195
20203
  const llm = await this.getLLM({ requestContext, model });
20196
20204
  const normMessage = new chunkO6O5MD7Q_cjs.MessageList().add(message, "user").get.all.aiV5.ui().at(-1);
20197
20205
  if (!normMessage) {
@@ -20314,7 +20322,7 @@ ${errorMessages}`,
20314
20322
  autoResumeSuspendedTools,
20315
20323
  ...rest
20316
20324
  }) {
20317
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
20325
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
20318
20326
  let convertedMemoryTools = {};
20319
20327
  if (this._agentNetworkAppend) {
20320
20328
  this.logger.debug(`[Agent:${this.name}] - Skipping memory tools (agent network context)`, { runId });
@@ -20350,7 +20358,7 @@ ${errorMessages}`,
20350
20358
  tracingPolicy: this.#options?.tracingPolicy,
20351
20359
  requireApproval: toolObj.requireApproval
20352
20360
  };
20353
- const convertedToCoreTool = chunkYVFFNB2F_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
20361
+ const convertedToCoreTool = chunk542IIQM4_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
20354
20362
  convertedMemoryTools[toolName] = convertedToCoreTool;
20355
20363
  }
20356
20364
  }
@@ -20369,7 +20377,7 @@ ${errorMessages}`,
20369
20377
  autoResumeSuspendedTools,
20370
20378
  ...rest
20371
20379
  }) {
20372
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
20380
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
20373
20381
  let convertedWorkspaceTools = {};
20374
20382
  if (this._agentNetworkAppend) {
20375
20383
  this.logger.debug(`[Agent:${this.name}] - Skipping workspace tools (agent network context)`, { runId });
@@ -20401,7 +20409,7 @@ ${errorMessages}`,
20401
20409
  requireApproval: toolObj.requireApproval,
20402
20410
  workspace
20403
20411
  };
20404
- const convertedToCoreTool = chunkYVFFNB2F_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
20412
+ const convertedToCoreTool = chunk542IIQM4_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
20405
20413
  convertedWorkspaceTools[toolName] = convertedToCoreTool;
20406
20414
  }
20407
20415
  }
@@ -20423,7 +20431,7 @@ ${errorMessages}`,
20423
20431
  autoResumeSuspendedTools,
20424
20432
  ...rest
20425
20433
  }) {
20426
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
20434
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
20427
20435
  let convertedSkillTools = {};
20428
20436
  if (this._agentNetworkAppend) {
20429
20437
  return convertedSkillTools;
@@ -20455,7 +20463,7 @@ ${errorMessages}`,
20455
20463
  // Skill tools never require approval
20456
20464
  workspace
20457
20465
  };
20458
- const convertedToCoreTool = chunkYVFFNB2F_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
20466
+ const convertedToCoreTool = chunk542IIQM4_cjs.makeCoreTool(toolObj, options, void 0, autoResumeSuspendedTools);
20459
20467
  convertedSkillTools[toolName] = convertedToCoreTool;
20460
20468
  }
20461
20469
  }
@@ -20515,7 +20523,7 @@ ${errorMessages}`,
20515
20523
  */
20516
20524
  async __runProcessInputStep(args) {
20517
20525
  const { requestContext, messageList, stepNumber = 0, processorStates, ...rest } = args;
20518
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
20526
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
20519
20527
  let tripwire;
20520
20528
  if (this.#inputProcessors || this.#memory) {
20521
20529
  const runner = await this.getProcessorRunner({
@@ -20644,7 +20652,7 @@ ${errorMessages}`,
20644
20652
  autoResumeSuspendedTools,
20645
20653
  ...rest
20646
20654
  }) {
20647
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
20655
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
20648
20656
  let toolsForRequest = {};
20649
20657
  this.logger.debug(`[Agents:${this.name}] - Assembling assigned tools`, { runId, threadId, resourceId });
20650
20658
  const memory = await this.getMemory({ requestContext });
@@ -20671,7 +20679,7 @@ ${errorMessages}`,
20671
20679
  tracingPolicy: this.#options?.tracingPolicy,
20672
20680
  requireApproval: tool2.requireApproval
20673
20681
  };
20674
- return [k, chunkYVFFNB2F_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
20682
+ return [k, chunk542IIQM4_cjs.makeCoreTool(tool2, options, void 0, autoResumeSuspendedTools)];
20675
20683
  })
20676
20684
  );
20677
20685
  const assignedToolEntriesConverted = Object.fromEntries(
@@ -20696,7 +20704,7 @@ ${errorMessages}`,
20696
20704
  autoResumeSuspendedTools,
20697
20705
  ...rest
20698
20706
  }) {
20699
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
20707
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
20700
20708
  let toolsForRequest = {};
20701
20709
  const memory = await this.getMemory({ requestContext });
20702
20710
  const toolsFromToolsets = Object.values(toolsets || {});
@@ -20722,7 +20730,7 @@ ${errorMessages}`,
20722
20730
  tracingPolicy: this.#options?.tracingPolicy,
20723
20731
  requireApproval: toolObj.requireApproval
20724
20732
  };
20725
- const convertedToCoreTool = chunkYVFFNB2F_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
20733
+ const convertedToCoreTool = chunk542IIQM4_cjs.makeCoreTool(toolObj, options, "toolset", autoResumeSuspendedTools);
20726
20734
  toolsForRequest[toolName] = convertedToCoreTool;
20727
20735
  }
20728
20736
  }
@@ -20743,7 +20751,7 @@ ${errorMessages}`,
20743
20751
  autoResumeSuspendedTools,
20744
20752
  ...rest
20745
20753
  }) {
20746
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
20754
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
20747
20755
  let toolsForRequest = {};
20748
20756
  const memory = await this.getMemory({ requestContext });
20749
20757
  const clientToolsForInput = Object.entries(clientTools || {});
@@ -20768,7 +20776,7 @@ ${errorMessages}`,
20768
20776
  tracingPolicy: this.#options?.tracingPolicy,
20769
20777
  requireApproval: tool2.requireApproval
20770
20778
  };
20771
- const convertedToCoreTool = chunkYVFFNB2F_cjs.makeCoreTool(toolRest, options, "client-tool", autoResumeSuspendedTools);
20779
+ const convertedToCoreTool = chunk542IIQM4_cjs.makeCoreTool(toolRest, options, "client-tool", autoResumeSuspendedTools);
20772
20780
  toolsForRequest[toolName] = convertedToCoreTool;
20773
20781
  }
20774
20782
  }
@@ -20820,7 +20828,7 @@ ${errorMessages}`,
20820
20828
  delegation,
20821
20829
  ...rest
20822
20830
  }) {
20823
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
20831
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
20824
20832
  const convertedAgentTools = {};
20825
20833
  const agents = await this.listAgents({ requestContext });
20826
20834
  if (Object.keys(agents).length > 0) {
@@ -21050,7 +21058,7 @@ ${effectiveInstructions}`;
21050
21058
  const generateResult = resumeData ? await agent.resumeGenerate(resumeData, {
21051
21059
  runId: suspendedToolRunId,
21052
21060
  requestContext,
21053
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {}),
21061
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {}),
21054
21062
  ...effectiveInstructions && { instructions: effectiveInstructions },
21055
21063
  ...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
21056
21064
  ...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
@@ -21062,7 +21070,7 @@ ${effectiveInstructions}`;
21062
21070
  } : {}
21063
21071
  }) : await agent.generate(messagesForSubAgent, {
21064
21072
  requestContext,
21065
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {}),
21073
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {}),
21066
21074
  ...effectiveInstructions && { instructions: effectiveInstructions },
21067
21075
  ...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
21068
21076
  ...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
@@ -21126,14 +21134,14 @@ ${effectiveInstructions}`;
21126
21134
  } else if (methodType === "generate" && modelVersion === "v1") {
21127
21135
  const generateResult = await agent.generateLegacy(messagesForSubAgent, {
21128
21136
  requestContext,
21129
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {})
21137
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {})
21130
21138
  });
21131
21139
  result = { text: generateResult.text };
21132
21140
  } else if ((methodType === "stream" || methodType === "streamLegacy") && supportedLanguageModelSpecifications.includes(modelVersion)) {
21133
21141
  const streamResult = resumeData ? await agent.resumeStream(resumeData, {
21134
21142
  runId: suspendedToolRunId,
21135
21143
  requestContext,
21136
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {}),
21144
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {}),
21137
21145
  ...effectiveInstructions && { instructions: effectiveInstructions },
21138
21146
  ...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
21139
21147
  ...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
@@ -21147,7 +21155,7 @@ ${effectiveInstructions}`;
21147
21155
  } : {}
21148
21156
  }) : await agent.stream(messagesForSubAgent, {
21149
21157
  requestContext,
21150
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {}),
21158
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {}),
21151
21159
  ...effectiveInstructions && { instructions: effectiveInstructions },
21152
21160
  ...effectiveMaxSteps && { maxSteps: effectiveMaxSteps },
21153
21161
  ...resourceId && threadId && !subAgentHasOwnMemoryConfig ? {
@@ -21246,7 +21254,7 @@ ${effectiveInstructions}`;
21246
21254
  } else {
21247
21255
  const streamResult = await agent.streamLegacy(effectivePrompt, {
21248
21256
  requestContext,
21249
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {})
21257
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {})
21250
21258
  });
21251
21259
  let fullText = "";
21252
21260
  for await (const chunk of streamResult.fullStream) {
@@ -21428,7 +21436,7 @@ ${effectiveInstructions}`;
21428
21436
  ...observabilityContext,
21429
21437
  tracingPolicy: this.#options?.tracingPolicy
21430
21438
  };
21431
- convertedAgentTools[`agent-${agentName}`] = chunkYVFFNB2F_cjs.makeCoreTool(
21439
+ convertedAgentTools[`agent-${agentName}`] = chunk542IIQM4_cjs.makeCoreTool(
21432
21440
  toolObj,
21433
21441
  options,
21434
21442
  void 0,
@@ -21451,7 +21459,7 @@ ${effectiveInstructions}`;
21451
21459
  autoResumeSuspendedTools,
21452
21460
  ...rest
21453
21461
  }) {
21454
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
21462
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
21455
21463
  const convertedWorkflowTools = {};
21456
21464
  const workflows = await this.listWorkflows({ requestContext });
21457
21465
  if (Object.keys(workflows).length > 0) {
@@ -21522,13 +21530,13 @@ ${effectiveInstructions}`;
21522
21530
  result = await run.resume({
21523
21531
  resumeData,
21524
21532
  requestContext,
21525
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {})
21533
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {})
21526
21534
  });
21527
21535
  } else {
21528
21536
  result = await run.start({
21529
21537
  inputData: workflowInputData,
21530
21538
  requestContext,
21531
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {}),
21539
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {}),
21532
21540
  ...initialState && { initialState }
21533
21541
  });
21534
21542
  }
@@ -21536,7 +21544,7 @@ ${effectiveInstructions}`;
21536
21544
  const streamResult = run.streamLegacy({
21537
21545
  inputData: workflowInputData,
21538
21546
  requestContext,
21539
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {})
21547
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {})
21540
21548
  });
21541
21549
  if (context?.writer) {
21542
21550
  await streamResult.stream.pipeTo(context.writer);
@@ -21549,11 +21557,11 @@ ${effectiveInstructions}`;
21549
21557
  const streamResult = resumeData ? run.resumeStream({
21550
21558
  resumeData,
21551
21559
  requestContext,
21552
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {})
21560
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {})
21553
21561
  }) : run.stream({
21554
21562
  inputData: workflowInputData,
21555
21563
  requestContext,
21556
- ...chunkJUL4UHWQ_cjs.resolveObservabilityContext(context ?? {}),
21564
+ ...chunk4SE5WPZS_cjs.resolveObservabilityContext(context ?? {}),
21557
21565
  ...initialState && { initialState }
21558
21566
  });
21559
21567
  if (context?.writer) {
@@ -21644,7 +21652,7 @@ ${effectiveInstructions}`;
21644
21652
  ...observabilityContext,
21645
21653
  tracingPolicy: this.#options?.tracingPolicy
21646
21654
  };
21647
- convertedWorkflowTools[`workflow-${workflowName}`] = chunkYVFFNB2F_cjs.makeCoreTool(
21655
+ convertedWorkflowTools[`workflow-${workflowName}`] = chunk542IIQM4_cjs.makeCoreTool(
21648
21656
  toolObj,
21649
21657
  options,
21650
21658
  void 0,
@@ -21672,11 +21680,11 @@ ${effectiveInstructions}`;
21672
21680
  delegation,
21673
21681
  ...rest
21674
21682
  }) {
21675
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
21683
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
21676
21684
  let mastraProxy = void 0;
21677
21685
  const logger = this.logger;
21678
21686
  if (this.#mastra) {
21679
- mastraProxy = chunkYVFFNB2F_cjs.createMastraProxy({ mastra: this.#mastra, logger });
21687
+ mastraProxy = chunk542IIQM4_cjs.createMastraProxy({ mastra: this.#mastra, logger });
21680
21688
  }
21681
21689
  const assignedTools = await this.listAssignedTools({
21682
21690
  runId,
@@ -21928,7 +21936,7 @@ ${effectiveInstructions}`;
21928
21936
  const resolvedModel = await this.resolveModelConfig(selection, requestContext);
21929
21937
  this.assertSupportsPreparedModels(resolvedModel);
21930
21938
  let headers;
21931
- if (resolvedModel instanceof chunkW7I3FI2N_cjs.ModelRouterLanguageModel) {
21939
+ if (resolvedModel instanceof chunk6W6AOWKN_cjs.ModelRouterLanguageModel) {
21932
21940
  headers = resolvedModel.config?.headers;
21933
21941
  }
21934
21942
  return [
@@ -21961,7 +21969,7 @@ ${effectiveInstructions}`;
21961
21969
  throw mastraError;
21962
21970
  }
21963
21971
  let headers;
21964
- if (model instanceof chunkW7I3FI2N_cjs.ModelRouterLanguageModel) {
21972
+ if (model instanceof chunk6W6AOWKN_cjs.ModelRouterLanguageModel) {
21965
21973
  headers = model.config?.headers;
21966
21974
  }
21967
21975
  return {
@@ -22031,10 +22039,10 @@ ${effectiveInstructions}`;
22031
22039
  resourceId
22032
22040
  }) || crypto2.randomUUID();
22033
22041
  const instructions = options.instructions || await this.getInstructions({ requestContext });
22034
- const agentSpan = chunkJUL4UHWQ_cjs.getOrCreateSpan({
22042
+ const agentSpan = chunk4SE5WPZS_cjs.getOrCreateSpan({
22035
22043
  type: "agent_run" /* AGENT_RUN */,
22036
22044
  name: `agent run: '${this.id}'`,
22037
- entityType: chunkJUL4UHWQ_cjs.EntityType.AGENT,
22045
+ entityType: chunk4SE5WPZS_cjs.EntityType.AGENT,
22038
22046
  entityId: this.id,
22039
22047
  entityName: this.name,
22040
22048
  input: options.messages,
@@ -22107,7 +22115,7 @@ ${effectiveInstructions}`;
22107
22115
  workspace
22108
22116
  });
22109
22117
  const run = await executionWorkflow.createRun();
22110
- const observabilityContext = chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan });
22118
+ const observabilityContext = chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan });
22111
22119
  const result = await run.start({ ...observabilityContext });
22112
22120
  return result;
22113
22121
  }
@@ -22131,7 +22139,7 @@ ${effectiveInstructions}`;
22131
22139
  structuredOutput = false,
22132
22140
  overrideScorers
22133
22141
  }) {
22134
- const observabilityContext = chunkJUL4UHWQ_cjs.createObservabilityContext({ currentSpan: agentSpan });
22142
+ const observabilityContext = chunk4SE5WPZS_cjs.createObservabilityContext({ currentSpan: agentSpan });
22135
22143
  const resToLog = {
22136
22144
  text: result.text,
22137
22145
  object: result.object,
@@ -22412,7 +22420,7 @@ ${effectiveInstructions}`;
22412
22420
  const defaultOptions = await this.getDefaultOptions({
22413
22421
  requestContext: options?.requestContext
22414
22422
  });
22415
- const mergedOptions = chunkYVFFNB2F_cjs.deepMerge(
22423
+ const mergedOptions = chunk542IIQM4_cjs.deepMerge(
22416
22424
  defaultOptions,
22417
22425
  options ?? {}
22418
22426
  );
@@ -22482,7 +22490,7 @@ ${effectiveInstructions}`;
22482
22490
  const defaultOptions = await this.getDefaultOptions({
22483
22491
  requestContext: streamOptions?.requestContext
22484
22492
  });
22485
- const mergedOptions = chunkYVFFNB2F_cjs.deepMerge(
22493
+ const mergedOptions = chunk542IIQM4_cjs.deepMerge(
22486
22494
  defaultOptions,
22487
22495
  streamOptions ?? {}
22488
22496
  );
@@ -22546,7 +22554,7 @@ ${effectiveInstructions}`;
22546
22554
  const defaultOptions = await this.getDefaultOptions({
22547
22555
  requestContext: streamOptions?.requestContext
22548
22556
  });
22549
- let mergedStreamOptions = chunkYVFFNB2F_cjs.deepMerge(
22557
+ let mergedStreamOptions = chunk542IIQM4_cjs.deepMerge(
22550
22558
  defaultOptions,
22551
22559
  streamOptions ?? {}
22552
22560
  );
@@ -22611,7 +22619,7 @@ ${effectiveInstructions}`;
22611
22619
  const defaultOptions = await this.getDefaultOptions({
22612
22620
  requestContext: options?.requestContext
22613
22621
  });
22614
- const mergedOptions = chunkYVFFNB2F_cjs.deepMerge(
22622
+ const mergedOptions = chunk542IIQM4_cjs.deepMerge(
22615
22623
  defaultOptions,
22616
22624
  options ?? {}
22617
22625
  );
@@ -22848,7 +22856,7 @@ var ModerationProcessor = class _ModerationProcessor {
22848
22856
  async processInput(args) {
22849
22857
  try {
22850
22858
  const { messages, abort, ...rest } = args;
22851
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
22859
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
22852
22860
  if (messages.length === 0) {
22853
22861
  return messages;
22854
22862
  }
@@ -22882,7 +22890,7 @@ var ModerationProcessor = class _ModerationProcessor {
22882
22890
  async processOutputStream(args) {
22883
22891
  try {
22884
22892
  const { part, streamParts, abort, ...rest } = args;
22885
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
22893
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
22886
22894
  if (part.type !== "text-delta") {
22887
22895
  return part;
22888
22896
  }
@@ -23090,7 +23098,7 @@ var PromptInjectionDetector = class _PromptInjectionDetector {
23090
23098
  async processInput(args) {
23091
23099
  try {
23092
23100
  const { messages, abort, ...rest } = args;
23093
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
23101
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
23094
23102
  if (messages.length === 0) {
23095
23103
  return messages;
23096
23104
  }
@@ -23338,7 +23346,7 @@ var PIIDetector = class _PIIDetector {
23338
23346
  async processInput(args) {
23339
23347
  try {
23340
23348
  const { messages, abort, ...rest } = args;
23341
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
23349
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
23342
23350
  if (messages.length === 0) {
23343
23351
  return messages;
23344
23352
  }
@@ -23621,7 +23629,7 @@ IMPORTANT: Only include PII types that are actually detected. If no PII is found
23621
23629
  */
23622
23630
  async processOutputStream(args) {
23623
23631
  const { part, abort, ...rest } = args;
23624
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
23632
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
23625
23633
  try {
23626
23634
  if (part.type !== "text-delta") {
23627
23635
  return part;
@@ -23684,7 +23692,7 @@ IMPORTANT: Only include PII types that are actually detected. If no PII is found
23684
23692
  abort,
23685
23693
  ...rest
23686
23694
  }) {
23687
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
23695
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
23688
23696
  try {
23689
23697
  if (messages.length === 0) {
23690
23698
  return messages;
@@ -23813,7 +23821,7 @@ var LanguageDetector = class _LanguageDetector {
23813
23821
  async processInput(args) {
23814
23822
  try {
23815
23823
  const { messages, abort, ...rest } = args;
23816
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
23824
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
23817
23825
  if (messages.length === 0) {
23818
23826
  return messages;
23819
23827
  }
@@ -24478,7 +24486,7 @@ var SystemPromptScrubber = class {
24478
24486
  */
24479
24487
  async processOutputStream(args) {
24480
24488
  const { part, abort, ...rest } = args;
24481
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
24489
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
24482
24490
  if (part.type !== "text-delta") {
24483
24491
  return part;
24484
24492
  }
@@ -24533,7 +24541,7 @@ var SystemPromptScrubber = class {
24533
24541
  abort,
24534
24542
  ...rest
24535
24543
  }) {
24536
- const observabilityContext = chunkJUL4UHWQ_cjs.resolveObservabilityContext(rest);
24544
+ const observabilityContext = chunk4SE5WPZS_cjs.resolveObservabilityContext(rest);
24537
24545
  const processedMessages = [];
24538
24546
  for (const message of messages) {
24539
24547
  if (message.role !== "assistant" || !message.content?.parts) {
@@ -25399,7 +25407,7 @@ var WorkingMemory = class {
25399
25407
  return messageList;
25400
25408
  }
25401
25409
  generateEmptyFromSchemaInternal(schema) {
25402
- const result = chunkYVFFNB2F_cjs.generateEmptyFromSchema(schema);
25410
+ const result = chunk542IIQM4_cjs.generateEmptyFromSchema(schema);
25403
25411
  return Object.keys(result).length > 0 ? result : null;
25404
25412
  }
25405
25413
  getWorkingMemoryToolInstruction({
@@ -26044,7 +26052,7 @@ https://mastra.ai/en/docs/memory/semantic-recall`
26044
26052
  );
26045
26053
  }
26046
26054
  if (typeof config.embedder === "string") {
26047
- this.embedder = new chunkW7I3FI2N_cjs.ModelRouterEmbeddingModel(config.embedder);
26055
+ this.embedder = new chunk6W6AOWKN_cjs.ModelRouterEmbeddingModel(config.embedder);
26048
26056
  } else {
26049
26057
  this.embedder = config.embedder;
26050
26058
  }
@@ -26083,7 +26091,7 @@ https://mastra.ai/en/docs/memory/overview`
26083
26091
  }
26084
26092
  setEmbedder(embedder, embedderOptions) {
26085
26093
  if (typeof embedder === "string") {
26086
- this.embedder = new chunkW7I3FI2N_cjs.ModelRouterEmbeddingModel(embedder);
26094
+ this.embedder = new chunk6W6AOWKN_cjs.ModelRouterEmbeddingModel(embedder);
26087
26095
  } else {
26088
26096
  this.embedder = embedder;
26089
26097
  }
@@ -26180,7 +26188,7 @@ https://mastra.ai/en/docs/memory/overview`
26180
26188
  "The threads.generateTitle option has been moved. Use the top-level generateTitle option instead."
26181
26189
  );
26182
26190
  }
26183
- const mergedConfig = chunkYVFFNB2F_cjs.deepMerge(this.threadConfig, config || {});
26191
+ const mergedConfig = chunk542IIQM4_cjs.deepMerge(this.threadConfig, config || {});
26184
26192
  if (typeof config?.workingMemory === "object" && config.workingMemory?.schema && typeof mergedConfig.workingMemory === "object") {
26185
26193
  mergedConfig.workingMemory.schema = config.workingMemory.schema;
26186
26194
  }
@@ -26532,7 +26540,7 @@ var MockMemory = class extends MastraMemory {
26532
26540
  } = {}) {
26533
26541
  super({
26534
26542
  name: "mock",
26535
- storage: storage || new chunkVSGRSX3N_cjs.InMemoryStore(),
26543
+ storage: storage || new chunkXAFCD3W2_cjs.InMemoryStore(),
26536
26544
  options: {
26537
26545
  ...options,
26538
26546
  workingMemory: enableWorkingMemory ? { enabled: true, template: workingMemoryTemplate } : options?.workingMemory,
@@ -26841,5 +26849,5 @@ exports.validateStepRequestContext = validateStepRequestContext;
26841
26849
  exports.validateStepResumeData = validateStepResumeData;
26842
26850
  exports.validateStepStateData = validateStepStateData;
26843
26851
  exports.validateStepSuspendData = validateStepSuspendData;
26844
- //# sourceMappingURL=chunk-NI24OP2N.cjs.map
26845
- //# sourceMappingURL=chunk-NI24OP2N.cjs.map
26852
+ //# sourceMappingURL=chunk-XZE2N5VH.cjs.map
26853
+ //# sourceMappingURL=chunk-XZE2N5VH.cjs.map