feat: prompt command (MessageBox), admin status in banner

This commit is contained in:
Helios Agent 2026-03-03 15:44:27 +01:00
parent fdd2124da8
commit e0edf60461
No known key found for this signature in database
GPG key ID: C8259547CD8309B5
6 changed files with 100 additions and 0 deletions

View file

@ -479,6 +479,30 @@ pub async fn clipboard_set(
}
}
/// POST /sessions/:id/prompt
#[derive(Deserialize)]
pub struct PromptBody {
pub message: String,
pub title: Option<String>,
}
pub async fn prompt_user(
Path(session_id): Path<String>,
State(state): State<AppState>,
Json(body): Json<PromptBody>,
) -> impl IntoResponse {
match dispatch(&state, &session_id, "prompt", |rid| ServerMessage::PromptRequest {
request_id: rid,
message: body.message.clone(),
title: body.title.clone(),
})
.await
{
Ok(_) => (StatusCode::OK, Json(serde_json::json!({ "ok": true }))).into_response(),
Err(e) => e.into_response(),
}
}
/// POST /sessions/:id/label
#[derive(Deserialize)]
pub struct LabelBody {