| import { | ||
| array, | ||
| boolean, | ||
| custom, | ||
| discriminatedUnion, | ||
| enum as enumType, | ||
| instanceof as instanceOf, | ||
| lazy, | ||
| literal, | ||
| looseObject, | ||
| never, | ||
| null as nullType, | ||
| number, | ||
| object, | ||
| record, | ||
| string, | ||
| union, | ||
| unknown, | ||
| } from 'zod/v4'; | ||
| // Import individual Zod factories so bundlers can tree-shake the full `z` | ||
| // namespace, which also re-exports every locale. | ||
| export const z = { | ||
| array, | ||
| boolean, | ||
| custom, | ||
| discriminatedUnion, | ||
| enum: enumType, | ||
| instanceof: instanceOf, | ||
| lazy, | ||
| literal, | ||
| looseObject, | ||
| never, | ||
| null: nullType, | ||
| number, | ||
| object, | ||
| record, | ||
| string, | ||
| union, | ||
| unknown, | ||
| }; | ||
| export type { ZodType } from 'zod/v4'; |
+4
-4
| { | ||
| "name": "ai", | ||
| "version": "7.0.57", | ||
| "version": "7.0.58", | ||
| "type": "module", | ||
@@ -45,5 +45,5 @@ "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.", | ||
| "dependencies": { | ||
| "@ai-sdk/gateway": "4.0.45", | ||
| "@ai-sdk/provider": "4.0.6", | ||
| "@ai-sdk/provider-utils": "5.0.24" | ||
| "@ai-sdk/provider": "4.0.7", | ||
| "@ai-sdk/provider-utils": "5.0.25", | ||
| "@ai-sdk/gateway": "4.0.46" | ||
| }, | ||
@@ -50,0 +50,0 @@ "devDependencies": { |
@@ -222,3 +222,3 @@ import { | ||
| abortSignal, | ||
| timeout, | ||
| timeout: timeout ?? preparedCall.timeout, | ||
| experimental_sandbox: sandbox, | ||
@@ -288,3 +288,3 @@ onStart: mergeCallbacks( | ||
| abortSignal, | ||
| timeout, | ||
| timeout: timeout ?? preparedCall.timeout, | ||
| experimental_sandbox: sandbox, | ||
@@ -291,0 +291,0 @@ experimental_transform, |
@@ -96,3 +96,3 @@ import type { | ||
| * @param n - Number of videos to generate. Default: 1. | ||
| * @param aspectRatio - Aspect ratio of the videos to generate. Must have the format `{width}:{height}`. | ||
| * @param aspectRatio - Aspect ratio of the videos to generate. Must have the format `{width}:{height}`, or `'adaptive'`. | ||
| * @param resolution - Resolution of the videos to generate. Must have the format `{width}x{height}`. | ||
@@ -159,5 +159,6 @@ * @param duration - Duration of the video in seconds. | ||
| /** | ||
| * Aspect ratio of the videos to generate. Must have the format `{width}:{height}`. | ||
| * Aspect ratio of the videos to generate. Must have the format | ||
| * `{width}:{height}`, or `'adaptive'` to inherit the ratio from the input media. | ||
| */ | ||
| aspectRatio?: `${number}:${number}`; | ||
| aspectRatio?: `${number}:${number}` | 'adaptive'; | ||
@@ -164,0 +165,0 @@ /** |
@@ -16,7 +16,7 @@ import { | ||
| } from '@ai-sdk/provider-utils'; | ||
| import { z } from 'zod/v4'; | ||
| import { jsonValueSchema } from '../types/json-value'; | ||
| import { providerMetadataSchema } from '../types/provider-metadata'; | ||
| import { z, type ZodType } from '../util/zod'; | ||
| const fileInlineDataSchema: z.ZodType<DataContent> = z.union([ | ||
| const fileInlineDataSchema: ZodType<DataContent> = z.union([ | ||
| z.string(), | ||
@@ -33,3 +33,3 @@ z.instanceof(Uint8Array), | ||
| */ | ||
| export const textPartSchema: z.ZodType<TextPart> = z.object({ | ||
| export const textPartSchema: ZodType<TextPart> = z.object({ | ||
| type: z.literal('text'), | ||
@@ -45,3 +45,3 @@ text: z.string(), | ||
| */ | ||
| export const imagePartSchema: z.ZodType<ImagePart> = z.object({ | ||
| export const imagePartSchema: ZodType<ImagePart> = z.object({ | ||
| type: z.literal('image'), | ||
@@ -75,3 +75,3 @@ image: z.union([ | ||
| */ | ||
| export const filePartSchema: z.ZodType<FilePart> = z.object({ | ||
| export const filePartSchema: ZodType<FilePart> = z.object({ | ||
| type: z.literal('file'), | ||
@@ -92,3 +92,3 @@ data: z.union([ | ||
| */ | ||
| export const reasoningPartSchema: z.ZodType<ReasoningPart> = z.object({ | ||
| export const reasoningPartSchema: ZodType<ReasoningPart> = z.object({ | ||
| type: z.literal('reasoning'), | ||
@@ -102,3 +102,3 @@ text: z.string(), | ||
| */ | ||
| export const customPartSchema: z.ZodType<CustomPart> = z.object({ | ||
| export const customPartSchema: ZodType<CustomPart> = z.object({ | ||
| type: z.literal('custom'), | ||
@@ -112,3 +112,3 @@ kind: z.string().transform(value => value as `${string}.${string}`), | ||
| */ | ||
| export const reasoningFilePartSchema: z.ZodType<ReasoningFilePart> = z.object({ | ||
| export const reasoningFilePartSchema: ZodType<ReasoningFilePart> = z.object({ | ||
| type: z.literal('reasoning-file'), | ||
@@ -156,3 +156,3 @@ data: z.union([ | ||
| */ | ||
| export const toolCallPartSchema: z.ZodType<ToolCallPart> = z.object({ | ||
| export const toolCallPartSchema: ZodType<ToolCallPart> = z.object({ | ||
| type: z.literal('tool-call'), | ||
@@ -164,3 +164,3 @@ toolCallId: z.string(), | ||
| providerExecuted: z.boolean().optional(), | ||
| }) as z.ZodType<ToolCallPart>; // necessary bc input is optional on Zod type | ||
| }) as ZodType<ToolCallPart>; // necessary bc input is optional on Zod type | ||
@@ -170,3 +170,3 @@ /** | ||
| */ | ||
| export const outputSchema: z.ZodType<ToolResultOutput> = z.discriminatedUnion( | ||
| export const outputSchema: ZodType<ToolResultOutput> = z.discriminatedUnion( | ||
| 'type', | ||
@@ -280,3 +280,3 @@ [ | ||
| */ | ||
| export const toolResultPartSchema: z.ZodType<ToolResultPart> = z.object({ | ||
| export const toolResultPartSchema: ZodType<ToolResultPart> = z.object({ | ||
| type: z.literal('tool-result'), | ||
@@ -287,3 +287,3 @@ toolCallId: z.string(), | ||
| providerOptions: providerMetadataSchema.optional(), | ||
| }) as z.ZodType<ToolResultPart>; // necessary bc result is optional on Zod type | ||
| }) as ZodType<ToolResultPart>; // necessary bc result is optional on Zod type | ||
@@ -293,8 +293,9 @@ /** | ||
| */ | ||
| export const toolApprovalRequestSchema: z.ZodType<ToolApprovalRequest> = | ||
| z.object({ | ||
| export const toolApprovalRequestSchema: ZodType<ToolApprovalRequest> = z.object( | ||
| { | ||
| type: z.literal('tool-approval-request'), | ||
| approvalId: z.string(), | ||
| toolCallId: z.string(), | ||
| }); | ||
| }, | ||
| ); | ||
@@ -304,3 +305,3 @@ /** | ||
| */ | ||
| export const toolApprovalResponseSchema: z.ZodType<ToolApprovalResponse> = | ||
| export const toolApprovalResponseSchema: ZodType<ToolApprovalResponse> = | ||
| z.object({ | ||
@@ -307,0 +308,0 @@ type: z.literal('tool-approval-response'), |
+10
-12
@@ -8,4 +8,4 @@ import type { | ||
| } from '@ai-sdk/provider-utils'; | ||
| import { z } from 'zod/v4'; | ||
| import { providerMetadataSchema } from '../types/provider-metadata'; | ||
| import { z, type ZodType } from '../util/zod'; | ||
| import { | ||
@@ -24,11 +24,9 @@ customPartSchema, | ||
| export const systemModelMessageSchema: z.ZodType<SystemModelMessage> = z.object( | ||
| { | ||
| role: z.literal('system'), | ||
| content: z.string(), | ||
| providerOptions: providerMetadataSchema.optional(), | ||
| }, | ||
| ); | ||
| export const systemModelMessageSchema: ZodType<SystemModelMessage> = z.object({ | ||
| role: z.literal('system'), | ||
| content: z.string(), | ||
| providerOptions: providerMetadataSchema.optional(), | ||
| }); | ||
| export const userModelMessageSchema: z.ZodType<UserModelMessage> = z.object({ | ||
| export const userModelMessageSchema: ZodType<UserModelMessage> = z.object({ | ||
| role: z.literal('user'), | ||
@@ -42,3 +40,3 @@ content: z.union([ | ||
| export const assistantModelMessageSchema: z.ZodType<AssistantModelMessage> = | ||
| export const assistantModelMessageSchema: ZodType<AssistantModelMessage> = | ||
| z.object({ | ||
@@ -64,3 +62,3 @@ role: z.literal('assistant'), | ||
| export const toolModelMessageSchema: z.ZodType<ToolModelMessage> = z.object({ | ||
| export const toolModelMessageSchema: ZodType<ToolModelMessage> = z.object({ | ||
| role: z.literal('tool'), | ||
@@ -71,3 +69,3 @@ content: z.array(z.union([toolResultPartSchema, toolApprovalResponseSchema])), | ||
| export const modelMessageSchema: z.ZodType<ModelMessage> = z.union([ | ||
| export const modelMessageSchema: ZodType<ModelMessage> = z.union([ | ||
| systemModelMessageSchema, | ||
@@ -74,0 +72,0 @@ userModelMessageSchema, |
@@ -7,3 +7,3 @@ import { InvalidPromptError } from '@ai-sdk/provider'; | ||
| } from '@ai-sdk/provider-utils'; | ||
| import { z } from 'zod/v4'; | ||
| import { z } from '../util/zod'; | ||
| import { modelMessageSchema } from './message'; | ||
@@ -10,0 +10,0 @@ import type { Instructions, Prompt } from './prompt'; |
| import type { JSONValue as OriginalJSONValue } from '@ai-sdk/provider'; | ||
| import { z } from 'zod/v4'; | ||
| import { z, type ZodType } from '../util/zod'; | ||
| export const jsonValueSchema: z.ZodType<JSONValue> = z.lazy(() => | ||
| export const jsonValueSchema: ZodType<JSONValue> = z.lazy(() => | ||
| z.union([ | ||
@@ -6,0 +6,0 @@ z.null(), |
| import type { SharedV4ProviderMetadata } from '@ai-sdk/provider'; | ||
| import { z } from 'zod/v4'; | ||
| import { z, type ZodType } from '../util/zod'; | ||
| import { jsonValueSchema } from './json-value'; | ||
@@ -13,5 +13,5 @@ | ||
| export const providerMetadataSchema: z.ZodType<ProviderMetadata> = z.record( | ||
| export const providerMetadataSchema: ZodType<ProviderMetadata> = z.record( | ||
| z.string(), | ||
| z.record(z.string(), jsonValueSchema.optional()), | ||
| ); |
| import type { JSONObject } from '@ai-sdk/provider'; | ||
| import { z } from 'zod/v4'; | ||
| import { | ||
@@ -16,5 +15,6 @@ providerMetadataSchema, | ||
| import type { ValueOf } from '../util/value-of'; | ||
| import { z, type ZodType } from '../util/zod'; | ||
| import { lazySchema, zodSchema } from '@ai-sdk/provider-utils'; | ||
| const toolMetadataSchema: z.ZodType<JSONObject> = z.record( | ||
| const toolMetadataSchema: ZodType<JSONObject> = z.record( | ||
| z.string(), | ||
@@ -21,0 +21,0 @@ jsonValueSchema.optional(), |
@@ -9,3 +9,2 @@ import { TypeValidationError, type JSONObject } from '@ai-sdk/provider'; | ||
| } from '@ai-sdk/provider-utils'; | ||
| import { z } from 'zod/v4'; | ||
| import { InvalidArgumentError } from '../error'; | ||
@@ -15,2 +14,3 @@ import { jsonValueSchema } from '../types/json-value'; | ||
| import { providerMetadataSchema } from '../types/provider-metadata'; | ||
| import { z, type ZodType } from '../util/zod'; | ||
| import type { | ||
@@ -24,3 +24,3 @@ DataUIPart, | ||
| const toolMetadataSchema: z.ZodType<JSONObject> = z.record( | ||
| const toolMetadataSchema: ZodType<JSONObject> = z.record( | ||
| z.string(), | ||
@@ -27,0 +27,0 @@ jsonValueSchema.optional(), |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6671928
0.06%627
0.16%69322
0.15%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated