@mastra/core 0.24.7-alpha.0 → 0.24.7-alpha.2
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 +56 -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-H6SCQEQZ.js → chunk-2BY7C6Y7.js} +145 -19
- package/dist/chunk-2BY7C6Y7.js.map +1 -0
- package/dist/{chunk-TMGNLNND.cjs → chunk-2YE6RNCZ.cjs} +4 -4
- package/dist/{chunk-TMGNLNND.cjs.map → chunk-2YE6RNCZ.cjs.map} +1 -1
- package/dist/{chunk-MQOYPEDP.js → chunk-2YN6HGEH.js} +3 -3
- package/dist/{chunk-MQOYPEDP.js.map → chunk-2YN6HGEH.js.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-6D2K2CAA.js → chunk-6VB52TJV.js} +3 -3
- package/dist/{chunk-6D2K2CAA.js.map → chunk-6VB52TJV.js.map} +1 -1
- package/dist/{chunk-JVV5LREI.js → chunk-BKBVQTOH.js} +2 -2
- package/dist/chunk-BKBVQTOH.js.map +1 -0
- package/dist/{chunk-XFEAV36D.cjs → chunk-CNIM7N4E.cjs} +64 -16
- package/dist/chunk-CNIM7N4E.cjs.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-NP7A4CAN.js → chunk-E5NCEJEJ.js} +3 -3
- package/dist/{chunk-NP7A4CAN.js.map → chunk-E5NCEJEJ.js.map} +1 -1
- package/dist/{chunk-VATR2Z2C.cjs → chunk-FQTJPLCW.cjs} +154 -28
- package/dist/chunk-FQTJPLCW.cjs.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-GSFQAR6S.cjs → chunk-ICICKWAG.cjs} +6 -6
- package/dist/{chunk-GSFQAR6S.cjs.map → chunk-ICICKWAG.cjs.map} +1 -1
- package/dist/{chunk-7YGCP2UZ.js → chunk-N6P5GJRO.js} +54 -6
- package/dist/chunk-N6P5GJRO.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-NPNGPMT2.js → chunk-V2IMZSNO.js} +3 -3
- package/dist/{chunk-NPNGPMT2.js.map → chunk-V2IMZSNO.js.map} +1 -1
- package/dist/{chunk-LGKZOO44.cjs → chunk-X5JTTWMF.cjs} +9 -9
- package/dist/{chunk-LGKZOO44.cjs.map → chunk-X5JTTWMF.cjs.map} +1 -1
- package/dist/{chunk-BMJ6HNP4.js → chunk-Y2BH2LUD.js} +32 -27
- package/dist/chunk-Y2BH2LUD.js.map +1 -0
- package/dist/{chunk-IAJHRFO4.cjs → chunk-YPYLWTZI.cjs} +60 -21
- package/dist/chunk-YPYLWTZI.cjs.map +1 -0
- package/dist/{chunk-HJOAX5IQ.cjs → chunk-YYKN3NDZ.cjs} +72 -64
- package/dist/chunk-YYKN3NDZ.cjs.map +1 -0
- package/dist/{chunk-MHNE743G.js → chunk-Z6ZIJYKK.js} +4 -4
- package/dist/{chunk-MHNE743G.js.map → chunk-Z6ZIJYKK.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 +88 -56
- package/dist/index.js +11 -11
- 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/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-7YGCP2UZ.js.map +0 -1
- package/dist/chunk-AQGLVU53.cjs.map +0 -1
- package/dist/chunk-BLUDYAPI.js.map +0 -1
- package/dist/chunk-BMJ6HNP4.js.map +0 -1
- package/dist/chunk-H6SCQEQZ.js.map +0 -1
- package/dist/chunk-HJOAX5IQ.cjs.map +0 -1
- package/dist/chunk-IAJHRFO4.cjs.map +0 -1
- package/dist/chunk-JVV5LREI.js.map +0 -1
- package/dist/chunk-TX4TTPYJ.cjs.map +0 -1
- package/dist/chunk-VATR2Z2C.cjs.map +0 -1
- package/dist/chunk-WIMFJ2BA.js.map +0 -1
- package/dist/chunk-XFEAV36D.cjs.map +0 -1
|
@@ -7,15 +7,11 @@ var chunkVF676YCO_cjs = require('./chunk-VF676YCO.cjs');
|
|
|
7
7
|
var chunk6VOPKVYH_cjs = require('./chunk-6VOPKVYH.cjs');
|
|
8
8
|
var chunkA5KDVZDL_cjs = require('./chunk-A5KDVZDL.cjs');
|
|
9
9
|
var crypto$1 = require('crypto');
|
|
10
|
-
var
|
|
10
|
+
var jsonToZod = require('@mastra/schema-compat/json-to-zod');
|
|
11
11
|
var zod = require('zod');
|
|
12
12
|
var schemaCompat = require('@mastra/schema-compat');
|
|
13
13
|
var web = require('stream/web');
|
|
14
14
|
|
|
15
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
|
|
17
|
-
var jsonSchemaToZod__default = /*#__PURE__*/_interopDefault(jsonSchemaToZod);
|
|
18
|
-
|
|
19
15
|
// src/ai-tracing/types.ts
|
|
20
16
|
var AISpanType = /* @__PURE__ */ ((AISpanType2) => {
|
|
21
17
|
AISpanType2["AGENT_RUN"] = "agent_run";
|
|
@@ -860,7 +856,7 @@ function convertVercelToolParameters(tool) {
|
|
|
860
856
|
if (typeof schema === "function") {
|
|
861
857
|
schema = schema();
|
|
862
858
|
}
|
|
863
|
-
return isZodType(schema) ? schema : resolveSerializedZodOutput(
|
|
859
|
+
return isZodType(schema) ? schema : resolveSerializedZodOutput(jsonToZod.jsonSchemaToZod(schema));
|
|
864
860
|
}
|
|
865
861
|
function makeCoreTool(originalTool, options, logType) {
|
|
866
862
|
return new CoreToolBuilder({ originalTool, options, logType }).build();
|
|
@@ -1002,6 +998,44 @@ async function fetchWithRetry(url, options = {}, maxRetries = 3) {
|
|
|
1002
998
|
}
|
|
1003
999
|
throw lastError || new Error("Request failed after multiple retry attempts");
|
|
1004
1000
|
}
|
|
1001
|
+
function omitKeys(obj, keysToOmit) {
|
|
1002
|
+
return Object.fromEntries(Object.entries(obj).filter(([key]) => !keysToOmit.includes(key)));
|
|
1003
|
+
}
|
|
1004
|
+
function selectFields(obj, fields) {
|
|
1005
|
+
if (!obj || typeof obj !== "object") {
|
|
1006
|
+
return obj;
|
|
1007
|
+
}
|
|
1008
|
+
const result = {};
|
|
1009
|
+
for (const field of fields) {
|
|
1010
|
+
const value = getNestedValue(obj, field);
|
|
1011
|
+
if (value !== void 0) {
|
|
1012
|
+
setNestedValue(result, field, value);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
return result;
|
|
1016
|
+
}
|
|
1017
|
+
function getNestedValue(obj, path) {
|
|
1018
|
+
return path.split(".").reduce((current, key) => {
|
|
1019
|
+
return current && typeof current === "object" ? current[key] : void 0;
|
|
1020
|
+
}, obj);
|
|
1021
|
+
}
|
|
1022
|
+
function setNestedValue(obj, path, value) {
|
|
1023
|
+
const keys = path.split(".");
|
|
1024
|
+
const lastKey = keys.pop();
|
|
1025
|
+
if (!lastKey) {
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
const target = keys.reduce((current, key) => {
|
|
1029
|
+
if (!current[key] || typeof current[key] !== "object") {
|
|
1030
|
+
current[key] = {};
|
|
1031
|
+
}
|
|
1032
|
+
return current[key];
|
|
1033
|
+
}, obj);
|
|
1034
|
+
target[lastKey] = value;
|
|
1035
|
+
}
|
|
1036
|
+
var removeUndefinedValues = (obj) => {
|
|
1037
|
+
return Object.fromEntries(Object.entries(obj).filter(([_, value]) => value !== void 0));
|
|
1038
|
+
};
|
|
1005
1039
|
|
|
1006
1040
|
// src/ai-tracing/exporters/cloud.ts
|
|
1007
1041
|
var CloudExporter = class extends BaseExporter {
|
|
@@ -2050,28 +2084,28 @@ function setupAITracing(config) {
|
|
|
2050
2084
|
}
|
|
2051
2085
|
|
|
2052
2086
|
// src/ai-tracing/utils.ts
|
|
2053
|
-
function
|
|
2087
|
+
function omitKeys2(obj, keysToOmit) {
|
|
2054
2088
|
return Object.fromEntries(Object.entries(obj).filter(([key]) => !keysToOmit.includes(key)));
|
|
2055
2089
|
}
|
|
2056
|
-
function
|
|
2090
|
+
function selectFields2(obj, fields) {
|
|
2057
2091
|
if (!obj || typeof obj !== "object") {
|
|
2058
2092
|
return obj;
|
|
2059
2093
|
}
|
|
2060
2094
|
const result = {};
|
|
2061
2095
|
for (const field of fields) {
|
|
2062
|
-
const value =
|
|
2096
|
+
const value = getNestedValue2(obj, field);
|
|
2063
2097
|
if (value !== void 0) {
|
|
2064
|
-
|
|
2098
|
+
setNestedValue2(result, field, value);
|
|
2065
2099
|
}
|
|
2066
2100
|
}
|
|
2067
2101
|
return result;
|
|
2068
2102
|
}
|
|
2069
|
-
function
|
|
2103
|
+
function getNestedValue2(obj, path) {
|
|
2070
2104
|
return path.split(".").reduce((current, key) => {
|
|
2071
2105
|
return current && typeof current === "object" ? current[key] : void 0;
|
|
2072
2106
|
}, obj);
|
|
2073
2107
|
}
|
|
2074
|
-
function
|
|
2108
|
+
function setNestedValue2(obj, path, value) {
|
|
2075
2109
|
const keys = path.split(".");
|
|
2076
2110
|
const lastKey = keys.pop();
|
|
2077
2111
|
if (!lastKey) {
|
|
@@ -2321,12 +2355,12 @@ var BaseAITracing = class extends chunk6VOPKVYH_cjs.MastraBase {
|
|
|
2321
2355
|
if (value !== void 0) {
|
|
2322
2356
|
if (parts.length > 1) {
|
|
2323
2357
|
const nestedPath = parts.slice(1).join(".");
|
|
2324
|
-
const nestedValue =
|
|
2358
|
+
const nestedValue = getNestedValue2(value, nestedPath);
|
|
2325
2359
|
if (nestedValue !== void 0) {
|
|
2326
|
-
|
|
2360
|
+
setNestedValue2(result, key, nestedValue);
|
|
2327
2361
|
}
|
|
2328
2362
|
} else {
|
|
2329
|
-
|
|
2363
|
+
setNestedValue2(result, key, value);
|
|
2330
2364
|
}
|
|
2331
2365
|
}
|
|
2332
2366
|
}
|
|
@@ -2908,7 +2942,8 @@ exports.generateEmptyFromSchema = generateEmptyFromSchema;
|
|
|
2908
2942
|
exports.getAITracing = getAITracing;
|
|
2909
2943
|
exports.getAllAITracing = getAllAITracing;
|
|
2910
2944
|
exports.getDefaultAITracing = getDefaultAITracing;
|
|
2911
|
-
exports.getNestedValue =
|
|
2945
|
+
exports.getNestedValue = getNestedValue2;
|
|
2946
|
+
exports.getNestedValue2 = getNestedValue;
|
|
2912
2947
|
exports.getOrCreateSpan = getOrCreateSpan;
|
|
2913
2948
|
exports.getSelectedAITracing = getSelectedAITracing;
|
|
2914
2949
|
exports.getValidTraceId = getValidTraceId;
|
|
@@ -2920,17 +2955,21 @@ exports.isZodType = isZodType;
|
|
|
2920
2955
|
exports.makeCoreTool = makeCoreTool;
|
|
2921
2956
|
exports.makeCoreToolV5 = makeCoreToolV5;
|
|
2922
2957
|
exports.maskStreamTags = maskStreamTags;
|
|
2923
|
-
exports.omitKeys =
|
|
2958
|
+
exports.omitKeys = omitKeys2;
|
|
2959
|
+
exports.omitKeys2 = omitKeys;
|
|
2924
2960
|
exports.parseFieldKey = parseFieldKey;
|
|
2925
2961
|
exports.parseSqlIdentifier = parseSqlIdentifier;
|
|
2926
2962
|
exports.registerAITracing = registerAITracing;
|
|
2963
|
+
exports.removeUndefinedValues = removeUndefinedValues;
|
|
2927
2964
|
exports.resolveSerializedZodOutput = resolveSerializedZodOutput;
|
|
2928
|
-
exports.selectFields =
|
|
2929
|
-
exports.
|
|
2965
|
+
exports.selectFields = selectFields2;
|
|
2966
|
+
exports.selectFields2 = selectFields;
|
|
2967
|
+
exports.setNestedValue = setNestedValue2;
|
|
2968
|
+
exports.setNestedValue2 = setNestedValue;
|
|
2930
2969
|
exports.setSelector = setSelector;
|
|
2931
2970
|
exports.setupAITracing = setupAITracing;
|
|
2932
2971
|
exports.shutdownAITracingRegistry = shutdownAITracingRegistry;
|
|
2933
2972
|
exports.unregisterAITracing = unregisterAITracing;
|
|
2934
2973
|
exports.wrapMastra = wrapMastra;
|
|
2935
|
-
//# sourceMappingURL=chunk-
|
|
2936
|
-
//# sourceMappingURL=chunk-
|
|
2974
|
+
//# sourceMappingURL=chunk-YPYLWTZI.cjs.map
|
|
2975
|
+
//# sourceMappingURL=chunk-YPYLWTZI.cjs.map
|