@mastra/react 1.6.1 → 1.6.2-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/dist/index.cjs +10 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/mastra-db/accumulator.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -325,11 +325,13 @@ const mapWorkflowStreamChunkToWatchResult = (prev, chunk) => {
|
|
|
325
325
|
...finalStatus === "success" && lastStep?.status === "success" ? { result: lastStep?.output } : finalStatus === "failed" && lastStep?.status === "failed" ? { error: lastStep?.error } : finalStatus === "tripwire" && chunk.payload.tripwire ? { tripwire: chunk.payload.tripwire } : {}
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
|
-
const
|
|
328
|
+
const stepId = chunk.payload?.id;
|
|
329
|
+
if (stepId === void 0) return previous;
|
|
330
|
+
const { stepCallId: _stepCallId, stepName: _stepName, ...newPayload } = chunk.payload;
|
|
329
331
|
const newSteps = {
|
|
330
332
|
...previous.steps,
|
|
331
|
-
[
|
|
332
|
-
...previous.steps[
|
|
333
|
+
[stepId]: {
|
|
334
|
+
...previous.steps[stepId],
|
|
333
335
|
...newPayload
|
|
334
336
|
}
|
|
335
337
|
};
|
|
@@ -362,8 +364,8 @@ const mapWorkflowStreamChunkToWatchResult = (prev, chunk) => {
|
|
|
362
364
|
...previous,
|
|
363
365
|
steps: {
|
|
364
366
|
...previous.steps,
|
|
365
|
-
[
|
|
366
|
-
...previous.steps[
|
|
367
|
+
[stepId]: {
|
|
368
|
+
...previous.steps[stepId],
|
|
367
369
|
foreachProgress: {
|
|
368
370
|
completedCount: chunk.payload.completedCount,
|
|
369
371
|
totalCount: chunk.payload.totalCount,
|
|
@@ -702,6 +704,7 @@ const accumulateChunk = ({ chunk, conversation, metadata }) => {
|
|
|
702
704
|
};
|
|
703
705
|
const newPart = {
|
|
704
706
|
...makeToolInvocationPart(invocation),
|
|
707
|
+
title: chunk.payload.title,
|
|
705
708
|
providerMetadata: chunk.payload.providerMetadata
|
|
706
709
|
};
|
|
707
710
|
const existing = locateToolPart(result, chunk.payload.toolCallId, false);
|
|
@@ -722,6 +725,7 @@ const accumulateChunk = ({ chunk, conversation, metadata }) => {
|
|
|
722
725
|
toolCallId: chunk.payload.toolCallId,
|
|
723
726
|
args: chunk.payload.args
|
|
724
727
|
},
|
|
728
|
+
title: chunk.payload.title ?? prev.title,
|
|
725
729
|
providerMetadata: chunk.payload.providerMetadata ?? prev.providerMetadata
|
|
726
730
|
};
|
|
727
731
|
return replaceAt(result, messageIndex, withParts(targetMessage, parts));
|
|
@@ -742,6 +746,7 @@ const accumulateChunk = ({ chunk, conversation, metadata }) => {
|
|
|
742
746
|
};
|
|
743
747
|
const newPart = {
|
|
744
748
|
...makeToolInvocationPart(invocation),
|
|
749
|
+
title: chunk.payload.title,
|
|
745
750
|
argsText: ""
|
|
746
751
|
};
|
|
747
752
|
if (!lastMessage || lastMessage.role !== "assistant") return appendAssistantMessage(result, `tool-call-streaming-${chunk.runId + Date.now()}`, [newPart], metadata);
|