@modelcontextprotocol/ext-apps 0.3.1 → 0.4.0

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.
@@ -55,20 +55,24 @@ export declare const McpUiSandboxProxyReadyNotificationSchema: z.ZodObject<{
55
55
  params: z.ZodObject<{}, z.core.$strip>;
56
56
  }, z.core.$strip>;
57
57
  /**
58
- * @description Notification containing HTML resource for the sandbox proxy to load.
59
- * @internal
60
- * @see https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx#sandbox-proxy
58
+ * @description Content Security Policy configuration for UI resources.
61
59
  */
62
- export declare const McpUiSandboxResourceReadyNotificationSchema: z.ZodObject<{
63
- method: z.ZodLiteral<"ui/notifications/sandbox-resource-ready">;
64
- params: z.ZodObject<{
65
- html: z.ZodString;
66
- sandbox: z.ZodOptional<z.ZodString>;
67
- csp: z.ZodOptional<z.ZodObject<{
68
- connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
69
- resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
- }, z.core.$strip>>;
71
- }, z.core.$strip>;
60
+ export declare const McpUiResourceCspSchema: z.ZodObject<{
61
+ connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
63
+ frameDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ baseUriDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
+ }, z.core.$strip>;
66
+ /**
67
+ * @description Sandbox permissions requested by the UI resource.
68
+ * Hosts MAY honor these by setting appropriate iframe `allow` attributes.
69
+ * Apps SHOULD NOT assume permissions are granted; use JS feature detection as fallback.
70
+ */
71
+ export declare const McpUiResourcePermissionsSchema: z.ZodObject<{
72
+ camera: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
73
+ microphone: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
74
+ geolocation: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
75
+ clipboardWrite: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
72
76
  }, z.core.$strip>;
73
77
  /**
74
78
  * @description Notification of UI size changes (bidirectional: Guest <-> Host).
@@ -138,6 +142,14 @@ export declare const McpUiResourceTeardownRequestSchema: z.ZodObject<{
138
142
  * @see {@link McpUiResourceTeardownRequest}
139
143
  */
140
144
  export declare const McpUiResourceTeardownResultSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
145
+ export declare const McpUiSupportedContentBlockModalitiesSchema: z.ZodObject<{
146
+ text: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
147
+ image: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
148
+ audio: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
149
+ resource: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
150
+ resourceLink: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
151
+ structuredContent: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
152
+ }, z.core.$strip>;
141
153
  /**
142
154
  * @description Capabilities supported by the host application.
143
155
  * @see {@link McpUiInitializeResult} for the initialization result that includes these capabilities
@@ -152,6 +164,36 @@ export declare const McpUiHostCapabilitiesSchema: z.ZodObject<{
152
164
  listChanged: z.ZodOptional<z.ZodBoolean>;
153
165
  }, z.core.$strip>>;
154
166
  logging: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
167
+ sandbox: z.ZodOptional<z.ZodObject<{
168
+ permissions: z.ZodOptional<z.ZodObject<{
169
+ camera: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
170
+ microphone: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
171
+ geolocation: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
172
+ clipboardWrite: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
173
+ }, z.core.$strip>>;
174
+ csp: z.ZodOptional<z.ZodObject<{
175
+ connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
176
+ resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
177
+ frameDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
178
+ baseUriDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
179
+ }, z.core.$strip>>;
180
+ }, z.core.$strip>>;
181
+ updateModelContext: z.ZodOptional<z.ZodObject<{
182
+ text: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
183
+ image: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
184
+ audio: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
185
+ resource: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
186
+ resourceLink: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
187
+ structuredContent: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
188
+ }, z.core.$strip>>;
189
+ message: z.ZodOptional<z.ZodObject<{
190
+ text: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
191
+ image: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
192
+ audio: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
193
+ resource: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
194
+ resourceLink: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
195
+ structuredContent: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
196
+ }, z.core.$strip>>;
155
197
  }, z.core.$strip>;
156
198
  /**
157
199
  * @description Capabilities provided by the Guest UI (App).
@@ -171,13 +213,6 @@ export declare const McpUiInitializedNotificationSchema: z.ZodObject<{
171
213
  method: z.ZodLiteral<"ui/notifications/initialized">;
172
214
  params: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
173
215
  }, z.core.$strip>;
174
- /**
175
- * @description Content Security Policy configuration for UI resources.
176
- */
177
- export declare const McpUiResourceCspSchema: z.ZodObject<{
178
- connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
179
- resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
180
- }, z.core.$strip>;
181
216
  /**
182
217
  * @description UI Resource metadata for security and rendering configuration.
183
218
  */
@@ -185,6 +220,14 @@ export declare const McpUiResourceMetaSchema: z.ZodObject<{
185
220
  csp: z.ZodOptional<z.ZodObject<{
186
221
  connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
187
222
  resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
223
+ frameDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
224
+ baseUriDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
225
+ }, z.core.$strip>>;
226
+ permissions: z.ZodOptional<z.ZodObject<{
227
+ camera: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
228
+ microphone: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
229
+ geolocation: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
230
+ clipboardWrite: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
188
231
  }, z.core.$strip>>;
189
232
  domain: z.ZodOptional<z.ZodString>;
190
233
  prefersBorder: z.ZodOptional<z.ZodBoolean>;
@@ -315,6 +358,30 @@ export declare const McpUiMessageRequestSchema: z.ZodObject<{
315
358
  }, z.core.$strip>]>>;
316
359
  }, z.core.$strip>;
