@mastra/core 1.26.0-alpha.5 → 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.
- package/CHANGELOG.md +35 -0
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +1 -1
- package/dist/channels/index.cjs +4 -4
- package/dist/channels/index.js +1 -1
- package/dist/{chunk-3PRW3IRQ.cjs → chunk-2GTJG7N7.cjs} +5 -5
- package/dist/{chunk-3PRW3IRQ.cjs.map → chunk-2GTJG7N7.cjs.map} +1 -1
- package/dist/{chunk-2ZA7GO5N.cjs → chunk-2RYZTNKM.cjs} +9 -9
- package/dist/{chunk-2ZA7GO5N.cjs.map → chunk-2RYZTNKM.cjs.map} +1 -1
- package/dist/{chunk-HV6FLK65.js → chunk-3V3TWAOV.js} +3 -3
- package/dist/{chunk-HV6FLK65.js.map → chunk-3V3TWAOV.js.map} +1 -1
- package/dist/{chunk-72EQLBZY.js → chunk-4OEDEA4R.js} +18 -2
- package/dist/chunk-4OEDEA4R.js.map +1 -0
- package/dist/{chunk-L5FMCXMX.js → chunk-7TE3EINJ.js} +3 -3
- package/dist/{chunk-L5FMCXMX.js.map → chunk-7TE3EINJ.js.map} +1 -1
- package/dist/{chunk-PP3Z4TR3.cjs → chunk-A5FICPKS.cjs} +144 -30
- package/dist/chunk-A5FICPKS.cjs.map +1 -0
- package/dist/{chunk-5WHRYMKF.cjs → chunk-CMVFPCQD.cjs} +6 -6
- package/dist/{chunk-5WHRYMKF.cjs.map → chunk-CMVFPCQD.cjs.map} +1 -1
- package/dist/{chunk-PMNREZUF.js → chunk-CSKV732I.js} +78 -9
- package/dist/chunk-CSKV732I.js.map +1 -0
- package/dist/{chunk-GNOSEGOW.cjs → chunk-D6TANH6C.cjs} +369 -300
- package/dist/chunk-D6TANH6C.cjs.map +1 -0
- package/dist/{chunk-TDX45OUR.js → chunk-DC2ANROB.js} +5 -5
- package/dist/{chunk-TDX45OUR.js.map → chunk-DC2ANROB.js.map} +1 -1
- package/dist/{chunk-MHZ7JPQO.js → chunk-E2JX5SB5.js} +4 -4
- package/dist/{chunk-MHZ7JPQO.js.map → chunk-E2JX5SB5.js.map} +1 -1
- package/dist/{chunk-ANNI34X7.cjs → chunk-EF6TARJQ.cjs} +17 -17
- package/dist/{chunk-ANNI34X7.cjs.map → chunk-EF6TARJQ.cjs.map} +1 -1
- package/dist/{chunk-QQDA2MGW.js → chunk-F6JLITZF.js} +9 -9
- package/dist/{chunk-QQDA2MGW.js.map → chunk-F6JLITZF.js.map} +1 -1
- package/dist/{chunk-HDKQ7SH2.cjs → chunk-IHIJMKPH.cjs} +15 -3
- package/dist/chunk-IHIJMKPH.cjs.map +1 -0
- package/dist/{chunk-AJBH645B.js → chunk-IIK3GTWP.js} +4 -4
- package/dist/{chunk-AJBH645B.js.map → chunk-IIK3GTWP.js.map} +1 -1
- package/dist/{chunk-IDXQEXTK.js → chunk-J2RBPKWY.js} +132 -18
- package/dist/chunk-J2RBPKWY.js.map +1 -0
- package/dist/{chunk-PDZA7CHH.js → chunk-KHUIVU76.js} +3 -3
- package/dist/{chunk-PDZA7CHH.js.map → chunk-KHUIVU76.js.map} +1 -1
- package/dist/{chunk-FCD77VJW.js → chunk-LDMQWY3L.js} +15 -3
- package/dist/chunk-LDMQWY3L.js.map +1 -0
- package/dist/{chunk-T44GAO6N.cjs → chunk-LDQ34EIK.cjs} +17 -2
- package/dist/chunk-LDQ34EIK.cjs.map +1 -0
- package/dist/{chunk-SRBMROTH.js → chunk-MDW33PHJ.js} +3 -3
- package/dist/{chunk-SRBMROTH.js.map → chunk-MDW33PHJ.js.map} +1 -1
- package/dist/{chunk-IT7OSYXH.js → chunk-MXTZZYN7.js} +17 -2
- package/dist/chunk-MXTZZYN7.js.map +1 -0
- package/dist/{chunk-OLEGQBPJ.cjs → chunk-NQ2WVP6R.cjs} +48 -48
- package/dist/{chunk-OLEGQBPJ.cjs.map → chunk-NQ2WVP6R.cjs.map} +1 -1
- package/dist/{chunk-RAD2NM47.cjs → chunk-RYMTTCPE.cjs} +18 -2
- package/dist/chunk-RYMTTCPE.cjs.map +1 -0
- package/dist/{chunk-COER2756.cjs → chunk-X5MXWGXL.cjs} +17 -17
- package/dist/{chunk-COER2756.cjs.map → chunk-X5MXWGXL.cjs.map} +1 -1
- package/dist/{chunk-RK7JY24T.cjs → chunk-Y43FM6KS.cjs} +7 -7
- package/dist/{chunk-RK7JY24T.cjs.map → chunk-Y43FM6KS.cjs.map} +1 -1
- package/dist/{chunk-IRVU7UEG.cjs → chunk-YEQS5A2T.cjs} +224 -224
- package/dist/{chunk-IRVU7UEG.cjs.map → chunk-YEQS5A2T.cjs.map} +1 -1
- package/dist/datasets/index.cjs +11 -11
- package/dist/datasets/index.js +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +147 -147
- package/dist/evals/index.cjs +5 -5
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +3 -3
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/harness/index.cjs +8 -7
- package/dist/harness/index.cjs.map +1 -1
- package/dist/harness/index.js +6 -5
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/tools.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +20 -20
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/aisdk/v4/model.d.ts +90 -0
- package/dist/llm/model/aisdk/v4/model.d.ts.map +1 -0
- package/dist/llm/model/aisdk/v5/model.d.ts +13 -0
- package/dist/llm/model/aisdk/v5/model.d.ts.map +1 -1
- package/dist/llm/model/aisdk/v6/model.d.ts +12 -0
- package/dist/llm/model/aisdk/v6/model.d.ts.map +1 -1
- package/dist/llm/model/gateways/base.d.ts +13 -0
- package/dist/llm/model/gateways/base.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +50 -5
- package/dist/llm/model/resolve-model.d.ts.map +1 -1
- package/dist/llm/model/router.d.ts +12 -0
- package/dist/llm/model/router.d.ts.map +1 -1
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/mastra-E4FZXGH6.cjs +12 -0
- package/dist/{mastra-VDOKA4KM.cjs.map → mastra-E4FZXGH6.cjs.map} +1 -1
- package/dist/mastra-HXNBKNLN.js +3 -0
- package/dist/{mastra-7Y4LYBV5.js.map → mastra-HXNBKNLN.js.map} +1 -1
- package/dist/memory/index.cjs +19 -19
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-7WNX7TCU.js +3 -0
- package/dist/{models-dev-NA6SJZMY.js.map → models-dev-7WNX7TCU.js.map} +1 -1
- package/dist/models-dev-WLCAFFJ4.cjs +12 -0
- package/dist/{models-dev-NF7UD62B.cjs.map → models-dev-WLCAFFJ4.cjs.map} +1 -1
- package/dist/netlify-36GUTVVT.cjs +12 -0
- package/dist/{netlify-P4EFQMHA.cjs.map → netlify-36GUTVVT.cjs.map} +1 -1
- package/dist/netlify-YRYIHP2F.js +3 -0
- package/dist/{netlify-KHE7KRN5.js.map → netlify-YRYIHP2F.js.map} +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +45 -45
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-42GJNKSE.cjs +44 -0
- package/dist/{provider-registry-SFV3WU5J.cjs.map → provider-registry-42GJNKSE.cjs.map} +1 -1
- package/dist/provider-registry-754T4RLN.js +3 -0
- package/dist/{provider-registry-LSYGSSFL.js.map → provider-registry-754T4RLN.js.map} +1 -1
- package/dist/provider-registry.json +124 -10
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/stream/index.cjs +8 -8
- package/dist/stream/index.js +1 -1
- package/dist/test-utils/llm-mock.cjs +4 -4
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/voice/index.cjs +6 -6
- package/dist/voice/index.js +1 -1
- package/dist/voice/voice.d.ts +18 -0
- package/dist/voice/voice.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +24 -24
- package/dist/workflows/index.js +1 -1
- package/package.json +5 -5
- package/src/llm/model/provider-types.generated.d.ts +50 -5
- package/dist/chunk-72EQLBZY.js.map +0 -1
- package/dist/chunk-FCD77VJW.js.map +0 -1
- package/dist/chunk-GNOSEGOW.cjs.map +0 -1
- package/dist/chunk-HDKQ7SH2.cjs.map +0 -1
- package/dist/chunk-IDXQEXTK.js.map +0 -1
- package/dist/chunk-IT7OSYXH.js.map +0 -1
- package/dist/chunk-PMNREZUF.js.map +0 -1
- package/dist/chunk-PP3Z4TR3.cjs.map +0 -1
- package/dist/chunk-RAD2NM47.cjs.map +0 -1
- package/dist/chunk-T44GAO6N.cjs.map +0 -1
- package/dist/mastra-7Y4LYBV5.js +0 -3
- package/dist/mastra-VDOKA4KM.cjs +0 -12
- package/dist/models-dev-NA6SJZMY.js +0 -3
- package/dist/models-dev-NF7UD62B.cjs +0 -12
- package/dist/netlify-KHE7KRN5.js +0 -3
- package/dist/netlify-P4EFQMHA.cjs +0 -12
- package/dist/provider-registry-LSYGSSFL.js +0 -3
- package/dist/provider-registry-SFV3WU5J.cjs +0 -44
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MastraGateway, PROVIDER_REGISTRY, GatewayRegistry } from './chunk-
|
|
2
|
-
import { ModelsDevGateway, parseModelRouterId } from './chunk-
|
|
3
|
-
import { NetlifyGateway } from './chunk-
|
|
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-
|
|
5
|
-
import { AISDKV5LanguageModel, createStreamFromGenerateResult } from './chunk-
|
|
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-
|
|
14222
|
-
//# sourceMappingURL=chunk-
|
|
14290
|
+
//# sourceMappingURL=chunk-CSKV732I.js.map
|
|
14291
|
+
//# sourceMappingURL=chunk-CSKV732I.js.map
|