@mastra/core 0.17.0-alpha.3 → 0.17.0-alpha.5
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 +22 -0
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/index.cjs +11 -11
- 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 +1 -1
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/types.d.ts +5 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/ai-tracing/exporters/default.d.ts +1 -0
- package/dist/ai-tracing/exporters/default.d.ts.map +1 -1
- package/dist/ai-tracing/index.cjs +35 -31
- package/dist/ai-tracing/index.js +1 -1
- package/dist/ai-tracing/spans/base.d.ts +2 -1
- package/dist/ai-tracing/spans/base.d.ts.map +1 -1
- package/dist/ai-tracing/types.d.ts +35 -4
- package/dist/ai-tracing/types.d.ts.map +1 -1
- package/dist/ai-tracing/utils.d.ts +3 -2
- package/dist/ai-tracing/utils.d.ts.map +1 -1
- package/dist/{chunk-4UUBZNVD.cjs → chunk-3DHX2SDR.cjs} +20 -9
- package/dist/chunk-3DHX2SDR.cjs.map +1 -0
- package/dist/{chunk-6DGBFJVJ.js → chunk-4VHC2F5H.js} +10 -8
- package/dist/chunk-4VHC2F5H.js.map +1 -0
- package/dist/{chunk-6ER2C5KK.js → chunk-666JQVO5.js} +73 -60
- package/dist/chunk-666JQVO5.js.map +1 -0
- package/dist/{chunk-DFG5DYBU.cjs → chunk-7UO6UWCO.cjs} +4 -4
- package/dist/{chunk-DFG5DYBU.cjs.map → chunk-7UO6UWCO.cjs.map} +1 -1
- package/dist/{chunk-CUL4XPO7.cjs → chunk-CP4TZ4HO.cjs} +119 -46
- package/dist/chunk-CP4TZ4HO.cjs.map +1 -0
- package/dist/{chunk-HN446TOQ.js → chunk-D43ZGJR3.js} +17 -6
- package/dist/chunk-D43ZGJR3.js.map +1 -0
- package/dist/{chunk-NHXCRP73.cjs → chunk-EXG53YAJ.cjs} +92 -79
- package/dist/chunk-EXG53YAJ.cjs.map +1 -0
- package/dist/{chunk-7GC52IJO.cjs → chunk-HBQSSMAD.cjs} +13 -11
- package/dist/chunk-HBQSSMAD.cjs.map +1 -0
- package/dist/{chunk-O5ZQXW2Z.js → chunk-IYN65QCO.js} +5 -5
- package/dist/{chunk-O5ZQXW2Z.js.map → chunk-IYN65QCO.js.map} +1 -1
- package/dist/{chunk-RYRLZO4M.js → chunk-KYFRWMTX.js} +3 -3
- package/dist/{chunk-RYRLZO4M.js.map → chunk-KYFRWMTX.js.map} +1 -1
- package/dist/{chunk-AZW77RIZ.cjs → chunk-MRZHPP3G.cjs} +103 -5
- package/dist/chunk-MRZHPP3G.cjs.map +1 -0
- package/dist/{chunk-MEAE636Z.js → chunk-NRGXWM6C.js} +17 -4
- package/dist/chunk-NRGXWM6C.js.map +1 -0
- package/dist/{chunk-UIOXAMCE.js → chunk-PL3B3FZM.js} +119 -47
- package/dist/chunk-PL3B3FZM.js.map +1 -0
- package/dist/{chunk-PGJPVLDZ.cjs → chunk-RNJ4GD7U.cjs} +6 -6
- package/dist/{chunk-PGJPVLDZ.cjs.map → chunk-RNJ4GD7U.cjs.map} +1 -1
- package/dist/{chunk-VFSLYB2P.cjs → chunk-SZZPFXZ7.cjs} +21 -8
- package/dist/chunk-SZZPFXZ7.cjs.map +1 -0
- package/dist/{chunk-FJRTJO6A.cjs → chunk-VBBMXF7Z.cjs} +12 -12
- package/dist/{chunk-FJRTJO6A.cjs.map → chunk-VBBMXF7Z.cjs.map} +1 -1
- package/dist/{chunk-YUSC7Q6Y.js → chunk-VXJFKEON.js} +4 -4
- package/dist/{chunk-YUSC7Q6Y.js.map → chunk-VXJFKEON.js.map} +1 -1
- package/dist/{chunk-A6DPQCNR.js → chunk-XRJDA7BI.js} +102 -4
- package/dist/chunk-XRJDA7BI.js.map +1 -0
- package/dist/index.cjs +38 -38
- package/dist/index.js +7 -7
- package/dist/llm/model/model.d.ts +3 -1
- package/dist/llm/model/model.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +3 -1
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/shared.types.d.ts +4 -0
- package/dist/llm/model/shared.types.d.ts.map +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/test-utils/options.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +836 -0
- package/dist/loop/workflows/agentic-execution/index.d.ts.map +1 -0
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +559 -0
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -0
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +311 -0
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -0
- package/dist/loop/{workflow → workflows/agentic-execution}/tool-call-step.d.ts +16 -16
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -0
- package/dist/loop/workflows/agentic-loop/index.d.ts +842 -0
- package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -0
- package/dist/loop/workflows/run-state.d.ts.map +1 -0
- package/dist/loop/workflows/schema.d.ts +439 -0
- package/dist/loop/workflows/schema.d.ts.map +1 -0
- package/dist/loop/{workflow → workflows}/stream.d.ts +1 -1
- package/dist/loop/workflows/stream.d.ts.map +1 -0
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +4 -4
- package/dist/memory/index.js +1 -1
- package/dist/network/index.cjs +2 -2
- package/dist/network/index.js +1 -1
- package/dist/network/vNext/index.cjs +34 -34
- package/dist/network/vNext/index.cjs.map +1 -1
- package/dist/network/vNext/index.js +7 -7
- package/dist/network/vNext/index.js.map +1 -1
- package/dist/processors/index.cjs +8 -8
- package/dist/processors/index.js +2 -2
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.js +1 -1
- package/dist/scores/base.d.ts.map +1 -1
- package/dist/scores/index.cjs +8 -8
- package/dist/scores/index.js +1 -1
- package/dist/storage/index.cjs +3 -3
- package/dist/storage/index.js +1 -1
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +3 -3
- package/dist/stream/index.js +1 -1
- package/dist/stream/types.d.ts +1 -1
- package/dist/stream/types.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/utils.cjs +17 -17
- package/dist/utils.d.ts +2 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/workflows/default.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.d.ts.map +1 -1
- package/dist/workflows/execution-engine.d.ts +7 -2
- package/dist/workflows/execution-engine.d.ts.map +1 -1
- package/dist/workflows/index.cjs +10 -10
- 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/types.d.ts +6 -1
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +12 -10
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4UUBZNVD.cjs.map +0 -1
- package/dist/chunk-6DGBFJVJ.js.map +0 -1
- package/dist/chunk-6ER2C5KK.js.map +0 -1
- package/dist/chunk-7GC52IJO.cjs.map +0 -1
- package/dist/chunk-A6DPQCNR.js.map +0 -1
- package/dist/chunk-AZW77RIZ.cjs.map +0 -1
- package/dist/chunk-CUL4XPO7.cjs.map +0 -1
- package/dist/chunk-HN446TOQ.js.map +0 -1
- package/dist/chunk-MEAE636Z.js.map +0 -1
- package/dist/chunk-NHXCRP73.cjs.map +0 -1
- package/dist/chunk-UIOXAMCE.js.map +0 -1
- package/dist/chunk-VFSLYB2P.cjs.map +0 -1
- package/dist/loop/workflow/llm-execution.d.ts +0 -81
- package/dist/loop/workflow/llm-execution.d.ts.map +0 -1
- package/dist/loop/workflow/outer-llm-step.d.ts +0 -44
- package/dist/loop/workflow/outer-llm-step.d.ts.map +0 -1
- package/dist/loop/workflow/run-state.d.ts.map +0 -1
- package/dist/loop/workflow/schema.d.ts +0 -92
- package/dist/loop/workflow/schema.d.ts.map +0 -1
- package/dist/loop/workflow/stream.d.ts.map +0 -1
- package/dist/loop/workflow/tool-call-step.d.ts.map +0 -1
- /package/dist/loop/{workflow → workflows}/run-state.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCP4TZ4HO_cjs = require('./chunk-CP4TZ4HO.cjs');
|
|
4
4
|
var chunkC73WLCY3_cjs = require('./chunk-C73WLCY3.cjs');
|
|
5
5
|
var crypto = require('crypto');
|
|
6
6
|
var AIV4 = require('ai');
|
|
@@ -613,7 +613,7 @@ function convertDataContentToBase64String(content) {
|
|
|
613
613
|
var downloadFromUrl = async ({ url, downloadRetries }) => {
|
|
614
614
|
const urlText = url.toString();
|
|
615
615
|
try {
|
|
616
|
-
const response = await
|
|
616
|
+
const response = await chunkCP4TZ4HO_cjs.fetchWithRetry(
|
|
617
617
|
urlText,
|
|
618
618
|
{
|
|
619
619
|
method: "GET"
|
|
@@ -1082,7 +1082,105 @@ var MessageList = class _MessageList {
|
|
|
1082
1082
|
model: () => this.aiV5UIMessagesToAIV5ModelMessages(this.response.aiV5.ui()).filter(
|
|
1083
1083
|
(m) => m.role === `tool` || m.role === `assistant`
|
|
1084
1084
|
),
|
|
1085
|
-
modelContent: () => {
|
|
1085
|
+
modelContent: (stepNumber) => {
|
|
1086
|
+
if (typeof stepNumber === "number") {
|
|
1087
|
+
const uiMessages = this.response.aiV5.ui();
|
|
1088
|
+
const uiMessagesParts = uiMessages.flatMap((item) => item.parts);
|
|
1089
|
+
const stepBoundaries = [];
|
|
1090
|
+
uiMessagesParts.forEach((part, index) => {
|
|
1091
|
+
if (part.type === "step-start") {
|
|
1092
|
+
stepBoundaries.push(index);
|
|
1093
|
+
}
|
|
1094
|
+
});
|
|
1095
|
+
if (stepNumber === -1) {
|
|
1096
|
+
const toolParts = uiMessagesParts.filter((p) => p.type?.startsWith("tool-"));
|
|
1097
|
+
const hasStepStart = stepBoundaries.length > 0;
|
|
1098
|
+
if (!hasStepStart && toolParts.length > 0) {
|
|
1099
|
+
const lastToolPart = toolParts[toolParts.length - 1];
|
|
1100
|
+
if (!lastToolPart) {
|
|
1101
|
+
return [];
|
|
1102
|
+
}
|
|
1103
|
+
const lastToolIndex = uiMessagesParts.indexOf(lastToolPart);
|
|
1104
|
+
const previousToolPart = toolParts[toolParts.length - 2];
|
|
1105
|
+
const previousToolIndex = previousToolPart ? uiMessagesParts.indexOf(previousToolPart) : -1;
|
|
1106
|
+
const startIndex2 = previousToolIndex + 1;
|
|
1107
|
+
const stepParts3 = uiMessagesParts.slice(startIndex2, lastToolIndex + 1);
|
|
1108
|
+
const stepUiMessages3 = [
|
|
1109
|
+
{
|
|
1110
|
+
id: "last-step",
|
|
1111
|
+
role: "assistant",
|
|
1112
|
+
parts: stepParts3
|
|
1113
|
+
}
|
|
1114
|
+
];
|
|
1115
|
+
const modelMessages3 = AIV5__namespace.convertToModelMessages(this.sanitizeV5UIMessages(stepUiMessages3));
|
|
1116
|
+
return modelMessages3.flatMap(this.response.aiV5.stepContent);
|
|
1117
|
+
}
|
|
1118
|
+
const totalSteps = stepBoundaries.length + 1;
|
|
1119
|
+
if (totalSteps === 1 && !hasStepStart) {
|
|
1120
|
+
const stepUiMessages3 = [
|
|
1121
|
+
{
|
|
1122
|
+
id: "last-step",
|
|
1123
|
+
role: "assistant",
|
|
1124
|
+
parts: uiMessagesParts
|
|
1125
|
+
}
|
|
1126
|
+
];
|
|
1127
|
+
const modelMessages3 = AIV5__namespace.convertToModelMessages(this.sanitizeV5UIMessages(stepUiMessages3));
|
|
1128
|
+
return modelMessages3.flatMap(this.response.aiV5.stepContent);
|
|
1129
|
+
}
|
|
1130
|
+
const lastStepStart = stepBoundaries[stepBoundaries.length - 1];
|
|
1131
|
+
if (lastStepStart === void 0) {
|
|
1132
|
+
return [];
|
|
1133
|
+
}
|
|
1134
|
+
const stepParts2 = uiMessagesParts.slice(lastStepStart + 1);
|
|
1135
|
+
if (stepParts2.length === 0) {
|
|
1136
|
+
return [];
|
|
1137
|
+
}
|
|
1138
|
+
const stepUiMessages2 = [
|
|
1139
|
+
{
|
|
1140
|
+
id: "last-step",
|
|
1141
|
+
role: "assistant",
|
|
1142
|
+
parts: stepParts2
|
|
1143
|
+
}
|
|
1144
|
+
];
|
|
1145
|
+
const modelMessages2 = AIV5__namespace.convertToModelMessages(this.sanitizeV5UIMessages(stepUiMessages2));
|
|
1146
|
+
return modelMessages2.flatMap(this.response.aiV5.stepContent);
|
|
1147
|
+
}
|
|
1148
|
+
if (stepNumber === 1) {
|
|
1149
|
+
const firstStepStart = stepBoundaries[0] ?? uiMessagesParts.length;
|
|
1150
|
+
if (firstStepStart === 0) {
|
|
1151
|
+
return [];
|
|
1152
|
+
}
|
|
1153
|
+
const stepParts2 = uiMessagesParts.slice(0, firstStepStart);
|
|
1154
|
+
const stepUiMessages2 = [
|
|
1155
|
+
{
|
|
1156
|
+
id: "step-1",
|
|
1157
|
+
role: "assistant",
|
|
1158
|
+
parts: stepParts2
|
|
1159
|
+
}
|
|
1160
|
+
];
|
|
1161
|
+
const modelMessages2 = AIV5__namespace.convertToModelMessages(this.sanitizeV5UIMessages(stepUiMessages2));
|
|
1162
|
+
return modelMessages2.flatMap(this.response.aiV5.stepContent);
|
|
1163
|
+
}
|
|
1164
|
+
const stepIndex = stepNumber - 2;
|
|
1165
|
+
if (stepIndex < 0 || stepIndex >= stepBoundaries.length) {
|
|
1166
|
+
return [];
|
|
1167
|
+
}
|
|
1168
|
+
const startIndex = (stepBoundaries[stepIndex] ?? 0) + 1;
|
|
1169
|
+
const endIndex = stepBoundaries[stepIndex + 1] ?? uiMessagesParts.length;
|
|
1170
|
+
if (startIndex >= endIndex) {
|
|
1171
|
+
return [];
|
|
1172
|
+
}
|
|
1173
|
+
const stepParts = uiMessagesParts.slice(startIndex, endIndex);
|
|
1174
|
+
const stepUiMessages = [
|
|
1175
|
+
{
|
|
1176
|
+
id: `step-${stepNumber}`,
|
|
1177
|
+
role: "assistant",
|
|
1178
|
+
parts: stepParts
|
|
1179
|
+
}
|
|
1180
|
+
];
|
|
1181
|
+
const modelMessages = AIV5__namespace.convertToModelMessages(this.sanitizeV5UIMessages(stepUiMessages));
|
|
1182
|
+
return modelMessages.flatMap(this.response.aiV5.stepContent);
|
|
1183
|
+
}
|
|
1086
1184
|
return this.response.aiV5.model().map(this.response.aiV5.stepContent).flat();
|
|
1087
1185
|
},
|
|
1088
1186
|
stepContent: (message) => {
|
|
@@ -2884,5 +2982,5 @@ exports.DefaultGeneratedFile = DefaultGeneratedFile;
|
|
|
2884
2982
|
exports.DefaultGeneratedFileWithType = DefaultGeneratedFileWithType;
|
|
2885
2983
|
exports.MessageList = MessageList;
|
|
2886
2984
|
exports.convertMessages = convertMessages;
|
|
2887
|
-
//# sourceMappingURL=chunk-
|
|
2888
|
-
//# sourceMappingURL=chunk-
|
|
2985
|
+
//# sourceMappingURL=chunk-MRZHPP3G.cjs.map
|
|
2986
|
+
//# sourceMappingURL=chunk-MRZHPP3G.cjs.map
|