agentmux_srv/server/remote_ops/
reclaim_op.rs1use serde_json::Value;
10
11use super::{AppState, RemoteCaller, RemoteRefusal, RemoteResult};
12use crate::server::app_api::agent_history_reclaim::run_for;
13
14pub(super) async fn history_reclaim(_state: &AppState, caller: &RemoteCaller, params: Value) -> RemoteResult {
15 let action = params.get("action").and_then(Value::as_str).unwrap_or("status");
16 if !matches!(action, "request" | "cancel" | "status") {
17 return Err(RemoteRefusal::failed(format!("action is \"request\", \"cancel\" or \"status\", not {action:?}")));
18 }
19 run_for(action, &caller.actor()).map_err(RemoteRefusal::failed)
20}