feat: replace prompt with inform (fire-and-forget), logs default 20 lines

This commit is contained in:
Helios Agent 2026-03-06 03:13:42 +01:00
parent d2f77f8054
commit af0b6b5ddb
No known key found for this signature in database
GPG key ID: C8259547CD8309B5
5 changed files with 51 additions and 13 deletions

View file

@ -401,6 +401,22 @@ pub async fn clipboard_set(
}
}
/// POST /devices/:label/inform
pub async fn inform_user(
Path(label): Path<String>,
State(state): State<AppState>,
Json(body): Json<PromptBody>,
) -> impl IntoResponse {
match dispatch(&state, &label, "inform", |rid| ServerMessage::InformRequest {
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 /devices/:label/prompt
#[derive(Deserialize)]
pub struct PromptBody {