@@ -286,7 +286,17 @@ export const ClientCapabilitiesSchema = z.object({
286286 /**
287287 * Present if the client supports eliciting user input.
288288 */
289- elicitation : AssertObjectSchema . optional ( ) ,
289+ elicitation : z . intersection (
290+ z
291+ . object ( {
292+ /**
293+ * Whether the client should apply defaults to the user input.
294+ */
295+ applyDefaults : z . boolean ( ) . optional ( )
296+ } )
297+ . optional ( ) ,
298+ z . record ( z . string ( ) , z . unknown ( ) ) . optional ( )
299+ ) ,
290300 /**
291301 * Present if the client supports listing roots.
292302 */
@@ -1198,49 +1208,52 @@ export const CreateMessageResultSchema = ResultSchema.extend({
11981208 */
11991209export const BooleanSchemaSchema = z . object ( {
12001210 type : z . literal ( 'boolean' ) ,
1201- title : z . optional ( z . string ( ) ) ,
1202- description : z . optional ( z . string ( ) ) ,
1203- default : z . optional ( z . boolean ( ) )
1211+ title : z . string ( ) . optional ( ) ,
1212+ description : z . string ( ) . optional ( ) ,
1213+ default : z . boolean ( ) . optional ( )
12041214} ) ;
12051215
12061216/**
12071217 * Primitive schema definition for string fields.
12081218 */
12091219export const StringSchemaSchema = z . object ( {
12101220 type : z . literal ( 'string' ) ,
1211- title : z . optional ( z . string ( ) ) ,
1212- description : z . optional ( z . string ( ) ) ,
1213- minLength : z . optional ( z . number ( ) ) ,
1214- maxLength : z . optional ( z . number ( ) ) ,
1215- format : z . optional ( z . enum ( [ 'email' , 'uri' , 'date' , 'date-time' ] ) )
1221+ title : z . string ( ) . optional ( ) ,
1222+ description : z . string ( ) . optional ( ) ,
1223+ minLength : z . number ( ) . optional ( ) ,
1224+ maxLength : z . number ( ) . optional ( ) ,
1225+ format : z . enum ( [ 'email' , 'uri' , 'date' , 'date-time' ] ) . optional ( ) ,
1226+ default : z . string ( ) . optional ( )
12161227} ) ;
12171228
12181229/**
12191230 * Primitive schema definition for number fields.
12201231 */
12211232export const NumberSchemaSchema = z . object ( {
12221233 type : z . enum ( [ 'number' , 'integer' ] ) ,
1223- title : z . optional ( z . string ( ) ) ,
1224- description : z . optional ( z . string ( ) ) ,
1225- minimum : z . optional ( z . number ( ) ) ,
1226- maximum : z . optional ( z . number ( ) )
1234+ title : z . string ( ) . optional ( ) ,
1235+ description : z . string ( ) . optional ( ) ,
1236+ minimum : z . number ( ) . optional ( ) ,
1237+ maximum : z . number ( ) . optional ( ) ,
1238+ default : z . number ( ) . optional ( )
12271239} ) ;
12281240
12291241/**
12301242 * Primitive schema definition for enum fields.
12311243 */
12321244export const EnumSchemaSchema = z . object ( {
12331245 type : z . literal ( 'string' ) ,
1234- title : z . optional ( z . string ( ) ) ,
1235- description : z . optional ( z . string ( ) ) ,
1246+ title : z . string ( ) . optional ( ) ,
1247+ description : z . string ( ) . optional ( ) ,
12361248 enum : z . array ( z . string ( ) ) ,
1237- enumNames : z . optional ( z . array ( z . string ( ) ) )
1249+ enumNames : z . array ( z . string ( ) ) . optional ( ) ,
1250+ default : z . string ( ) . optional ( )
12381251} ) ;
12391252
12401253/**
12411254 * Union of all primitive schema definitions.
12421255 */
1243- export const PrimitiveSchemaDefinitionSchema = z . union ( [ BooleanSchemaSchema , StringSchemaSchema , NumberSchemaSchema , EnumSchemaSchema ] ) ;
1256+ export const PrimitiveSchemaDefinitionSchema = z . union ( [ EnumSchemaSchema , BooleanSchemaSchema , StringSchemaSchema , NumberSchemaSchema ] ) ;
12441257
12451258/**
12461259 * Parameters for an `elicitation/create` request.
0 commit comments