winx_code_agent/tools/
undo_edit.rs1use std::sync::Arc;
10
11use tokio::sync::Mutex;
12use tracing::instrument;
13
14use crate::errors::Result;
15use crate::state::bash_state::BashState;
16use crate::types::UndoEdit;
17
18#[instrument(level = "info", skip(bash_state_arc, undo))]
19pub async fn handle_tool_call(
20 bash_state_arc: &Arc<Mutex<Option<BashState>>>,
21 undo: UndoEdit,
22) -> Result<String> {
23 crate::tools::edit_files::handle_legacy_tool(
24 bash_state_arc,
25 crate::tools::edit_files::EditSurface::UndoEdit,
26 undo,
27 )
28 .await
29 .map(|outcome| outcome.text)
30}