From dc83f1ad38cd5b3cd3c3a5d165937bed8201e9ce Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Tue, 1 Apr 2025 20:40:47 -0400 Subject: [PATCH] Rename `assistant2` to `agent` (#27887) This PR renames the `assistant2` crate to `agent`. Release Notes: - N/A --- Cargo.lock | 154 +++++++++--------- Cargo.toml | 4 +- crates/{assistant2 => agent}/Cargo.toml | 2 +- crates/{assistant2 => agent}/LICENSE-GPL | 0 .../src/active_thread.rs | 0 crates/{assistant2 => agent}/src/assistant.rs | 6 +- .../src/assistant_configuration.rs | 0 .../add_context_server_modal.rs | 0 .../manage_profiles_modal.rs | 0 .../profile_modal_header.rs | 0 .../assistant_configuration/tool_picker.rs | 0 .../src/assistant_diff.rs | 0 .../src/assistant_model_selector.rs | 0 .../src/assistant_panel.rs | 0 .../src/buffer_codegen.rs | 0 crates/{assistant2 => agent}/src/context.rs | 0 .../src/context_picker.rs | 0 .../src/context_picker/completion_provider.rs | 0 .../context_picker/fetch_context_picker.rs | 0 .../src/context_picker/file_context_picker.rs | 0 .../context_picker/symbol_context_picker.rs | 0 .../context_picker/thread_context_picker.rs | 0 .../src/context_store.rs | 0 .../src/context_strip.rs | 0 .../src/history_store.rs | 0 .../src/inline_assistant.rs | 0 .../src/inline_prompt_editor.rs | 0 .../src/message_editor.rs | 0 .../src/profile_selector.rs | 0 .../src/terminal_codegen.rs | 0 .../src/terminal_inline_assistant.rs | 0 crates/{assistant2 => agent}/src/thread.rs | 0 .../src/thread_history.rs | 0 .../{assistant2 => agent}/src/thread_store.rs | 0 crates/{assistant2 => agent}/src/tool_use.rs | 0 crates/{assistant2 => agent}/src/ui.rs | 0 .../src/ui/agent_notification.rs | 0 .../src/ui/context_pill.rs | 0 crates/assistant_eval/Cargo.toml | 2 +- crates/assistant_eval/src/eval.rs | 2 +- .../assistant_eval/src/headless_assistant.rs | 4 +- crates/zed/Cargo.toml | 2 +- crates/zed/src/main.rs | 2 +- crates/zed/src/zed.rs | 19 +-- 44 files changed, 97 insertions(+), 100 deletions(-) rename crates/{assistant2 => agent}/Cargo.toml (99%) rename crates/{assistant2 => agent}/LICENSE-GPL (100%) rename crates/{assistant2 => agent}/src/active_thread.rs (100%) rename crates/{assistant2 => agent}/src/assistant.rs (96%) rename crates/{assistant2 => agent}/src/assistant_configuration.rs (100%) rename crates/{assistant2 => agent}/src/assistant_configuration/add_context_server_modal.rs (100%) rename crates/{assistant2 => agent}/src/assistant_configuration/manage_profiles_modal.rs (100%) rename crates/{assistant2 => agent}/src/assistant_configuration/manage_profiles_modal/profile_modal_header.rs (100%) rename crates/{assistant2 => agent}/src/assistant_configuration/tool_picker.rs (100%) rename crates/{assistant2 => agent}/src/assistant_diff.rs (100%) rename crates/{assistant2 => agent}/src/assistant_model_selector.rs (100%) rename crates/{assistant2 => agent}/src/assistant_panel.rs (100%) rename crates/{assistant2 => agent}/src/buffer_codegen.rs (100%) rename crates/{assistant2 => agent}/src/context.rs (100%) rename crates/{assistant2 => agent}/src/context_picker.rs (100%) rename crates/{assistant2 => agent}/src/context_picker/completion_provider.rs (100%) rename crates/{assistant2 => agent}/src/context_picker/fetch_context_picker.rs (100%) rename crates/{assistant2 => agent}/src/context_picker/file_context_picker.rs (100%) rename crates/{assistant2 => agent}/src/context_picker/symbol_context_picker.rs (100%) rename crates/{assistant2 => agent}/src/context_picker/thread_context_picker.rs (100%) rename crates/{assistant2 => agent}/src/context_store.rs (100%) rename crates/{assistant2 => agent}/src/context_strip.rs (100%) rename crates/{assistant2 => agent}/src/history_store.rs (100%) rename crates/{assistant2 => agent}/src/inline_assistant.rs (100%) rename crates/{assistant2 => agent}/src/inline_prompt_editor.rs (100%) rename crates/{assistant2 => agent}/src/message_editor.rs (100%) rename crates/{assistant2 => agent}/src/profile_selector.rs (100%) rename crates/{assistant2 => agent}/src/terminal_codegen.rs (100%) rename crates/{assistant2 => agent}/src/terminal_inline_assistant.rs (100%) rename crates/{assistant2 => agent}/src/thread.rs (100%) rename crates/{assistant2 => agent}/src/thread_history.rs (100%) rename crates/{assistant2 => agent}/src/thread_store.rs (100%) rename crates/{assistant2 => agent}/src/tool_use.rs (100%) rename crates/{assistant2 => agent}/src/ui.rs (100%) rename crates/{assistant2 => agent}/src/ui/agent_notification.rs (100%) rename crates/{assistant2 => agent}/src/ui/context_pill.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 3d93fc52c2..10cce07bf6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -47,6 +47,81 @@ dependencies = [ "zeroize", ] +[[package]] +name = "agent" +version = "0.1.0" +dependencies = [ + "anyhow", + "assistant_context_editor", + "assistant_settings", + "assistant_slash_command", + "assistant_tool", + "async-watch", + "buffer_diff", + "chrono", + "client", + "clock", + "collections", + "command_palette_hooks", + "context_server", + "convert_case 0.8.0", + "db", + "editor", + "feature_flags", + "file_icons", + "fs", + "futures 0.3.31", + "fuzzy", + "git", + "gpui", + "heed", + "html_to_markdown", + "http_client", + "indexmap", + "indoc", + "itertools 0.14.0", + "language", + "language_model", + "language_model_selector", + "log", + "lsp", + "markdown", + "menu", + "multi_buffer", + "ordered-float 2.10.1", + "parking_lot", + "paths", + "picker", + "project", + "prompt_library", + "prompt_store", + "proto", + "rand 0.8.5", + "release_channel", + "rope", + "schemars", + "serde", + "serde_json", + "settings", + "smallvec", + "smol", + "streaming_diff", + "telemetry", + "telemetry_events", + "terminal", + "terminal_view", + "text", + "theme", + "time", + "time_format", + "ui", + "util", + "uuid", + "vim_mode_setting", + "workspace", + "zed_actions", +] + [[package]] name = "ahash" version = "0.7.8" @@ -441,81 +516,6 @@ dependencies = [ "zed_actions", ] -[[package]] -name = "assistant2" -version = "0.1.0" -dependencies = [ - "anyhow", - "assistant_context_editor", - "assistant_settings", - "assistant_slash_command", - "assistant_tool", - "async-watch", - "buffer_diff", - "chrono", - "client", - "clock", - "collections", - "command_palette_hooks", - "context_server", - "convert_case 0.8.0", - "db", - "editor", - "feature_flags", - "file_icons", - "fs", - "futures 0.3.31", - "fuzzy", - "git", - "gpui", - "heed", - "html_to_markdown", - "http_client", - "indexmap", - "indoc", - "itertools 0.14.0", - "language", - "language_model", - "language_model_selector", - "log", - "lsp", - "markdown", - "menu", - "multi_buffer", - "ordered-float 2.10.1", - "parking_lot", - "paths", - "picker", - "project", - "prompt_library", - "prompt_store", - "proto", - "rand 0.8.5", - "release_channel", - "rope", - "schemars", - "serde", - "serde_json", - "settings", - "smallvec", - "smol", - "streaming_diff", - "telemetry", - "telemetry_events", - "terminal", - "terminal_view", - "text", - "theme", - "time", - "time_format", - "ui", - "util", - "uuid", - "vim_mode_setting", - "workspace", - "zed_actions", -] - [[package]] name = "assistant_context_editor" version = "0.1.0" @@ -573,8 +573,8 @@ dependencies = [ name = "assistant_eval" version = "0.1.0" dependencies = [ + "agent", "anyhow", - "assistant2", "assistant_tool", "assistant_tools", "clap", @@ -17500,11 +17500,11 @@ name = "zed" version = "0.181.0" dependencies = [ "activity_indicator", + "agent", "anyhow", "ashpd", "assets", "assistant", - "assistant2", "assistant_context_editor", "assistant_settings", "assistant_tools", diff --git a/Cargo.toml b/Cargo.toml index 47f36d5338..0ef48a7795 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,11 +2,11 @@ resolver = "2" members = [ "crates/activity_indicator", + "crates/agent", "crates/anthropic", "crates/askpass", "crates/assets", "crates/assistant", - "crates/assistant2", "crates/assistant_context_editor", "crates/assistant_eval", "crates/assistant_settings", @@ -207,12 +207,12 @@ edition = "2024" # activity_indicator = { path = "crates/activity_indicator" } +agent = { path = "crates/agent" } ai = { path = "crates/ai" } anthropic = { path = "crates/anthropic" } askpass = { path = "crates/askpass" } assets = { path = "crates/assets" } assistant = { path = "crates/assistant" } -assistant2 = { path = "crates/assistant2" } assistant_context_editor = { path = "crates/assistant_context_editor" } assistant_eval = { path = "crates/assistant_eval" } assistant_settings = { path = "crates/assistant_settings" } diff --git a/crates/assistant2/Cargo.toml b/crates/agent/Cargo.toml similarity index 99% rename from crates/assistant2/Cargo.toml rename to crates/agent/Cargo.toml index 0c7c36a460..62cca74772 100644 --- a/crates/assistant2/Cargo.toml +++ b/crates/agent/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "assistant2" +name = "agent" version = "0.1.0" edition.workspace = true publish.workspace = true diff --git a/crates/assistant2/LICENSE-GPL b/crates/agent/LICENSE-GPL similarity index 100% rename from crates/assistant2/LICENSE-GPL rename to crates/agent/LICENSE-GPL diff --git a/crates/assistant2/src/active_thread.rs b/crates/agent/src/active_thread.rs similarity index 100% rename from crates/assistant2/src/active_thread.rs rename to crates/agent/src/active_thread.rs diff --git a/crates/assistant2/src/assistant.rs b/crates/agent/src/assistant.rs similarity index 96% rename from crates/assistant2/src/assistant.rs rename to crates/agent/src/assistant.rs index b34986d33f..8f1993442f 100644 --- a/crates/assistant2/src/assistant.rs +++ b/crates/agent/src/assistant.rs @@ -97,7 +97,7 @@ impl_actions!(agent, [NewThread, ManageProfiles]); const NAMESPACE: &str = "agent"; -/// Initializes the `assistant2` crate. +/// Initializes the `agent` crate. pub fn init( fs: Arc, client: Arc, @@ -123,10 +123,10 @@ pub fn init( cx.observe_new(AddContextServerModal::register).detach(); cx.observe_new(ManageProfilesModal::register).detach(); - feature_gate_assistant2_actions(cx); + feature_gate_agent_actions(cx); } -fn feature_gate_assistant2_actions(cx: &mut App) { +fn feature_gate_agent_actions(cx: &mut App) { CommandPaletteFilter::update_global(cx, |filter, _cx| { filter.hide_namespace(NAMESPACE); }); diff --git a/crates/assistant2/src/assistant_configuration.rs b/crates/agent/src/assistant_configuration.rs similarity index 100% rename from crates/assistant2/src/assistant_configuration.rs rename to crates/agent/src/assistant_configuration.rs diff --git a/crates/assistant2/src/assistant_configuration/add_context_server_modal.rs b/crates/agent/src/assistant_configuration/add_context_server_modal.rs similarity index 100% rename from crates/assistant2/src/assistant_configuration/add_context_server_modal.rs rename to crates/agent/src/assistant_configuration/add_context_server_modal.rs diff --git a/crates/assistant2/src/assistant_configuration/manage_profiles_modal.rs b/crates/agent/src/assistant_configuration/manage_profiles_modal.rs similarity index 100% rename from crates/assistant2/src/assistant_configuration/manage_profiles_modal.rs rename to crates/agent/src/assistant_configuration/manage_profiles_modal.rs diff --git a/crates/assistant2/src/assistant_configuration/manage_profiles_modal/profile_modal_header.rs b/crates/agent/src/assistant_configuration/manage_profiles_modal/profile_modal_header.rs similarity index 100% rename from crates/assistant2/src/assistant_configuration/manage_profiles_modal/profile_modal_header.rs rename to crates/agent/src/assistant_configuration/manage_profiles_modal/profile_modal_header.rs diff --git a/crates/assistant2/src/assistant_configuration/tool_picker.rs b/crates/agent/src/assistant_configuration/tool_picker.rs similarity index 100% rename from crates/assistant2/src/assistant_configuration/tool_picker.rs rename to crates/agent/src/assistant_configuration/tool_picker.rs diff --git a/crates/assistant2/src/assistant_diff.rs b/crates/agent/src/assistant_diff.rs similarity index 100% rename from crates/assistant2/src/assistant_diff.rs rename to crates/agent/src/assistant_diff.rs diff --git a/crates/assistant2/src/assistant_model_selector.rs b/crates/agent/src/assistant_model_selector.rs similarity index 100% rename from crates/assistant2/src/assistant_model_selector.rs rename to crates/agent/src/assistant_model_selector.rs diff --git a/crates/assistant2/src/assistant_panel.rs b/crates/agent/src/assistant_panel.rs similarity index 100% rename from crates/assistant2/src/assistant_panel.rs rename to crates/agent/src/assistant_panel.rs diff --git a/crates/assistant2/src/buffer_codegen.rs b/crates/agent/src/buffer_codegen.rs similarity index 100% rename from crates/assistant2/src/buffer_codegen.rs rename to crates/agent/src/buffer_codegen.rs diff --git a/crates/assistant2/src/context.rs b/crates/agent/src/context.rs similarity index 100% rename from crates/assistant2/src/context.rs rename to crates/agent/src/context.rs diff --git a/crates/assistant2/src/context_picker.rs b/crates/agent/src/context_picker.rs similarity index 100% rename from crates/assistant2/src/context_picker.rs rename to crates/agent/src/context_picker.rs diff --git a/crates/assistant2/src/context_picker/completion_provider.rs b/crates/agent/src/context_picker/completion_provider.rs similarity index 100% rename from crates/assistant2/src/context_picker/completion_provider.rs rename to crates/agent/src/context_picker/completion_provider.rs diff --git a/crates/assistant2/src/context_picker/fetch_context_picker.rs b/crates/agent/src/context_picker/fetch_context_picker.rs similarity index 100% rename from crates/assistant2/src/context_picker/fetch_context_picker.rs rename to crates/agent/src/context_picker/fetch_context_picker.rs diff --git a/crates/assistant2/src/context_picker/file_context_picker.rs b/crates/agent/src/context_picker/file_context_picker.rs similarity index 100% rename from crates/assistant2/src/context_picker/file_context_picker.rs rename to crates/agent/src/context_picker/file_context_picker.rs diff --git a/crates/assistant2/src/context_picker/symbol_context_picker.rs b/crates/agent/src/context_picker/symbol_context_picker.rs similarity index 100% rename from crates/assistant2/src/context_picker/symbol_context_picker.rs rename to crates/agent/src/context_picker/symbol_context_picker.rs diff --git a/crates/assistant2/src/context_picker/thread_context_picker.rs b/crates/agent/src/context_picker/thread_context_picker.rs similarity index 100% rename from crates/assistant2/src/context_picker/thread_context_picker.rs rename to crates/agent/src/context_picker/thread_context_picker.rs diff --git a/crates/assistant2/src/context_store.rs b/crates/agent/src/context_store.rs similarity index 100% rename from crates/assistant2/src/context_store.rs rename to crates/agent/src/context_store.rs diff --git a/crates/assistant2/src/context_strip.rs b/crates/agent/src/context_strip.rs similarity index 100% rename from crates/assistant2/src/context_strip.rs rename to crates/agent/src/context_strip.rs diff --git a/crates/assistant2/src/history_store.rs b/crates/agent/src/history_store.rs similarity index 100% rename from crates/assistant2/src/history_store.rs rename to crates/agent/src/history_store.rs diff --git a/crates/assistant2/src/inline_assistant.rs b/crates/agent/src/inline_assistant.rs similarity index 100% rename from crates/assistant2/src/inline_assistant.rs rename to crates/agent/src/inline_assistant.rs diff --git a/crates/assistant2/src/inline_prompt_editor.rs b/crates/agent/src/inline_prompt_editor.rs similarity index 100% rename from crates/assistant2/src/inline_prompt_editor.rs rename to crates/agent/src/inline_prompt_editor.rs diff --git a/crates/assistant2/src/message_editor.rs b/crates/agent/src/message_editor.rs similarity index 100% rename from crates/assistant2/src/message_editor.rs rename to crates/agent/src/message_editor.rs diff --git a/crates/assistant2/src/profile_selector.rs b/crates/agent/src/profile_selector.rs similarity index 100% rename from crates/assistant2/src/profile_selector.rs rename to crates/agent/src/profile_selector.rs diff --git a/crates/assistant2/src/terminal_codegen.rs b/crates/agent/src/terminal_codegen.rs similarity index 100% rename from crates/assistant2/src/terminal_codegen.rs rename to crates/agent/src/terminal_codegen.rs diff --git a/crates/assistant2/src/terminal_inline_assistant.rs b/crates/agent/src/terminal_inline_assistant.rs similarity index 100% rename from crates/assistant2/src/terminal_inline_assistant.rs rename to crates/agent/src/terminal_inline_assistant.rs diff --git a/crates/assistant2/src/thread.rs b/crates/agent/src/thread.rs similarity index 100% rename from crates/assistant2/src/thread.rs rename to crates/agent/src/thread.rs diff --git a/crates/assistant2/src/thread_history.rs b/crates/agent/src/thread_history.rs similarity index 100% rename from crates/assistant2/src/thread_history.rs rename to crates/agent/src/thread_history.rs diff --git a/crates/assistant2/src/thread_store.rs b/crates/agent/src/thread_store.rs similarity index 100% rename from crates/assistant2/src/thread_store.rs rename to crates/agent/src/thread_store.rs diff --git a/crates/assistant2/src/tool_use.rs b/crates/agent/src/tool_use.rs similarity index 100% rename from crates/assistant2/src/tool_use.rs rename to crates/agent/src/tool_use.rs diff --git a/crates/assistant2/src/ui.rs b/crates/agent/src/ui.rs similarity index 100% rename from crates/assistant2/src/ui.rs rename to crates/agent/src/ui.rs diff --git a/crates/assistant2/src/ui/agent_notification.rs b/crates/agent/src/ui/agent_notification.rs similarity index 100% rename from crates/assistant2/src/ui/agent_notification.rs rename to crates/agent/src/ui/agent_notification.rs diff --git a/crates/assistant2/src/ui/context_pill.rs b/crates/agent/src/ui/context_pill.rs similarity index 100% rename from crates/assistant2/src/ui/context_pill.rs rename to crates/agent/src/ui/context_pill.rs diff --git a/crates/assistant_eval/Cargo.toml b/crates/assistant_eval/Cargo.toml index cd4485a5a2..ebbffe0cf5 100644 --- a/crates/assistant_eval/Cargo.toml +++ b/crates/assistant_eval/Cargo.toml @@ -13,8 +13,8 @@ name = "assistant_eval" path = "src/main.rs" [dependencies] +agent.workspace = true anyhow.workspace = true -assistant2.workspace = true assistant_tool.workspace = true assistant_tools.workspace = true clap.workspace = true diff --git a/crates/assistant_eval/src/eval.rs b/crates/assistant_eval/src/eval.rs index 8801472e4d..71825e5be7 100644 --- a/crates/assistant_eval/src/eval.rs +++ b/crates/assistant_eval/src/eval.rs @@ -1,6 +1,6 @@ use crate::headless_assistant::{HeadlessAppState, HeadlessAssistant}; +use agent::RequestKind; use anyhow::anyhow; -use assistant2::RequestKind; use collections::HashMap; use gpui::{App, Task}; use language_model::{LanguageModel, TokenUsage}; diff --git a/crates/assistant_eval/src/headless_assistant.rs b/crates/assistant_eval/src/headless_assistant.rs index 1c983b85de..e5df567864 100644 --- a/crates/assistant_eval/src/headless_assistant.rs +++ b/crates/assistant_eval/src/headless_assistant.rs @@ -1,6 +1,6 @@ +use agent::{RequestKind, Thread, ThreadEvent, ThreadStore}; use anyhow::anyhow; use assistant_tool::ToolWorkingSet; -use assistant2::{RequestKind, Thread, ThreadEvent, ThreadStore}; use client::{Client, UserStore}; use collections::HashMap; use dap::DapRegistry; @@ -167,7 +167,7 @@ pub fn init(cx: &mut App) -> Arc { context_server::init(cx); let stdout_is_a_pty = false; let prompt_builder = PromptBuilder::load(fs.clone(), stdout_is_a_pty, cx); - assistant2::init(fs.clone(), client.clone(), prompt_builder.clone(), cx); + agent::init(fs.clone(), client.clone(), prompt_builder.clone(), cx); Arc::new(HeadlessAppState { languages, diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index ae9759c167..b5540f320a 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -16,10 +16,10 @@ path = "src/main.rs" [dependencies] activity_indicator.workspace = true +agent.workspace = true anyhow.workspace = true assets.workspace = true assistant.workspace = true -assistant2.workspace = true assistant_context_editor.workspace = true assistant_settings.workspace = true assistant_tools.workspace = true diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index afb4d7952b..0f34b54777 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -482,7 +482,7 @@ fn main() { prompt_builder.clone(), cx, ); - assistant2::init( + agent::init( app_state.fs.clone(), app_state.client.clone(), prompt_builder.clone(), diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 1ffd302e2f..16ee607ddc 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -8,11 +8,11 @@ mod quick_action_bar; #[cfg(target_os = "windows")] pub(crate) mod windows_only_instance; +use agent::AssistantDiffToolbar; use anyhow::Context as _; pub use app_menus::*; use assets::Assets; use assistant_context_editor::AssistantPanelDelegate; -use assistant2::AssistantDiffToolbar; use breadcrumbs::Breadcrumbs; use client::{ZED_URL_SCHEME, zed_urls}; use collections::VecDeque; @@ -466,12 +466,9 @@ fn initialize_panels( }; let (assistant_panel, assistant2_panel) = if is_assistant2_enabled { - let assistant2_panel = assistant2::AssistantPanel::load( - workspace_handle.clone(), - prompt_builder, - cx.clone(), - ) - .await?; + let assistant2_panel = + agent::AssistantPanel::load(workspace_handle.clone(), prompt_builder, cx.clone()) + .await?; (None, Some(assistant2_panel)) } else { @@ -499,16 +496,16 @@ fn initialize_panels( // We need to do this here instead of within the individual `init` // functions so that we only register the actions once. // - // Once we ship `assistant2` we can push this back down into `assistant2::assistant_panel::init`. + // Once we ship `assistant2` we can push this back down into `agent::assistant_panel::init`. if is_assistant2_enabled { ::set_global( - Arc::new(assistant2::ConcreteAssistantPanelDelegate), + Arc::new(agent::ConcreteAssistantPanelDelegate), cx, ); workspace - .register_action(assistant2::AssistantPanel::toggle_focus) - .register_action(assistant2::InlineAssistant::inline_assist); + .register_action(agent::AssistantPanel::toggle_focus) + .register_action(agent::InlineAssistant::inline_assist); } else { ::set_global( Arc::new(assistant::assistant_panel::ConcreteAssistantPanelDelegate),