@mastra/core 1.5.0 → 1.6.0
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 +386 -0
- package/dist/agent/index.cjs +13 -13
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/adapters/AIV5Adapter.d.ts.map +1 -1
- package/dist/agent/message-list/conversion/output-converter.d.ts.map +1 -1
- package/dist/agent/message-list/index.cjs +18 -18
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +7 -7
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts +7 -7
- package/dist/agent/workflows/prepare-stream/schema.d.ts +11 -11
- package/dist/{chunk-CQ4Z6ZAV.cjs → chunk-3U3XFMGJ.cjs} +7 -7
- package/dist/{chunk-CQ4Z6ZAV.cjs.map → chunk-3U3XFMGJ.cjs.map} +1 -1
- package/dist/{chunk-D57U4II4.js → chunk-4WG5K4CK.js} +9 -8
- package/dist/chunk-4WG5K4CK.js.map +1 -0
- package/dist/{chunk-UZFGMMKU.js → chunk-5K45E5VE.js} +37 -3
- package/dist/chunk-5K45E5VE.js.map +1 -0
- package/dist/{chunk-OQ5LZ6OV.cjs → chunk-5VQPSWPG.cjs} +149 -61
- package/dist/chunk-5VQPSWPG.cjs.map +1 -0
- package/dist/{chunk-AIRMLZ43.js → chunk-7EXW4AAG.js} +4 -4
- package/dist/{chunk-AIRMLZ43.js.map → chunk-7EXW4AAG.js.map} +1 -1
- package/dist/{chunk-S4VVZI4E.cjs → chunk-AYHSPIT6.cjs} +326 -5
- package/dist/chunk-AYHSPIT6.cjs.map +1 -0
- package/dist/{chunk-YW54RH77.cjs → chunk-DB7U2C5B.cjs} +12 -5
- package/dist/chunk-DB7U2C5B.cjs.map +1 -0
- package/dist/{chunk-DST75PA4.js → chunk-DGS2KGDI.js} +4 -4
- package/dist/{chunk-DST75PA4.js.map → chunk-DGS2KGDI.js.map} +1 -1
- package/dist/{chunk-YIN5F7VO.js → chunk-EEU5NHHU.js} +4254 -3958
- package/dist/chunk-EEU5NHHU.js.map +1 -0
- package/dist/{chunk-A6EWCOGA.cjs → chunk-H5S4PS44.cjs} +197 -27
- package/dist/chunk-H5S4PS44.cjs.map +1 -0
- package/dist/{chunk-3YMDR4OL.cjs → chunk-HTAUP7ER.cjs} +4 -4
- package/dist/{chunk-3YMDR4OL.cjs.map → chunk-HTAUP7ER.cjs.map} +1 -1
- package/dist/{chunk-OHLVZVIK.js → chunk-IC5OUWKJ.js} +12 -5
- package/dist/chunk-IC5OUWKJ.js.map +1 -0
- package/dist/{chunk-MZIMV2BB.js → chunk-IHDE4CJV.js} +244 -213
- package/dist/chunk-IHDE4CJV.js.map +1 -0
- package/dist/{chunk-3KJW4EMO.js → chunk-IHEYJDJP.js} +3 -3
- package/dist/{chunk-3KJW4EMO.js.map → chunk-IHEYJDJP.js.map} +1 -1
- package/dist/{chunk-CXVMDV2B.js → chunk-IOY7Y5GV.js} +197 -27
- package/dist/chunk-IOY7Y5GV.js.map +1 -0
- package/dist/{chunk-MDC6VYA6.cjs → chunk-KAVAKMOQ.cjs} +4 -8
- package/dist/chunk-KAVAKMOQ.cjs.map +1 -0
- package/dist/{chunk-7WC7ALDW.cjs → chunk-LNKS4TJ6.cjs} +6 -6
- package/dist/{chunk-7WC7ALDW.cjs.map → chunk-LNKS4TJ6.cjs.map} +1 -1
- package/dist/{chunk-R3364RAL.js → chunk-MWGGSA5Q.js} +4 -4
- package/dist/{chunk-R3364RAL.js.map → chunk-MWGGSA5Q.js.map} +1 -1
- package/dist/{chunk-QSN5KQXZ.cjs → chunk-O7PZ4VOO.cjs} +11 -11
- package/dist/{chunk-QSN5KQXZ.cjs.map → chunk-O7PZ4VOO.cjs.map} +1 -1
- package/dist/chunk-OQDRPRKM.cjs +46 -0
- package/dist/chunk-OQDRPRKM.cjs.map +1 -0
- package/dist/{chunk-YV2YGQRY.js → chunk-RHKNKJNM.js} +101 -13
- package/dist/chunk-RHKNKJNM.js.map +1 -0
- package/dist/{chunk-TPDMP7OD.js → chunk-RHYZ6CQN.js} +4 -8
- package/dist/chunk-RHYZ6CQN.js.map +1 -0
- package/dist/{chunk-G5JVVFIG.cjs → chunk-RZNHRIM7.cjs} +9 -9
- package/dist/{chunk-G5JVVFIG.cjs.map → chunk-RZNHRIM7.cjs.map} +1 -1
- package/dist/{chunk-JZ6TH4HQ.cjs → chunk-TL2TTA4X.cjs} +4260 -3962
- package/dist/chunk-TL2TTA4X.cjs.map +1 -0
- package/dist/{chunk-KNXZ7KYL.cjs → chunk-TVPANHLE.cjs} +40 -2
- package/dist/chunk-TVPANHLE.cjs.map +1 -0
- package/dist/{chunk-7S6LA43E.cjs → chunk-VJWRJWSC.cjs} +278 -248
- package/dist/chunk-VJWRJWSC.cjs.map +1 -0
- package/dist/chunk-X2HAI3OX.js +39 -0
- package/dist/chunk-X2HAI3OX.js.map +1 -0
- package/dist/{chunk-FZ5DRHKE.js → chunk-XB3DA67Q.js} +325 -5
- package/dist/chunk-XB3DA67Q.js.map +1 -0
- package/dist/{chunk-NUV3BLRH.cjs → chunk-XWZAKKFT.cjs} +17 -16
- package/dist/chunk-XWZAKKFT.cjs.map +1 -0
- package/dist/{chunk-4GB2GS4S.js → chunk-YM6245EM.js} +5 -5
- package/dist/{chunk-4GB2GS4S.js.map → chunk-YM6245EM.js.map} +1 -1
- package/dist/datasets/index.cjs +17 -17
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +2 -1
- package/dist/docs/assets/SOURCE_MAP.json +417 -391
- package/dist/docs/references/docs-memory-observational-memory.md +2 -0
- package/dist/docs/references/docs-streaming-tool-streaming.md +6 -0
- package/dist/docs/references/docs-workspace-filesystem.md +21 -1
- package/dist/docs/references/reference-harness-harness-class.md +645 -0
- package/dist/docs/references/reference-memory-memory-class.md +1 -1
- package/dist/docs/references/reference-memory-observational-memory.md +1 -0
- package/dist/docs/references/reference-workspace-local-filesystem.md +25 -0
- package/dist/docs/references/reference-workspace-workspace-class.md +1 -24
- package/dist/docs/references/reference.md +1 -0
- package/dist/editor/types.d.ts +20 -1
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/evals/base.d.ts.map +1 -1
- package/dist/evals/index.cjs +20 -20
- package/dist/evals/index.js +3 -3
- package/dist/evals/scoreTraces/index.cjs +5 -5
- package/dist/evals/scoreTraces/index.js +2 -2
- package/dist/events/index.cjs +6 -2
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +1 -1
- package/dist/harness/harness.d.ts +105 -35
- package/dist/harness/harness.d.ts.map +1 -1
- package/dist/harness/index.cjs +472 -64
- package/dist/harness/index.cjs.map +1 -1
- package/dist/harness/index.d.ts +2 -1
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +468 -62
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/tools.d.ts +38 -0
- package/dist/harness/tools.d.ts.map +1 -1
- package/dist/harness/types.d.ts +64 -9
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +12 -12
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/gateways/models-dev.d.ts.map +1 -1
- package/dist/loop/index.cjs +12 -12
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts +6 -6
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/test-utils/options.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +21 -21
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +14 -14
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +7 -7
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +21 -21
- package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
- package/dist/loop/workflows/schema.d.ts +30 -30
- package/dist/loop/workflows/stream.d.ts +0 -13
- package/dist/loop/workflows/stream.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +14 -14
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-6P4CM74H.js +3 -0
- package/dist/{models-dev-MDI5E2YA.js.map → models-dev-6P4CM74H.js.map} +1 -1
- package/dist/models-dev-CLLSNT5L.cjs +12 -0
- package/dist/{models-dev-BW2GAM3K.cjs.map → models-dev-CLLSNT5L.cjs.map} +1 -1
- package/dist/processor-provider/index.cjs +256 -0
- package/dist/processor-provider/index.cjs.map +1 -0
- package/dist/processor-provider/index.d.ts +5 -0
- package/dist/processor-provider/index.d.ts.map +1 -0
- package/dist/processor-provider/index.js +243 -0
- package/dist/processor-provider/index.js.map +1 -0
- package/dist/processor-provider/phase-filtered-processor.d.ts +22 -0
- package/dist/processor-provider/phase-filtered-processor.d.ts.map +1 -0
- package/dist/processor-provider/providers/index.d.ts +12 -0
- package/dist/processor-provider/providers/index.d.ts.map +1 -0
- package/dist/processor-provider/types.d.ts +65 -0
- package/dist/processor-provider/types.d.ts.map +1 -0
- package/dist/processors/index.cjs +41 -41
- package/dist/processors/index.js +1 -1
- package/dist/processors/memory/message-history.d.ts.map +1 -1
- package/dist/processors/step-schema.d.ts +14 -14
- package/dist/provider-registry-HMTFO5FV.cjs +40 -0
- package/dist/{provider-registry-4PH2JPIA.cjs.map → provider-registry-HMTFO5FV.cjs.map} +1 -1
- package/dist/provider-registry-TTZ2WN2P.js +3 -0
- package/dist/{provider-registry-VEJ3PN4S.js.map → provider-registry-TTZ2WN2P.js.map} +1 -1
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/storage/base.d.ts +2 -1
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/constants.cjs +68 -52
- package/dist/storage/constants.d.ts +6 -2
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/index.d.ts +1 -0
- package/dist/storage/domains/index.d.ts.map +1 -1
- package/dist/storage/domains/inmemory-db.d.ts +4 -1
- package/dist/storage/domains/inmemory-db.d.ts.map +1 -1
- package/dist/storage/domains/mcp-servers/base.d.ts +47 -0
- package/dist/storage/domains/mcp-servers/base.d.ts.map +1 -0
- package/dist/storage/domains/mcp-servers/index.d.ts +3 -0
- package/dist/storage/domains/mcp-servers/index.d.ts.map +1 -0
- package/dist/storage/domains/mcp-servers/inmemory.d.ts +31 -0
- package/dist/storage/domains/mcp-servers/inmemory.d.ts.map +1 -0
- package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/types.d.ts +44 -44
- package/dist/storage/domains/operations/inmemory.d.ts.map +1 -1
- package/dist/storage/index.cjs +178 -154
- package/dist/storage/index.js +2 -2
- package/dist/storage/mock.d.ts.map +1 -1
- package/dist/storage/types.d.ts +220 -6
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts +1 -1
- package/dist/stream/MastraWorkflowStream.d.ts +1 -1
- package/dist/stream/aisdk/v5/input.d.ts.map +1 -1
- package/dist/stream/base/input.d.ts +19 -0
- package/dist/stream/base/input.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +11 -11
- package/dist/stream/index.js +2 -2
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/vector/index.cjs +9 -9
- package/dist/vector/index.js +2 -2
- 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/step-executor.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
- package/dist/workflows/index.cjs +25 -25
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/step.d.ts.map +1 -1
- package/dist/workspace/constants/index.d.ts +1 -0
- package/dist/workspace/constants/index.d.ts.map +1 -1
- package/dist/workspace/index.cjs +64 -64
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/tools/ast-edit.d.ts +97 -0
- package/dist/workspace/tools/ast-edit.d.ts.map +1 -0
- package/dist/workspace/tools/search.d.ts +1 -1
- package/dist/workspace/tools/tools.d.ts.map +1 -1
- package/package.json +12 -11
- package/processor-provider.d.ts +1 -0
- package/dist/chunk-4D4KB75Y.cjs +0 -9
- package/dist/chunk-4D4KB75Y.cjs.map +0 -1
- package/dist/chunk-7S6LA43E.cjs.map +0 -1
- package/dist/chunk-A6EWCOGA.cjs.map +0 -1
- package/dist/chunk-BVUMKER5.js +0 -7
- package/dist/chunk-BVUMKER5.js.map +0 -1
- package/dist/chunk-CXVMDV2B.js.map +0 -1
- package/dist/chunk-D57U4II4.js.map +0 -1
- package/dist/chunk-FZ5DRHKE.js.map +0 -1
- package/dist/chunk-JZ6TH4HQ.cjs.map +0 -1
- package/dist/chunk-KNXZ7KYL.cjs.map +0 -1
- package/dist/chunk-MDC6VYA6.cjs.map +0 -1
- package/dist/chunk-MZIMV2BB.js.map +0 -1
- package/dist/chunk-NUV3BLRH.cjs.map +0 -1
- package/dist/chunk-OHLVZVIK.js.map +0 -1
- package/dist/chunk-OQ5LZ6OV.cjs.map +0 -1
- package/dist/chunk-S4VVZI4E.cjs.map +0 -1
- package/dist/chunk-TPDMP7OD.js.map +0 -1
- package/dist/chunk-UZFGMMKU.js.map +0 -1
- package/dist/chunk-YIN5F7VO.js.map +0 -1
- package/dist/chunk-YV2YGQRY.js.map +0 -1
- package/dist/chunk-YW54RH77.cjs.map +0 -1
- package/dist/models-dev-BW2GAM3K.cjs +0 -12
- package/dist/models-dev-MDI5E2YA.js +0 -3
- package/dist/provider-registry-4PH2JPIA.cjs +0 -40
- package/dist/provider-registry-VEJ3PN4S.js +0 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVJWRJWSC_cjs = require('./chunk-VJWRJWSC.cjs');
|
|
4
4
|
var chunkZCBG4ZQT_cjs = require('./chunk-ZCBG4ZQT.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkTL2TTA4X_cjs = require('./chunk-TL2TTA4X.cjs');
|
|
6
|
+
var chunkDB7U2C5B_cjs = require('./chunk-DB7U2C5B.cjs');
|
|
7
7
|
var chunkKJBMTK5B_cjs = require('./chunk-KJBMTK5B.cjs');
|
|
8
8
|
var chunkEAZ6YDCQ_cjs = require('./chunk-EAZ6YDCQ.cjs');
|
|
9
9
|
var chunkVDKWYUGC_cjs = require('./chunk-VDKWYUGC.cjs');
|
|
@@ -58,7 +58,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
58
58
|
let suspended;
|
|
59
59
|
let bailed;
|
|
60
60
|
const startedAt = Date.now();
|
|
61
|
-
const { inputData, validationError } = await
|
|
61
|
+
const { inputData, validationError } = await chunkVJWRJWSC_cjs.validateStepInput({
|
|
62
62
|
prevOutput: typeof params.foreachIdx === "number" ? params.input?.[params.foreachIdx] : params.input,
|
|
63
63
|
step,
|
|
64
64
|
validateInputs: params.validateInputs ?? true
|
|
@@ -81,6 +81,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
81
81
|
const { __workflow_meta, ...userSuspendData } = suspendDataToUse;
|
|
82
82
|
suspendDataToUse = userSuspendData;
|
|
83
83
|
}
|
|
84
|
+
let stateUpdate;
|
|
84
85
|
try {
|
|
85
86
|
if (validationError) {
|
|
86
87
|
throw validationError;
|
|
@@ -88,7 +89,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
88
89
|
const callId = crypto.randomUUID();
|
|
89
90
|
const outputWriter = this.createOutputWriter(runId);
|
|
90
91
|
const stepOutput = await step.execute(
|
|
91
|
-
|
|
92
|
+
chunkVJWRJWSC_cjs.createDeprecationProxy(
|
|
92
93
|
{
|
|
93
94
|
workflowId: params.workflowId,
|
|
94
95
|
runId,
|
|
@@ -97,15 +98,15 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
97
98
|
inputData,
|
|
98
99
|
state: params.state,
|
|
99
100
|
setState: async (newState) => {
|
|
100
|
-
|
|
101
|
+
stateUpdate = { ...stateUpdate ?? params.state, ...newState };
|
|
101
102
|
},
|
|
102
103
|
retryCount,
|
|
103
104
|
resumeData: params.resumeData,
|
|
104
105
|
suspendData: suspendDataToUse,
|
|
105
106
|
getInitData: () => stepResults?.input,
|
|
106
|
-
getStepResult:
|
|
107
|
+
getStepResult: chunkVJWRJWSC_cjs.getStepResult.bind(this, stepResults),
|
|
107
108
|
suspend: async (suspendPayload, suspendOptions) => {
|
|
108
|
-
const { suspendData, validationError: validationError2 } = await
|
|
109
|
+
const { suspendData, validationError: validationError2 } = await chunkVJWRJWSC_cjs.validateStepSuspendData({
|
|
109
110
|
suspendData: suspendPayload,
|
|
110
111
|
step,
|
|
111
112
|
validateInputs: params.validateInputs ?? true
|
|
@@ -160,7 +161,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
160
161
|
},
|
|
161
162
|
{
|
|
162
163
|
paramName: "runCount",
|
|
163
|
-
deprecationMessage:
|
|
164
|
+
deprecationMessage: chunkVJWRJWSC_cjs.runCountDeprecationMessage,
|
|
164
165
|
logger: this.logger
|
|
165
166
|
}
|
|
166
167
|
)
|
|
@@ -168,6 +169,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
168
169
|
const isNestedWorkflowStep = step.component === "WORKFLOW";
|
|
169
170
|
const nestedWflowStepPaused = isNestedWorkflowStep && perStep;
|
|
170
171
|
const endedAt = Date.now();
|
|
172
|
+
const finalState = stateUpdate ?? params.state;
|
|
171
173
|
let finalResult;
|
|
172
174
|
if (suspended) {
|
|
173
175
|
finalResult = {
|
|
@@ -175,7 +177,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
175
177
|
status: "suspended",
|
|
176
178
|
suspendedAt: endedAt,
|
|
177
179
|
...stepOutput ? { suspendOutput: stepOutput } : {},
|
|
178
|
-
__state:
|
|
180
|
+
__state: finalState
|
|
179
181
|
};
|
|
180
182
|
if (suspended.payload) {
|
|
181
183
|
finalResult.suspendPayload = suspended.payload;
|
|
@@ -187,13 +189,13 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
187
189
|
status: "bailed",
|
|
188
190
|
endedAt,
|
|
189
191
|
output: bailed.payload,
|
|
190
|
-
__state:
|
|
192
|
+
__state: finalState
|
|
191
193
|
};
|
|
192
194
|
} else if (nestedWflowStepPaused) {
|
|
193
195
|
finalResult = {
|
|
194
196
|
...stepInfo,
|
|
195
197
|
status: "paused",
|
|
196
|
-
__state:
|
|
198
|
+
__state: finalState
|
|
197
199
|
};
|
|
198
200
|
} else {
|
|
199
201
|
finalResult = {
|
|
@@ -201,7 +203,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
201
203
|
status: "success",
|
|
202
204
|
endedAt,
|
|
203
205
|
output: stepOutput,
|
|
204
|
-
__state:
|
|
206
|
+
__state: finalState
|
|
205
207
|
};
|
|
206
208
|
}
|
|
207
209
|
return finalResult;
|
|
@@ -231,7 +233,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
231
233
|
// Preserve TripWire data as plain object for proper serialization
|
|
232
234
|
// Important: Check `error` not `errorInstance` because getErrorFromUnknown
|
|
233
235
|
// converts the error and loses the prototype chain
|
|
234
|
-
tripwire: error instanceof
|
|
236
|
+
tripwire: error instanceof chunkVJWRJWSC_cjs.TripWire ? {
|
|
235
237
|
reason: error.message,
|
|
236
238
|
retry: error.options?.retry,
|
|
237
239
|
metadata: error.options?.metadata,
|
|
@@ -289,7 +291,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
289
291
|
const callId = crypto.randomUUID();
|
|
290
292
|
const outputWriter = this.createOutputWriter(runId);
|
|
291
293
|
return condition(
|
|
292
|
-
|
|
294
|
+
chunkVJWRJWSC_cjs.createDeprecationProxy(
|
|
293
295
|
{
|
|
294
296
|
workflowId,
|
|
295
297
|
runId,
|
|
@@ -300,7 +302,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
300
302
|
retryCount,
|
|
301
303
|
resumeData,
|
|
302
304
|
getInitData: () => stepResults?.input,
|
|
303
|
-
getStepResult:
|
|
305
|
+
getStepResult: chunkVJWRJWSC_cjs.getStepResult.bind(this, stepResults),
|
|
304
306
|
bail: (_result) => {
|
|
305
307
|
throw new Error("Not implemented");
|
|
306
308
|
},
|
|
@@ -327,7 +329,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
327
329
|
},
|
|
328
330
|
{
|
|
329
331
|
paramName: "runCount",
|
|
330
|
-
deprecationMessage:
|
|
332
|
+
deprecationMessage: chunkVJWRJWSC_cjs.runCountDeprecationMessage,
|
|
331
333
|
logger: this.logger
|
|
332
334
|
}
|
|
333
335
|
)
|
|
@@ -347,7 +349,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
347
349
|
const callId = crypto.randomUUID();
|
|
348
350
|
const outputWriter = this.createOutputWriter(runId);
|
|
349
351
|
return await step.fn(
|
|
350
|
-
|
|
352
|
+
chunkVJWRJWSC_cjs.createDeprecationProxy(
|
|
351
353
|
{
|
|
352
354
|
workflowId: params.workflowId,
|
|
353
355
|
runId,
|
|
@@ -361,7 +363,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
361
363
|
retryCount,
|
|
362
364
|
resumeData: params.resumeData,
|
|
363
365
|
getInitData: () => stepResults?.input,
|
|
364
|
-
getStepResult:
|
|
366
|
+
getStepResult: chunkVJWRJWSC_cjs.getStepResult.bind(this, stepResults),
|
|
365
367
|
suspend: async (_suspendPayload) => {
|
|
366
368
|
throw new Error("Not implemented");
|
|
367
369
|
},
|
|
@@ -390,7 +392,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
390
392
|
},
|
|
391
393
|
{
|
|
392
394
|
paramName: "runCount",
|
|
393
|
-
deprecationMessage:
|
|
395
|
+
deprecationMessage: chunkVJWRJWSC_cjs.runCountDeprecationMessage,
|
|
394
396
|
logger: this.logger
|
|
395
397
|
}
|
|
396
398
|
)
|
|
@@ -414,7 +416,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
414
416
|
const callId = crypto.randomUUID();
|
|
415
417
|
const outputWriter = this.createOutputWriter(runId);
|
|
416
418
|
const result = await step.fn(
|
|
417
|
-
|
|
419
|
+
chunkVJWRJWSC_cjs.createDeprecationProxy(
|
|
418
420
|
{
|
|
419
421
|
workflowId: params.workflowId,
|
|
420
422
|
runId,
|
|
@@ -428,7 +430,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
428
430
|
retryCount,
|
|
429
431
|
resumeData: params.resumeData,
|
|
430
432
|
getInitData: () => stepResults?.input,
|
|
431
|
-
getStepResult:
|
|
433
|
+
getStepResult: chunkVJWRJWSC_cjs.getStepResult.bind(this, stepResults),
|
|
432
434
|
suspend: async (_suspendPayload) => {
|
|
433
435
|
throw new Error("Not implemented");
|
|
434
436
|
},
|
|
@@ -457,7 +459,7 @@ var StepExecutor = class extends chunkRO47SMI7_cjs.MastraBase {
|
|
|
457
459
|
},
|
|
458
460
|
{
|
|
459
461
|
paramName: "runCount",
|
|
460
|
-
deprecationMessage:
|
|
462
|
+
deprecationMessage: chunkVJWRJWSC_cjs.runCountDeprecationMessage,
|
|
461
463
|
logger: this.logger
|
|
462
464
|
}
|
|
463
465
|
)
|
|
@@ -476,7 +478,7 @@ function isTripwireChunk(chunk) {
|
|
|
476
478
|
}
|
|
477
479
|
function createTripWireFromChunk(chunk) {
|
|
478
480
|
const { payload } = chunk;
|
|
479
|
-
return new
|
|
481
|
+
return new chunkVJWRJWSC_cjs.TripWire(
|
|
480
482
|
payload.reason || "Agent tripwire triggered",
|
|
481
483
|
{
|
|
482
484
|
retry: payload.retry,
|
|
@@ -777,7 +779,7 @@ async function processWorkflowForEach({
|
|
|
777
779
|
const workflowsStore2 = await mastra.getStorage()?.getStore("workflows");
|
|
778
780
|
const updatedOutput = [...currentResult.output];
|
|
779
781
|
for (const suspIdx of indicesToResume) {
|
|
780
|
-
updatedOutput[suspIdx] =
|
|
782
|
+
updatedOutput[suspIdx] = chunkTL2TTA4X_cjs.createPendingMarker();
|
|
781
783
|
}
|
|
782
784
|
await workflowsStore2?.updateWorkflowResults({
|
|
783
785
|
workflowName: workflowId,
|
|
@@ -1939,7 +1941,91 @@ var WorkflowEventProcessor = class extends EventProcessor {
|
|
|
1939
1941
|
activeSteps[step.step.id] = true;
|
|
1940
1942
|
const workflowsStore = await this.mastra?.getStorage()?.getStore("workflows");
|
|
1941
1943
|
if (step.step instanceof EventedWorkflow || step.step.component === "WORKFLOW") {
|
|
1942
|
-
if (resumeSteps?.length
|
|
1944
|
+
if (resumeSteps?.length === 1 && resumeSteps[0] === step.step.id) {
|
|
1945
|
+
const stepData = stepResults[step.step.id];
|
|
1946
|
+
const nestedRunId = stepData?.suspendPayload?.__workflow_meta?.runId;
|
|
1947
|
+
if (!nestedRunId) {
|
|
1948
|
+
return this.errorWorkflow(
|
|
1949
|
+
{
|
|
1950
|
+
workflowId,
|
|
1951
|
+
runId,
|
|
1952
|
+
executionPath,
|
|
1953
|
+
stepResults,
|
|
1954
|
+
activeSteps,
|
|
1955
|
+
resumeSteps,
|
|
1956
|
+
prevResult,
|
|
1957
|
+
resumeData,
|
|
1958
|
+
parentWorkflow,
|
|
1959
|
+
requestContext
|
|
1960
|
+
},
|
|
1961
|
+
new chunk4U7ZLI36_cjs.MastraError({
|
|
1962
|
+
id: "MASTRA_WORKFLOW",
|
|
1963
|
+
text: `Nested workflow run id not found for auto-detection: ${JSON.stringify(stepResults)}`,
|
|
1964
|
+
domain: "MASTRA_WORKFLOW" /* MASTRA_WORKFLOW */,
|
|
1965
|
+
category: "SYSTEM" /* SYSTEM */
|
|
1966
|
+
})
|
|
1967
|
+
);
|
|
1968
|
+
}
|
|
1969
|
+
const snapshot = await workflowsStore?.loadWorkflowSnapshot({
|
|
1970
|
+
workflowName: step.step.id,
|
|
1971
|
+
runId: nestedRunId
|
|
1972
|
+
});
|
|
1973
|
+
const suspendedStepId = Object.keys(snapshot?.suspendedPaths ?? {})?.[0];
|
|
1974
|
+
if (!suspendedStepId) {
|
|
1975
|
+
return this.errorWorkflow(
|
|
1976
|
+
{
|
|
1977
|
+
workflowId,
|
|
1978
|
+
runId,
|
|
1979
|
+
executionPath,
|
|
1980
|
+
stepResults,
|
|
1981
|
+
activeSteps,
|
|
1982
|
+
resumeSteps,
|
|
1983
|
+
prevResult,
|
|
1984
|
+
resumeData,
|
|
1985
|
+
parentWorkflow,
|
|
1986
|
+
requestContext
|
|
1987
|
+
},
|
|
1988
|
+
new chunk4U7ZLI36_cjs.MastraError({
|
|
1989
|
+
id: "MASTRA_WORKFLOW",
|
|
1990
|
+
text: `No suspended step found in nested workflow: ${step.step.id}`,
|
|
1991
|
+
domain: "MASTRA_WORKFLOW" /* MASTRA_WORKFLOW */,
|
|
1992
|
+
category: "SYSTEM" /* SYSTEM */
|
|
1993
|
+
})
|
|
1994
|
+
);
|
|
1995
|
+
}
|
|
1996
|
+
const nestedExecutionPath = snapshot?.suspendedPaths?.[suspendedStepId];
|
|
1997
|
+
const nestedStepResults = snapshot?.context;
|
|
1998
|
+
await this.mastra.pubsub.publish("workflows", {
|
|
1999
|
+
type: "workflow.resume",
|
|
2000
|
+
runId,
|
|
2001
|
+
data: {
|
|
2002
|
+
workflowId: step.step.id,
|
|
2003
|
+
parentWorkflow: {
|
|
2004
|
+
stepId: step.step.id,
|
|
2005
|
+
workflowId,
|
|
2006
|
+
runId,
|
|
2007
|
+
executionPath,
|
|
2008
|
+
resumeSteps,
|
|
2009
|
+
stepResults,
|
|
2010
|
+
input: prevResult,
|
|
2011
|
+
parentWorkflow
|
|
2012
|
+
},
|
|
2013
|
+
executionPath: nestedExecutionPath,
|
|
2014
|
+
runId: nestedRunId,
|
|
2015
|
+
resumeSteps: [suspendedStepId],
|
|
2016
|
+
// Resume the auto-detected inner step
|
|
2017
|
+
stepResults: nestedStepResults,
|
|
2018
|
+
prevResult,
|
|
2019
|
+
resumeData,
|
|
2020
|
+
activeSteps,
|
|
2021
|
+
requestContext,
|
|
2022
|
+
perStep,
|
|
2023
|
+
initialState: currentState,
|
|
2024
|
+
state: currentState,
|
|
2025
|
+
outputOptions
|
|
2026
|
+
}
|
|
2027
|
+
});
|
|
2028
|
+
} else if (resumeSteps?.length > 1) {
|
|
1943
2029
|
const stepData = stepResults[step.step.id];
|
|
1944
2030
|
const nestedRunId = stepData?.suspendPayload?.__workflow_meta?.runId;
|
|
1945
2031
|
if (!nestedRunId) {
|
|
@@ -2005,7 +2091,7 @@ var WorkflowEventProcessor = class extends EventProcessor {
|
|
|
2005
2091
|
runId
|
|
2006
2092
|
}) ?? { context: {} };
|
|
2007
2093
|
const nestedWorkflow = step.step;
|
|
2008
|
-
const timeTravelParams =
|
|
2094
|
+
const timeTravelParams = chunkVJWRJWSC_cjs.createTimeTravelExecutionParams({
|
|
2009
2095
|
steps: timeTravel.steps.slice(1),
|
|
2010
2096
|
inputData: timeTravel.inputData,
|
|
2011
2097
|
resumeData: timeTravel.resumeData,
|
|
@@ -2105,7 +2191,7 @@ var WorkflowEventProcessor = class extends EventProcessor {
|
|
|
2105
2191
|
for (const [key, value] of Object.entries(requestContext)) {
|
|
2106
2192
|
rc.set(key, value);
|
|
2107
2193
|
}
|
|
2108
|
-
const { resumeData: timeTravelResumeData, validationError: timeTravelResumeValidationError } = await
|
|
2194
|
+
const { resumeData: timeTravelResumeData, validationError: timeTravelResumeValidationError } = await chunkVJWRJWSC_cjs.validateStepResumeData({
|
|
2109
2195
|
resumeData: timeTravel?.stepResults[step.step.id]?.status === "suspended" ? timeTravel?.resumeData : void 0,
|
|
2110
2196
|
step: step.step
|
|
2111
2197
|
});
|
|
@@ -2239,6 +2325,7 @@ var WorkflowEventProcessor = class extends EventProcessor {
|
|
|
2239
2325
|
//timeTravel is passed in as workflow.step.end ends the step, not the workflow, the timeTravel info is passed to the next step to run.
|
|
2240
2326
|
stepResults: {
|
|
2241
2327
|
...stepResults,
|
|
2328
|
+
[step.step.id]: stepResult,
|
|
2242
2329
|
__state: updatedState
|
|
2243
2330
|
},
|
|
2244
2331
|
prevResult: stepResult,
|
|
@@ -2924,7 +3011,7 @@ var WorkflowEventProcessor = class extends EventProcessor {
|
|
|
2924
3011
|
|
|
2925
3012
|
// src/workflows/evented/workflow.ts
|
|
2926
3013
|
function cloneWorkflow(workflow, opts) {
|
|
2927
|
-
const wf = new
|
|
3014
|
+
const wf = new chunkVJWRJWSC_cjs.Workflow({
|
|
2928
3015
|
id: opts.id,
|
|
2929
3016
|
inputSchema: workflow.inputSchema,
|
|
2930
3017
|
outputSchema: workflow.outputSchema,
|
|
@@ -2953,16 +3040,16 @@ function cloneStep(step, opts) {
|
|
|
2953
3040
|
};
|
|
2954
3041
|
}
|
|
2955
3042
|
function isAgent(input) {
|
|
2956
|
-
return input instanceof
|
|
3043
|
+
return input instanceof chunkVJWRJWSC_cjs.Agent;
|
|
2957
3044
|
}
|
|
2958
3045
|
function isToolStep(input) {
|
|
2959
3046
|
return input instanceof chunkEAZ6YDCQ_cjs.Tool;
|
|
2960
3047
|
}
|
|
2961
3048
|
function isStepParams(input) {
|
|
2962
|
-
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof
|
|
3049
|
+
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof chunkVJWRJWSC_cjs.Agent) && !(input instanceof chunkEAZ6YDCQ_cjs.Tool);
|
|
2963
3050
|
}
|
|
2964
3051
|
function isProcessor(obj) {
|
|
2965
|
-
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof
|
|
3052
|
+
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof chunkVJWRJWSC_cjs.Agent) && !(obj instanceof chunkEAZ6YDCQ_cjs.Tool) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
|
|
2966
3053
|
}
|
|
2967
3054
|
function createStep(params, agentOrToolOptions) {
|
|
2968
3055
|
if (isAgent(params)) {
|
|
@@ -3077,7 +3164,7 @@ function createStepFromAgent(params, agentOrToolOptions) {
|
|
|
3077
3164
|
};
|
|
3078
3165
|
const llm = await params.getLLM({ requestContext });
|
|
3079
3166
|
const modelInfo = llm.getModel();
|
|
3080
|
-
const isV2Model =
|
|
3167
|
+
const isV2Model = chunkVJWRJWSC_cjs.isSupportedLanguageModel(modelInfo);
|
|
3081
3168
|
let structuredResult = null;
|
|
3082
3169
|
const handleFinish = (result) => {
|
|
3083
3170
|
const resultWithObject = result;
|
|
@@ -3231,8 +3318,8 @@ function createStepFromProcessor(processor) {
|
|
|
3231
3318
|
return {
|
|
3232
3319
|
id: `processor:${processor.id}`,
|
|
3233
3320
|
description: processor.name ?? `Processor ${processor.id}`,
|
|
3234
|
-
inputSchema:
|
|
3235
|
-
outputSchema:
|
|
3321
|
+
inputSchema: chunkVJWRJWSC_cjs.ProcessorStepSchema,
|
|
3322
|
+
outputSchema: chunkVJWRJWSC_cjs.ProcessorStepOutputSchema,
|
|
3236
3323
|
execute: async ({ inputData, requestContext, tracingContext }) => {
|
|
3237
3324
|
const input = inputData;
|
|
3238
3325
|
const {
|
|
@@ -3261,7 +3348,7 @@ function createStepFromProcessor(processor) {
|
|
|
3261
3348
|
abortSignal
|
|
3262
3349
|
} = input;
|
|
3263
3350
|
const abort = (reason, options) => {
|
|
3264
|
-
throw new
|
|
3351
|
+
throw new chunkVJWRJWSC_cjs.TripWire(reason || `Tripwire triggered by ${processor.id}`, options, processor.id);
|
|
3265
3352
|
};
|
|
3266
3353
|
if (!hasPhaseMethod(phase)) {
|
|
3267
3354
|
return input;
|
|
@@ -3294,7 +3381,7 @@ function createStepFromProcessor(processor) {
|
|
|
3294
3381
|
phase,
|
|
3295
3382
|
// Auto-create MessageList from messages if not provided
|
|
3296
3383
|
// This enables running processor workflows from the UI where messageList can't be serialized
|
|
3297
|
-
messageList: messageList ?? (Array.isArray(messages) ? new
|
|
3384
|
+
messageList: messageList ?? (Array.isArray(messages) ? new chunkDB7U2C5B_cjs.MessageList().add(messages, "input").addSystem(systemMessages ?? []) : void 0),
|
|
3298
3385
|
stepNumber,
|
|
3299
3386
|
systemMessages,
|
|
3300
3387
|
streamParts,
|
|
@@ -3319,7 +3406,7 @@ function createStepFromProcessor(processor) {
|
|
|
3319
3406
|
processorSpan?.end({ output: result });
|
|
3320
3407
|
return result;
|
|
3321
3408
|
} catch (error) {
|
|
3322
|
-
if (error instanceof
|
|
3409
|
+
if (error instanceof chunkVJWRJWSC_cjs.TripWire) {
|
|
3323
3410
|
processorSpan?.end({ output: { tripwire: error.message } });
|
|
3324
3411
|
} else {
|
|
3325
3412
|
processorSpan?.error({ error, endSpan: true });
|
|
@@ -3347,7 +3434,7 @@ function createStepFromProcessor(processor) {
|
|
|
3347
3434
|
messageList: passThrough.messageList,
|
|
3348
3435
|
systemMessages: systemMessages ?? []
|
|
3349
3436
|
});
|
|
3350
|
-
if (result instanceof
|
|
3437
|
+
if (result instanceof chunkDB7U2C5B_cjs.MessageList) {
|
|
3351
3438
|
if (result !== passThrough.messageList) {
|
|
3352
3439
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
3353
3440
|
category: "USER" /* USER */,
|
|
@@ -3362,7 +3449,7 @@ function createStepFromProcessor(processor) {
|
|
|
3362
3449
|
systemMessages: result.getAllSystemMessages()
|
|
3363
3450
|
};
|
|
3364
3451
|
} else if (Array.isArray(result)) {
|
|
3365
|
-
|
|
3452
|
+
chunkVJWRJWSC_cjs.ProcessorRunner.applyMessagesToMessageList(
|
|
3366
3453
|
result,
|
|
3367
3454
|
passThrough.messageList,
|
|
3368
3455
|
idsBeforeProcessing,
|
|
@@ -3372,7 +3459,7 @@ function createStepFromProcessor(processor) {
|
|
|
3372
3459
|
return { ...passThrough, messages: result };
|
|
3373
3460
|
} else if (result && "messages" in result && "systemMessages" in result) {
|
|
3374
3461
|
const typedResult = result;
|
|
3375
|
-
|
|
3462
|
+
chunkVJWRJWSC_cjs.ProcessorRunner.applyMessagesToMessageList(
|
|
3376
3463
|
typedResult.messages,
|
|
3377
3464
|
passThrough.messageList,
|
|
3378
3465
|
idsBeforeProcessing,
|
|
@@ -3418,13 +3505,13 @@ function createStepFromProcessor(processor) {
|
|
|
3418
3505
|
structuredOutput,
|
|
3419
3506
|
steps: steps ?? []
|
|
3420
3507
|
});
|
|
3421
|
-
const validatedResult = await
|
|
3508
|
+
const validatedResult = await chunkVJWRJWSC_cjs.ProcessorRunner.validateAndFormatProcessInputStepResult(result, {
|
|
3422
3509
|
messageList: passThrough.messageList,
|
|
3423
3510
|
processor,
|
|
3424
3511
|
stepNumber: stepNumber ?? 0
|
|
3425
3512
|
});
|
|
3426
3513
|
if (validatedResult.messages) {
|
|
3427
|
-
|
|
3514
|
+
chunkVJWRJWSC_cjs.ProcessorRunner.applyMessagesToMessageList(
|
|
3428
3515
|
validatedResult.messages,
|
|
3429
3516
|
passThrough.messageList,
|
|
3430
3517
|
idsBeforeProcessing,
|
|
@@ -3482,7 +3569,7 @@ function createStepFromProcessor(processor) {
|
|
|
3482
3569
|
delete mutableState[spanKey];
|
|
3483
3570
|
}
|
|
3484
3571
|
} catch (error) {
|
|
3485
|
-
if (error instanceof
|
|
3572
|
+
if (error instanceof chunkVJWRJWSC_cjs.TripWire) {
|
|
3486
3573
|
processorSpan2?.end({ output: { tripwire: error.message } });
|
|
3487
3574
|
} else {
|
|
3488
3575
|
processorSpan2?.error({ error, endSpan: true });
|
|
@@ -3511,7 +3598,7 @@ function createStepFromProcessor(processor) {
|
|
|
3511
3598
|
messages,
|
|
3512
3599
|
messageList: passThrough.messageList
|
|
3513
3600
|
});
|
|
3514
|
-
if (result instanceof
|
|
3601
|
+
if (result instanceof chunkDB7U2C5B_cjs.MessageList) {
|
|
3515
3602
|
if (result !== passThrough.messageList) {
|
|
3516
3603
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
3517
3604
|
category: "USER" /* USER */,
|
|
@@ -3526,7 +3613,7 @@ function createStepFromProcessor(processor) {
|
|
|
3526
3613
|
systemMessages: result.getAllSystemMessages()
|
|
3527
3614
|
};
|
|
3528
3615
|
} else if (Array.isArray(result)) {
|
|
3529
|
-
|
|
3616
|
+
chunkVJWRJWSC_cjs.ProcessorRunner.applyMessagesToMessageList(
|
|
3530
3617
|
result,
|
|
3531
3618
|
passThrough.messageList,
|
|
3532
3619
|
idsBeforeProcessing,
|
|
@@ -3536,7 +3623,7 @@ function createStepFromProcessor(processor) {
|
|
|
3536
3623
|
return { ...passThrough, messages: result };
|
|
3537
3624
|
} else if (result && "messages" in result && "systemMessages" in result) {
|
|
3538
3625
|
const typedResult = result;
|
|
3539
|
-
|
|
3626
|
+
chunkVJWRJWSC_cjs.ProcessorRunner.applyMessagesToMessageList(
|
|
3540
3627
|
typedResult.messages,
|
|
3541
3628
|
passThrough.messageList,
|
|
3542
3629
|
idsBeforeProcessing,
|
|
@@ -3577,7 +3664,7 @@ function createStepFromProcessor(processor) {
|
|
|
3577
3664
|
systemMessages: systemMessages ?? [],
|
|
3578
3665
|
steps: steps ?? []
|
|
3579
3666
|
});
|
|
3580
|
-
if (result instanceof
|
|
3667
|
+
if (result instanceof chunkDB7U2C5B_cjs.MessageList) {
|
|
3581
3668
|
if (result !== passThrough.messageList) {
|
|
3582
3669
|
throw new chunk4U7ZLI36_cjs.MastraError({
|
|
3583
3670
|
category: "USER" /* USER */,
|
|
@@ -3592,7 +3679,7 @@ function createStepFromProcessor(processor) {
|
|
|
3592
3679
|
systemMessages: result.getAllSystemMessages()
|
|
3593
3680
|
};
|
|
3594
3681
|
} else if (Array.isArray(result)) {
|
|
3595
|
-
|
|
3682
|
+
chunkVJWRJWSC_cjs.ProcessorRunner.applyMessagesToMessageList(
|
|
3596
3683
|
result,
|
|
3597
3684
|
passThrough.messageList,
|
|
3598
3685
|
idsBeforeProcessing,
|
|
@@ -3602,7 +3689,7 @@ function createStepFromProcessor(processor) {
|
|
|
3602
3689
|
return { ...passThrough, messages: result };
|
|
3603
3690
|
} else if (result && "messages" in result && "systemMessages" in result) {
|
|
3604
3691
|
const typedResult = result;
|
|
3605
|
-
|
|
3692
|
+
chunkVJWRJWSC_cjs.ProcessorRunner.applyMessagesToMessageList(
|
|
3606
3693
|
typedResult.messages,
|
|
3607
3694
|
passThrough.messageList,
|
|
3608
3695
|
idsBeforeProcessing,
|
|
@@ -3646,7 +3733,7 @@ function createWorkflow(params) {
|
|
|
3646
3733
|
executionEngine
|
|
3647
3734
|
});
|
|
3648
3735
|
}
|
|
3649
|
-
var EventedWorkflow = class extends
|
|
3736
|
+
var EventedWorkflow = class extends chunkVJWRJWSC_cjs.Workflow {
|
|
3650
3737
|
constructor(params) {
|
|
3651
3738
|
super(params);
|
|
3652
3739
|
this.engineType = "evented";
|
|
@@ -3711,7 +3798,7 @@ var EventedWorkflow = class extends chunk7S6LA43E_cjs.Workflow {
|
|
|
3711
3798
|
return run;
|
|
3712
3799
|
}
|
|
3713
3800
|
};
|
|
3714
|
-
var EventedRun = class extends
|
|
3801
|
+
var EventedRun = class extends chunkVJWRJWSC_cjs.Run {
|
|
3715
3802
|
constructor(params) {
|
|
3716
3803
|
super(params);
|
|
3717
3804
|
this.serializedStepGraph = params.serializedStepGraph;
|
|
@@ -3923,7 +4010,7 @@ var EventedRun = class extends chunk7S6LA43E_cjs.Run {
|
|
|
3923
4010
|
}
|
|
3924
4011
|
}
|
|
3925
4012
|
});
|
|
3926
|
-
this.streamOutput = new
|
|
4013
|
+
this.streamOutput = new chunkVJWRJWSC_cjs.WorkflowRunOutput({
|
|
3927
4014
|
runId: this.runId,
|
|
3928
4015
|
workflowId: this.workflowId,
|
|
3929
4016
|
stream
|
|
@@ -3989,7 +4076,7 @@ var EventedRun = class extends chunk7S6LA43E_cjs.Run {
|
|
|
3989
4076
|
}
|
|
3990
4077
|
}
|
|
3991
4078
|
});
|
|
3992
|
-
this.streamOutput = new
|
|
4079
|
+
this.streamOutput = new chunkVJWRJWSC_cjs.WorkflowRunOutput({
|
|
3993
4080
|
runId: this.runId,
|
|
3994
4081
|
workflowId: this.workflowId,
|
|
3995
4082
|
stream
|
|
@@ -4222,7 +4309,7 @@ function isExecutableStep(step) {
|
|
|
4222
4309
|
}
|
|
4223
4310
|
|
|
4224
4311
|
// src/workflows/evented/execution-engine.ts
|
|
4225
|
-
var EventedExecutionEngine = class extends
|
|
4312
|
+
var EventedExecutionEngine = class extends chunkVJWRJWSC_cjs.ExecutionEngine {
|
|
4226
4313
|
eventProcessor;
|
|
4227
4314
|
constructor({
|
|
4228
4315
|
mastra,
|
|
@@ -4262,7 +4349,7 @@ var EventedExecutionEngine = class extends chunk7S6LA43E_cjs.ExecutionEngine {
|
|
|
4262
4349
|
await ack?.();
|
|
4263
4350
|
await pubsub.unsubscribe("workflows-finish", finishCb);
|
|
4264
4351
|
if (event.type === "workflow.fail" && event.data.stepResults) {
|
|
4265
|
-
event.data.stepResults =
|
|
4352
|
+
event.data.stepResults = chunkVJWRJWSC_cjs.hydrateSerializedStepErrors(event.data.stepResults);
|
|
4266
4353
|
}
|
|
4267
4354
|
resolveResult(event.data);
|
|
4268
4355
|
return;
|
|
@@ -4344,7 +4431,7 @@ var EventedExecutionEngine = class extends chunk7S6LA43E_cjs.ExecutionEngine {
|
|
|
4344
4431
|
const { __state: _removedState, ...stepResultsWithoutTopLevelState } = resultData.stepResults ?? {};
|
|
4345
4432
|
const cleanStepResults = {};
|
|
4346
4433
|
for (const [stepId, stepResult] of Object.entries(stepResultsWithoutTopLevelState)) {
|
|
4347
|
-
cleanStepResults[stepId] =
|
|
4434
|
+
cleanStepResults[stepId] = chunkVJWRJWSC_cjs.cleanStepResult(stepResult);
|
|
4348
4435
|
}
|
|
4349
4436
|
let callbackArg;
|
|
4350
4437
|
if (resultData.prevResult.status === "failed") {
|
|
@@ -4407,9 +4494,10 @@ var EventedExecutionEngine = class extends chunk7S6LA43E_cjs.ExecutionEngine {
|
|
|
4407
4494
|
}
|
|
4408
4495
|
let result;
|
|
4409
4496
|
if (resultData.prevResult.status === "suspended") {
|
|
4410
|
-
const suspendedSteps = Object.entries(resultData.stepResults).map(([
|
|
4497
|
+
const suspendedSteps = Object.entries(resultData.stepResults).map(([stepId, stepResult]) => {
|
|
4411
4498
|
if (stepResult.status === "suspended") {
|
|
4412
|
-
|
|
4499
|
+
const existingPath = stepResult.suspendPayload?.__workflow_meta?.path ?? [];
|
|
4500
|
+
return [stepId, ...existingPath];
|
|
4413
4501
|
}
|
|
4414
4502
|
return null;
|
|
4415
4503
|
}).filter(Boolean);
|
|
@@ -4460,5 +4548,5 @@ exports.cloneStep = cloneStep;
|
|
|
4460
4548
|
exports.cloneWorkflow = cloneWorkflow;
|
|
4461
4549
|
exports.createStep = createStep;
|
|
4462
4550
|
exports.createWorkflow = createWorkflow;
|
|
4463
|
-
//# sourceMappingURL=chunk-
|
|
4464
|
-
//# sourceMappingURL=chunk-
|
|
4551
|
+
//# sourceMappingURL=chunk-5VQPSWPG.cjs.map
|
|
4552
|
+
//# sourceMappingURL=chunk-5VQPSWPG.cjs.map
|