1- use agent_client_protocol as acp ;
1+ use sacp ;
22use std:: pin:: Pin ;
33use tokio_util:: compat:: { FuturesAsyncReadCompatExt as _, FuturesAsyncWriteCompatExt } ;
44
55use futures:: { AsyncRead , AsyncWrite } ;
66
7- use sacp:: JsonRpcConnectionCx ;
7+ use sacp:: JrConnectionCx ;
88use tokio:: process:: Child ;
99use tracing:: debug;
1010
@@ -21,10 +21,10 @@ pub trait ComponentProvider: Send {
2121 /// * `incoming_bytes`: bytes received by the conponent from the conductor.
2222 fn create (
2323 & self ,
24- cx : & JsonRpcConnectionCx ,
24+ cx : & JrConnectionCx ,
2525 outgoing_bytes : Pin < Box < dyn AsyncWrite + Send > > ,
2626 incoming_bytes : Pin < Box < dyn AsyncRead + Send > > ,
27- ) -> Result < Cleanup , acp :: Error > ;
27+ ) -> Result < Cleanup , sacp :: Error > ;
2828}
2929
3030/// Cleanup enum returned by component provider.
@@ -60,7 +60,7 @@ pub struct Component {
6060
6161 /// The connection context to the component. This is called `agent_cx` because the
6262 /// component is acting as the conductor's agent.
63- pub agent_cx : JsonRpcConnectionCx ,
63+ pub agent_cx : JrConnectionCx ,
6464}
6565
6666/// A "command provider" provides a component by running a command and sending ACP messages to/from stdio.
@@ -77,17 +77,17 @@ impl CommandComponentProvider {
7777impl ComponentProvider for CommandComponentProvider {
7878 fn create (
7979 & self ,
80- cx : & JsonRpcConnectionCx ,
80+ cx : & JrConnectionCx ,
8181 outgoing_bytes : Pin < Box < dyn AsyncWrite + Send > > ,
8282 incoming_bytes : Pin < Box < dyn AsyncRead + Send > > ,
83- ) -> Result < Cleanup , acp :: Error > {
83+ ) -> Result < Cleanup , sacp :: Error > {
8484 debug ! ( command = self . command, "Spawning command" ) ;
8585
8686 let mut child = tokio:: process:: Command :: new ( & self . command )
8787 . stdin ( std:: process:: Stdio :: piped ( ) )
8888 . stdout ( std:: process:: Stdio :: piped ( ) )
8989 . spawn ( )
90- . map_err ( acp :: Error :: into_internal_error) ?;
90+ . map_err ( sacp :: Error :: into_internal_error) ?;
9191
9292 // Take ownership of the streams (can only do this once!)
9393 let mut child_stdin = child. stdin . take ( ) . expect ( "Failed to open stdin" ) ;
@@ -96,14 +96,14 @@ impl ComponentProvider for CommandComponentProvider {
9696 cx. spawn ( async move {
9797 tokio:: io:: copy ( & mut incoming_bytes. compat ( ) , & mut child_stdin)
9898 . await
99- . map_err ( acp :: Error :: into_internal_error) ?;
99+ . map_err ( sacp :: Error :: into_internal_error) ?;
100100 Ok ( ( ) )
101101 } ) ?;
102102
103103 cx. spawn ( async move {
104104 tokio:: io:: copy ( & mut child_stdout, & mut outgoing_bytes. compat_write ( ) )
105105 . await
106- . map_err ( acp :: Error :: into_internal_error) ?;
106+ . map_err ( sacp :: Error :: into_internal_error) ?;
107107 Ok ( ( ) )
108108 } ) ?;
109109
0 commit comments