55 requiredDefaultOnError ,
66 vecSkipError ,
77} from "../schema-deserialize.js" ;
8- import { z } from "zod/v4" ;
8+ import * as z from "zod/v4" ;
99
1010/**
1111 * **UNSTABLE**
@@ -400,13 +400,12 @@ export const zErrorCode = z.union([
400400 z . literal ( - 32002 ) ,
401401 z . literal ( - 32042 ) ,
402402 z
403- . number ( )
404403 . int ( )
405404 . min ( - 2147483648 , {
406- message : "Invalid value: Expected int32 to be >= -2147483648" ,
405+ error : "Invalid value: Expected int32 to be >= -2147483648" ,
407406 } )
408407 . max ( 2147483647 , {
409- message : "Invalid value: Expected int32 to be <= 2147483647" ,
408+ error : "Invalid value: Expected int32 to be <= 2147483647" ,
410409 } ) ,
411410] ) ;
412411
@@ -839,11 +838,10 @@ export const zNesDocumentDidSaveCapabilities = z.object({
839838export const zNesEditHistoryCapabilities = z . object ( {
840839 _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
841840 maxCount : z
842- . number ( )
843841 . int ( )
844842 . gte ( 0 )
845843 . max ( 4294967295 , {
846- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
844+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
847845 } )
848846 . nullish ( ) ,
849847} ) ;
@@ -860,11 +858,11 @@ export const zNesEditHistoryEntry = z.object({
860858 * A code excerpt from a file.
861859 */
862860export const zNesExcerpt = z . object ( {
863- endLine : z . number ( ) . int ( ) . gte ( 0 ) . max ( 4294967295 , {
864- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
861+ endLine : z . int ( ) . gte ( 0 ) . max ( 4294967295 , {
862+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
865863 } ) ,
866- startLine : z . number ( ) . int ( ) . gte ( 0 ) . max ( 4294967295 , {
867- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
864+ startLine : z . int ( ) . gte ( 0 ) . max ( 4294967295 , {
865+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
868866 } ) ,
869867 text : z . string ( ) ,
870868} ) ;
@@ -898,11 +896,10 @@ export const zNesRecentFile = z.object({
898896export const zNesRecentFilesCapabilities = z . object ( {
899897 _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
900898 maxCount : z
901- . number ( )
902899 . int ( )
903900 . gte ( 0 )
904901 . max ( 4294967295 , {
905- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
902+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
906903 } )
907904 . nullish ( ) ,
908905} ) ;
@@ -994,11 +991,10 @@ export const zNesTriggerKind = z.union([
994991export const zNesUserActionsCapabilities = z . object ( {
995992 _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
996993 maxCount : z
997- . number ( )
998994 . int ( )
999995 . gte ( 0 )
1000996 . max ( 4294967295 , {
1001- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
997+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
1002998 } )
1003999 . nullish ( ) ,
10041000} ) ;
@@ -1267,11 +1263,11 @@ export const zPlanUpdate = z.object({
12671263 * The meaning of `character` depends on the negotiated position encoding.
12681264 */
12691265export const zPosition = z . object ( {
1270- character : z . number ( ) . int ( ) . gte ( 0 ) . max ( 4294967295 , {
1271- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
1266+ character : z . int ( ) . gte ( 0 ) . max ( 4294967295 , {
1267+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
12721268 } ) ,
1273- line : z . number ( ) . int ( ) . gte ( 0 ) . max ( 4294967295 , {
1274- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
1269+ line : z . int ( ) . gte ( 0 ) . max ( 4294967295 , {
1270+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
12751271 } ) ,
12761272} ) ;
12771273
@@ -1369,7 +1365,7 @@ export const zPromptCapabilities = z.object({
13691365 * This version is only bumped for breaking changes.
13701366 * Non-breaking changes should be introduced via capabilities.
13711367 */
1372- export const zProtocolVersion = z . number ( ) . int ( ) . gte ( 0 ) . lte ( 65535 ) ;
1368+ export const zProtocolVersion = z . int ( ) . gte ( 0 ) . lte ( 65535 ) ;
13731369
13741370/**
13751371 * Request parameters for the initialize method.
@@ -2029,19 +2025,17 @@ export const zLoadSessionRequest = z.object({
20292025export const zReadTextFileRequest = z . object ( {
20302026 _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
20312027 limit : z
2032- . number ( )
20332028 . int ( )
20342029 . gte ( 0 )
20352030 . max ( 4294967295 , {
2036- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
2031+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
20372032 } )
20382033 . nullish ( ) ,
20392034 line : z
2040- . number ( )
20412035 . int ( )
20422036 . gte ( 0 )
20432037 . max ( 4294967295 , {
2044- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
2038+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
20452039 } )
20462040 . nullish ( ) ,
20472041 path : z . string ( ) ,
@@ -2374,19 +2368,17 @@ export const zStringPropertySchema = z.object({
23742368 enum : z . array ( z . string ( ) ) . nullish ( ) ,
23752369 format : zStringFormat . nullish ( ) ,
23762370 maxLength : z
2377- . number ( )
23782371 . int ( )
23792372 . gte ( 0 )
23802373 . max ( 4294967295 , {
2381- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
2374+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
23822375 } )
23832376 . nullish ( ) ,
23842377 minLength : z
2385- . number ( )
23862378 . int ( )
23872379 . gte ( 0 )
23882380 . max ( 4294967295 , {
2389- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
2381+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
23902382 } )
23912383 . nullish ( ) ,
23922384 oneOf : z . array ( zEnumOption ) . nullish ( ) ,
@@ -2434,11 +2426,10 @@ export const zTerminal = z.object({
24342426export const zTerminalExitStatus = z . object ( {
24352427 _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
24362428 exitCode : z
2437- . number ( )
24382429 . int ( )
24392430 . gte ( 0 )
24402431 . max ( 4294967295 , {
2441- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
2432+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
24422433 } )
24432434 . nullish ( ) ,
24442435 signal : z . string ( ) . nullish ( ) ,
@@ -2808,7 +2799,7 @@ export const zElicitationUrlMode = z.intersection(
28082799 z . union ( [ zElicitationSessionScope , zElicitationRequestScope ] ) ,
28092800 z . object ( {
28102801 elicitationId : zElicitationId ,
2811- url : z . string ( ) . url ( ) ,
2802+ url : z . url ( ) ,
28122803 } ) ,
28132804) ;
28142805
@@ -2823,11 +2814,10 @@ export const zElicitationUrlMode = z.intersection(
28232814export const zToolCallLocation = z . object ( {
28242815 _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
28252816 line : z
2826- . number ( )
28272817 . int ( )
28282818 . gte ( 0 )
28292819 . max ( 4294967295 , {
2830- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
2820+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
28312821 } )
28322822 . nullish ( ) ,
28332823 path : z . string ( ) ,
@@ -3282,11 +3272,10 @@ export const zWaitForTerminalExitRequest = z.object({
32823272export const zWaitForTerminalExitResponse = z . object ( {
32833273 _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
32843274 exitCode : z
3285- . number ( )
32863275 . int ( )
32873276 . gte ( 0 )
32883277 . max ( 4294967295 , {
3289- message : "Invalid value: Expected uint32 to be <= 4294967295" ,
3278+ error : "Invalid value: Expected uint32 to be <= 4294967295" ,
32903279 } )
32913280 . nullish ( ) ,
32923281 signal : z . string ( ) . nullish ( ) ,
0 commit comments