@mastra/core 0.24.6 → 0.24.7-alpha.1
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 +54 -0
- package/dist/agent/index.cjs +13 -13
- package/dist/agent/index.js +2 -2
- package/dist/agent/input-processor/index.cjs +6 -6
- package/dist/agent/input-processor/index.js +1 -1
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/ai-tracing/index.cjs +36 -36
- package/dist/ai-tracing/index.js +1 -1
- package/dist/{chunk-XWGHD4C7.cjs → chunk-22DLIF7L.cjs} +5 -5
- package/dist/{chunk-XWGHD4C7.cjs.map → chunk-22DLIF7L.cjs.map} +1 -1
- package/dist/{chunk-PAOBGBU7.cjs → chunk-3IDFSGG3.cjs} +4 -4
- package/dist/{chunk-PAOBGBU7.cjs.map → chunk-3IDFSGG3.cjs.map} +1 -1
- package/dist/{chunk-42RUESSD.cjs → chunk-4YYPQOP7.cjs} +9 -4
- package/dist/{chunk-42RUESSD.cjs.map → chunk-4YYPQOP7.cjs.map} +1 -1
- package/dist/{chunk-AQGLVU53.cjs → chunk-5PSD3IKG.cjs} +19 -6
- package/dist/chunk-5PSD3IKG.cjs.map +1 -0
- package/dist/{chunk-LAQQETGP.js → chunk-5UWR4YYL.js} +33 -28
- package/dist/chunk-5UWR4YYL.js.map +1 -0
- package/dist/{chunk-RJOVFHWN.cjs → chunk-6DFSLVVY.cjs} +34 -7
- package/dist/chunk-6DFSLVVY.cjs.map +1 -0
- package/dist/{chunk-6D2K2CAA.js → chunk-6VB52TJV.js} +3 -3
- package/dist/{chunk-6D2K2CAA.js.map → chunk-6VB52TJV.js.map} +1 -1
- package/dist/{chunk-VXHOOZSK.js → chunk-72F4RGK7.js} +3 -3
- package/dist/{chunk-VXHOOZSK.js.map → chunk-72F4RGK7.js.map} +1 -1
- package/dist/{chunk-XDMQQZNX.cjs → chunk-AHQOJZT2.cjs} +74 -66
- package/dist/chunk-AHQOJZT2.cjs.map +1 -0
- package/dist/{chunk-JVV5LREI.js → chunk-BKBVQTOH.js} +2 -2
- package/dist/chunk-BKBVQTOH.js.map +1 -0
- package/dist/{chunk-DMBN72QF.cjs → chunk-DISETAP2.cjs} +4 -4
- package/dist/{chunk-DMBN72QF.cjs.map → chunk-DISETAP2.cjs.map} +1 -1
- package/dist/{chunk-BLUDYAPI.js → chunk-DSUKMFZY.js} +19 -6
- package/dist/chunk-DSUKMFZY.js.map +1 -0
- package/dist/{chunk-NRQC7DQW.js → chunk-DYJA57WK.js} +55 -7
- package/dist/chunk-DYJA57WK.js.map +1 -0
- package/dist/{chunk-Q6LWNLAJ.js → chunk-GIK7MM2K.js} +8 -3
- package/dist/{chunk-Q6LWNLAJ.js.map → chunk-GIK7MM2K.js.map} +1 -1
- package/dist/{chunk-DHLW4AP7.js → chunk-GOEAJJED.js} +3 -3
- package/dist/{chunk-DHLW4AP7.js.map → chunk-GOEAJJED.js.map} +1 -1
- package/dist/{chunk-GZDIHQDK.cjs → chunk-GWA56ELO.cjs} +4 -4
- package/dist/{chunk-GZDIHQDK.cjs.map → chunk-GWA56ELO.cjs.map} +1 -1
- package/dist/{chunk-CT2DMHGC.cjs → chunk-ICICKWAG.cjs} +8 -8
- package/dist/{chunk-CT2DMHGC.cjs.map → chunk-ICICKWAG.cjs.map} +1 -1
- package/dist/{chunk-Z6QCWTTO.js → chunk-KQGP7VMN.js} +145 -19
- package/dist/chunk-KQGP7VMN.js.map +1 -0
- package/dist/{chunk-INOOZ2A2.js → chunk-PHSTPDWR.js} +33 -6
- package/dist/chunk-PHSTPDWR.js.map +1 -0
- package/dist/{chunk-WIMFJ2BA.js → chunk-PPAIPZ6C.js} +51 -13
- package/dist/chunk-PPAIPZ6C.js.map +1 -0
- package/dist/{chunk-UWTYVVVZ.js → chunk-RLYWCJQ6.js} +3 -3
- package/dist/{chunk-UWTYVVVZ.js.map → chunk-RLYWCJQ6.js.map} +1 -1
- package/dist/{chunk-HCCXJ5YJ.js → chunk-RP4YCZP7.js} +3 -3
- package/dist/{chunk-HCCXJ5YJ.js.map → chunk-RP4YCZP7.js.map} +1 -1
- package/dist/{chunk-CYEQK4PM.cjs → chunk-RQPGIUUA.cjs} +6 -6
- package/dist/{chunk-CYEQK4PM.cjs.map → chunk-RQPGIUUA.cjs.map} +1 -1
- package/dist/{chunk-46XGIEXM.cjs → chunk-RWPKCFZT.cjs} +4 -4
- package/dist/{chunk-46XGIEXM.cjs.map → chunk-RWPKCFZT.cjs.map} +1 -1
- package/dist/{chunk-KWF3J2Q4.cjs → chunk-SJ3PJ5D6.cjs} +11 -11
- package/dist/{chunk-KWF3J2Q4.cjs.map → chunk-SJ3PJ5D6.cjs.map} +1 -1
- package/dist/{chunk-ICF3MCIN.cjs → chunk-TR5CDVHO.cjs} +65 -17
- package/dist/chunk-TR5CDVHO.cjs.map +1 -0
- package/dist/{chunk-PIH5FBNQ.cjs → chunk-U57JN7JY.cjs} +154 -28
- package/dist/chunk-U57JN7JY.cjs.map +1 -0
- package/dist/{chunk-NPNGPMT2.js → chunk-V2IMZSNO.js} +3 -3
- package/dist/{chunk-NPNGPMT2.js.map → chunk-V2IMZSNO.js.map} +1 -1
- package/dist/{chunk-IAJHRFO4.cjs → chunk-YPYLWTZI.cjs} +60 -21
- package/dist/chunk-YPYLWTZI.cjs.map +1 -0
- package/dist/{chunk-ZIWN73GQ.js → chunk-Z6ZIJYKK.js} +5 -5
- package/dist/{chunk-ZIWN73GQ.js.map → chunk-Z6ZIJYKK.js.map} +1 -1
- package/dist/{chunk-MRSBLBQ5.js → chunk-ZOQ6Q5Q3.js} +4 -4
- package/dist/{chunk-MRSBLBQ5.js.map → chunk-ZOQ6Q5Q3.js.map} +1 -1
- package/dist/{chunk-TX4TTPYJ.cjs → chunk-ZZ2DSE2G.cjs} +2 -2
- package/dist/chunk-ZZ2DSE2G.cjs.map +1 -0
- package/dist/index.cjs +96 -64
- package/dist/index.js +13 -13
- package/dist/llm/index.cjs +8 -8
- package/dist/llm/index.js +2 -2
- package/dist/llm/model/provider-registry.d.ts.map +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/workflows/stream.d.ts +1 -1
- package/dist/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +3 -1
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.js +1 -1
- package/dist/processors/index.cjs +11 -11
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-254GJGUL.cjs +40 -0
- package/dist/{provider-registry-RUDYHG7J.cjs.map → provider-registry-254GJGUL.cjs.map} +1 -1
- package/dist/provider-registry-7BUYRBGO.js +3 -0
- package/dist/{provider-registry-THITZUJ7.js.map → provider-registry-7BUYRBGO.js.map} +1 -1
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.js +1 -1
- package/dist/scores/index.cjs +9 -9
- package/dist/scores/index.js +2 -2
- package/dist/scores/scoreTraces/index.cjs +8 -8
- package/dist/scores/scoreTraces/index.js +3 -3
- package/dist/server/index.cjs +25 -36
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +24 -35
- package/dist/server/index.js.map +1 -1
- package/dist/server/simple-auth.d.ts +13 -18
- package/dist/server/simple-auth.d.ts.map +1 -1
- package/dist/storage/base.d.ts +2 -9
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/domains/workflows/base.d.ts +2 -9
- package/dist/storage/domains/workflows/base.d.ts.map +1 -1
- package/dist/storage/domains/workflows/inmemory.d.ts +2 -9
- package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
- package/dist/storage/index.cjs +31 -10
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.js +25 -4
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/types.d.ts +10 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/telemetry/index.cjs +7 -7
- package/dist/telemetry/index.js +1 -1
- package/dist/telemetry/telemetry.decorators.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.cjs +2 -2
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.js +1 -1
- package/dist/utils.cjs +37 -17
- package/dist/utils.d.ts +32 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/voice/index.cjs +6 -6
- package/dist/voice/index.js +1 -1
- package/dist/workflows/default.d.ts +26 -8
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/execution-engine.d.ts +5 -1
- package/dist/workflows/evented/execution-engine.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts +5 -4
- package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts +1 -1
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/parallel.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/parallel.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/sleep.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/sleep.d.ts.map +1 -1
- package/dist/workflows/evented/workflow.d.ts +2 -1
- package/dist/workflows/evented/workflow.d.ts.map +1 -1
- package/dist/workflows/execution-engine.d.ts +5 -3
- package/dist/workflows/execution-engine.d.ts.map +1 -1
- package/dist/workflows/index.cjs +26 -14
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/legacy/index.cjs +22 -22
- package/dist/workflows/legacy/index.js +1 -1
- package/dist/workflows/step.d.ts +1 -0
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workflows/types.d.ts +51 -1
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/utils.d.ts +20 -0
- package/dist/workflows/utils.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +98 -12
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-AQGLVU53.cjs.map +0 -1
- package/dist/chunk-BLUDYAPI.js.map +0 -1
- package/dist/chunk-IAJHRFO4.cjs.map +0 -1
- package/dist/chunk-ICF3MCIN.cjs.map +0 -1
- package/dist/chunk-INOOZ2A2.js.map +0 -1
- package/dist/chunk-JVV5LREI.js.map +0 -1
- package/dist/chunk-LAQQETGP.js.map +0 -1
- package/dist/chunk-NRQC7DQW.js.map +0 -1
- package/dist/chunk-PIH5FBNQ.cjs.map +0 -1
- package/dist/chunk-RJOVFHWN.cjs.map +0 -1
- package/dist/chunk-TX4TTPYJ.cjs.map +0 -1
- package/dist/chunk-WIMFJ2BA.js.map +0 -1
- package/dist/chunk-XDMQQZNX.cjs.map +0 -1
- package/dist/chunk-Z6QCWTTO.js.map +0 -1
- package/dist/provider-registry-RUDYHG7J.cjs +0 -40
- package/dist/provider-registry-THITZUJ7.js +0 -3
|
@@ -5,7 +5,7 @@ import { isVercelTool, validateToolInput } from './chunk-WM4RO23J.js';
|
|
|
5
5
|
import { MastraBase } from './chunk-VQASQG5D.js';
|
|
6
6
|
import { ConsoleLogger, LogLevel, RegisteredLogger } from './chunk-UXG7PYML.js';
|
|
7
7
|
import { createHash } from 'crypto';
|
|
8
|
-
import jsonSchemaToZod from 'json-
|
|
8
|
+
import { jsonSchemaToZod } from '@mastra/schema-compat/json-to-zod';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { convertZodSchemaToAISDKSchema, OpenAIReasoningSchemaCompatLayer, OpenAISchemaCompatLayer, GoogleSchemaCompatLayer, AnthropicSchemaCompatLayer, DeepSeekSchemaCompatLayer, MetaSchemaCompatLayer, applyCompatLayer } from '@mastra/schema-compat';
|
|
11
11
|
import { TransformStream } from 'stream/web';
|
|
@@ -996,6 +996,44 @@ async function fetchWithRetry(url, options = {}, maxRetries = 3) {
|
|
|
996
996
|
}
|
|
997
997
|
throw lastError || new Error("Request failed after multiple retry attempts");
|
|
998
998
|
}
|
|
999
|
+
function omitKeys(obj, keysToOmit) {
|
|
1000
|
+
return Object.fromEntries(Object.entries(obj).filter(([key]) => !keysToOmit.includes(key)));
|
|
1001
|
+
}
|
|
1002
|
+
function selectFields(obj, fields) {
|
|
1003
|
+
if (!obj || typeof obj !== "object") {
|
|
1004
|
+
return obj;
|
|
1005
|
+
}
|
|
1006
|
+
const result = {};
|
|
1007
|
+
for (const field of fields) {
|
|
1008
|
+
const value = getNestedValue(obj, field);
|
|
1009
|
+
if (value !== void 0) {
|
|
1010
|
+
setNestedValue(result, field, value);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
return result;
|
|
1014
|
+
}
|
|
1015
|
+
function getNestedValue(obj, path) {
|
|
1016
|
+
return path.split(".").reduce((current, key) => {
|
|
1017
|
+
return current && typeof current === "object" ? current[key] : void 0;
|
|
1018
|
+
}, obj);
|
|
1019
|
+
}
|
|
1020
|
+
function setNestedValue(obj, path, value) {
|
|
1021
|
+
const keys = path.split(".");
|
|
1022
|
+
const lastKey = keys.pop();
|
|
1023
|
+
if (!lastKey) {
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
const target = keys.reduce((current, key) => {
|
|
1027
|
+
if (!current[key] || typeof current[key] !== "object") {
|
|
1028
|
+
current[key] = {};
|
|
1029
|
+
}
|
|
1030
|
+
return current[key];
|
|
1031
|
+
}, obj);
|
|
1032
|
+
target[lastKey] = value;
|
|
1033
|
+
}
|
|
1034
|
+
var removeUndefinedValues = (obj) => {
|
|
1035
|
+
return Object.fromEntries(Object.entries(obj).filter(([_, value]) => value !== void 0));
|
|
1036
|
+
};
|
|
999
1037
|
|
|
1000
1038
|
// src/ai-tracing/exporters/cloud.ts
|
|
1001
1039
|
var CloudExporter = class extends BaseExporter {
|
|
@@ -2044,28 +2082,28 @@ function setupAITracing(config) {
|
|
|
2044
2082
|
}
|
|
2045
2083
|
|
|
2046
2084
|
// src/ai-tracing/utils.ts
|
|
2047
|
-
function
|
|
2085
|
+
function omitKeys2(obj, keysToOmit) {
|
|
2048
2086
|
return Object.fromEntries(Object.entries(obj).filter(([key]) => !keysToOmit.includes(key)));
|
|
2049
2087
|
}
|
|
2050
|
-
function
|
|
2088
|
+
function selectFields2(obj, fields) {
|
|
2051
2089
|
if (!obj || typeof obj !== "object") {
|
|
2052
2090
|
return obj;
|
|
2053
2091
|
}
|
|
2054
2092
|
const result = {};
|
|
2055
2093
|
for (const field of fields) {
|
|
2056
|
-
const value =
|
|
2094
|
+
const value = getNestedValue2(obj, field);
|
|
2057
2095
|
if (value !== void 0) {
|
|
2058
|
-
|
|
2096
|
+
setNestedValue2(result, field, value);
|
|
2059
2097
|
}
|
|
2060
2098
|
}
|
|
2061
2099
|
return result;
|
|
2062
2100
|
}
|
|
2063
|
-
function
|
|
2101
|
+
function getNestedValue2(obj, path) {
|
|
2064
2102
|
return path.split(".").reduce((current, key) => {
|
|
2065
2103
|
return current && typeof current === "object" ? current[key] : void 0;
|
|
2066
2104
|
}, obj);
|
|
2067
2105
|
}
|
|
2068
|
-
function
|
|
2106
|
+
function setNestedValue2(obj, path, value) {
|
|
2069
2107
|
const keys = path.split(".");
|
|
2070
2108
|
const lastKey = keys.pop();
|
|
2071
2109
|
if (!lastKey) {
|
|
@@ -2315,12 +2353,12 @@ var BaseAITracing = class extends MastraBase {
|
|
|
2315
2353
|
if (value !== void 0) {
|
|
2316
2354
|
if (parts.length > 1) {
|
|
2317
2355
|
const nestedPath = parts.slice(1).join(".");
|
|
2318
|
-
const nestedValue =
|
|
2356
|
+
const nestedValue = getNestedValue2(value, nestedPath);
|
|
2319
2357
|
if (nestedValue !== void 0) {
|
|
2320
|
-
|
|
2358
|
+
setNestedValue2(result, key, nestedValue);
|
|
2321
2359
|
}
|
|
2322
2360
|
} else {
|
|
2323
|
-
|
|
2361
|
+
setNestedValue2(result, key, value);
|
|
2324
2362
|
}
|
|
2325
2363
|
}
|
|
2326
2364
|
}
|
|
@@ -2875,6 +2913,6 @@ var ModelSpanTracker = class {
|
|
|
2875
2913
|
}
|
|
2876
2914
|
};
|
|
2877
2915
|
|
|
2878
|
-
export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, BaseExporter, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, ModelSpanTracker, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, checkEvalStorageFields, clearAITracingRegistry, createMastraProxy, deepClean, deepMerge, delay, ensureToolProperties, fetchWithRetry, generateEmptyFromSchema, getAITracing, getAllAITracing, getDefaultAITracing, getNestedValue, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isCoreMessage, isMastra, isUiMessage, isZodType, makeCoreTool, makeCoreToolV5, maskStreamTags, omitKeys, parseFieldKey, parseSqlIdentifier, registerAITracing, resolveSerializedZodOutput, selectFields, setNestedValue, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra };
|
|
2879
|
-
//# sourceMappingURL=chunk-
|
|
2880
|
-
//# sourceMappingURL=chunk-
|
|
2916
|
+
export { AISpanType, AITracingEventType, BaseAISpan, BaseAITracing, BaseExporter, CloudExporter, ConsoleExporter, DefaultAISpan, DefaultAITracing, DefaultExporter, InternalSpans, ModelSpanTracker, NoOpAISpan, SamplingStrategyType, SensitiveDataFilter, checkEvalStorageFields, clearAITracingRegistry, createMastraProxy, deepClean, deepMerge, delay, ensureToolProperties, fetchWithRetry, generateEmptyFromSchema, getAITracing, getAllAITracing, getDefaultAITracing, getNestedValue2 as getNestedValue, getNestedValue as getNestedValue2, getOrCreateSpan, getSelectedAITracing, getValidTraceId, hasAITracing, isCoreMessage, isMastra, isUiMessage, isZodType, makeCoreTool, makeCoreToolV5, maskStreamTags, omitKeys2 as omitKeys, omitKeys as omitKeys2, parseFieldKey, parseSqlIdentifier, registerAITracing, removeUndefinedValues, resolveSerializedZodOutput, selectFields2 as selectFields, selectFields as selectFields2, setNestedValue2 as setNestedValue, setNestedValue as setNestedValue2, setSelector, setupAITracing, shutdownAITracingRegistry, unregisterAITracing, wrapMastra };
|
|
2917
|
+
//# sourceMappingURL=chunk-PPAIPZ6C.js.map
|
|
2918
|
+
//# sourceMappingURL=chunk-PPAIPZ6C.js.map
|