@mastra/ai-sdk 1.0.0-beta.11 → 1.0.0-beta.12

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @mastra/ai-sdk
2
2
 
3
+ ## 1.0.0-beta.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix data chunk property filtering to only include type, data, and id properties ([#11477](https://github.com/mastra-ai/mastra/pull/11477))
8
+
9
+ Previously, when `isDataChunkType` checks were performed, the entire chunk object was returned, potentially letting extra properties like `from`, `runId`, `metadata`, etc go through. This could cause issues with `useChat` and other UI components.
10
+
11
+ Now, all locations that handle `DataChunkType` properly destructure and return only the allowed properties:
12
+ - `type` (required): The chunk type identifier starting with "data-"
13
+ - `data` (required): The actual data payload
14
+ - `id` (optional): An optional identifier for the chunk
15
+
16
+ - Updated dependencies [[`e54953e`](https://github.com/mastra-ai/mastra/commit/e54953ed8ce1b28c0d62a19950163039af7834b4), [`7d56d92`](https://github.com/mastra-ai/mastra/commit/7d56d9213886e8353956d7d40df10045fd12b299), [`fdac646`](https://github.com/mastra-ai/mastra/commit/fdac646033a0930a1a4e00d13aa64c40bb7f1e02), [`d07b568`](https://github.com/mastra-ai/mastra/commit/d07b5687819ea8cb1dffa776d0c1765faf4aa1ae), [`68ec97d`](https://github.com/mastra-ai/mastra/commit/68ec97d4c07c6393fcf95c2481fc5d73da99f8c8), [`4aa55b3`](https://github.com/mastra-ai/mastra/commit/4aa55b383cf06043943359ea316572fd969861a7)]:
17
+ - @mastra/core@1.0.0-beta.19
18
+
3
19
  ## 1.0.0-beta.11
4
20
 
5
21
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,kBAAkB,EACnB,MAAM,qBAA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unkToUIMessageStream({
3276
3276
  ${JSON.stringify(part)}`
3277
3277
  );
3278
3278
  }
3279
- return part.output;
3279
+ const { type, data, id } = part.output;
3280
+ return { type, data, ...id !== void 0 && { id } };
3280
3281
  }
3281
3282
  return;
3282
3283
  }
@@ -3338,7 +3339,8 @@ function convertFullStreamChunkToUIMessageStream({
3338
3339
  ${JSON.stringify(part)}`
3339
3340
  );
3340
3341
  }
3341
- return part;
3342
+ const { type, data, id } = part;
3343
+ return { type, data, ...id !== void 0 && { id } };
3342
3344
  }
3343
3345
  return;
3344
3346
  }
@@ -3696,7 +3698,8 @@ function transformWorkflow(payload, bufferedWorkflows, isNested, includeTextStre
3696
3698
  ${JSON.stringify(output)}`
3697
3699
  );
3698
3700
  }
3699
- return output;
3701
+ const { type, data, id } = output;
3702
+ return { type, data, ...id !== void 0 && { id } };
3700
3703
  }
3701
3704
  return null;
3702
3705
  }
@@ -3708,7 +3711,12 @@ function transformWorkflow(payload, bufferedWorkflows, isNested, includeTextStre
3708
3711
  ${JSON.stringify(payload)}`
3709
3712
  );
3710
3713
  }
3711
- return payload;
3714
+ const { type, data, id } = payload;
3715
+ return {
3716
+ type,
3717
+ data,
3718
+ ...id !== void 0 && { id }
3719
+ };
3712
3720
  }
3713
3721
  return null;
3714
3722
  }
@@ -3971,8 +3979,8 @@ function transformNetwork(payload, bufferedNetworks, isNested) {
3971
3979
  ${JSON.stringify(payload)}`
3972
3980
  );
3973
3981
  }
3974
- const { type, data } = payload.payload;
3975
- return { type, data };
3982
+ const { type, data, id } = payload.payload;
3983
+ return { type, data, ...id !== void 0 && { id } };
3976
3984
  }
3977
3985
  if (isWorkflowExecutionDataChunkType(payload)) {
3978
3986
  if (!("data" in payload.payload)) {
@@ -3981,8 +3989,8 @@ function transformNetwork(payload, bufferedNetworks, isNested) {
3981
3989
  ${JSON.stringify(payload)}`
3982
3990
  );
3983
3991
  }
3984
- const { type, data } = payload.payload;
3985
- return { type, data };
3992
+ const { type, data, id } = payload.payload;
3993
+ return { type, data, ...id !== void 0 && { id } };
3986
3994
  }
3987
3995
  if (payload.type.startsWith("agent-execution-event-")) {
3988
3996
  const stepId = payload.payload.runId;
@@ -4042,8 +4050,8 @@ function transformNetwork(payload, bufferedNetworks, isNested) {
4042
4050
  ${JSON.stringify(payload)}`
4043
4051
  );
4044
4052
  }
4045
- const { type, data } = payload;
4046
- return { type, data };
4053
+ const { type, data, id } = payload;
4054
+ return { type, data, ...id !== void 0 && { id } };
4047
4055
  }
4048
4056
  return null;
4049
4057
  }