@mastra/core 1.26.0-alpha.4 → 1.26.0-alpha.6

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 (156) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/agent/agent.d.ts.map +1 -1
  3. package/dist/agent/index.cjs +8 -8
  4. package/dist/agent/index.js +1 -1
  5. package/dist/browser/index.cjs +2 -2
  6. package/dist/browser/index.js +1 -1
  7. package/dist/channels/index.cjs +4 -4
  8. package/dist/channels/index.js +1 -1
  9. package/dist/{chunk-5VOSWZCR.cjs → chunk-2GTJG7N7.cjs} +5 -5
  10. package/dist/{chunk-5VOSWZCR.cjs.map → chunk-2GTJG7N7.cjs.map} +1 -1
  11. package/dist/{chunk-DMBNRISI.cjs → chunk-2RYZTNKM.cjs} +9 -9
  12. package/dist/{chunk-DMBNRISI.cjs.map → chunk-2RYZTNKM.cjs.map} +1 -1
  13. package/dist/{chunk-M67X4PZR.js → chunk-3V3TWAOV.js} +3 -3
  14. package/dist/{chunk-M67X4PZR.js.map → chunk-3V3TWAOV.js.map} +1 -1
  15. package/dist/{chunk-72EQLBZY.js → chunk-4OEDEA4R.js} +18 -2
  16. package/dist/chunk-4OEDEA4R.js.map +1 -0
  17. package/dist/{chunk-2NLDSYDR.js → chunk-7TE3EINJ.js} +3 -3
  18. package/dist/{chunk-2NLDSYDR.js.map → chunk-7TE3EINJ.js.map} +1 -1
  19. package/dist/{chunk-JVWWVGYJ.cjs → chunk-A5FICPKS.cjs} +148 -30
  20. package/dist/chunk-A5FICPKS.cjs.map +1 -0
  21. package/dist/{chunk-OQXJBGMN.cjs → chunk-CMVFPCQD.cjs} +6 -6
  22. package/dist/{chunk-OQXJBGMN.cjs.map → chunk-CMVFPCQD.cjs.map} +1 -1
  23. package/dist/{chunk-ZEW4LKNA.js → chunk-CSKV732I.js} +78 -9
  24. package/dist/chunk-CSKV732I.js.map +1 -0
  25. package/dist/{chunk-QX4DMINV.cjs → chunk-D6TANH6C.cjs} +369 -300
  26. package/dist/chunk-D6TANH6C.cjs.map +1 -0
  27. package/dist/{chunk-VGI3XJHQ.js → chunk-DC2ANROB.js} +11 -8
  28. package/dist/chunk-DC2ANROB.js.map +1 -0
  29. package/dist/{chunk-ONVOZCMT.js → chunk-E2JX5SB5.js} +4 -4
  30. package/dist/{chunk-ONVOZCMT.js.map → chunk-E2JX5SB5.js.map} +1 -1
  31. package/dist/{chunk-ZYKGDZFW.cjs → chunk-EF6TARJQ.cjs} +22 -19
  32. package/dist/chunk-EF6TARJQ.cjs.map +1 -0
  33. package/dist/{chunk-7YSXX5LB.js → chunk-F6JLITZF.js} +9 -9
  34. package/dist/{chunk-7YSXX5LB.js.map → chunk-F6JLITZF.js.map} +1 -1
  35. package/dist/{chunk-5TD3NIQP.cjs → chunk-IHIJMKPH.cjs} +15 -3
  36. package/dist/chunk-IHIJMKPH.cjs.map +1 -0
  37. package/dist/{chunk-26LM3QQG.js → chunk-IIK3GTWP.js} +4 -4
  38. package/dist/{chunk-26LM3QQG.js.map → chunk-IIK3GTWP.js.map} +1 -1
  39. package/dist/{chunk-4QHKKRIT.js → chunk-J2RBPKWY.js} +136 -18
  40. package/dist/chunk-J2RBPKWY.js.map +1 -0
  41. package/dist/{chunk-YCEAP2LH.js → chunk-KHUIVU76.js} +3 -3
  42. package/dist/{chunk-YCEAP2LH.js.map → chunk-KHUIVU76.js.map} +1 -1
  43. package/dist/{chunk-7G3LGDEP.js → chunk-LDMQWY3L.js} +15 -3
  44. package/dist/chunk-LDMQWY3L.js.map +1 -0
  45. package/dist/{chunk-T44GAO6N.cjs → chunk-LDQ34EIK.cjs} +17 -2
  46. package/dist/chunk-LDQ34EIK.cjs.map +1 -0
  47. package/dist/{chunk-RWXRM5PV.js → chunk-MDW33PHJ.js} +3 -3
  48. package/dist/{chunk-RWXRM5PV.js.map → chunk-MDW33PHJ.js.map} +1 -1
  49. package/dist/{chunk-IT7OSYXH.js → chunk-MXTZZYN7.js} +17 -2
  50. package/dist/chunk-MXTZZYN7.js.map +1 -0
  51. package/dist/{chunk-3ICKYYBF.cjs → chunk-NQ2WVP6R.cjs} +48 -48
  52. package/dist/{chunk-3ICKYYBF.cjs.map → chunk-NQ2WVP6R.cjs.map} +1 -1
  53. package/dist/{chunk-RAD2NM47.cjs → chunk-RYMTTCPE.cjs} +18 -2
  54. package/dist/chunk-RYMTTCPE.cjs.map +1 -0
  55. package/dist/{chunk-IDVPZFDE.cjs → chunk-X5MXWGXL.cjs} +17 -17
  56. package/dist/{chunk-IDVPZFDE.cjs.map → chunk-X5MXWGXL.cjs.map} +1 -1
  57. package/dist/{chunk-44XCLGWT.cjs → chunk-Y43FM6KS.cjs} +7 -7
  58. package/dist/{chunk-44XCLGWT.cjs.map → chunk-Y43FM6KS.cjs.map} +1 -1
  59. package/dist/{chunk-FTRKVTQN.cjs → chunk-YEQS5A2T.cjs} +224 -224
  60. package/dist/{chunk-FTRKVTQN.cjs.map → chunk-YEQS5A2T.cjs.map} +1 -1
  61. package/dist/datasets/index.cjs +11 -11
  62. package/dist/datasets/index.js +1 -1
  63. package/dist/docs/SKILL.md +1 -1
  64. package/dist/docs/assets/SOURCE_MAP.json +176 -176
  65. package/dist/evals/index.cjs +5 -5
  66. package/dist/evals/index.js +2 -2
  67. package/dist/evals/scoreTraces/index.cjs +3 -3
  68. package/dist/evals/scoreTraces/index.js +1 -1
  69. package/dist/harness/index.cjs +8 -7
  70. package/dist/harness/index.cjs.map +1 -1
  71. package/dist/harness/index.js +6 -5
  72. package/dist/harness/index.js.map +1 -1
  73. package/dist/harness/tools.d.ts.map +1 -1
  74. package/dist/index.cjs +2 -2
  75. package/dist/index.js +1 -1
  76. package/dist/llm/index.cjs +20 -20
  77. package/dist/llm/index.js +5 -5
  78. package/dist/llm/model/aisdk/v4/model.d.ts +90 -0
  79. package/dist/llm/model/aisdk/v4/model.d.ts.map +1 -0
  80. package/dist/llm/model/aisdk/v5/model.d.ts +13 -0
  81. package/dist/llm/model/aisdk/v5/model.d.ts.map +1 -1
  82. package/dist/llm/model/aisdk/v6/model.d.ts +12 -0
  83. package/dist/llm/model/aisdk/v6/model.d.ts.map +1 -1
  84. package/dist/llm/model/gateways/base.d.ts +13 -0
  85. package/dist/llm/model/gateways/base.d.ts.map +1 -1
  86. package/dist/llm/model/provider-types.generated.d.ts +52 -5
  87. package/dist/llm/model/resolve-model.d.ts.map +1 -1
  88. package/dist/llm/model/router.d.ts +12 -0
  89. package/dist/llm/model/router.d.ts.map +1 -1
  90. package/dist/loop/index.cjs +14 -14
  91. package/dist/loop/index.js +1 -1
  92. package/dist/mastra/index.cjs +2 -2
  93. package/dist/mastra/index.js +1 -1
  94. package/dist/mastra-E4FZXGH6.cjs +12 -0
  95. package/dist/{mastra-JJ4XSFRA.cjs.map → mastra-E4FZXGH6.cjs.map} +1 -1
  96. package/dist/mastra-HXNBKNLN.js +3 -0
  97. package/dist/{mastra-4WSGHKT3.js.map → mastra-HXNBKNLN.js.map} +1 -1
  98. package/dist/memory/index.cjs +19 -19
  99. package/dist/memory/index.js +1 -1
  100. package/dist/models-dev-7WNX7TCU.js +3 -0
  101. package/dist/{models-dev-5M6UHKL7.js.map → models-dev-7WNX7TCU.js.map} +1 -1
  102. package/dist/models-dev-WLCAFFJ4.cjs +12 -0
  103. package/dist/{models-dev-6PV6IPEU.cjs.map → models-dev-WLCAFFJ4.cjs.map} +1 -1
  104. package/dist/netlify-36GUTVVT.cjs +12 -0
  105. package/dist/{netlify-MV4MTDH4.cjs.map → netlify-36GUTVVT.cjs.map} +1 -1
  106. package/dist/netlify-YRYIHP2F.js +3 -0
  107. package/dist/{netlify-K5ZLW6FE.js.map → netlify-YRYIHP2F.js.map} +1 -1
  108. package/dist/processor-provider/index.cjs +10 -10
  109. package/dist/processor-provider/index.js +1 -1
  110. package/dist/processors/index.cjs +45 -45
  111. package/dist/processors/index.js +1 -1
  112. package/dist/provider-registry-42GJNKSE.cjs +44 -0
  113. package/dist/{provider-registry-5YSRQUGN.cjs.map → provider-registry-42GJNKSE.cjs.map} +1 -1
  114. package/dist/provider-registry-754T4RLN.js +3 -0
  115. package/dist/{provider-registry-JLVRVYJG.js.map → provider-registry-754T4RLN.js.map} +1 -1
  116. package/dist/provider-registry.json +128 -10
  117. package/dist/relevance/index.cjs +3 -3
  118. package/dist/relevance/index.js +1 -1
  119. package/dist/stream/index.cjs +8 -8
  120. package/dist/stream/index.js +1 -1
  121. package/dist/test-utils/llm-mock.cjs +4 -4
  122. package/dist/test-utils/llm-mock.js +1 -1
  123. package/dist/tool-loop-agent/index.cjs +4 -4
  124. package/dist/tool-loop-agent/index.js +1 -1
  125. package/dist/tools/provider-tool-utils.d.ts +2 -1
  126. package/dist/tools/provider-tool-utils.d.ts.map +1 -1
  127. package/dist/voice/index.cjs +6 -6
  128. package/dist/voice/index.js +1 -1
  129. package/dist/voice/voice.d.ts +18 -0
  130. package/dist/voice/voice.d.ts.map +1 -1
  131. package/dist/workflows/evented/index.cjs +10 -10
  132. package/dist/workflows/evented/index.js +1 -1
  133. package/dist/workflows/index.cjs +24 -24
  134. package/dist/workflows/index.js +1 -1
  135. package/package.json +3 -3
  136. package/src/llm/model/provider-types.generated.d.ts +52 -5
  137. package/dist/chunk-4QHKKRIT.js.map +0 -1
  138. package/dist/chunk-5TD3NIQP.cjs.map +0 -1
  139. package/dist/chunk-72EQLBZY.js.map +0 -1
  140. package/dist/chunk-7G3LGDEP.js.map +0 -1
  141. package/dist/chunk-IT7OSYXH.js.map +0 -1
  142. package/dist/chunk-JVWWVGYJ.cjs.map +0 -1
  143. package/dist/chunk-QX4DMINV.cjs.map +0 -1
  144. package/dist/chunk-RAD2NM47.cjs.map +0 -1
  145. package/dist/chunk-T44GAO6N.cjs.map +0 -1
  146. package/dist/chunk-VGI3XJHQ.js.map +0 -1
  147. package/dist/chunk-ZEW4LKNA.js.map +0 -1
  148. package/dist/chunk-ZYKGDZFW.cjs.map +0 -1
  149. package/dist/mastra-4WSGHKT3.js +0 -3
  150. package/dist/mastra-JJ4XSFRA.cjs +0 -12
  151. package/dist/models-dev-5M6UHKL7.js +0 -3
  152. package/dist/models-dev-6PV6IPEU.cjs +0 -12
  153. package/dist/netlify-K5ZLW6FE.js +0 -3
  154. package/dist/netlify-MV4MTDH4.cjs +0 -12
  155. package/dist/provider-registry-5YSRQUGN.cjs +0 -44
  156. package/dist/provider-registry-JLVRVYJG.js +0 -3
