diff --git a/crates/client/src/main.rs b/crates/client/src/main.rs index f23e8bf..5b8deaf 100644 --- a/crates/client/src/main.rs +++ b/crates/client/src/main.rs @@ -27,12 +27,8 @@ fn banner() { println!(); // Use same column layout as info_line: 2sp + emoji_cell(2w) + 2sp + name(14) + 2sp + value // ☀ is 1-wide → emoji_cell pads to 2 → need 1 extra space to match - println!( - " {} {:<14} {}", - "☀ ".yellow().bold(), // 1-wide + explicit space = 2 display cols - "HELIOS REMOTE".bold(), - env!("GIT_COMMIT").dimmed() - ); + println!(" {} {}", "☀ ".yellow().bold(), "HELIOS REMOTE".bold()); + display::info_line("🔗", "commit:", &env!("GIT_COMMIT").dimmed().to_string()); } fn print_session_info(label: &str, sid: &uuid::Uuid) { @@ -369,7 +365,7 @@ async fn handle_message( input.trim().to_string() }).await.unwrap_or_default(); display::prompt_done(&message, &answer); - ClientMessage::Ack { request_id } + ClientMessage::PromptResponse { request_id, answer } } ServerMessage::ExecRequest { request_id, command, timeout_ms } => { diff --git a/crates/common/src/protocol.rs b/crates/common/src/protocol.rs index 1d558a2..993c9b4 100644 --- a/crates/common/src/protocol.rs +++ b/crates/common/src/protocol.rs @@ -137,6 +137,8 @@ pub enum ClientMessage { }, /// Response to a clipboard-get request ClipboardGetResponse { request_id: Uuid, text: String }, + /// Response to a prompt request — contains the user's typed answer + PromptResponse { request_id: Uuid, answer: String }, } /// Mouse button variants diff --git a/crates/server/src/api.rs b/crates/server/src/api.rs index 0f5fb94..2e07f84 100644 --- a/crates/server/src/api.rs +++ b/crates/server/src/api.rs @@ -564,6 +564,9 @@ pub async fn prompt_user( }) .await { + Ok(ClientMessage::PromptResponse { answer, .. }) => { + (StatusCode::OK, Json(serde_json::json!({ "ok": true, "answer": answer }))).into_response() + } Ok(_) => (StatusCode::OK, Json(serde_json::json!({ "ok": true }))).into_response(), Err(e) => e.into_response(), } diff --git a/crates/server/src/ws_handler.rs b/crates/server/src/ws_handler.rs index 00220a7..9602928 100644 --- a/crates/server/src/ws_handler.rs +++ b/crates/server/src/ws_handler.rs @@ -93,6 +93,7 @@ async fn handle_client_message(session_id: Uuid, msg: ClientMessage, state: &App | ClientMessage::LogsResponse { request_id, .. } | ClientMessage::DownloadResponse { request_id, .. } | ClientMessage::ClipboardGetResponse { request_id, .. } + | ClientMessage::PromptResponse { request_id, .. } | ClientMessage::Ack { request_id } | ClientMessage::Error { request_id, .. } => { let rid = *request_id; diff --git a/remote.py b/remote.py index c8ddfab..e089ad5 100644 --- a/remote.py +++ b/remote.py @@ -390,8 +390,12 @@ def cmd_prompt(args): body = {"message": args.message} if args.title: body["title"] = args.title - _req("POST", f"/sessions/{sid}/prompt", json=body) - print(f"User confirmed prompt on session {sid!r}.") + resp = _req("POST", f"/sessions/{sid}/prompt", json=body) + answer = resp.get("answer", "") + if answer: + print(answer) + else: + print(f"Prompt confirmed (no answer returned).") def cmd_wait_for_window(args):