@modelcontextprotocol/ext-apps 0.3.1 → 0.4.1

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.
@@ -1,8 +1,8 @@
1
1
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
2
  import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
3
- import { CallToolRequest, CallToolResult, Implementation, ListPromptsRequest, ListPromptsResult, ListResourcesRequest, ListResourcesResult, ListResourceTemplatesRequest, ListResourceTemplatesResult, LoggingMessageNotification, PingRequest, PromptListChangedNotification, ReadResourceRequest, ReadResourceResult, ResourceListChangedNotification, ToolListChangedNotification } from "@modelcontextprotocol/sdk/types.js";
3
+ import { CallToolRequest, CallToolResult, EmptyResult, Implementation, ListPromptsRequest, ListPromptsResult, ListResourcesRequest, ListResourcesResult, ListResourceTemplatesRequest, ListResourceTemplatesResult, LoggingMessageNotification, PingRequest, PromptListChangedNotification, ReadResourceRequest, ReadResourceResult, ResourceListChangedNotification, Tool, ToolListChangedNotification } from "@modelcontextprotocol/sdk/types.js";
4
4
  import { Protocol, ProtocolOptions, RequestOptions } from "@modelcontextprotocol/sdk/shared/protocol.js";
5
- import { type AppNotification, type AppRequest, type AppResult, type McpUiSandboxResourceReadyNotification, type McpUiSizeChangedNotification, type McpUiToolCancelledNotification, type McpUiToolInputNotification, type McpUiToolInputPartialNotification, type McpUiToolResultNotification, McpUiAppCapabilities, McpUiHostCapabilities, McpUiHostContext, McpUiHostContextChangedNotification, McpUiInitializedNotification, McpUiMessageRequest, McpUiMessageResult, McpUiOpenLinkRequest, McpUiOpenLinkResult, McpUiResourceTeardownRequest, McpUiSandboxProxyReadyNotification, McpUiRequestDisplayModeRequest, McpUiRequestDisplayModeResult } from "./types";
5
+ import { type AppNotification, type AppRequest, type AppResult, type McpUiSandboxResourceReadyNotification, type McpUiSizeChangedNotification, type McpUiToolCancelledNotification, type McpUiToolInputNotification, type McpUiToolInputPartialNotification, type McpUiToolResultNotification, McpUiAppCapabilities, McpUiUpdateModelContextRequest, McpUiHostCapabilities, McpUiHostContext, McpUiHostContextChangedNotification, McpUiInitializedNotification, McpUiMessageRequest, McpUiMessageResult, McpUiOpenLinkRequest, McpUiOpenLinkResult, McpUiResourceTeardownRequest, McpUiSandboxProxyReadyNotification, McpUiRequestDisplayModeRequest, McpUiRequestDisplayModeResult, McpUiResourcePermissions } from "./types";
6
6
  export * from "./types";
7
7
  export { RESOURCE_URI_META_KEY, RESOURCE_MIME_TYPE } from "./app";
8
8
  export { PostMessageTransport } from "./message-transport";
@@ -15,7 +15,7 @@ export { PostMessageTransport } from "./message-transport";
15
15
  *
16
16
  * @param tool - A tool object with optional `_meta` property
17
17
  * @returns The UI resource URI if valid, undefined if not present
18
- * @throws Error if resourceUri is present but invalid (not starting with "ui://")
18
+ * @throws Error if resourceUri is present but invalid (does not start with "ui://")
19
19
  *
20
20
  * @example
21
21
  * ```typescript
@@ -30,13 +30,31 @@ export { PostMessageTransport } from "./message-transport";
30
30
  * });
31
31
  * ```
32
32
  */
33
- export declare function getToolUiResourceUri(tool: {
34
- _meta?: Record<string, unknown>;
35
- }): string | undefined;
33
+ export declare function getToolUiResourceUri(tool: Partial<Tool>): string | undefined;
36
34
  /**
37
- * Options for configuring AppBridge behavior.
35
+ * Build iframe `allow` attribute string from permissions.
38
36
  *
39
- * @see ProtocolOptions from @modelcontextprotocol/sdk for available options
37
+ * Maps McpUiResourcePermissions to the Permission Policy allow attribute
38
+ * format used by iframes (e.g., "microphone; clipboard-write").
39
+ *
40
+ * @param permissions - Permissions requested by the UI resource
41
+ * @returns Space-separated permission directives, or empty string if none
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const allow = buildAllowAttribute({ microphone: {}, clipboardWrite: {} });
46
+ * // Returns: "microphone; clipboard-write"
47
+ * iframe.setAttribute("allow", allow);
48
+ * ```
49
+ */
50
+ export declare function buildAllowAttribute(permissions: McpUiResourcePermissions | undefined): string;
51
+ /**
52
+ * Options for configuring {@link AppBridge} behavior.
53
+ *
54
+ * @property hostContext - Optional initial host context to provide to the Guest UI
55
+ *
56
+ * @see `ProtocolOptions` from @modelcontextprotocol/sdk for available options
57
+ * @see {@link McpUiHostContext} for the hostContext structure
40
58
  */
