@@ -5,7 +5,6 @@ import type { Transport } from '../shared/transport.js';
55import {
66 CreateMessageRequestSchema ,
77 ElicitRequestSchema ,
8- ElicitationCompleteNotificationSchema ,
98 ErrorCode ,
109 LATEST_PROTOCOL_VERSION ,
1110 ListPromptsRequestSchema ,
@@ -18,6 +17,7 @@ import {
1817 SetLevelRequestSchema ,
1918 SUPPORTED_PROTOCOL_VERSIONS
2019} from '../types.js' ;
20+ import { ElicitationCompleteNotificationSchema } from '../experimental/index.js' ;
2121import { Server } from './index.js' ;
2222import type { JsonSchemaType , JsonSchemaValidator , jsonSchemaValidator } from '../validation/types.js' ;
2323import type { AnyObjectSchema } from './zod-compat.js' ;
@@ -925,15 +925,15 @@ test('should forward notification options when using elicitation completion noti
925925 }
926926 ) ;
927927
928- client . setNotificationHandler ( ElicitationCompleteNotificationSchema , ( ) => { } ) ;
928+ client . experimental . setElicitationCompleteHandler ( ( ) => { } ) ;
929929
930930 const [ clientTransport , serverTransport ] = InMemoryTransport . createLinkedPair ( ) ;
931931
932932 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
933933
934934 const notificationSpy = vi . spyOn ( server , 'notification' ) ;
935935
936- const notifier = server . createElicitationCompletionNotifier ( 'elicitation-789' , { relatedRequestId : 42 } ) ;
936+ const notifier = server . experimental . createElicitationCompleteNotifier ( 'elicitation-789' , { relatedRequestId : 42 } ) ;
937937 await notifier ( ) ;
938938
939939 expect ( notificationSpy ) . toHaveBeenCalledWith (
@@ -973,15 +973,15 @@ test('should create notifier that emits elicitation completion notification', as
973973 ) ;
974974
975975 const receivedIds : string [ ] = [ ] ;
976- client . setNotificationHandler ( ElicitationCompleteNotificationSchema , notification => {
976+ client . experimental . setElicitationCompleteHandler ( notification => {
977977 receivedIds . push ( notification . params . elicitationId ) ;
978978 } ) ;
979979
980980 const [ clientTransport , serverTransport ] = InMemoryTransport . createLinkedPair ( ) ;
981981
982982 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
983983
984- const notifier = server . createElicitationCompletionNotifier ( 'elicitation-123' ) ;
984+ const notifier = server . experimental . createElicitationCompleteNotifier ( 'elicitation-123' ) ;
985985 await notifier ( ) ;
986986
987987 await new Promise ( resolve => setTimeout ( resolve , 0 ) ) ;
@@ -1018,7 +1018,7 @@ test('should throw when creating notifier if client lacks URL elicitation suppor
10181018
10191019 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
10201020
1021- expect ( ( ) => server . createElicitationCompletionNotifier ( 'elicitation-123' ) ) . toThrow (
1021+ expect ( ( ) => server . experimental . createElicitationCompleteNotifier ( 'elicitation-123' ) ) . toThrow (
10221022 'Client does not support URL elicitation (required for notifications/elicitation/complete)'
10231023 ) ;
10241024} ) ;
0 commit comments