Rename assistant2 to agent (#27887)

This PR renames the `assistant2` crate to `agent`.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2025-04-02 00:40:47 +00:00
committed by GitHub
parent 8e0f70f3c7
commit dc83f1ad38
44 changed files with 97 additions and 100 deletions
@@ -1,5 +1,5 @@
[package]
name = "assistant2"
name = "agent"
version = "0.1.0"
edition.workspace = true
publish.workspace = true
@@ -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<dyn Fs>,
client: Arc<Client>,
@@ -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);
});
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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};
@@ -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<HeadlessAppState> {
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,
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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(),
+8 -11
View File
@@ -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 {
<dyn AssistantPanelDelegate>::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 {
<dyn AssistantPanelDelegate>::set_global(
Arc::new(assistant::assistant_panel::ConcreteAssistantPanelDelegate),