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-01 20:40:47 -04:00 committed by GitHub
parent 8e0f70f3c7
commit dc83f1ad38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 97 additions and 100 deletions

154
Cargo.lock generated
View file

@ -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",

View file

@ -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" }

View file

@ -1,5 +1,5 @@
[package]
name = "assistant2"
name = "agent"
version = "0.1.0"
edition.workspace = true
publish.workspace = true

View file

@ -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);
});

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

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};

View file

@ -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,

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

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(),

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),