@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.js CHANGED
@@ -324,11 +324,13 @@ const mapWorkflowStreamChunkToWatchResult = (prev, chunk) => {
324
324
  ...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 } : {}
325
325
  };
326
326
  }
327
- const { stepCallId: _stepCallId, stepName: _stepName, ...newPayload } = chunk.payload ?? {};
327
+ const stepId = chunk.payload?.id;
328
+ if (stepId === void 0) return previous;
329
+ const { stepCallId: _stepCallId, stepName: _stepName, ...newPayload } = chunk.payload;
328
330
  const newSteps = {
329
331
  ...previous.steps,
330
- [chunk.payload.id]: {
331
- ...previous.steps[chunk.payload.id],
332
+ [stepId]: {
333
+ ...previous.steps[stepId],
332
334
  ...newPayload
333
335
  }
334
336
  };
@@ -361,8 +363,8 @@ const mapWorkflowStreamChunkToWatchResult = (prev, chunk) => {
361
363
  ...previous,
362
364
  steps: {
363
365
  ...previous.steps,
364
- [chunk.payload.id]: {
365
- ...previous.steps[chunk.payload.id],
366
+ [stepId]: {
367
+ ...previous.steps[stepId],
366
368
  foreachProgress: {
367
369
  completedCount: chunk.payload.completedCount,
368
370
  totalCount: chunk.payload.totalCount,
@@ -701,6 +703,7 @@ const accumulateChunk = ({ chunk, conversation, metadata }) => {
701
703
  };
702
704
  const newPart = {
703
705
  ...makeToolInvocationPart(invocation),
706
+ title: chunk.payload.title,
704
707
  providerMetadata: chunk.payload.providerMetadata
705
708
  };
706
709
  const existing = locateToolPart(result, chunk.payload.toolCallId, false);
@@ -721,6 +724,7 @@ const accumulateChunk = ({ chunk, conversation, metadata }) => {
721
724
  toolCallId: chunk.payload.toolCallId,
722
725
  args: chunk.payload.args
723
726
  },
727
+ title: chunk.payload.title ?? prev.title,
724
728
  providerMetadata: chunk.payload.providerMetadata ?? prev.providerMetadata
725
729
  };
726
730
  return replaceAt(result, messageIndex, withParts(targetMessage, parts));
@@ -741,6 +745,7 @@ const accumulateChunk = ({ chunk, conversation, metadata }) => {
741
745
  };
742
746
  const newPart = {
743
747
  ...makeToolInvocationPart(invocation),
748
+ title: chunk.payload.title,
744
749
  argsText: ""
745
750
  };
746
751
  if (!lastMessage || lastMessage.role !== "assistant") return appendAssistantMessage(result, `tool-call-streaming-${chunk.runId + Date.now()}`, [newPart], metadata);