@@ -61,10 +61,7 @@ async fn main() -> Result<()> {
6161 Err ( e) => error ! ( "Connection error: {}" , e) ,
6262 }
6363
64- warn ! (
65- "Reconnecting in {} seconds..." ,
66- args. reconnect_interval
67- ) ;
64+ warn ! ( "Reconnecting in {} seconds..." , args. reconnect_interval) ;
6865 tokio:: time:: sleep ( Duration :: from_secs ( args. reconnect_interval ) ) . await ;
6966 }
7067}
@@ -81,7 +78,7 @@ async fn connect_and_serve(
8178 let mut request = server_url. into_client_request ( ) ?;
8279 request. headers_mut ( ) . insert (
8380 "Sec-WebSocket-Protocol" ,
84- tokio_tungstenite:: tungstenite:: http:: HeaderValue :: from_static ( "sandd.v1" )
81+ tokio_tungstenite:: tungstenite:: http:: HeaderValue :: from_static ( "sandd.v1" ) ,
8582 ) ;
8683
8784 let ( ws_stream, response) = match tokio_tungstenite:: connect_async ( request) . await {
@@ -184,13 +181,7 @@ async fn connect_and_serve(
184181 } ;
185182
186183 // Handle message inline
187- if let Err ( e) = handle_message (
188- message,
189- ws_tx_clone. clone ( ) ,
190- executor. clone ( ) ,
191- )
192- . await
193- {
184+ if let Err ( e) = handle_message ( message, ws_tx_clone. clone ( ) , executor. clone ( ) ) . await {
194185 error ! ( "Error handling message: {}" , e) ;
195186 }
196187 }
@@ -245,13 +236,11 @@ where
245236
246237 let json = serde_json:: to_string ( & response) ?;
247238 let mut tx = ws_tx. lock ( ) . await ;
248- tx. send ( WsMessage :: Text ( json) ) . await . map_err ( |e| anyhow :: anyhow! ( "{}" , e ) ) ? ;
239+ tx. send ( WsMessage :: Text ( json) ) . await ?
249240 } else {
250241 // Normal shell execution
251242 debug ! ( "Executing command: {}" , command) ;
252- let result = executor
253- . execute ( & command, timeout_secs, env, cwd)
254- . await ;
243+ let result = executor. execute ( & command, timeout_secs, env, cwd) . await ;
255244
256245 let response = match result {
257246 Ok ( output) => Message :: CommandOutput {
@@ -269,7 +258,9 @@ where
269258
270259 let json = serde_json:: to_string ( & response) ?;
271260 let mut tx = ws_tx. lock ( ) . await ;
272- tx. send ( WsMessage :: Text ( json) ) . await . map_err ( |e| anyhow:: anyhow!( "{}" , e) ) ?;
261+ tx. send ( WsMessage :: Text ( json) )
262+ . await
263+ . map_err ( |e| anyhow:: anyhow!( "{}" , e) ) ?;
273264 }
274265 }
275266
@@ -279,7 +270,10 @@ where
279270 cols : _,
280271 term : _,
281272 } => {
282- debug ! ( "Starting shell session: {} (not implemented in MVP)" , request_id) ;
273+ debug ! (
274+ "Starting shell session: {} (not implemented in MVP)" ,
275+ request_id
276+ ) ;
283277
284278 // TODO: Shell functionality disabled for MVP due to PtySystem Sync issues
285279 let response = Message :: ShellStarted {
@@ -290,10 +284,15 @@ where
290284
291285 let json = serde_json:: to_string ( & response) ?;
292286 let mut tx = ws_tx. lock ( ) . await ;
293- tx. send ( WsMessage :: Text ( json) ) . await . map_err ( |e| anyhow:: anyhow!( "{}" , e) ) ?;
287+ tx. send ( WsMessage :: Text ( json) )
288+ . await
289+ . map_err ( |e| anyhow:: anyhow!( "{}" , e) ) ?;
294290 }
295291
296- Message :: ShellInput { request_id : _, data : _ } => {
292+ Message :: ShellInput {
293+ request_id : _,
294+ data : _,
295+ } => {
297296 debug ! ( "Shell input (not implemented)" ) ;
298297 // TODO: Shell functionality disabled for MVP
299298 }
@@ -324,7 +323,11 @@ where
324323 offset,
325324 } => {
326325 // In a full implementation, write chunks to file
327- debug ! ( "Received file chunk: {} bytes at offset {}" , data. len( ) , offset) ;
326+ debug ! (
327+ "Received file chunk: {} bytes at offset {}" ,
328+ data. len( ) ,
329+ offset
330+ ) ;
328331 }
329332
330333 Message :: FileDownloadStart { request_id, path } => {
0 commit comments