317
360
  }, z.core.$strip>;
361
+ /**
362
+ * @description Notification containing HTML resource for the sandbox proxy to load.
363
+ * @internal
364
+ * @see https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx#sandbox-proxy
365
+ */
366
+ export declare const McpUiSandboxResourceReadyNotificationSchema: z.ZodObject<{
367
+ method: z.ZodLiteral<"ui/notifications/sandbox-resource-ready">;
368
+ params: z.ZodObject<{
369
+ html: z.ZodString;
370
+ sandbox: z.ZodOptional<z.ZodString>;
371
+ csp: z.ZodOptional<z.ZodObject<{
372
+ connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
373
+ resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
374
+ frameDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
375
+ baseUriDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
376
+ }, z.core.$strip>>;
377
+ permissions: z.ZodOptional<z.ZodObject<{
378
+ camera: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
379
+ microphone: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
380
+ geolocation: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
381
+ clipboardWrite: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
382
+ }, z.core.$strip>>;
383
+ }, z.core.$strip>;
384
+ }, z.core.$strip>;
318
385
  /**
319
386
  * @description Notification containing tool execution result (Host -> Guest UI).
320
387
  */
@@ -579,6 +646,110 @@ export declare const McpUiHostContextChangedNotificationSchema: z.ZodObject<{
579
646
  }, z.core.$strip>>;
580
647
  }, z.core.$loose>;
581
648
  }, z.core.$strip>;
