feat: prompt command (MessageBox), admin status in banner
This commit is contained in:
parent
fdd2124da8
commit
e0edf60461
6 changed files with 100 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue