Skip to content

Commit 49fd0e7

Browse files
chughtapanclaude
andcommitted
Fix extensions field to use JSONObjectSchema instead of removed AssertObjectSchema
The merge with main brought in modelcontextprotocol#1612 which replaced AssertObjectSchema with JSONObjectSchema, but the extensions fields were not updated. Also fixes spec.types.ts to use JSONObject (matching experimental) for bidirectional type compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1b73042 commit 49fd0e7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/core/src/types/spec.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ export interface ClientCapabilities {
586586
* @example Extensions — UI extension with MIME type support
587587
* {@includeCode ./examples/ClientCapabilities/extensions-ui-mime-types.json}
588588
*/
589-
extensions?: { [key: string]: object };
589+
extensions?: { [key: string]: JSONObject };
590590
}
591591

592592
/**
@@ -703,7 +703,7 @@ export interface ServerCapabilities {
703703
* @example Extensions — UI extension support
704704
* {@includeCode ./examples/ServerCapabilities/extensions-ui.json}
705705
*/
706-
extensions?: { [key: string]: object };
706+
extensions?: { [key: string]: JSONObject };
707707
}
708708

709709
/**

packages/core/src/types/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ export const ClientCapabilitiesSchema = z.object({
560560
/**
561561
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
562562
*/
563-
extensions: z.record(z.string(), AssertObjectSchema).optional()
563+
extensions: z.record(z.string(), JSONObjectSchema).optional()
564564
});
565565

566566
export const InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
@@ -642,7 +642,7 @@ export const ServerCapabilitiesSchema = z.object({
642642
/**
643643
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
644644
*/
645-
extensions: z.record(z.string(), AssertObjectSchema).optional()
645+
extensions: z.record(z.string(), JSONObjectSchema).optional()
646646
});
647647

648648
/**

0 commit comments

Comments
 (0)