From e9a9f6dace865057e494bf15a30e996518e66d98 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Thu, 24 Jul 2025 10:53:54 +0200 Subject: [PATCH] Remove unused code --- crates/acp_thread/src/acp_thread.rs | 4 +- crates/agent_servers/src/claude/tools.rs | 104 ----------------------- 2 files changed, 2 insertions(+), 106 deletions(-) diff --git a/crates/acp_thread/src/acp_thread.rs b/crates/acp_thread/src/acp_thread.rs index 632bdf6f898272d039bf33edab9b7ded83511240..7617553d4f33b5fd8f71ff6c8d76da1fc3d31903 100644 --- a/crates/acp_thread/src/acp_thread.rs +++ b/crates/acp_thread/src/acp_thread.rs @@ -916,7 +916,7 @@ impl AcpThread { &mut self, message: &str, cx: &mut Context, - ) -> BoxFuture<'static, Result<(), acp_old::Error>> { + ) -> BoxFuture<'static, Result<()>> { self.send( vec![acp::ContentBlock::Text(acp::TextContent { text: message.to_string(), @@ -930,7 +930,7 @@ impl AcpThread { &mut self, message: Vec, cx: &mut Context, - ) -> BoxFuture<'static, Result<(), acp_old::Error>> { + ) -> BoxFuture<'static, Result<()>> { let block = ContentBlock::new_combined( message.clone(), self.project.read(cx).languages().clone(), diff --git a/crates/agent_servers/src/claude/tools.rs b/crates/agent_servers/src/claude/tools.rs index 36b4661579cd878ee75bef0043944b7c08eb59ad..ed25f9af7f1c57375470575910aba4235ad4121d 100644 --- a/crates/agent_servers/src/claude/tools.rs +++ b/crates/agent_servers/src/claude/tools.rs @@ -1,7 +1,6 @@ use std::path::PathBuf; use agent_client_protocol as acp; -use agentic_coding_protocol as acp_old; use itertools::Itertools; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -233,109 +232,6 @@ impl ClaudeTool { } } - pub fn confirmation(&self, description: Option) -> acp_old::ToolCallConfirmation { - match &self { - Self::Edit(_) | Self::Write(_) | Self::NotebookEdit(_) | Self::MultiEdit(_) => { - acp_old::ToolCallConfirmation::Edit { description } - } - Self::WebFetch(params) => acp_old::ToolCallConfirmation::Fetch { - urls: params - .as_ref() - .map(|p| vec![p.url.clone()]) - .unwrap_or_default(), - description, - }, - Self::Terminal(Some(BashToolParams { - description, - command, - .. - })) => acp_old::ToolCallConfirmation::Execute { - command: command.clone(), - root_command: command.clone(), - description: description.clone(), - }, - Self::ExitPlanMode(Some(params)) => acp_old::ToolCallConfirmation::Other { - description: if let Some(description) = description { - format!("{description} {}", params.plan) - } else { - params.plan.clone() - }, - }, - Self::Task(Some(params)) => acp_old::ToolCallConfirmation::Other { - description: if let Some(description) = description { - format!("{description} {}", params.description) - } else { - params.description.clone() - }, - }, - Self::Ls(Some(LsToolParams { path, .. })) - | Self::ReadFile(Some(ReadToolParams { abs_path: path, .. })) => { - let path = path.display(); - acp_old::ToolCallConfirmation::Other { - description: if let Some(description) = description { - format!("{description} {path}") - } else { - path.to_string() - }, - } - } - Self::NotebookRead(Some(NotebookReadToolParams { notebook_path, .. })) => { - let path = notebook_path.display(); - acp_old::ToolCallConfirmation::Other { - description: if let Some(description) = description { - format!("{description} {path}") - } else { - path.to_string() - }, - } - } - Self::Glob(Some(params)) => acp_old::ToolCallConfirmation::Other { - description: if let Some(description) = description { - format!("{description} {params}") - } else { - params.to_string() - }, - }, - Self::Grep(Some(params)) => acp_old::ToolCallConfirmation::Other { - description: if let Some(description) = description { - format!("{description} {params}") - } else { - params.to_string() - }, - }, - Self::WebSearch(Some(params)) => acp_old::ToolCallConfirmation::Other { - description: if let Some(description) = description { - format!("{description} {params}") - } else { - params.to_string() - }, - }, - Self::TodoWrite(Some(params)) => { - let params = params.todos.iter().map(|todo| &todo.content).join(", "); - acp_old::ToolCallConfirmation::Other { - description: if let Some(description) = description { - format!("{description} {params}") - } else { - params - }, - } - } - Self::Terminal(None) - | Self::Task(None) - | Self::NotebookRead(None) - | Self::ExitPlanMode(None) - | Self::Ls(None) - | Self::Glob(None) - | Self::Grep(None) - | Self::ReadFile(None) - | Self::WebSearch(None) - | Self::TodoWrite(None) - | Self::Other { .. } => acp_old::ToolCallConfirmation::Other { - description: description.unwrap_or("".to_string()), - }, - } - } - pub fn locations(&self) -> Vec { match &self { Self::Edit(Some(EditToolParams { abs_path, .. })) => vec![acp::ToolCallLocation {