@@ -1,8 +1,8 @@
1
- import { MastraGateway, PROVIDER_REGISTRY, GatewayRegistry } from './chunk-4QHKKRIT.js';
2
- import { ModelsDevGateway, parseModelRouterId } from './chunk-RWXRM5PV.js';
3
- import { NetlifyGateway } from './chunk-2NLDSYDR.js';
4
- import { EventSourceParserStream, AISDKError, InvalidArgumentError, APICallError, LoadAPIKeyError, LoadSettingError, TypeValidationError, JSONParseError, EmptyResponseBodyError, lazySchema, zodSchema, createJsonErrorResponseHandler, createProviderDefinedToolFactoryWithOutputSchema, createProviderDefinedToolFactory, lazyValidator, withoutTrailingSlash, loadOptionalSetting, generateId, parseProviderOptions, combineHeaders, resolve, postJsonToApi, createJsonResponseHandler, createEventSourceResponseHandler, withUserAgentSuffix, loadApiKey, UnsupportedFunctionalityError, convertToBase64, validateTypes, MastraModelGateway, createOpenAICompatible, createOpenAI, TooManyEmbeddingValuesForCallError, InvalidResponseDataError, isParsableJson, convertBase64ToUint8Array, mediaTypeToExtension, postFormDataToApi, createBinaryResponseHandler, InvalidPromptError, MASTRA_USER_AGENT } from './chunk-7G3LGDEP.js';
5
- import { AISDKV5LanguageModel, createStreamFromGenerateResult } from './chunk-IT7OSYXH.js';
1
+ import { MastraGateway, PROVIDER_REGISTRY, GatewayRegistry } from './chunk-J2RBPKWY.js';
2
+ import { ModelsDevGateway, parseModelRouterId } from './chunk-MDW33PHJ.js';
3
+ import { NetlifyGateway } from './chunk-7TE3EINJ.js';
4
+ import { EventSourceParserStream, AISDKError, InvalidArgumentError, APICallError, LoadAPIKeyError, LoadSettingError, TypeValidationError, JSONParseError, EmptyResponseBodyError, lazySchema, zodSchema, createJsonErrorResponseHandler, createProviderDefinedToolFactoryWithOutputSchema, createProviderDefinedToolFactory, lazyValidator, withoutTrailingSlash, loadOptionalSetting, generateId, parseProviderOptions, combineHeaders, resolve, postJsonToApi, createJsonResponseHandler, createEventSourceResponseHandler, withUserAgentSuffix, loadApiKey, UnsupportedFunctionalityError, convertToBase64, validateTypes, MastraModelGateway, createOpenAICompatible, createOpenAI, TooManyEmbeddingValuesForCallError, InvalidResponseDataError, isParsableJson, convertBase64ToUint8Array, mediaTypeToExtension, postFormDataToApi, createBinaryResponseHandler, InvalidPromptError, MASTRA_USER_AGENT } from './chunk-LDMQWY3L.js';
5
+ import { AISDKV5LanguageModel, createStreamFromGenerateResult } from './chunk-MXTZZYN7.js';
6
6
  import { InMemoryServerCache } from './chunk-HQXVBGBM.js';
