diff --git a/rust/agent.rs b/rust/agent.rs index 3481f328..70a732d8 100644 --- a/rust/agent.rs +++ b/rust/agent.rs @@ -147,82 +147,82 @@ pub trait Agent { #[async_trait::async_trait(?Send)] impl Agent for Rc { async fn initialize(&self, args: InitializeRequest) -> Result { - self.initialize(args).await + self.as_ref().initialize(args).await } async fn authenticate(&self, args: AuthenticateRequest) -> Result { - self.authenticate(args).await + self.as_ref().authenticate(args).await } async fn new_session(&self, args: NewSessionRequest) -> Result { - self.new_session(args).await + self.as_ref().new_session(args).await } async fn load_session(&self, args: LoadSessionRequest) -> Result { - self.load_session(args).await + self.as_ref().load_session(args).await } async fn set_session_mode( &self, args: SetSessionModeRequest, ) -> Result { - self.set_session_mode(args).await + self.as_ref().set_session_mode(args).await } async fn prompt(&self, args: PromptRequest) -> Result { - self.prompt(args).await + self.as_ref().prompt(args).await } async fn cancel(&self, args: CancelNotification) -> Result<(), Error> { - self.cancel(args).await + self.as_ref().cancel(args).await } #[cfg(feature = "unstable")] async fn set_session_model( &self, args: SetSessionModelRequest, ) -> Result { - self.set_session_model(args).await + self.as_ref().set_session_model(args).await } async fn ext_method(&self, args: ExtRequest) -> Result { - self.ext_method(args).await + self.as_ref().ext_method(args).await } async fn ext_notification(&self, args: ExtNotification) -> Result<(), Error> { - self.ext_notification(args).await + self.as_ref().ext_notification(args).await } } #[async_trait::async_trait(?Send)] impl Agent for Arc { async fn initialize(&self, args: InitializeRequest) -> Result { - self.initialize(args).await + self.as_ref().initialize(args).await } async fn authenticate(&self, args: AuthenticateRequest) -> Result { - self.authenticate(args).await + self.as_ref().authenticate(args).await } async fn new_session(&self, args: NewSessionRequest) -> Result { - self.new_session(args).await + self.as_ref().new_session(args).await } async fn load_session(&self, args: LoadSessionRequest) -> Result { - self.load_session(args).await + self.as_ref().load_session(args).await } async fn set_session_mode( &self, args: SetSessionModeRequest, ) -> Result { - self.set_session_mode(args).await + self.as_ref().set_session_mode(args).await } async fn prompt(&self, args: PromptRequest) -> Result { - self.prompt(args).await + self.as_ref().prompt(args).await } async fn cancel(&self, args: CancelNotification) -> Result<(), Error> { - self.cancel(args).await + self.as_ref().cancel(args).await } #[cfg(feature = "unstable")] async fn set_session_model( &self, args: SetSessionModelRequest, ) -> Result { - self.set_session_model(args).await + self.as_ref().set_session_model(args).await } async fn ext_method(&self, args: ExtRequest) -> Result { - self.ext_method(args).await + self.as_ref().ext_method(args).await } async fn ext_notification(&self, args: ExtNotification) -> Result<(), Error> { - self.ext_notification(args).await + self.as_ref().ext_notification(args).await } } diff --git a/rust/client.rs b/rust/client.rs index 481c842d..15d589bc 100644 --- a/rust/client.rs +++ b/rust/client.rs @@ -169,58 +169,58 @@ impl Client for Rc { &self, args: RequestPermissionRequest, ) -> Result { - self.request_permission(args).await + self.as_ref().request_permission(args).await } async fn write_text_file( &self, args: WriteTextFileRequest, ) -> Result { - self.write_text_file(args).await + self.as_ref().write_text_file(args).await } async fn read_text_file( &self, args: ReadTextFileRequest, ) -> Result { - self.read_text_file(args).await + self.as_ref().read_text_file(args).await } async fn session_notification(&self, args: SessionNotification) -> Result<(), Error> { - self.session_notification(args).await + self.as_ref().session_notification(args).await } async fn create_terminal( &self, args: CreateTerminalRequest, ) -> Result { - self.create_terminal(args).await + self.as_ref().create_terminal(args).await } async fn terminal_output( &self, args: TerminalOutputRequest, ) -> Result { - self.terminal_output(args).await + self.as_ref().terminal_output(args).await } async fn release_terminal( &self, args: ReleaseTerminalRequest, ) -> Result { - self.release_terminal(args).await + self.as_ref().release_terminal(args).await } async fn wait_for_terminal_exit( &self, args: WaitForTerminalExitRequest, ) -> Result { - self.wait_for_terminal_exit(args).await + self.as_ref().wait_for_terminal_exit(args).await } async fn kill_terminal_command( &self, args: KillTerminalCommandRequest, ) -> Result { - self.kill_terminal_command(args).await + self.as_ref().kill_terminal_command(args).await } async fn ext_method(&self, args: ExtRequest) -> Result { - self.ext_method(args).await + self.as_ref().ext_method(args).await } async fn ext_notification(&self, args: ExtNotification) -> Result<(), Error> { - self.ext_notification(args).await + self.as_ref().ext_notification(args).await } } @@ -230,58 +230,58 @@ impl Client for Arc { &self, args: RequestPermissionRequest, ) -> Result { - self.request_permission(args).await + self.as_ref().request_permission(args).await } async fn write_text_file( &self, args: WriteTextFileRequest, ) -> Result { - self.write_text_file(args).await + self.as_ref().write_text_file(args).await } async fn read_text_file( &self, args: ReadTextFileRequest, ) -> Result { - self.read_text_file(args).await + self.as_ref().read_text_file(args).await } async fn session_notification(&self, args: SessionNotification) -> Result<(), Error> { - self.session_notification(args).await + self.as_ref().session_notification(args).await } async fn create_terminal( &self, args: CreateTerminalRequest, ) -> Result { - self.create_terminal(args).await + self.as_ref().create_terminal(args).await } async fn terminal_output( &self, args: TerminalOutputRequest, ) -> Result { - self.terminal_output(args).await + self.as_ref().terminal_output(args).await } async fn release_terminal( &self, args: ReleaseTerminalRequest, ) -> Result { - self.release_terminal(args).await + self.as_ref().release_terminal(args).await } async fn wait_for_terminal_exit( &self, args: WaitForTerminalExitRequest, ) -> Result { - self.wait_for_terminal_exit(args).await + self.as_ref().wait_for_terminal_exit(args).await } async fn kill_terminal_command( &self, args: KillTerminalCommandRequest, ) -> Result { - self.kill_terminal_command(args).await + self.as_ref().kill_terminal_command(args).await } async fn ext_method(&self, args: ExtRequest) -> Result { - self.ext_method(args).await + self.as_ref().ext_method(args).await } async fn ext_notification(&self, args: ExtNotification) -> Result<(), Error> { - self.ext_notification(args).await + self.as_ref().ext_notification(args).await } }