@@ -250,83 +250,6 @@ impl Display for ToolCallStatus {
}
}
-#[derive(Debug)]
-pub enum ToolCallConfirmation {
- Edit {
- description: Option<Entity<Markdown>>,
- },
- Execute {
- command: String,
- root_command: String,
- description: Option<Entity<Markdown>>,
- },
- Mcp {
- server_name: String,
- tool_name: String,
- tool_display_name: String,
- description: Option<Entity<Markdown>>,
- },
- Fetch {
- urls: Vec<SharedString>,
- description: Option<Entity<Markdown>>,
- },
- Other {
- description: Entity<Markdown>,
- },
-}
-
-impl ToolCallConfirmation {
- pub fn from_acp(
- confirmation: acp_old::ToolCallConfirmation,
- language_registry: Arc<LanguageRegistry>,
- cx: &mut App,
- ) -> Self {
- let to_md = |description: String, cx: &mut App| -> Entity<Markdown> {
- cx.new(|cx| {
- Markdown::new(
- description.into(),
- Some(language_registry.clone()),
- None,
- cx,
- )
- })
- };
-
- match confirmation {
- acp_old::ToolCallConfirmation::Edit { description } => Self::Edit {
- description: description.map(|description| to_md(description, cx)),
- },
- acp_old::ToolCallConfirmation::Execute {
- command,
- root_command,
- description,
- } => Self::Execute {
- command,
- root_command,
- description: description.map(|description| to_md(description, cx)),
- },
- acp_old::ToolCallConfirmation::Mcp {
- server_name,
- tool_name,
- tool_display_name,
- description,
- } => Self::Mcp {
- server_name,
- tool_name,
- tool_display_name,
- description: description.map(|description| to_md(description, cx)),
- },
- acp_old::ToolCallConfirmation::Fetch { urls, description } => Self::Fetch {
- urls: urls.iter().map(|url| url.into()).collect(),
- description: description.map(|description| to_md(description, cx)),
- },
- acp_old::ToolCallConfirmation::Other { description } => Self::Other {
- description: to_md(description, cx),
- },
- }
- }
-}
-
#[derive(Debug, PartialEq, Clone)]
enum ContentBlock {
Empty,