7
7
  import { MastraError } from './chunk-FJEVLHJT.js';
8
8
  import { RequestContext } from './chunk-JGOH7RWL.js';
@@ -72,6 +72,20 @@ var AISDKV6LanguageModel = class {
72
72
  async doStream(options) {
73
73
  return await this.#model.doStream(remapToolsToV3(options));
74
74
  }
75
+ /**
76
+ * Custom serialization for tracing/observability spans.
77
+ * `#model` is already a true JS private field and not enumerable, so
78
+ * the wrapped provider SDK client can't leak. This method makes the
79
+ * safe shape explicit and avoids walking `supportedUrls` (a
80
+ * PromiseLike / regex map that isn't useful in spans).
81
+ */
82
+ serializeForSpan() {
83
+ return {
84
+ specificationVersion: this.specificationVersion,
85
+ modelId: this.modelId,
86
+ provider: this.provider
87
+ };
88
+ }
75
89
  };
76
90
 
77
91
  // ../../node_modules/.pnpm/@ai-sdk+provider-utils@3.0.22_zod@4.3.6/node_modules/@ai-sdk/provider-utils/dist/index.mjs
@@ -7461,6 +7475,20 @@ var ModelRouterLanguageModel = class _ModelRouterLanguageModel {
7461
7475
  _getStreamTransport() {
7462
7476
  return this.#lastStreamTransport;
7463
7477
  }
7478
+ /**
7479
+ * Custom serialization for tracing/observability spans.
7480
+ * Excludes `config` (holds apiKey, headers, url) and `gateway`
7481
+ * (may hold proxy credentials or cached tokens) so they cannot leak
7482
+ * into telemetry backends.
7483
+ */
7484
+ serializeForSpan() {
7485
+ return {
7486
+ specificationVersion: this.specificationVersion,
7487
+ modelId: this.modelId,
7488
+ provider: this.provider,
7489
+ gatewayId: this.gatewayId
7490
+ };
7491
+ }
7464
7492
  setStreamTransport({
7465
7493
  resolvedTransport,
7466
7494
  key,
@@ -7628,6 +7656,47 @@ var ModelRouterLanguageModel = class _ModelRouterLanguageModel {
7628
7656
  static webSocketFetches = /* @__PURE__ */ new Map();
7629
7657
  };
7630
7658
 
7659
+ // src/llm/model/aisdk/v4/model.ts
7660
+ var AISDKV4LegacyLanguageModel = class {
7661
+ specificationVersion = "v1";
7662
+ provider;
7663
+ modelId;
7664
+ defaultObjectGenerationMode;
7665
+ supportsImageUrls;
7666
+ supportsStructuredOutputs;
7667
+ #model;
7668
+ constructor(config) {
7669
+ this.#model = config;
7670
+ this.provider = config.provider;
7671
+ this.modelId = config.modelId;
7672
+ this.defaultObjectGenerationMode = config.defaultObjectGenerationMode;
7673
+ this.supportsImageUrls = config.supportsImageUrls;
7674
+ this.supportsStructuredOutputs = config.supportsStructuredOutputs;
7675
+ }
7676
+ supportsUrl(url) {
7677
+ return this.#model.supportsUrl?.(url) ?? false;
7678
+ }
7679
+ doGenerate(options) {
7680
+ return this.#model.doGenerate(options);
7681
+ }
7682
+ doStream(options) {
7683
+ return this.#model.doStream(options);
7684
+ }
7685
+ /**
7686
+ * Custom serialization for tracing/observability spans.
7687
+ * `#model` is already a true JS private field and not enumerable, so
7688
+ * the wrapped provider SDK client can't leak. This method makes the
7689
+ * safe shape explicit.
7690
+ */
7691
+ serializeForSpan() {
7692
+ return {
7693
+ specificationVersion: this.specificationVersion,
7694
+ modelId: this.modelId,
7695
+ provider: this.provider
7696
+ };
7697
+ }
7698
+ };
7699
+
7631
7700
  // src/llm/model/resolve-model.ts
7632
7701
  function isOpenAICompatibleObjectConfig(modelConfig) {
7633
7702
  if (typeof modelConfig === "object" && "specificationVersion" in modelConfig) return false;
@@ -7641,7 +7710,7 @@ async function resolveModelConfig(modelConfig, requestContext = new RequestConte
7641
7710
  if (typeof modelConfig === "function") {
7642
7711
  modelConfig = await modelConfig({ requestContext, mastra });
7643
7712
  }
7644
- if (modelConfig instanceof ModelRouterLanguageModel || modelConfig instanceof AISDKV5LanguageModel || modelConfig instanceof AISDKV6LanguageModel) {
7713
+ if (modelConfig instanceof ModelRouterLanguageModel || modelConfig instanceof AISDKV4LegacyLanguageModel || modelConfig instanceof AISDKV5LanguageModel || modelConfig instanceof AISDKV6LanguageModel) {
7645
7714
  return modelConfig;
7646
7715
  }
7647
7716
  if (typeof modelConfig === "object" && "specificationVersion" in modelConfig) {
@@ -7652,7 +7721,7 @@ async function resolveModelConfig(modelConfig, requestContext = new RequestConte
7652
7721
  return new AISDKV6LanguageModel(modelConfig);
7653
7722
  }
7654
7723
  if (modelConfig.specificationVersion === "v1") {
7655
- return modelConfig;
7724
+ return new AISDKV4LegacyLanguageModel(modelConfig);
7656
7725
  }
7657
7726
  if (typeof modelConfig.doStream === "function" && typeof modelConfig.doGenerate === "function") {
7658
7727
  return new AISDKV5LanguageModel(modelConfig);
@@ -14218,5 +14287,5 @@ var ModelRouterEmbeddingModel = class {
14218
14287
  };
14219
14288
 
14220
14289
  export { AzureOpenAIGateway, EMBEDDING_MODELS, ModelRouterEmbeddingModel, ModelRouterLanguageModel, defaultGateways, resolveModelConfig };
14221
- //# sourceMappingURL=chunk-ZEW4LKNA.js.map
14222
- //# sourceMappingURL=chunk-ZEW4LKNA.js.map
14290
+ //# sourceMappingURL=chunk-CSKV732I.js.map
14291
+ //# sourceMappingURL=chunk-CSKV732I.js.map