Rename assistant2
to agent
(#27887)
This PR renames the `assistant2` crate to `agent`. Release Notes: - N/A
This commit is contained in:
parent
8e0f70f3c7
commit
dc83f1ad38
44 changed files with 97 additions and 100 deletions
154
Cargo.lock
generated
154
Cargo.lock
generated
|
@ -47,6 +47,81 @@ dependencies = [
|
||||||
"zeroize",
|
"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]]
|
[[package]]
|
||||||
name = "ahash"
|
name = "ahash"
|
||||||
version = "0.7.8"
|
version = "0.7.8"
|
||||||
|
@ -441,81 +516,6 @@ dependencies = [
|
||||||
"zed_actions",
|
"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]]
|
[[package]]
|
||||||
name = "assistant_context_editor"
|
name = "assistant_context_editor"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -573,8 +573,8 @@ dependencies = [
|
||||||
name = "assistant_eval"
|
name = "assistant_eval"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"agent",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"assistant2",
|
|
||||||
"assistant_tool",
|
"assistant_tool",
|
||||||
"assistant_tools",
|
"assistant_tools",
|
||||||
"clap",
|
"clap",
|
||||||
|
@ -17500,11 +17500,11 @@ name = "zed"
|
||||||
version = "0.181.0"
|
version = "0.181.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activity_indicator",
|
"activity_indicator",
|
||||||
|
"agent",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"ashpd",
|
"ashpd",
|
||||||
"assets",
|
"assets",
|
||||||
"assistant",
|
"assistant",
|
||||||
"assistant2",
|
|
||||||
"assistant_context_editor",
|
"assistant_context_editor",
|
||||||
"assistant_settings",
|
"assistant_settings",
|
||||||
"assistant_tools",
|
"assistant_tools",
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = [
|
members = [
|
||||||
"crates/activity_indicator",
|
"crates/activity_indicator",
|
||||||
|
"crates/agent",
|
||||||
"crates/anthropic",
|
"crates/anthropic",
|
||||||
"crates/askpass",
|
"crates/askpass",
|
||||||
"crates/assets",
|
"crates/assets",
|
||||||
"crates/assistant",
|
"crates/assistant",
|
||||||
"crates/assistant2",
|
|
||||||
"crates/assistant_context_editor",
|
"crates/assistant_context_editor",
|
||||||
"crates/assistant_eval",
|
"crates/assistant_eval",
|
||||||
"crates/assistant_settings",
|
"crates/assistant_settings",
|
||||||
|
@ -207,12 +207,12 @@ edition = "2024"
|
||||||
#
|
#
|
||||||
|
|
||||||
activity_indicator = { path = "crates/activity_indicator" }
|
activity_indicator = { path = "crates/activity_indicator" }
|
||||||
|
agent = { path = "crates/agent" }
|
||||||
ai = { path = "crates/ai" }
|
ai = { path = "crates/ai" }
|
||||||
anthropic = { path = "crates/anthropic" }
|
anthropic = { path = "crates/anthropic" }
|
||||||
askpass = { path = "crates/askpass" }
|
askpass = { path = "crates/askpass" }
|
||||||
assets = { path = "crates/assets" }
|
assets = { path = "crates/assets" }
|
||||||
assistant = { path = "crates/assistant" }
|
assistant = { path = "crates/assistant" }
|
||||||
assistant2 = { path = "crates/assistant2" }
|
|
||||||
assistant_context_editor = { path = "crates/assistant_context_editor" }
|
assistant_context_editor = { path = "crates/assistant_context_editor" }
|
||||||
assistant_eval = { path = "crates/assistant_eval" }
|
assistant_eval = { path = "crates/assistant_eval" }
|
||||||
assistant_settings = { path = "crates/assistant_settings" }
|
assistant_settings = { path = "crates/assistant_settings" }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "assistant2"
|
name = "agent"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
publish.workspace = true
|
publish.workspace = true
|
|
@ -97,7 +97,7 @@ impl_actions!(agent, [NewThread, ManageProfiles]);
|
||||||
|
|
||||||
const NAMESPACE: &str = "agent";
|
const NAMESPACE: &str = "agent";
|
||||||
|
|
||||||
/// Initializes the `assistant2` crate.
|
/// Initializes the `agent` crate.
|
||||||
pub fn init(
|
pub fn init(
|
||||||
fs: Arc<dyn Fs>,
|
fs: Arc<dyn Fs>,
|
||||||
client: Arc<Client>,
|
client: Arc<Client>,
|
||||||
|
@ -123,10 +123,10 @@ pub fn init(
|
||||||
cx.observe_new(AddContextServerModal::register).detach();
|
cx.observe_new(AddContextServerModal::register).detach();
|
||||||
cx.observe_new(ManageProfilesModal::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| {
|
CommandPaletteFilter::update_global(cx, |filter, _cx| {
|
||||||
filter.hide_namespace(NAMESPACE);
|
filter.hide_namespace(NAMESPACE);
|
||||||
});
|
});
|
|
@ -13,8 +13,8 @@ name = "assistant_eval"
|
||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
agent.workspace = true
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
assistant2.workspace = true
|
|
||||||
assistant_tool.workspace = true
|
assistant_tool.workspace = true
|
||||||
assistant_tools.workspace = true
|
assistant_tools.workspace = true
|
||||||
clap.workspace = true
|
clap.workspace = true
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::headless_assistant::{HeadlessAppState, HeadlessAssistant};
|
use crate::headless_assistant::{HeadlessAppState, HeadlessAssistant};
|
||||||
|
use agent::RequestKind;
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use assistant2::RequestKind;
|
|
||||||
use collections::HashMap;
|
use collections::HashMap;
|
||||||
use gpui::{App, Task};
|
use gpui::{App, Task};
|
||||||
use language_model::{LanguageModel, TokenUsage};
|
use language_model::{LanguageModel, TokenUsage};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
use agent::{RequestKind, Thread, ThreadEvent, ThreadStore};
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use assistant_tool::ToolWorkingSet;
|
use assistant_tool::ToolWorkingSet;
|
||||||
use assistant2::{RequestKind, Thread, ThreadEvent, ThreadStore};
|
|
||||||
use client::{Client, UserStore};
|
use client::{Client, UserStore};
|
||||||
use collections::HashMap;
|
use collections::HashMap;
|
||||||
use dap::DapRegistry;
|
use dap::DapRegistry;
|
||||||
|
@ -167,7 +167,7 @@ pub fn init(cx: &mut App) -> Arc<HeadlessAppState> {
|
||||||
context_server::init(cx);
|
context_server::init(cx);
|
||||||
let stdout_is_a_pty = false;
|
let stdout_is_a_pty = false;
|
||||||
let prompt_builder = PromptBuilder::load(fs.clone(), stdout_is_a_pty, cx);
|
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 {
|
Arc::new(HeadlessAppState {
|
||||||
languages,
|
languages,
|
||||||
|
|
|
@ -16,10 +16,10 @@ path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
activity_indicator.workspace = true
|
activity_indicator.workspace = true
|
||||||
|
agent.workspace = true
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
assets.workspace = true
|
assets.workspace = true
|
||||||
assistant.workspace = true
|
assistant.workspace = true
|
||||||
assistant2.workspace = true
|
|
||||||
assistant_context_editor.workspace = true
|
assistant_context_editor.workspace = true
|
||||||
assistant_settings.workspace = true
|
assistant_settings.workspace = true
|
||||||
assistant_tools.workspace = true
|
assistant_tools.workspace = true
|
||||||
|
|
|
@ -482,7 +482,7 @@ fn main() {
|
||||||
prompt_builder.clone(),
|
prompt_builder.clone(),
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
assistant2::init(
|
agent::init(
|
||||||
app_state.fs.clone(),
|
app_state.fs.clone(),
|
||||||
app_state.client.clone(),
|
app_state.client.clone(),
|
||||||
prompt_builder.clone(),
|
prompt_builder.clone(),
|
||||||
|
|
|
@ -8,11 +8,11 @@ mod quick_action_bar;
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub(crate) mod windows_only_instance;
|
pub(crate) mod windows_only_instance;
|
||||||
|
|
||||||
|
use agent::AssistantDiffToolbar;
|
||||||
use anyhow::Context as _;
|
use anyhow::Context as _;
|
||||||
pub use app_menus::*;
|
pub use app_menus::*;
|
||||||
use assets::Assets;
|
use assets::Assets;
|
||||||
use assistant_context_editor::AssistantPanelDelegate;
|
use assistant_context_editor::AssistantPanelDelegate;
|
||||||
use assistant2::AssistantDiffToolbar;
|
|
||||||
use breadcrumbs::Breadcrumbs;
|
use breadcrumbs::Breadcrumbs;
|
||||||
use client::{ZED_URL_SCHEME, zed_urls};
|
use client::{ZED_URL_SCHEME, zed_urls};
|
||||||
use collections::VecDeque;
|
use collections::VecDeque;
|
||||||
|
@ -466,12 +466,9 @@ fn initialize_panels(
|
||||||
};
|
};
|
||||||
|
|
||||||
let (assistant_panel, assistant2_panel) = if is_assistant2_enabled {
|
let (assistant_panel, assistant2_panel) = if is_assistant2_enabled {
|
||||||
let assistant2_panel = assistant2::AssistantPanel::load(
|
let assistant2_panel =
|
||||||
workspace_handle.clone(),
|
agent::AssistantPanel::load(workspace_handle.clone(), prompt_builder, cx.clone())
|
||||||
prompt_builder,
|
.await?;
|
||||||
cx.clone(),
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
(None, Some(assistant2_panel))
|
(None, Some(assistant2_panel))
|
||||||
} else {
|
} else {
|
||||||
|
@ -499,16 +496,16 @@ fn initialize_panels(
|
||||||
// We need to do this here instead of within the individual `init`
|
// We need to do this here instead of within the individual `init`
|
||||||
// functions so that we only register the actions once.
|
// 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 {
|
if is_assistant2_enabled {
|
||||||
<dyn AssistantPanelDelegate>::set_global(
|
<dyn AssistantPanelDelegate>::set_global(
|
||||||
Arc::new(assistant2::ConcreteAssistantPanelDelegate),
|
Arc::new(agent::ConcreteAssistantPanelDelegate),
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
|
|
||||||
workspace
|
workspace
|
||||||
.register_action(assistant2::AssistantPanel::toggle_focus)
|
.register_action(agent::AssistantPanel::toggle_focus)
|
||||||
.register_action(assistant2::InlineAssistant::inline_assist);
|
.register_action(agent::InlineAssistant::inline_assist);
|
||||||
} else {
|
} else {
|
||||||
<dyn AssistantPanelDelegate>::set_global(
|
<dyn AssistantPanelDelegate>::set_global(
|
||||||
Arc::new(assistant::assistant_panel::ConcreteAssistantPanelDelegate),
|
Arc::new(assistant::assistant_panel::ConcreteAssistantPanelDelegate),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue