@@ -31,7 +31,7 @@ import {
3131 McpUiMessageResultSchema ,
3232 McpUiOpenLinkRequest ,
3333 McpUiOpenLinkResultSchema ,
34- McpUiSizeChangeNotification ,
34+ McpUiSizeChangedNotification ,
3535 McpUiToolInputNotification ,
3636 McpUiToolInputNotificationSchema ,
3737 McpUiToolInputPartialNotification ,
@@ -88,7 +88,7 @@ type AppOptions = ProtocolOptions & {
8888 * Automatically report size changes to the host using ResizeObserver.
8989 *
9090 * When enabled, the App monitors `document.body` and `document.documentElement`
91- * for size changes and automatically sends `ui/notifications/size-change `
91+ * for size changes and automatically sends `ui/notifications/size-changed `
9292 * notifications to the host.
9393 *
9494 * @default true
@@ -723,19 +723,19 @@ export class App extends Protocol<Request, Notification, Result> {
723723 *
724724 * @example Manually notify host of size change
725725 * ```typescript
726- * app.sendSizeChange ({
726+ * app.sendSizeChanged ({
727727 * width: 400,
728728 * height: 600
729729 * });
730730 * ```
731731 *
732732 * @returns Promise that resolves when the notification is sent
733733 *
734- * @see {@link McpUiSizeChangeNotification } for notification structure
734+ * @see {@link McpUiSizeChangedNotification } for notification structure
735735 */
736- sendSizeChange ( params : McpUiSizeChangeNotification [ "params" ] ) {
737- return this . notification ( < McpUiSizeChangeNotification > {
738- method : "ui/notifications/size-change " ,
736+ sendSizeChanged ( params : McpUiSizeChangedNotification [ "params" ] ) {
737+ return this . notification ( < McpUiSizeChangedNotification > {
738+ method : "ui/notifications/size-changed " ,
739739 params,
740740 } ) ;
741741 }
@@ -744,7 +744,7 @@ export class App extends Protocol<Request, Notification, Result> {
744744 * Set up automatic size change notifications using ResizeObserver.
745745 *
746746 * Observes both `document.documentElement` and `document.body` for size changes
747- * and automatically sends `ui/notifications/size-change ` notifications to the host.
747+ * and automatically sends `ui/notifications/size-changed ` notifications to the host.
748748 * The notifications are debounced using requestAnimationFrame to avoid duplicates.
749749 *
750750 * Note: This method is automatically called by `connect()` if the `autoResize`
@@ -759,18 +759,18 @@ export class App extends Protocol<Request, Notification, Result> {
759759 * await app.connect(transport);
760760 *
761761 * // Later, enable auto-resize manually
762- * const cleanup = app.setupSizeChangeNotifications ();
762+ * const cleanup = app.setupSizeChangedNotifications ();
763763 *
764764 * // Clean up when done
765765 * cleanup();
766766 * ```
767767 */
768- setupSizeChangeNotifications ( ) {
768+ setupSizeChangedNotifications ( ) {
769769 let scheduled = false ;
770770 let lastWidth = 0 ;
771771 let lastHeight = 0 ;
772772
773- const sendBodySizeChange = ( ) => {
773+ const sendBodySizeChanged = ( ) => {
774774 if ( scheduled ) {
775775 return ;
776776 }
@@ -801,14 +801,14 @@ export class App extends Protocol<Request, Notification, Result> {
801801 if ( width !== lastWidth || height !== lastHeight ) {
802802 lastWidth = width ;
803803 lastHeight = height ;
804- this . sendSizeChange ( { width, height } ) ;
804+ this . sendSizeChanged ( { width, height } ) ;
805805 }
806806 } ) ;
807807 } ;
808808
809- sendBodySizeChange ( ) ;
809+ sendBodySizeChanged ( ) ;
810810
811- const resizeObserver = new ResizeObserver ( sendBodySizeChange ) ;
811+ const resizeObserver = new ResizeObserver ( sendBodySizeChanged ) ;
812812 // Observe both html and body to catch all size changes
813813 resizeObserver . observe ( document . documentElement ) ;
814814 resizeObserver . observe ( document . body ) ;
@@ -824,7 +824,7 @@ export class App extends Protocol<Request, Notification, Result> {
824824 * 2. Sends `ui/initialize` request with app info and capabilities
825825 * 3. Receives host capabilities and context in response
826826 * 4. Sends `ui/notifications/initialized` notification
827- * 5. Sets up auto-resize using {@link setupSizeChangeNotifications } if enabled (default)
827+ * 5. Sets up auto-resize using {@link setupSizeChangedNotifications } if enabled (default)
828828 *
829829 * If initialization fails, the connection is automatically closed and an error
830830 * is thrown.
@@ -885,7 +885,7 @@ export class App extends Protocol<Request, Notification, Result> {
885885 } ) ;
886886
887887 if ( this . options ?. autoResize ) {
888- this . setupSizeChangeNotifications ( ) ;
888+ this . setupSizeChangedNotifications ( ) ;
889889 }
890890 } catch ( error ) {
891891 // Disconnect if initialization fails.
0 commit comments