@mastra/core 0.16.4-alpha.2 → 0.17.0-alpha.4
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 +55 -0
- package/dist/agent/agent.d.ts +17 -2
- 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 +15 -2
- 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/span_processors/sensitive-data-filter.d.ts +7 -1
- package/dist/ai-tracing/span_processors/sensitive-data-filter.d.ts.map +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/bundler/index.cjs +2 -2
- package/dist/bundler/index.d.ts +8 -2
- package/dist/bundler/index.d.ts.map +1 -1
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-AWILTHBM.js → chunk-2PQSZI63.js} +3 -3
- package/dist/{chunk-AWILTHBM.js.map → chunk-2PQSZI63.js.map} +1 -1
- package/dist/{chunk-4VP3M5T7.js → chunk-4OT7CXAS.js} +17 -4
- package/dist/chunk-4OT7CXAS.js.map +1 -0
- package/dist/{chunk-O5GOFG6A.js → chunk-4VHC2F5H.js} +10 -8
- package/dist/chunk-4VHC2F5H.js.map +1 -0
- package/dist/{chunk-VVH4BOE4.cjs → chunk-6MDSS7WL.cjs} +4 -4
- package/dist/{chunk-VVH4BOE4.cjs.map → chunk-6MDSS7WL.cjs.map} +1 -1
- package/dist/{chunk-YLR7PB3B.cjs → chunk-BGAJ72HJ.cjs} +104 -86
- package/dist/chunk-BGAJ72HJ.cjs.map +1 -0
- package/dist/{chunk-YYZT5JKX.js → chunk-BY37WSX5.js} +5 -5
- package/dist/{chunk-YYZT5JKX.js.map → chunk-BY37WSX5.js.map} +1 -1
- package/dist/{chunk-ERRIEUC2.cjs → chunk-CP4TZ4HO.cjs} +129 -48
- package/dist/chunk-CP4TZ4HO.cjs.map +1 -0
- package/dist/{chunk-W4GRW6AV.cjs → chunk-F3XF7MEZ.cjs} +12 -12
- package/dist/{chunk-W4GRW6AV.cjs.map → chunk-F3XF7MEZ.cjs.map} +1 -1
- package/dist/{chunk-PY4MHJTE.js → chunk-G366B5BY.js} +2 -2
- package/dist/chunk-G366B5BY.js.map +1 -0
- package/dist/{chunk-GJKL73EJ.cjs → chunk-HBQSSMAD.cjs} +13 -11
- package/dist/chunk-HBQSSMAD.cjs.map +1 -0
- package/dist/{chunk-UIFZI5XX.cjs → chunk-HZGYVRVN.cjs} +21 -8
- package/dist/chunk-HZGYVRVN.cjs.map +1 -0
- package/dist/{chunk-DUUXEPE5.cjs → chunk-MRZHPP3G.cjs} +103 -5
- package/dist/chunk-MRZHPP3G.cjs.map +1 -0
- package/dist/{chunk-ODLGLX2R.js → chunk-PL3B3FZM.js} +129 -49
- package/dist/chunk-PL3B3FZM.js.map +1 -0
- package/dist/{chunk-LVVAUDVQ.cjs → chunk-QHDT3QQC.cjs} +2 -2
- package/dist/chunk-QHDT3QQC.cjs.map +1 -0
- package/dist/chunk-QPOJZU26.cjs +14 -0
- package/dist/{chunk-ELKY3FEM.cjs.map → chunk-QPOJZU26.cjs.map} +1 -1
- package/dist/{chunk-VH3RNDZA.cjs → chunk-RNJ4GD7U.cjs} +6 -6
- package/dist/{chunk-VH3RNDZA.cjs.map → chunk-RNJ4GD7U.cjs.map} +1 -1
- package/dist/{chunk-ES5UWPHJ.js → chunk-TUXCO343.js} +17 -6
- package/dist/chunk-TUXCO343.js.map +1 -0
- package/dist/{chunk-CF3TI576.js → chunk-UWUM3F3X.js} +84 -66
- package/dist/chunk-UWUM3F3X.js.map +1 -0
- package/dist/{chunk-BVE3UPHV.js → chunk-VXJFKEON.js} +4 -4
- package/dist/{chunk-BVE3UPHV.js.map → chunk-VXJFKEON.js.map} +1 -1
- package/dist/{chunk-FTDM75SW.cjs → chunk-X3MOJJYH.cjs} +20 -9
- package/dist/chunk-X3MOJJYH.cjs.map +1 -0
- package/dist/{chunk-LVKX346H.js → chunk-XKVDOO2O.js} +3 -3
- package/dist/{chunk-LVKX346H.js.map → chunk-XKVDOO2O.js.map} +1 -1
- package/dist/{chunk-ZDMAOD35.js → chunk-XRJDA7BI.js} +102 -4
- package/dist/chunk-XRJDA7BI.js.map +1 -0
- package/dist/deployer/index.cjs +2 -2
- package/dist/deployer/index.js +1 -1
- package/dist/index.cjs +40 -40
- package/dist/index.js +8 -8
- 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 +6 -4
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/model.loop.types.d.ts +1 -1
- package/dist/llm/model/model.loop.types.d.ts.map +1 -1
- package/dist/llm/model/shared.types.d.ts +5 -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/loop.d.ts +1 -1
- package/dist/loop/loop.d.ts.map +1 -1
- package/dist/loop/test-utils/fullStream.d.ts.map +1 -1
- package/dist/loop/test-utils/generateText.d.ts.map +1 -1
- package/dist/loop/test-utils/options.d.ts.map +1 -1
- package/dist/loop/test-utils/resultObject.d.ts.map +1 -1
- package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
- package/dist/loop/test-utils/textStream.d.ts.map +1 -1
- package/dist/loop/test-utils/tools.d.ts.map +1 -1
- package/dist/loop/test-utils/utils.d.ts +4 -3
- package/dist/loop/test-utils/utils.d.ts.map +1 -1
- package/dist/loop/types.d.ts +2 -2
- package/dist/loop/types.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/server/types.d.ts +7 -0
- package/dist/server/types.d.ts.map +1 -1
- package/dist/storage/index.cjs +3 -3
- package/dist/storage/index.js +1 -1
- package/dist/stream/aisdk/v5/execute.d.ts +2 -1
- package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output-helpers.d.ts +1 -5
- package/dist/stream/aisdk/v5/output-helpers.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output.d.ts +2 -10
- package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
- package/dist/stream/base/output-format-handlers.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts +1 -5
- 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 +8 -2
- 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 +7 -6
- package/dist/chunk-4VP3M5T7.js.map +0 -1
- package/dist/chunk-CF3TI576.js.map +0 -1
- package/dist/chunk-DUUXEPE5.cjs.map +0 -1
- package/dist/chunk-ELKY3FEM.cjs +0 -14
- package/dist/chunk-ERRIEUC2.cjs.map +0 -1
- package/dist/chunk-ES5UWPHJ.js.map +0 -1
- package/dist/chunk-FTDM75SW.cjs.map +0 -1
- package/dist/chunk-GJKL73EJ.cjs.map +0 -1
- package/dist/chunk-LVVAUDVQ.cjs.map +0 -1
- package/dist/chunk-O5GOFG6A.js.map +0 -1
- package/dist/chunk-ODLGLX2R.js.map +0 -1
- package/dist/chunk-PY4MHJTE.js.map +0 -1
- package/dist/chunk-UIFZI5XX.cjs.map +0 -1
- package/dist/chunk-YLR7PB3B.cjs.map +0 -1
- package/dist/chunk-ZDMAOD35.js.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
|