649
+ /**
650
+ * @description Request to update the agent's context without requiring a follow-up action (Guest UI -> Host).
651
+ *
652
+ * Unlike `notifications/message` which is for debugging/logging, this request is intended
653
+ * to update the Host's model context. Each request overwrites the previous context sent by the Guest UI.
654
+ * Unlike messages, context updates do not trigger follow-ups.
655
+ *
656
+ * The host will typically defer sending the context to the model until the next user message
657
+ * (including `ui/message`), and will only send the last update received.
658
+ *
659
+ * @see {@link app.App.updateModelContext} for the method that sends this request
660
+ */
661
+ export declare const McpUiUpdateModelContextRequestSchema: z.ZodObject<{
662
+ method: z.ZodLiteral<"ui/update-model-context">;
663
+ params: z.ZodObject<{
664
+ content: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
665
+ type: z.ZodLiteral<"text">;
666
+ text: z.ZodString;
667
+ annotations: z.ZodOptional<z.ZodObject<{
668
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
669
+ user: "user";
670
+ assistant: "assistant";
671
+ }>>>;
672
+ priority: z.ZodOptional<z.ZodNumber>;
673
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
674
+ }, z.core.$strip>>;
675
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
676
+ }, z.core.$strip>, z.ZodObject<{
677
+ type: z.ZodLiteral<"image">;
678
+ data: z.ZodString;
679
+ mimeType: z.ZodString;
680
+ annotations: z.ZodOptional<z.ZodObject<{
681
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
682
+ user: "user";
683
+ assistant: "assistant";
684
+ }>>>;
685
+ priority: z.ZodOptional<z.ZodNumber>;
686
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
687
+ }, z.core.$strip>>;
688
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
689
+ }, z.core.$strip>, z.ZodObject<{
690
+ type: z.ZodLiteral<"audio">;
691
+ data: z.ZodString;
692
+ mimeType: z.ZodString;
693
+ annotations: z.ZodOptional<z.ZodObject<{
694
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
695
+ user: "user";
696
+ assistant: "assistant";
697
+ }>>>;
698
+ priority: z.ZodOptional<z.ZodNumber>;
699
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
700
+ }, z.core.$strip>>;
701
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
702
+ }, z.core.$strip>, z.ZodObject<{
703
+ uri: z.ZodString;
704
+ description: z.ZodOptional<z.ZodString>;
705
+ mimeType: z.ZodOptional<z.ZodString>;
706
+ annotations: z.ZodOptional<z.ZodObject<{
707
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
708
+ user: "user";
709
+ assistant: "assistant";
710
+ }>>>;
711
+ priority: z.ZodOptional<z.ZodNumber>;
712
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
713
+ }, z.core.$strip>>;
714
+ _meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
715
+ icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
716
+ src: z.ZodString;
717
+ mimeType: z.ZodOptional<z.ZodString>;
718
+ sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
719
+ theme: z.ZodOptional<z.ZodEnum<{
720
+ light: "light";
721
+ dark: "dark";
722
+ }>>;
723
+ }, z.core.$strip>>>;
724
+ name: z.ZodString;
725
+ title: z.ZodOptional<z.ZodString>;
726
+ type: z.ZodLiteral<"resource_link">;
727
+ }, z.core.$strip>, z.ZodObject<{
728
+ type: z.ZodLiteral<"resource">;
729
+ resource: z.ZodUnion<readonly [z.ZodObject<{
730
+ uri: z.ZodString;
731
+ mimeType: z.ZodOptional<z.ZodString>;
732
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
733
+ text: z.ZodString;
734
+ }, z.core.$strip>, z.ZodObject<{
735
+ uri: z.ZodString;
736
+ mimeType: z.ZodOptional<z.ZodString>;
737
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
738
+ blob: z.ZodString;
739
+ }, z.core.$strip>]>;
740
+ annotations: z.ZodOptional<z.ZodObject<{
741
+ audience: z.ZodOptional<z.ZodArray<z.ZodEnum<{
742
+ user: "user";
743
+ assistant: "assistant";
744
+ }>>>;
745
+ priority: z.ZodOptional<z.ZodNumber>;
746
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
747
+ }, z.core.$strip>>;
748
+ _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
749
+ }, z.core.$strip>]>>>;
750
+ structuredContent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
751
+ }, z.core.$strip>;
752
+ }, z.core.$strip>;
582
753
  /**
583
754
  * @description Initialization request sent from Guest UI to Host.
584
755
  * @see {@link app.App.connect} for the method that sends this request
@@ -643,6 +814,36 @@ export declare const McpUiInitializeResultSchema: z.ZodObject<{
643
814
  listChanged: z.ZodOptional<z.ZodBoolean>;
644
815
  }, z.core.$strip>>;
645
816
  logging: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
817
+ sandbox: z.ZodOptional<z.ZodObject<{
818
+ permissions: z.ZodOptional<z.ZodObject<{
819
+ camera: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
820
+ microphone: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
821
+ geolocation: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
822
+ clipboardWrite: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
823
+ }, z.core.$strip>>;
824
+ csp: z.ZodOptional<z.ZodObject<{
825
+ connectDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
826
+ resourceDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
827
+ frameDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
828
+ baseUriDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
829
+ }, z.core.$strip>>;
830
+ }, z.core.$strip>>;
831
+ updateModelContext: z.ZodOptional<z.ZodObject<{
832
+ text: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
833
+ image: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
834
+ audio: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
835
+ resource: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
836
+ resourceLink: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
837
+ structuredContent: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
838
+ }, z.core.$strip>>;
839
+ message: z.ZodOptional<z.ZodObject<{
840
+ text: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
841
+ image: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
842
+ audio: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
843
+ resource: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
844
+ resourceLink: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
845
+ structuredContent: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
846
+ }, z.core.$strip>>;
646
847
  }, z.core.$strip>;
647
848
  hostContext: z.ZodObject<{
648
849
  toolInfo: z.ZodOptional<z.ZodObject<{
@@ -8,7 +8,8 @@ export type McpUiOpenLinkRequestSchemaInferredType = z.infer<typeof generated.Mc
8
8
  export type McpUiOpenLinkResultSchemaInferredType = z.infer<typeof generated.McpUiOpenLinkResultSchema>;
9
9
  export type McpUiMessageResultSchemaInferredType = z.infer<typeof generated.McpUiMessageResultSchema>;
10
10
  export type McpUiSandboxProxyReadyNotificationSchemaInferredType = z.infer<typeof generated.McpUiSandboxProxyReadyNotificationSchema>;
11
- export type McpUiSandboxResourceReadyNotificationSchemaInferredType = z.infer<typeof generated.McpUiSandboxResourceReadyNotificationSchema>;
11
+ export type McpUiResourceCspSchemaInferredType = z.infer<typeof generated.McpUiResourceCspSchema>;
12
+ export type McpUiResourcePermissionsSchemaInferredType = z.infer<typeof generated.McpUiResourcePermissionsSchema>;
12
13
  export type McpUiSizeChangedNotificationSchemaInferredType = z.infer<typeof generated.McpUiSizeChangedNotificationSchema>;
13
14
  export type McpUiToolInputNotificationSchemaInferredType = z.infer<typeof generated.McpUiToolInputNotificationSchema>;
14
15
  export type McpUiToolInputPartialNotificationSchemaInferredType = z.infer<typeof generated.McpUiToolInputPartialNotificationSchema>;
@@ -17,18 +18,20 @@ export type McpUiHostCssSchemaInferredType = z.infer<typeof generated.McpUiHostC
17
18
  export type McpUiHostStylesSchemaInferredType = z.infer<typeof generated.McpUiHostStylesSchema>;
18
19
  export type McpUiResourceTeardownRequestSchemaInferredType = z.infer<typeof generated.McpUiResourceTeardownRequestSchema>;
19
20
  export type McpUiResourceTeardownResultSchemaInferredType = z.infer<typeof generated.McpUiResourceTeardownResultSchema>;
21
+ export type McpUiSupportedContentBlockModalitiesSchemaInferredType = z.infer<typeof generated.McpUiSupportedContentBlockModalitiesSchema>;
20
22
  export type McpUiHostCapabilitiesSchemaInferredType = z.infer<typeof generated.McpUiHostCapabilitiesSchema>;
21
23
  export type McpUiAppCapabilitiesSchemaInferredType = z.infer<typeof generated.McpUiAppCapabilitiesSchema>;
22
24
  export type McpUiInitializedNotificationSchemaInferredType = z.infer<typeof generated.McpUiInitializedNotificationSchema>;
23
- export type McpUiResourceCspSchemaInferredType = z.infer<typeof generated.McpUiResourceCspSchema>;
24
25
  export type McpUiResourceMetaSchemaInferredType = z.infer<typeof generated.McpUiResourceMetaSchema>;
25
26
  export type McpUiRequestDisplayModeRequestSchemaInferredType = z.infer<typeof generated.McpUiRequestDisplayModeRequestSchema>;
26
27
  export type McpUiRequestDisplayModeResultSchemaInferredType = z.infer<typeof generated.McpUiRequestDisplayModeResultSchema>;
27
28
  export type McpUiToolVisibilitySchemaInferredType = z.infer<typeof generated.McpUiToolVisibilitySchema>;
28
29
  export type McpUiToolMetaSchemaInferredType = z.infer<typeof generated.McpUiToolMetaSchema>;
29
30
  export type McpUiMessageRequestSchemaInferredType = z.infer<typeof generated.McpUiMessageRequestSchema>;
31
+ export type McpUiSandboxResourceReadyNotificationSchemaInferredType = z.infer<typeof generated.McpUiSandboxResourceReadyNotificationSchema>;
30
32
  export type McpUiToolResultNotificationSchemaInferredType = z.infer<typeof generated.McpUiToolResultNotificationSchema>;
31
33
  export type McpUiHostContextSchemaInferredType = z.infer<typeof generated.McpUiHostContextSchema>;
32
34
  export type McpUiHostContextChangedNotificationSchemaInferredType = z.infer<typeof generated.McpUiHostContextChangedNotificationSchema>;
35
+ export type McpUiUpdateModelContextRequestSchemaInferredType = z.infer<typeof generated.McpUiUpdateModelContextRequestSchema>;
33
36
  export type McpUiInitializeRequestSchemaInferredType = z.infer<typeof generated.McpUiInitializeRequestSchema>;
34
37
  export type McpUiInitializeResultSchemaInferredType = z.infer<typeof generated.McpUiInitializeResultSchema>;