@@ -577,7 +577,7 @@ test('should respect client notification capabilities', async () => {
577577 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
578578
579579 // This should work because the client has the roots.listChanged capability
580- await expect ( client . sendRootsListChanged ( ) ) . resolves . not . toThrow ( ) ;
580+ await expect ( client . legacy . sendRootsListChanged ( ) ) . resolves . not . toThrow ( ) ;
581581
582582 // Create a new client without the roots.listChanged capability
583583 const clientWithoutCapability = new LegacyTestClient (
@@ -594,7 +594,7 @@ test('should respect client notification capabilities', async () => {
594594 await clientWithoutCapability . connect ( clientTransport ) ;
595595
596596 // This should throw because the client doesn't have the roots.listChanged capability
597- await expect ( clientWithoutCapability . sendRootsListChanged ( ) ) . rejects . toThrow ( / ^ C l i e n t d o e s n o t s u p p o r t / ) ;
597+ await expect ( clientWithoutCapability . legacy . sendRootsListChanged ( ) ) . rejects . toThrow ( / ^ C l i e n t d o e s n o t s u p p o r t / ) ;
598598} ) ;
599599
600600/***
@@ -631,7 +631,7 @@ test('should respect server notification capabilities', async () => {
631631 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
632632
633633 // These should work because the server has the corresponding capabilities
634- await expect ( server . sendLoggingMessage ( { level : 'info' , data : 'Test' } ) ) . resolves . not . toThrow ( ) ;
634+ await expect ( server . legacy . sendLoggingMessage ( { level : 'info' , data : 'Test' } ) ) . resolves . not . toThrow ( ) ;
635635 await expect ( server . sendResourceListChanged ( ) ) . resolves . not . toThrow ( ) ;
636636
637637 // This should throw because the server doesn't have the tools capability
@@ -756,7 +756,7 @@ test('should accept form-mode elicitation request when client advertises empty e
756756 // Server should be able to send form-mode elicitation request
757757 // This works because getSupportedElicitationModes defaults to form mode
758758 // when neither form nor url are explicitly declared
759- const result = await server . elicitInput ( {
759+ const result = await server . legacy . elicitInput ( {
760760 mode : 'form' ,
761761 message : 'Please provide your username' ,
762762 requestedSchema : {
@@ -906,7 +906,7 @@ test('should reject missing-mode elicitation when client only supports URL mode'
906906 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
907907
908908 await expect (
909- server . request ( {
909+ server . legacy . request ( {
910910 method : 'elicitation/create' ,
911911 params : {
912912 message : 'Please provide data' ,
@@ -1052,7 +1052,7 @@ test('should apply defaults for form-mode elicitation when applyDefaults is enab
10521052
10531053 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
10541054
1055- const result = await server . elicitInput ( {
1055+ const result = await server . legacy . elicitInput ( {
10561056 mode : 'form' ,
10571057 message : 'Please confirm your preferences' ,
10581058 requestedSchema : {
@@ -1542,7 +1542,7 @@ test('should not activate listChanged handler when server does not advertise cap
15421542 expect ( client . getServerCapabilities ( ) ?. tools ?. listChanged ) . toBeFalsy ( ) ;
15431543
15441544 // Send a tool list changed notification manually
1545- await server . notification ( { method : 'notifications/tools/list_changed' } ) ;
1545+ await server . legacy . notification ( { method : 'notifications/tools/list_changed' } ) ;
15461546 await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
15471547
15481548 // Handler should NOT have been activated because server didn't advertise listChanged
@@ -1591,7 +1591,7 @@ test('should activate listChanged handler when server advertises capability', as
15911591 expect ( client . getServerCapabilities ( ) ?. tools ?. listChanged ) . toBe ( true ) ;
15921592
15931593 // Send a tool list changed notification
1594- await server . notification ( { method : 'notifications/tools/list_changed' } ) ;
1594+ await server . legacy . notification ( { method : 'notifications/tools/list_changed' } ) ;
15951595 await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
15961596
15971597 // Handler SHOULD have been called
@@ -1649,9 +1649,9 @@ test('should not activate any handlers when server has no listChanged capabiliti
16491649 expect ( caps ?. resources ?. listChanged ) . toBeFalsy ( ) ;
16501650
16511651 // Send notifications for all three types
1652- await server . notification ( { method : 'notifications/tools/list_changed' } ) ;
1653- await server . notification ( { method : 'notifications/prompts/list_changed' } ) ;
1654- await server . notification ( { method : 'notifications/resources/list_changed' } ) ;
1652+ await server . legacy . notification ( { method : 'notifications/tools/list_changed' } ) ;
1653+ await server . legacy . notification ( { method : 'notifications/prompts/list_changed' } ) ;
1654+ await server . legacy . notification ( { method : 'notifications/resources/list_changed' } ) ;
16551655 await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
16561656
16571657 // No handlers should have been activated
@@ -1709,8 +1709,8 @@ test('should handle partial listChanged capability support', async () => {
17091709 expect ( client . getServerCapabilities ( ) ?. prompts ?. listChanged ) . toBeFalsy ( ) ;
17101710
17111711 // Send notifications for both
1712- await server . notification ( { method : 'notifications/tools/list_changed' } ) ;
1713- await server . notification ( { method : 'notifications/prompts/list_changed' } ) ;
1712+ await server . legacy . notification ( { method : 'notifications/tools/list_changed' } ) ;
1713+ await server . legacy . notification ( { method : 'notifications/prompts/list_changed' } ) ;
17141714 await new Promise ( resolve => setTimeout ( resolve , 100 ) ) ;
17151715
17161716 // Tools handler should have been called
@@ -2350,7 +2350,7 @@ describe('Client sampling validation with tools', () => {
23502350 const [ clientTransport , serverTransport ] = InMemoryTransport . createLinkedPair ( ) ;
23512351 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
23522352
2353- const result = await server . createMessage ( {
2353+ const result = await server . legacy . createMessage ( {
23542354 messages : [ { role : 'user' , content : { type : 'text' , text : 'hello' } } ] ,
23552355 maxTokens : 100 ,
23562356 tools : [ { name : 'test_tool' , inputSchema : { type : 'object' } } ]
@@ -2376,7 +2376,7 @@ describe('Client sampling validation with tools', () => {
23762376 const [ clientTransport , serverTransport ] = InMemoryTransport . createLinkedPair ( ) ;
23772377 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
23782378
2379- const result = await server . createMessage ( {
2379+ const result = await server . legacy . createMessage ( {
23802380 messages : [ { role : 'user' , content : { type : 'text' , text : 'hello' } } ] ,
23812381 maxTokens : 100 ,
23822382 tools : [ { name : 'test_tool' , inputSchema : { type : 'object' } } ]
@@ -2400,7 +2400,7 @@ describe('Client sampling validation with tools', () => {
24002400 const [ clientTransport , serverTransport ] = InMemoryTransport . createLinkedPair ( ) ;
24012401 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
24022402
2403- const result = await server . createMessage ( {
2403+ const result = await server . legacy . createMessage ( {
24042404 messages : [ { role : 'user' , content : { type : 'text' , text : 'hello' } } ] ,
24052405 maxTokens : 100
24062406 } ) ;
@@ -2424,7 +2424,7 @@ describe('Client sampling validation with tools', () => {
24242424 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
24252425
24262426 await expect (
2427- server . createMessage ( {
2427+ server . legacy . createMessage ( {
24282428 messages : [ { role : 'user' , content : { type : 'text' , text : 'hello' } } ] ,
24292429 maxTokens : 100
24302430 } )
@@ -2447,7 +2447,7 @@ describe('Client sampling validation with tools', () => {
24472447 const [ clientTransport , serverTransport ] = InMemoryTransport . createLinkedPair ( ) ;
24482448 await Promise . all ( [ client . connect ( clientTransport ) , server . connect ( serverTransport ) ] ) ;
24492449
2450- const result = await server . createMessage ( {
2450+ const result = await server . legacy . createMessage ( {
24512451 messages : [ { role : 'user' , content : { type : 'text' , text : 'hello' } } ] ,
24522452 maxTokens : 100 ,
24532453 tools : [ { name : 'test_tool' , inputSchema : { type : 'object' } } ] ,
0 commit comments