1414
1515from conduit .client .callbacks import CallbackManager
1616from conduit .client .coordinator import MessageCoordinator
17+ from conduit .client .message_context import MessageContext
1718from conduit .client .protocol .elicitation import (
1819 ElicitationManager ,
1920 ElicitationNotConfiguredError ,
2021)
2122from conduit .client .protocol .roots import RootsManager
2223from conduit .client .protocol .sampling import SamplingManager , SamplingNotConfiguredError
23- from conduit .client .request_context import RequestContext
2424from conduit .client .server_manager import ServerManager
2525from conduit .protocol .base import (
2626 INTERNAL_ERROR ,
@@ -293,7 +293,7 @@ def _validate_protocol_version(self, result: InitializeResult) -> None:
293293 # ================================
294294
295295 async def _handle_ping (
296- self , context : RequestContext , request : PingRequest
296+ self , context : MessageContext , request : PingRequest
297297 ) -> EmptyResult :
298298 """Returns an empty result."""
299299
@@ -304,7 +304,7 @@ async def _handle_ping(
304304 # ================================
305305
306306 async def _handle_list_roots (
307- self , context : RequestContext , request : ListRootsRequest
307+ self , context : MessageContext , request : ListRootsRequest
308308 ) -> ListRootsResult | Error :
309309 """Returns the roots available to the server.
310310
@@ -324,7 +324,7 @@ async def _handle_list_roots(
324324 # ================================
325325
326326 async def _handle_sampling (
327- self , context : RequestContext , request : CreateMessageRequest
327+ self , context : MessageContext , request : CreateMessageRequest
328328 ) -> CreateMessageResult | Error :
329329 """Creates a message using the configured sampling handler.
330330
@@ -354,7 +354,7 @@ async def _handle_sampling(
354354 # ================================
355355
356356 async def _handle_elicitation (
357- self , context : RequestContext , request : ElicitRequest
357+ self , context : MessageContext , request : ElicitRequest
358358 ) -> ElicitResult | Error :
359359 """Returns an elicitation result using the configured elicitation handler.
360360
@@ -384,7 +384,7 @@ async def _handle_elicitation(
384384 # ================================
385385
386386 async def _handle_cancelled (
387- self , context : RequestContext , notification : CancelledNotification
387+ self , context : MessageContext , notification : CancelledNotification
388388 ) -> None :
389389 """Cancels a request from the server and calls the registered callback."""
390390 request_exists = (
@@ -400,13 +400,13 @@ async def _handle_cancelled(
400400 await self .callbacks .call_cancelled (context .server_id , notification )
401401
402402 async def _handle_progress (
403- self , context : RequestContext , notification : ProgressNotification
403+ self , context : MessageContext , notification : ProgressNotification
404404 ) -> None :
405405 """Calls the registered callback for progress updates."""
406406 await self .callbacks .call_progress (context .server_id , notification )
407407
408408 async def _handle_prompts_list_changed (
409- self , context : RequestContext , notification : PromptListChangedNotification
409+ self , context : MessageContext , notification : PromptListChangedNotification
410410 ) -> None :
411411 """Fetches the updated prompts list and calls the registered callback.
412412
@@ -433,7 +433,7 @@ async def _handle_prompts_list_changed(
433433 )
434434
435435 async def _handle_resources_list_changed (
436- self , context : RequestContext , notification : ResourceListChangedNotification
436+ self , context : MessageContext , notification : ResourceListChangedNotification
437437 ) -> None :
438438 """Fetches the updated resources/templates and calls the registered callback.
439439
@@ -479,7 +479,7 @@ async def _handle_resources_list_changed(
479479 )
480480
481481 async def _handle_resources_updated (
482- self , context : RequestContext , notification : ResourceUpdatedNotification
482+ self , context : MessageContext , notification : ResourceUpdatedNotification
483483 ) -> None :
484484 """Reads the updated resource content and calls the registered callback.
485485
@@ -502,7 +502,7 @@ async def _handle_resources_updated(
502502 )
503503
504504 async def _handle_tools_list_changed (
505- self , context : RequestContext , notification : ToolListChangedNotification
505+ self , context : MessageContext , notification : ToolListChangedNotification
506506 ) -> None :
507507 """Fetches the updated tools list and calls the registered callback.
508508
@@ -529,7 +529,7 @@ async def _handle_tools_list_changed(
529529 )
530530
531531 async def _handle_logging_message (
532- self , context : RequestContext , notification : LoggingMessageNotification
532+ self , context : MessageContext , notification : LoggingMessageNotification
533533 ) -> None :
534534 """Calls the registered callback for logging messages."""
535535 await self .callbacks .call_logging_message (context .server_id , notification )
0 commit comments