ai 6.0.0-beta.41 → 6.0.0-beta.42

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,13 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.0-beta.42
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6306603]
8
+ - @ai-sdk/provider-utils@4.0.0-beta.16
9
+ - @ai-sdk/gateway@2.0.0-beta.29
10
+
3
11
  ## 6.0.0-beta.41
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { createGateway, gateway } from '@ai-sdk/gateway';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
- import { Tool, InferToolInput, InferToolOutput, AssistantModelMessage, ToolModelMessage, ReasoningPart, ModelMessage, FlexibleSchema, InferSchema, SystemModelMessage, UserModelMessage, ProviderOptions, IdGenerator, ToolCall, DataContent, Validator, StandardSchemaV1, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
3
+ import { Tool, InferToolInput, InferToolOutput, AssistantModelMessage, ToolModelMessage, ReasoningPart, ModelMessage, FlexibleSchema, InferSchema, SystemModelMessage, UserModelMessage, ProviderOptions, IdGenerator, ToolCall, DataContent, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
4
4
  export { AssistantContent, AssistantModelMessage, DataContent, FilePart, FlexibleSchema, IdGenerator, ImagePart, InferSchema, InferToolInput, InferToolOutput, ModelMessage, Schema, SystemModelMessage, TextPart, Tool, ToolApprovalRequest, ToolApprovalResponse, ToolCallOptions, ToolCallPart, ToolContent, ToolExecuteFunction, ToolModelMessage, ToolResultPart, UserContent, UserModelMessage, asSchema, createIdGenerator, dynamicTool, generateId, jsonSchema, parseJsonEventStream, tool, zodSchema } from '@ai-sdk/provider-utils';
5
5
  import * as _ai_sdk_provider from '@ai-sdk/provider';
6
6
  import { EmbeddingModelV3, EmbeddingModelV2, EmbeddingModelV3Embedding, ImageModelV3, ImageModelV3CallWarning, ImageModelV3ProviderMetadata, JSONValue as JSONValue$1, LanguageModelV3, LanguageModelV2, LanguageModelV3FinishReason, LanguageModelV3CallWarning, LanguageModelV3Source, LanguageModelV3Middleware, SharedV3ProviderMetadata, SpeechModelV3, SpeechModelV3CallWarning, TranscriptionModelV3, TranscriptionModelV3CallWarning, LanguageModelV3Usage, LanguageModelV3CallOptions, AISDKError, LanguageModelV3ToolCall, JSONSchema7, JSONParseError, TypeValidationError, ProviderV3, ProviderV2, NoSuchModelError, JSONObject } from '@ai-sdk/provider';
@@ -1690,7 +1690,7 @@ type InferUIMessageToolCall<UI_MESSAGE extends UIMessage> = ValueOf<{
1690
1690
  dynamic: true;
1691
1691
  });
1692
1692
 
1693
- declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazyValidator<{
1693
+ declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
1694
1694
  type: "text-start";
1695
1695
  id: string;
1696
1696
  providerMetadata?: _ai_sdk_provider.SharedV3ProviderMetadata | undefined;
@@ -4303,12 +4303,12 @@ type CreateUIMessage<UI_MESSAGE extends UIMessage> = Omit<UI_MESSAGE, 'id' | 'ro
4303
4303
  id?: UI_MESSAGE['id'];
4304
4304
  role?: UI_MESSAGE['role'];
4305
4305
  };
4306
- type UIDataPartSchemas = Record<string, Validator<any> | StandardSchemaV1<any>>;
4306
+ type UIDataPartSchemas = Record<string, FlexibleSchema>;
4307
4307
  type UIDataTypesToSchemas<T extends UIDataTypes> = {
4308
- [K in keyof T]: Validator<T[K]> | StandardSchemaV1<T[K]>;
4308
+ [K in keyof T]: FlexibleSchema<T[K]>;
4309
4309
  };
4310
4310
  type InferUIDataParts<T extends UIDataPartSchemas> = {
4311
- [K in keyof T]: T[K] extends Validator<infer U> ? U : T[K] extends StandardSchemaV1<infer U> ? U : unknown;
4311
+ [K in keyof T]: InferSchema<T[K]>;
4312
4312
  };
4313
4313
  type ChatRequestOptions = {
4314
4314
  /**
@@ -4373,7 +4373,7 @@ interface ChatInit<UI_MESSAGE extends UIMessage> {
4373
4373
  * generated.
4374
4374
  */
4375
4375
  id?: string;
4376
- messageMetadataSchema?: Validator<InferUIMessageMetadata<UI_MESSAGE>> | StandardSchemaV1<InferUIMessageMetadata<UI_MESSAGE>>;
4376
+ messageMetadataSchema?: FlexibleSchema<InferUIMessageMetadata<UI_MESSAGE>>;
4377
4377
  dataPartSchemas?: UIDataTypesToSchemas<InferUIMessageData<UI_MESSAGE>>;
4378
4378
  messages?: UI_MESSAGE[];
4379
4379
  /**
@@ -4749,9 +4749,9 @@ type SafeValidateUIMessagesResult<UI_MESSAGE extends UIMessage> = {
4749
4749
  */
4750
4750
  declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>({ messages, metadataSchema, dataSchemas, tools, }: {
4751
4751
  messages: unknown;
4752
- metadataSchema?: Validator<UIMessage['metadata']> | StandardSchemaV1<unknown, UI_MESSAGE['metadata']>;
4752
+ metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
4753
4753
  dataSchemas?: {
4754
- [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: Validator<InferUIMessageData<UI_MESSAGE>[NAME]> | StandardSchemaV1<unknown, InferUIMessageData<UI_MESSAGE>[NAME]>;
4754
+ [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: FlexibleSchema<InferUIMessageData<UI_MESSAGE>[NAME]>;
4755
4755
  };
4756
4756
  tools?: {
4757
4757
  [NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
@@ -4766,9 +4766,9 @@ declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>({ messages
4766
4766
  */
4767
4767
  declare function validateUIMessages<UI_MESSAGE extends UIMessage>({ messages, metadataSchema, dataSchemas, tools, }: {
4768
4768
  messages: unknown;
4769
- metadataSchema?: Validator<UIMessage['metadata']> | StandardSchemaV1<unknown, UI_MESSAGE['metadata']>;
4769
+ metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
4770
4770
  dataSchemas?: {
4771
- [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: Validator<InferUIMessageData<UI_MESSAGE>[NAME]> | StandardSchemaV1<unknown, InferUIMessageData<UI_MESSAGE>[NAME]>;
4771
+ [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: FlexibleSchema<InferUIMessageData<UI_MESSAGE>[NAME]>;
4772
4772
  };
4773
4773
  tools?: {
4774
4774
  [NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { createGateway, gateway } from '@ai-sdk/gateway';
2
2
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
- import { Tool, InferToolInput, InferToolOutput, AssistantModelMessage, ToolModelMessage, ReasoningPart, ModelMessage, FlexibleSchema, InferSchema, SystemModelMessage, UserModelMessage, ProviderOptions, IdGenerator, ToolCall, DataContent, Validator, StandardSchemaV1, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
3
+ import { Tool, InferToolInput, InferToolOutput, AssistantModelMessage, ToolModelMessage, ReasoningPart, ModelMessage, FlexibleSchema, InferSchema, SystemModelMessage, UserModelMessage, ProviderOptions, IdGenerator, ToolCall, DataContent, Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
4
4
  export { AssistantContent, AssistantModelMessage, DataContent, FilePart, FlexibleSchema, IdGenerator, ImagePart, InferSchema, InferToolInput, InferToolOutput, ModelMessage, Schema, SystemModelMessage, TextPart, Tool, ToolApprovalRequest, ToolApprovalResponse, ToolCallOptions, ToolCallPart, ToolContent, ToolExecuteFunction, ToolModelMessage, ToolResultPart, UserContent, UserModelMessage, asSchema, createIdGenerator, dynamicTool, generateId, jsonSchema, parseJsonEventStream, tool, zodSchema } from '@ai-sdk/provider-utils';
5
5
  import * as _ai_sdk_provider from '@ai-sdk/provider';
6
6
  import { EmbeddingModelV3, EmbeddingModelV2, EmbeddingModelV3Embedding, ImageModelV3, ImageModelV3CallWarning, ImageModelV3ProviderMetadata, JSONValue as JSONValue$1, LanguageModelV3, LanguageModelV2, LanguageModelV3FinishReason, LanguageModelV3CallWarning, LanguageModelV3Source, LanguageModelV3Middleware, SharedV3ProviderMetadata, SpeechModelV3, SpeechModelV3CallWarning, TranscriptionModelV3, TranscriptionModelV3CallWarning, LanguageModelV3Usage, LanguageModelV3CallOptions, AISDKError, LanguageModelV3ToolCall, JSONSchema7, JSONParseError, TypeValidationError, ProviderV3, ProviderV2, NoSuchModelError, JSONObject } from '@ai-sdk/provider';
@@ -1690,7 +1690,7 @@ type InferUIMessageToolCall<UI_MESSAGE extends UIMessage> = ValueOf<{
1690
1690
  dynamic: true;
1691
1691
  });
1692
1692
 
1693
- declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazyValidator<{
1693
+ declare const uiMessageChunkSchema: _ai_sdk_provider_utils.LazySchema<{
1694
1694
  type: "text-start";
1695
1695
  id: string;
1696
1696
  providerMetadata?: _ai_sdk_provider.SharedV3ProviderMetadata | undefined;
@@ -4303,12 +4303,12 @@ type CreateUIMessage<UI_MESSAGE extends UIMessage> = Omit<UI_MESSAGE, 'id' | 'ro
4303
4303
  id?: UI_MESSAGE['id'];
4304
4304
  role?: UI_MESSAGE['role'];
4305
4305
  };
4306
- type UIDataPartSchemas = Record<string, Validator<any> | StandardSchemaV1<any>>;
4306
+ type UIDataPartSchemas = Record<string, FlexibleSchema>;
4307
4307
  type UIDataTypesToSchemas<T extends UIDataTypes> = {
4308
- [K in keyof T]: Validator<T[K]> | StandardSchemaV1<T[K]>;
4308
+ [K in keyof T]: FlexibleSchema<T[K]>;
4309
4309
  };
4310
4310
  type InferUIDataParts<T extends UIDataPartSchemas> = {
4311
- [K in keyof T]: T[K] extends Validator<infer U> ? U : T[K] extends StandardSchemaV1<infer U> ? U : unknown;
4311
+ [K in keyof T]: InferSchema<T[K]>;
4312
4312
  };
4313
4313
  type ChatRequestOptions = {
4314
4314
  /**
@@ -4373,7 +4373,7 @@ interface ChatInit<UI_MESSAGE extends UIMessage> {
4373
4373
  * generated.
4374
4374
  */
4375
4375
  id?: string;
4376
- messageMetadataSchema?: Validator<InferUIMessageMetadata<UI_MESSAGE>> | StandardSchemaV1<InferUIMessageMetadata<UI_MESSAGE>>;
4376
+ messageMetadataSchema?: FlexibleSchema<InferUIMessageMetadata<UI_MESSAGE>>;
4377
4377
  dataPartSchemas?: UIDataTypesToSchemas<InferUIMessageData<UI_MESSAGE>>;
4378
4378
  messages?: UI_MESSAGE[];
4379
4379
  /**
@@ -4749,9 +4749,9 @@ type SafeValidateUIMessagesResult<UI_MESSAGE extends UIMessage> = {
4749
4749
  */
4750
4750
  declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>({ messages, metadataSchema, dataSchemas, tools, }: {
4751
4751
  messages: unknown;
4752
- metadataSchema?: Validator<UIMessage['metadata']> | StandardSchemaV1<unknown, UI_MESSAGE['metadata']>;
4752
+ metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
4753
4753
  dataSchemas?: {
4754
- [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: Validator<InferUIMessageData<UI_MESSAGE>[NAME]> | StandardSchemaV1<unknown, InferUIMessageData<UI_MESSAGE>[NAME]>;
4754
+ [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: FlexibleSchema<InferUIMessageData<UI_MESSAGE>[NAME]>;
4755
4755
  };
4756
4756
  tools?: {
4757
4757
  [NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
@@ -4766,9 +4766,9 @@ declare function safeValidateUIMessages<UI_MESSAGE extends UIMessage>({ messages
4766
4766
  */
4767
4767
  declare function validateUIMessages<UI_MESSAGE extends UIMessage>({ messages, metadataSchema, dataSchemas, tools, }: {
4768
4768
  messages: unknown;
4769
- metadataSchema?: Validator<UIMessage['metadata']> | StandardSchemaV1<unknown, UI_MESSAGE['metadata']>;
4769
+ metadataSchema?: FlexibleSchema<UIMessage['metadata']>;
4770
4770
  dataSchemas?: {
4771
- [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: Validator<InferUIMessageData<UI_MESSAGE>[NAME]> | StandardSchemaV1<unknown, InferUIMessageData<UI_MESSAGE>[NAME]>;
4771
+ [NAME in keyof InferUIMessageData<UI_MESSAGE> & string]?: FlexibleSchema<InferUIMessageData<UI_MESSAGE>[NAME]>;
4772
4772
  };
4773
4773
  tools?: {
4774
4774
  [NAME in keyof InferUIMessageTools<UI_MESSAGE> & string]?: Tool<InferUIMessageTools<UI_MESSAGE>[NAME]['input'], InferUIMessageTools<UI_MESSAGE>[NAME]['output']>;
package/dist/index.js CHANGED
@@ -813,7 +813,7 @@ function detectMediaType({
813
813
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
814
814
 
815
815
  // src/version.ts
816
- var VERSION = true ? "6.0.0-beta.41" : "0.0.0-test";
816
+ var VERSION = true ? "6.0.0-beta.42" : "0.0.0-test";
817
817
 
818
818
  // src/util/download/download.ts
819
819
  var download = async ({ url }) => {
@@ -3214,7 +3214,7 @@ var import_provider_utils14 = require("@ai-sdk/provider-utils");
3214
3214
  // src/ui-message-stream/ui-message-chunks.ts
3215
3215
  var import_v47 = require("zod/v4");
3216
3216
  var import_provider_utils12 = require("@ai-sdk/provider-utils");
3217
- var uiMessageChunkSchema = (0, import_provider_utils12.lazyValidator)(
3217
+ var uiMessageChunkSchema = (0, import_provider_utils12.lazySchema)(
3218
3218
  () => (0, import_provider_utils12.zodSchema)(
3219
3219
  import_v47.z.union([
3220
3220
  import_v47.z.strictObject({
@@ -10461,7 +10461,7 @@ var TextStreamChatTransport = class extends HttpChatTransport {
10461
10461
  var import_provider32 = require("@ai-sdk/provider");
10462
10462
  var import_provider_utils35 = require("@ai-sdk/provider-utils");
10463
10463
  var import_v410 = require("zod/v4");
10464
- var uiMessagesSchema = (0, import_provider_utils35.lazyValidator)(
10464
+ var uiMessagesSchema = (0, import_provider_utils35.lazySchema)(
10465
10465
  () => (0, import_provider_utils35.zodSchema)(
10466
10466
  import_v410.z.array(
10467
10467
  import_v410.z.object({