diff --git a/Cargo.lock b/Cargo.lock index 346b099d1b..0d48becc83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2622,6 +2622,7 @@ dependencies = [ "anthropic", "anyhow", "assistant", + "assistant_slash_command", "assistant_tool", "async-stripe", "async-trait", @@ -2678,6 +2679,7 @@ dependencies = [ "pretty_assertions", "project", "prometheus", + "prompt_library", "prost 0.9.0", "rand 0.8.5", "recent_projects", @@ -16246,6 +16248,7 @@ dependencies = [ "project", "project_panel", "project_symbols", + "prompt_library", "proto", "recent_projects", "release_channel", diff --git a/crates/assistant/src/assistant.rs b/crates/assistant/src/assistant.rs index a57f4ca3d6..826d8ab357 100644 --- a/crates/assistant/src/assistant.rs +++ b/crates/assistant/src/assistant.rs @@ -12,35 +12,34 @@ pub mod slash_command_settings; mod streaming_diff; mod terminal_inline_assistant; -pub use ::prompt_library::PromptBuilder; -use ::prompt_library::PromptLoadingParams; -pub use assistant_panel::{AssistantPanel, AssistantPanelEvent}; +use std::path::PathBuf; +use std::sync::Arc; + +use ::prompt_library::{PromptBuilder, PromptLoadingParams}; use assistant_settings::AssistantSettings; use assistant_slash_command::SlashCommandRegistry; -pub use assistant_slash_command::{SlashCommandId, SlashCommandWorkingSet}; use assistant_slash_commands::{ProjectSlashCommandFeatureFlag, SearchSlashCommandFeatureFlag}; use client::{proto, Client}; use command_palette_hooks::CommandPaletteFilter; -pub use context::*; -pub use context_store::*; use feature_flags::FeatureFlagAppExt; use fs::Fs; use gpui::impl_internal_actions; use gpui::{actions, AppContext, Global, SharedString, UpdateGlobal}; -pub(crate) use inline_assistant::*; use language_model::{ LanguageModelId, LanguageModelProviderId, LanguageModelRegistry, LanguageModelResponseMessage, }; -pub use patch::*; use semantic_index::{CloudEmbeddingProvider, SemanticDb}; use serde::{Deserialize, Serialize}; use settings::{Settings, SettingsStore}; -use std::path::PathBuf; -use std::sync::Arc; -pub(crate) use streaming_diff::*; use util::ResultExt; +pub use crate::assistant_panel::{AssistantPanel, AssistantPanelEvent}; +pub use crate::context::*; +pub use crate::context_store::*; +pub(crate) use crate::inline_assistant::*; +pub use crate::patch::*; use crate::slash_command_settings::SlashCommandSettings; +pub(crate) use crate::streaming_diff::*; actions!( assistant, diff --git a/crates/assistant/src/context/context_tests.rs b/crates/assistant/src/context/context_tests.rs index 444cb6560a..6876b29913 100644 --- a/crates/assistant/src/context/context_tests.rs +++ b/crates/assistant/src/context/context_tests.rs @@ -1,7 +1,7 @@ use super::{AssistantEdit, MessageCacheMetadata}; use crate::{ assistant_panel, AssistantEditKind, CacheStatus, Context, ContextEvent, ContextId, - ContextOperation, InvokedSlashCommandId, MessageId, MessageStatus, PromptBuilder, + ContextOperation, InvokedSlashCommandId, MessageId, MessageStatus, }; use anyhow::Result; use assistant_slash_command::{ @@ -22,6 +22,7 @@ use language_model::{LanguageModelCacheConfiguration, LanguageModelRegistry, Rol use parking_lot::Mutex; use pretty_assertions::assert_eq; use project::Project; +use prompt_library::PromptBuilder; use rand::prelude::*; use serde_json::json; use settings::SettingsStore; diff --git a/crates/assistant/src/context_store.rs b/crates/assistant/src/context_store.rs index 43fc4b8aa1..92d9889f93 100644 --- a/crates/assistant/src/context_store.rs +++ b/crates/assistant/src/context_store.rs @@ -1,10 +1,9 @@ -use crate::SlashCommandId; use crate::{ Context, ContextEvent, ContextId, ContextOperation, ContextVersion, SavedContext, SavedContextMetadata, }; use anyhow::{anyhow, Context as _, Result}; -use assistant_slash_command::SlashCommandWorkingSet; +use assistant_slash_command::{SlashCommandId, SlashCommandWorkingSet}; use assistant_tool::{ToolId, ToolWorkingSet}; use client::{proto, telemetry::Telemetry, Client, TypedEnvelope}; use clock::ReplicaId; diff --git a/crates/assistant/src/prompt_library.rs b/crates/assistant/src/prompt_library.rs index 03997d4ef5..c6c4c1e53d 100644 --- a/crates/assistant/src/prompt_library.rs +++ b/crates/assistant/src/prompt_library.rs @@ -1,6 +1,6 @@ -use crate::SlashCommandWorkingSet; use crate::{slash_command::SlashCommandCompletionProvider, AssistantPanel, InlineAssistant}; use anyhow::Result; +use assistant_slash_command::SlashCommandWorkingSet; use collections::{HashMap, HashSet}; use editor::{actions::Tab, CurrentLineHighlight, Editor, EditorElement, EditorEvent, EditorStyle}; use gpui::{ diff --git a/crates/assistant/src/slash_command.rs b/crates/assistant/src/slash_command.rs index b4841647df..793d2a950a 100644 --- a/crates/assistant/src/slash_command.rs +++ b/crates/assistant/src/slash_command.rs @@ -1,8 +1,8 @@ use crate::assistant_panel::ContextEditor; -use crate::SlashCommandWorkingSet; use anyhow::Result; use assistant_slash_command::AfterCompletion; pub use assistant_slash_command::SlashCommand; +use assistant_slash_command::SlashCommandWorkingSet; use editor::{CompletionProvider, Editor}; use fuzzy::{match_strings, StringMatchCandidate}; use gpui::{Model, Task, ViewContext, WeakView, WindowContext}; diff --git a/crates/assistant/src/slash_command_picker.rs b/crates/assistant/src/slash_command_picker.rs index 102f706c95..d5840f4196 100644 --- a/crates/assistant/src/slash_command_picker.rs +++ b/crates/assistant/src/slash_command_picker.rs @@ -1,11 +1,11 @@ use std::sync::Arc; +use assistant_slash_command::SlashCommandWorkingSet; use gpui::{AnyElement, DismissEvent, SharedString, Task, WeakView}; use picker::{Picker, PickerDelegate, PickerEditorPosition}; use ui::{prelude::*, ListItem, ListItemSpacing, PopoverMenu, PopoverTrigger, Tooltip}; use crate::assistant_panel::ContextEditor; -use crate::SlashCommandWorkingSet; #[derive(IntoElement)] pub(super) struct SlashCommandSelector { diff --git a/crates/collab/Cargo.toml b/crates/collab/Cargo.toml index c6e2a34a3c..9c6b4f35f6 100644 --- a/crates/collab/Cargo.toml +++ b/crates/collab/Cargo.toml @@ -79,8 +79,8 @@ uuid.workspace = true [dev-dependencies] assistant = { workspace = true, features = ["test-support"] } +assistant_slash_command.workspace = true assistant_tool.workspace = true -context_server.workspace = true async-trait.workspace = true audio.workspace = true call = { workspace = true, features = ["test-support"] } @@ -88,6 +88,7 @@ channel.workspace = true client = { workspace = true, features = ["test-support"] } collab_ui = { workspace = true, features = ["test-support"] } collections = { workspace = true, features = ["test-support"] } +context_server.workspace = true ctor.workspace = true editor = { workspace = true, features = ["test-support"] } env_logger.workspace = true @@ -108,6 +109,7 @@ node_runtime.workspace = true notifications = { workspace = true, features = ["test-support"] } pretty_assertions.workspace = true project = { workspace = true, features = ["test-support"] } +prompt_library.workspace = true recent_projects = { workspace = true } release_channel.workspace = true remote = { workspace = true, features = ["test-support"] } diff --git a/crates/collab/src/tests/integration_tests.rs b/crates/collab/src/tests/integration_tests.rs index e6bb07c925..5abb17799b 100644 --- a/crates/collab/src/tests/integration_tests.rs +++ b/crates/collab/src/tests/integration_tests.rs @@ -6,13 +6,15 @@ use crate::{ }, }; use anyhow::{anyhow, Result}; -use assistant::{ContextStore, PromptBuilder, SlashCommandWorkingSet}; +use assistant::ContextStore; +use assistant_slash_command::SlashCommandWorkingSet; use assistant_tool::ToolWorkingSet; use call::{room, ActiveCall, ParticipantLocation, Room}; use client::{User, RECEIVE_TIMEOUT}; use collections::{HashMap, HashSet}; use fs::{FakeFs, Fs as _, RemoveOptions}; use futures::{channel::mpsc, StreamExt as _}; +use prompt_library::PromptBuilder; use git::status::{FileStatus, StatusCode, TrackedStatus, UnmergedStatus, UnmergedStatusCode}; use gpui::{ diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 5b077cf378..b9388c571c 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -87,6 +87,7 @@ profiling.workspace = true project.workspace = true project_panel.workspace = true project_symbols.workspace = true +prompt_library.workspace = true proto.workspace = true recent_projects.workspace = true release_channel.workspace = true diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 700d47d74a..3c8e070b37 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -12,7 +12,6 @@ pub(crate) mod windows_only_instance; use anyhow::Context as _; pub use app_menus::*; use assets::Assets; -use assistant::PromptBuilder; use breadcrumbs::Breadcrumbs; use client::{zed_urls, ZED_URL_SCHEME}; use collections::VecDeque; @@ -32,6 +31,7 @@ use outline_panel::OutlinePanel; use paths::{local_settings_file_relative_path, local_tasks_file_relative_path}; use project::{DirectoryLister, ProjectItem}; use project_panel::ProjectPanel; +use prompt_library::PromptBuilder; use quick_action_bar::QuickActionBar; use recent_projects::open_ssh_project; use release_channel::{AppCommitSha, ReleaseChannel};