ai 5.1.0-beta.7 → 5.1.0-beta.8

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,11 @@
1
1
  # ai
2
2
 
3
+ ## 5.1.0-beta.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 7eca093: fix(ai): update `uiMessageChunkSchema` to satisfy the `UIMessageChunk` type
8
+
3
9
  ## 5.1.0-beta.7
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1650,10 +1650,6 @@ declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
1650
1650
  errorText: z.ZodString;
1651
1651
  providerExecuted: z.ZodOptional<z.ZodBoolean>;
1652
1652
  dynamic: z.ZodOptional<z.ZodBoolean>;
1653
- }, z.core.$strict>, z.ZodObject<{
1654
- type: z.ZodLiteral<"reasoning">;
1655
- text: z.ZodString;
1656
- providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
1657
1653
  }, z.core.$strict>, z.ZodObject<{
1658
1654
  type: z.ZodLiteral<"reasoning-start">;
1659
1655
  id: z.ZodString;
@@ -1667,8 +1663,6 @@ declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
1667
1663
  type: z.ZodLiteral<"reasoning-end">;
1668
1664
  id: z.ZodString;
1669
1665
  providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
1670
- }, z.core.$strict>, z.ZodObject<{
1671
- type: z.ZodLiteral<"reasoning-part-finish">;
1672
1666
  }, z.core.$strict>, z.ZodObject<{
1673
1667
  type: z.ZodLiteral<"source-url">;
1674
1668
  sourceId: z.ZodString;
@@ -1688,7 +1682,7 @@ declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
1688
1682
  mediaType: z.ZodString;
1689
1683
  providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
1690
1684
  }, z.core.$strict>, z.ZodObject<{
1691
- type: z.ZodString;
1685
+ type: z.ZodCustom<`data-${string}`, `data-${string}`>;
1692
1686
  id: z.ZodOptional<z.ZodString>;
1693
1687
  data: z.ZodUnknown;
1694
1688
  transient: z.ZodOptional<z.ZodBoolean>;
@@ -1803,6 +1797,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
1803
1797
  type: 'file';
1804
1798
  url: string;
1805
1799
  mediaType: string;
1800
+ providerMetadata?: ProviderMetadata;
1806
1801
  } | DataUIMessageChunk<DATA_TYPES> | {
1807
1802
  type: 'start-step';
1808
1803
  } | {
package/dist/index.d.ts CHANGED
@@ -1650,10 +1650,6 @@ declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
1650
1650
  errorText: z.ZodString;
1651
1651
  providerExecuted: z.ZodOptional<z.ZodBoolean>;
1652
1652
  dynamic: z.ZodOptional<z.ZodBoolean>;
1653
- }, z.core.$strict>, z.ZodObject<{
1654
- type: z.ZodLiteral<"reasoning">;
1655
- text: z.ZodString;
1656
- providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
1657
1653
  }, z.core.$strict>, z.ZodObject<{
1658
1654
  type: z.ZodLiteral<"reasoning-start">;
1659
1655
  id: z.ZodString;
@@ -1667,8 +1663,6 @@ declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
1667
1663
  type: z.ZodLiteral<"reasoning-end">;
1668
1664
  id: z.ZodString;
1669
1665
  providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
1670
- }, z.core.$strict>, z.ZodObject<{
1671
- type: z.ZodLiteral<"reasoning-part-finish">;
1672
1666
  }, z.core.$strict>, z.ZodObject<{
1673
1667
  type: z.ZodLiteral<"source-url">;
1674
1668
  sourceId: z.ZodString;
@@ -1688,7 +1682,7 @@ declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
1688
1682
  mediaType: z.ZodString;
1689
1683
  providerMetadata: z.ZodOptional<z.ZodType<_ai_sdk_provider.SharedV2ProviderMetadata, unknown, z.core.$ZodTypeInternals<_ai_sdk_provider.SharedV2ProviderMetadata, unknown>>>;
1690
1684
  }, z.core.$strict>, z.ZodObject<{
1691
- type: z.ZodString;
1685
+ type: z.ZodCustom<`data-${string}`, `data-${string}`>;
1692
1686
  id: z.ZodOptional<z.ZodString>;
1693
1687
  data: z.ZodUnknown;
1694
1688
  transient: z.ZodOptional<z.ZodBoolean>;
@@ -1803,6 +1797,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
1803
1797
  type: 'file';
1804
1798
  url: string;
1805
1799
  mediaType: string;
1800
+ providerMetadata?: ProviderMetadata;
1806
1801
  } | DataUIMessageChunk<DATA_TYPES> | {
1807
1802
  type: 'start-step';
1808
1803
  } | {
package/dist/index.js CHANGED
@@ -768,7 +768,7 @@ function detectMediaType({
768
768
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
769
769
 
770
770
  // src/version.ts
771
- var VERSION = true ? "5.1.0-beta.7" : "0.0.0-test";
771
+ var VERSION = true ? "5.1.0-beta.8" : "0.0.0-test";
772
772
 
773
773
  // src/util/download/download.ts
774
774
  var download = async ({ url }) => {
@@ -2990,11 +2990,6 @@ var uiMessageChunkSchema = import_v47.z.union([
2990
2990
  providerExecuted: import_v47.z.boolean().optional(),
2991
2991
  dynamic: import_v47.z.boolean().optional()
2992
2992
  }),
2993
- import_v47.z.strictObject({
2994
- type: import_v47.z.literal("reasoning"),
2995
- text: import_v47.z.string(),
2996
- providerMetadata: providerMetadataSchema.optional()
2997
- }),
2998
2993
  import_v47.z.strictObject({
2999
2994
  type: import_v47.z.literal("reasoning-start"),
3000
2995
  id: import_v47.z.string(),
@@ -3011,9 +3006,6 @@ var uiMessageChunkSchema = import_v47.z.union([
3011
3006
  id: import_v47.z.string(),
3012
3007
  providerMetadata: providerMetadataSchema.optional()
3013
3008
  }),
3014
- import_v47.z.strictObject({
3015
- type: import_v47.z.literal("reasoning-part-finish")
3016
- }),
3017
3009
  import_v47.z.strictObject({
3018
3010
  type: import_v47.z.literal("source-url"),
3019
3011
  sourceId: import_v47.z.string(),
@@ -3036,7 +3028,10 @@ var uiMessageChunkSchema = import_v47.z.union([
3036
3028
  providerMetadata: providerMetadataSchema.optional()
3037
3029
  }),
3038
3030
  import_v47.z.strictObject({
3039
- type: import_v47.z.string().startsWith("data-"),
3031
+ type: import_v47.z.custom(
3032
+ (value) => typeof value === "string" && value.startsWith("data-"),
3033
+ { message: 'Type must start with "data-"' }
3034
+ ),
3040
3035
  id: import_v47.z.string().optional(),
3041
3036
  data: import_v47.z.unknown(),
3042
3037
  transient: import_v47.z.boolean().optional()