41
59
  export type HostOptions = ProtocolOptions & {
42
60
  hostContext?: McpUiHostContext;
@@ -51,7 +69,7 @@ export declare const SUPPORTED_PROTOCOL_VERSIONS: string[];
51
69
  /**
52
70
  * Extra metadata passed to request handlers.
53
71
  *
54
- * This type represents the additional context provided by the Protocol class
72
+ * This type represents the additional context provided by the `Protocol` class
55
73
  * when handling requests, including abort signals and session information.
56
74
  * It is extracted from the MCP SDK's request handler signature.
57
75
  *
@@ -59,12 +77,13 @@ export declare const SUPPORTED_PROTOCOL_VERSIONS: string[];
59
77
  */
60
78
  type RequestHandlerExtra = Parameters<Parameters<AppBridge["setRequestHandler"]>[1]>[1];
61
79
  /**
62
- * Host-side bridge for communicating with a single Guest UI (App).
80
+ * Host-side bridge for communicating with a single Guest UI ({@link app!App}).
63
81
  *
64
- * AppBridge extends the MCP SDK's Protocol class and acts as a proxy between
65
- * the host application and a Guest UI running in an iframe. It automatically
66
- * forwards MCP server capabilities (tools, resources, prompts) to the Guest UI
67
- * and handles the initialization handshake.
82
+ * `AppBridge` extends the MCP SDK's `Protocol` class and acts as a proxy between
83
+ * the host application and a Guest UI running in an iframe. When an MCP client
84
+ * is provided to the constructor, it automatically forwards MCP server capabilities
85
+ * (tools, resources, prompts) to the Guest UI. It also handles the initialization
86
+ * handshake.
68
87
  *
69
88
  * ## Architecture
70
89
  *
@@ -76,11 +95,11 @@ type RequestHandlerExtra = Parameters<Parameters<AppBridge["setRequestHandler"]>
76
95
  *
77
96
  * ## Lifecycle
78
97
  *
79
- * 1. **Create**: Instantiate AppBridge with MCP client and capabilities
98
+ * 1. **Create**: Instantiate `AppBridge` with MCP client and capabilities
80
99
  * 2. **Connect**: Call `connect()` with transport to establish communication
81
100
  * 3. **Wait for init**: Guest UI sends initialize request, bridge responds
82
- * 4. **Send data**: Call `sendToolInput()`, `sendToolResult()`, etc.
83
- * 5. **Teardown**: Call `teardownResource()` before unmounting iframe
101
+ * 4. **Send data**: Call {@link sendToolInput}, {@link sendToolResult}, etc.
102
+ * 5. **Teardown**: Call {@link teardownResource} before unmounting iframe
84
103
  *
85
104
  * @example Basic usage
86
105
  * ```typescript
@@ -130,7 +149,7 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
130
149
  * @param _client - MCP client connected to the server, or `null`. When provided,
131
150
  * {@link connect} will automatically set up forwarding of MCP requests/notifications
132
151
  * between the Guest UI and the server. When `null`, you must register handlers
133
- * manually using the `oncalltool`, `onlistresources`, etc. setters.
152
+ * manually using the {@link oncalltool}, {@link onlistresources}, etc. setters.
134
153
  * @param _hostInfo - Host application identification (name and version)
135
154
  * @param _capabilities - Features and capabilities the host supports
136
155
  * @param options - Configuration options (inherited from Protocol)
@@ -200,7 +219,7 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
200
219
  * Optional handler for ping requests from the Guest UI.
201
220
  *
202
221
  * The Guest UI can send standard MCP `ping` requests to verify the connection
203
- * is alive. The AppBridge automatically responds with an empty object, but this
222
+ * is alive. The {@link AppBridge} automatically responds with an empty object, but this
204
223
  * handler allows the host to observe or log ping activity.
205
224
  *
206
225
  * Unlike the other handlers which use setters, this is a direct property
@@ -221,7 +240,7 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
221
240
  * Register a handler for size change notifications from the Guest UI.
222
241
  *
223
242
  * The Guest UI sends `ui/notifications/size-changed` when its rendered content
224
- * size changes, typically via ResizeObserver. Set this callback to dynamically
243
+ * size changes, typically via `ResizeObserver`. Set this callback to dynamically
225
244
  * adjust the iframe container dimensions based on the Guest UI's content.
226
245
  *
227
246
  * Note: This is for Guest UI → Host communication. To notify the Guest UI of
@@ -240,7 +259,7 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
240
259
  * ```
241
260
  *
242
261
  * @see {@link McpUiSizeChangedNotification} for the notification type
243
- * @see {@link app.App.sendSizeChanged} for Host Guest UI size notifications
262
+ * @see {@link app!App.sendSizeChanged} - the Guest UI method that sends these notifications
244
263
  */
245
264
  set onsizechange(callback: (params: McpUiSizeChangedNotification["params"]) => void);
246
265
  /**
@@ -305,10 +324,10 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
305
324
  * leakage.
306
325
  *
307
326
  * @param callback - Handler that receives message params and returns a result
308
- * - params.role - Message role (currently only "user" is supported)
309
- * - params.content - Message content blocks (text, image, etc.)
310
- * - extra - Request metadata (abort signal, session info)
311
- * - Returns: Promise<McpUiMessageResult> with optional isError flag
327
+ * - `params.role` - Message role (currently only "user" is supported)
328
+ * - `params.content` - Message content blocks (text, image, etc.)
329
+ * - `extra` - Request metadata (abort signal, session info)
330
+ * - Returns: `Promise<McpUiMessageResult>` with optional `isError` flag
312
331
  *
313
332
  * @example
314
333
  * ```typescript
@@ -341,9 +360,9 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
341
360
  * - Reject the request entirely
342
361
  *
343
362
  * @param callback - Handler that receives URL params and returns a result
344
- * - params.url - URL to open in the host's browser
345
- * - extra - Request metadata (abort signal, session info)
346
- * - Returns: Promise<McpUiOpenLinkResult> with optional isError flag
363
+ * - `params.url` - URL to open in the host's browser
364
+ * - `extra` - Request metadata (abort signal, session info)
365
+ * - Returns: `Promise<McpUiOpenLinkResult>` with optional `isError` flag
347
366
  *
348
367
  * @example
349
368
  * ```typescript
@@ -382,17 +401,22 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
382
401
  * If the requested mode is not available, the handler should return the current
383
402
  * display mode instead.
384
403
  *
404
+ * By default, `AppBridge` returns the current `displayMode` from host context (or "inline").
405
+ * Setting this property replaces that default behavior.
406
+ *
385
407
  * @param callback - Handler that receives the requested mode and returns the actual mode set
386
- * - params.mode - The display mode being requested ("inline" | "fullscreen" | "pip")
387
- * - extra - Request metadata (abort signal, session info)
388
- * - Returns: Promise<McpUiRequestDisplayModeResult> with the actual mode set
408
+ * - `params.mode` - The display mode being requested ("inline" | "fullscreen" | "pip")
409
+ * - `extra` - Request metadata (abort signal, session info)
410
+ * - Returns: `Promise<McpUiRequestDisplayModeResult>` with the actual mode set
389
411
  *
390
412
  * @example
391
413
  * ```typescript
414
+ * let currentDisplayMode: McpUiDisplayMode = "inline";
415
+ *
392
416
  * bridge.onrequestdisplaymode = async ({ mode }, extra) => {
393
417
  * const availableModes = hostContext.availableDisplayModes ?? ["inline"];
394
418
  * if (availableModes.includes(mode)) {
395
- * setDisplayMode(mode);
419
+ * currentDisplayMode = mode;
396
420
  * return { mode };
397
421
  * }
398
422
  * // Return current mode if requested mode not available
@@ -416,9 +440,9 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
416
440
  * message type.
417
441
  *
418
442
  * @param callback - Handler that receives logging params
419
- * - params.level - Log level: "debug" | "info" | "notice" | "warning" | "error" | "critical" | "alert" | "emergency"
420
- * - params.logger - Optional logger name/identifier
421
- * - params.data - Log message and optional structured data
443
+ * - `params.level` - Log level: "debug" | "info" | "notice" | "warning" | "error" | "critical" | "alert" | "emergency"
444
+ * - `params.logger` - Optional logger name/identifier
445
+ * - `params.data` - Log message and optional structured data
422
446
  *
423
447
  * @example
424
448
  * ```typescript
@@ -432,6 +456,35 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
432
456
  * ```
433
457
  */
434
458
  set onloggingmessage(callback: (params: LoggingMessageNotification["params"]) => void);
459
+ /**
460
+ * Register a handler for model context updates from the Guest UI.
461
+ *
462
+ * The Guest UI sends `ui/update-model-context` requests to update the Host's
463
+ * model context. Each request overwrites the previous context stored by the Guest UI.
464
+ * Unlike logging messages, context updates are intended to be available to
465
+ * the model in future turns. Unlike messages, context updates do not trigger follow-ups.
466
+ *
467
+ * The host will typically defer sending the context to the model until the
468
+ * next user message (including `ui/message`), and will only send the last
469
+ * update received.
470
+ *
471
+ * @example
472
+ * ```typescript
473
+ * bridge.onupdatemodelcontext = async ({ content, structuredContent }, extra) => {
474
+ * // Update the model context with the new snapshot
475
+ * modelContext = {
476
+ * type: "app_context",
477
+ * content,
478
+ * structuredContent,
479
+ * timestamp: Date.now()
480
+ * };
481
+ * return {};
482
+ * };
483
+ * ```
484
+ *
485
+ * @see {@link McpUiUpdateModelContextRequest} for the request type
486
+ */
487
+ set onupdatemodelcontext(callback: (params: McpUiUpdateModelContextRequest["params"], extra: RequestHandlerExtra) => Promise<EmptyResult>);
435
488
  /**
436
489
  * Register a handler for tool call requests from the Guest UI.
437
490
  *
@@ -440,9 +493,9 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
440
493
  * by forwarding them to the MCP server.
441
494
  *
442
495
  * @param callback - Handler that receives tool call params and returns a
443
- * {@link CallToolResult}
444
- * @param callback.params - Tool call parameters (name and arguments)
445
- * @param callback.extra - Request metadata (abort signal, session info)
496
+ * `CallToolResult`
497
+ * - `params` - Tool call parameters (name and arguments)
498
+ * - `extra` - Request metadata (abort signal, session info)
446
499
  *
447
500
  * @example
448
501
  * ```typescript
@@ -455,8 +508,8 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
455
508
  * };
456
509
  * ```
457
510
  *
458
- * @see {@link CallToolRequest} for the request type
459
- * @see {@link CallToolResult} for the result type
511
+ * @see `CallToolRequest` from @modelcontextprotocol/sdk for the request type
512
+ * @see `CallToolResult` from @modelcontextprotocol/sdk for the result type
460
513
  */
461
514
  set oncalltool(callback: (params: CallToolRequest["params"], extra: RequestHandlerExtra) => Promise<CallToolResult>);
462
515
  /**
@@ -476,7 +529,7 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
476
529
  * });
477
530
  * ```
478
531
  *
479
- * @see {@link ToolListChangedNotification} for the notification type
532
+ * @see `ToolListChangedNotification` from @modelcontextprotocol/sdk for the notification type
480
533
  */
481
534
  sendToolListChanged(params?: ToolListChangedNotification["params"]): Promise<void>;
482
535
  /**
@@ -487,9 +540,9 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
487
540
  * requests, typically by forwarding them to the MCP server.
488
541
  *
489
542
  * @param callback - Handler that receives list params and returns a
490
- * {@link ListResourcesResult}
491
- * @param callback.params - Request params (may include cursor for pagination)
492
- * @param callback.extra - Request metadata (abort signal, session info)
543
+ * `ListResourcesResult`
544
+ * - `params` - Request params (may include cursor for pagination)
545
+ * - `extra` - Request metadata (abort signal, session info)
493
546
  *
494
547
  * @example
495
548
  * ```typescript
@@ -502,8 +555,8 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
502
555
  * };
503
556
  * ```
504
557
  *
505
- * @see {@link ListResourcesRequest} for the request type
506
- * @see {@link ListResourcesResult} for the result type
558
+ * @see `ListResourcesRequest` from @modelcontextprotocol/sdk for the request type
559
+ * @see `ListResourcesResult` from @modelcontextprotocol/sdk for the result type
507
560
  */
508
561
  set onlistresources(callback: (params: ListResourcesRequest["params"], extra: RequestHandlerExtra) => Promise<ListResourcesResult>);
509
562
  /**
@@ -514,9 +567,9 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
514
567
  * these requests, typically by forwarding them to the MCP server.
515
568
  *
516
569
  * @param callback - Handler that receives list params and returns a
517
- * {@link ListResourceTemplatesResult}
518
- * @param callback.params - Request params (may include cursor for pagination)
519
- * @param callback.extra - Request metadata (abort signal, session info)
570
+ * `ListResourceTemplatesResult`
571
+ * - `params` - Request params (may include cursor for pagination)
572
+ * - `extra` - Request metadata (abort signal, session info)
520
573
  *
521
574
  * @example
522
575
  * ```typescript
@@ -529,8 +582,8 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
529
582
  * };
530
583
  * ```
531
584
  *
532
- * @see {@link ListResourceTemplatesRequest} for the request type
533
- * @see {@link ListResourceTemplatesResult} for the result type
585
+ * @see `ListResourceTemplatesRequest` from @modelcontextprotocol/sdk for the request type
586
+ * @see `ListResourceTemplatesResult` from @modelcontextprotocol/sdk for the result type
534
587
  */
535
588
  set onlistresourcetemplates(callback: (params: ListResourceTemplatesRequest["params"], extra: RequestHandlerExtra) => Promise<ListResourceTemplatesResult>);
536
589
  /**
@@ -541,9 +594,9 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
541
594
  * requests, typically by forwarding them to the MCP server.
542
595
  *
543
596
  * @param callback - Handler that receives read params and returns a
544
- * {@link ReadResourceResult}
545
- * @param callback.params - Read parameters including the resource URI
546
- * @param callback.extra - Request metadata (abort signal, session info)
597
+ * `ReadResourceResult`
598
+ * - `params` - Read parameters including the resource URI
599
+ * - `extra` - Request metadata (abort signal, session info)
547
600
  *
548
601
  * @example
549
602
  * ```typescript
@@ -556,8 +609,8 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
556
609
  * };
557
610
  * ```
558
611
  *
559
- * @see {@link ReadResourceRequest} for the request type
560
- * @see {@link ReadResourceResult} for the result type
612
+ * @see `ReadResourceRequest` from @modelcontextprotocol/sdk for the request type
613
+ * @see `ReadResourceResult` from @modelcontextprotocol/sdk for the result type
561
614
  */
562
615
  set onreadresource(callback: (params: ReadResourceRequest["params"], extra: RequestHandlerExtra) => Promise<ReadResourceResult>);
563
616
  /**
@@ -577,7 +630,7 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
577
630
  * });
578
631
  * ```
579
632
  *
580
- * @see {@link ResourceListChangedNotification} for the notification type
633
+ * @see `ResourceListChangedNotification` from @modelcontextprotocol/sdk for the notification type
581
634
  */
582
635
  sendResourceListChanged(params?: ResourceListChangedNotification["params"]): Promise<void>;
583
636
  /**
@@ -588,9 +641,9 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
588
641
  * requests, typically by forwarding them to the MCP server.
589
642
  *
590
643
  * @param callback - Handler that receives list params and returns a
591
- * {@link ListPromptsResult}
592
- * @param callback.params - Request params (may include cursor for pagination)
593
- * @param callback.extra - Request metadata (abort signal, session info)
644
+ * `ListPromptsResult`
645
+ * - `params` - Request params (may include cursor for pagination)
646
+ * - `extra` - Request metadata (abort signal, session info)
594
647
  *
595
648
  * @example
596
649
  * ```typescript
@@ -603,8 +656,8 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
603
656
  * };
604
657
  * ```
605
658
  *
606
- * @see {@link ListPromptsRequest} for the request type
607
- * @see {@link ListPromptsResult} for the result type
659
+ * @see `ListPromptsRequest` from @modelcontextprotocol/sdk for the request type
660
+ * @see `ListPromptsResult` from @modelcontextprotocol/sdk for the result type
608
661
  */
609
662
  set onlistprompts(callback: (params: ListPromptsRequest["params"], extra: RequestHandlerExtra) => Promise<ListPromptsResult>);
610
663
  /**
@@ -624,7 +677,7 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
624
677
  * });
625
678
  * ```
626
679
  *
627
- * @see {@link PromptListChangedNotification} for the notification type
680
+ * @see `PromptListChangedNotification` from @modelcontextprotocol/sdk for the notification type
628
681
  */
629
682
  sendPromptListChanged(params?: PromptListChangedNotification["params"]): Promise<void>;
630
683
  /**
@@ -668,9 +721,10 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
668
721
  /**
669
722
  * Update the host context and notify the Guest UI of changes.
670
723
  *
671
- * Compares the new context with the current context and sends a
672
- * `ui/notifications/host-context-changed` notification containing only the
673
- * fields that have changed. If no fields have changed, no notification is sent.
724
+ * Compares fields present in the new context with the current context and sends a
725
+ * `ui/notifications/host-context-changed` notification containing only fields
726
+ * that have been added or modified. If no fields have changed, no notification is sent.
727
+ * The new context fully replaces the internal state.
674
728
  *
675
729
  * Common use cases include notifying the Guest UI when:
676
730
  * - Theme changes (light/dark mode toggle)
@@ -698,8 +752,13 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
698
752
  */
699
753
  setHostContext(hostContext: McpUiHostContext): void;
700
754
  /**
701
- * Send a host context change notification to the app.
702
- * Only sends the fields that have changed (partial update).
755
+ * Low-level method to notify the Guest UI of host context changes.
756
+ *
757
+ * Most hosts should use {@link setHostContext} instead, which automatically
758
+ * detects changes and calls this method with only the modified fields.
759
+ * Use this directly only when you need fine-grained control over change detection.
760
+ *
761
+ * @param params - The context fields that have changed (partial update)
703
762
  */
704
763
  sendHostContextChange(params: McpUiHostContextChangedNotification["params"]): Promise<void> | void;
705
764
  /**
@@ -786,7 +845,7 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
786
845
  * any other interruption. This allows the Guest UI to update its state and
787
846
  * display appropriate feedback to the user.
788
847
  *
789
- * @param params - Optional cancellation details:
848
+ * @param params - Cancellation details object
790
849
  * - `reason`: Human-readable explanation for why the tool was cancelled
791
850
  *
792
851
  * @example User-initiated cancellation
@@ -863,13 +922,13 @@ export declare class AppBridge extends Protocol<AppRequest, AppNotification, App
863
922
  * - Prompts (prompts/list, notifications/prompts/list_changed)
864
923
  *
865
924
  * If no client was passed to the constructor, no automatic forwarding is set up
866
- * and you must register handlers manually using the `oncalltool`, `onlistresources`,
925
+ * and you must register handlers manually using the {@link oncalltool}, {@link onlistresources},
867
926
  * etc. setters.
868
927
  *
869
- * After calling connect, wait for the `oninitialized` callback before sending
928
+ * After calling connect, wait for the {@link oninitialized} callback before sending
870
929
  * tool input and other data to the Guest UI.
871
930
  *
872
- * @param transport - Transport layer (typically PostMessageTransport)
931
+ * @param transport - Transport layer (typically {@link PostMessageTransport})
873
932
  * @returns Promise resolving when connection is established
874
933
  *
875
934
  * @throws {Error} If a client was passed but server capabilities are not available.