Initial commit
This commit is contained in:
@@ -12,7 +12,7 @@ use crate::ai::agent::AIAgentAttachment;
|
||||
/// based on the agent's working directory.
|
||||
#[cfg_attr(target_family = "wasm", allow(dead_code))]
|
||||
pub(crate) fn attachments_download_dir(working_dir: &Path) -> PathBuf {
|
||||
working_dir.join(".warp").join("attachments")
|
||||
working_dir.join(".warp-core").join("attachments")
|
||||
}
|
||||
|
||||
/// Extracts the filename component from a path, stripping any directory prefixes.
|
||||
|
||||
@@ -307,7 +307,7 @@ pub struct BlocklistAIController {
|
||||
ambient_agent_task_id: Option<AmbientAgentTaskId>,
|
||||
|
||||
/// Per-session directory for downloading file attachments.
|
||||
/// Set by the agent driver based on the workspace directory (e.g. `{working_dir}/.warp/attachments`).
|
||||
/// Set by the agent driver based on the workspace directory (e.g. `{working_dir}/.warp-core/attachments`).
|
||||
attachments_download_dir: Option<std::path::PathBuf>,
|
||||
|
||||
/// Pending auto-resume tasks that are waiting for network connectivity.
|
||||
|
||||
@@ -235,7 +235,7 @@ impl FileBasedMCPManager {
|
||||
/// config location.
|
||||
///
|
||||
/// "Global" means the installation was detected outside of a user repository:
|
||||
/// - For `MCPProvider::Warp`: `warp_data_dir()` (i.e. `~/.warp/.mcp.json`).
|
||||
/// - For `MCPProvider::Warp`: `warp_data_dir()` (i.e. `~/.warp-core/.mcp.json`).
|
||||
/// - For any other provider: the user's home directory (e.g. `~/.claude.json`).
|
||||
///
|
||||
/// Project-scoped installations (those detected inside a repo) are not considered
|
||||
@@ -409,11 +409,11 @@ impl FileBasedMCPManager {
|
||||
/// when its config does not specify `working_directory`.
|
||||
///
|
||||
/// The spawn root is the directory the config was discovered in, with one
|
||||
/// exception: global Warp installs are discovered in `~/.warp/` (Warp's data
|
||||
/// exception: global Warp installs are discovered in `~/.warp-core/` (Warp's data
|
||||
/// dir) which isn't a useful cwd for spawned processes, so they are remapped
|
||||
/// to the home directory instead.
|
||||
/// - Project-scoped installations: the repo root.
|
||||
/// - Global installations (`~/.warp/.mcp.json`, `~/.claude.json`, etc.): the
|
||||
/// - Global installations (`~/.warp-core/.mcp.json`, `~/.claude.json`, etc.): the
|
||||
/// home directory.
|
||||
///
|
||||
/// If the installation is referenced from multiple roots, the lexicographically
|
||||
@@ -429,7 +429,7 @@ impl FileBasedMCPManager {
|
||||
.sorted()
|
||||
.next()?;
|
||||
|
||||
// Global Warp installs live under `~/.warp/`, which is internal Warp state
|
||||
// Global Warp installs live under `~/.warp-core/`, which is internal Warp state
|
||||
// rather than a meaningful working directory. Map them to the home dir so
|
||||
// all global installs (Warp and third-party) share a consistent cwd.
|
||||
if discovery_root == warp_data_dir() {
|
||||
|
||||
@@ -29,13 +29,13 @@ static ENV_VAR_REGEX: LazyLock<Regex> =
|
||||
LazyLock::new(|| Regex::new(r"\$\{([^}]+)\}").expect("Regex is valid"));
|
||||
|
||||
/// Matches home config paths that are exactly one directory deep (e.g. `.codex/config.toml`,
|
||||
/// `.warp/.mcp.json`), capturing the parent directory component.
|
||||
/// `.warp-core/.mcp.json`), capturing the parent directory component.
|
||||
static HOME_SUBDIR_REGEX: LazyLock<Regex> =
|
||||
LazyLock::new(|| Regex::new(r"^([^/]+)/[^/]+$").expect("Regex is valid"));
|
||||
|
||||
/// Returns the subdirectory under the home directory that needs its own [`DirectoryWatcher`],
|
||||
/// inferred from the provider's home config path. Matches paths that are exactly one directory
|
||||
/// deep (e.g. `.codex/config.toml` → `.codex`, `.warp/.mcp.json` → `.warp`). Returns `None`
|
||||
/// deep (e.g. `.codex/config.toml` → `.codex`, `.warp-core/.mcp.json` → `.warp-core`). Returns `None`
|
||||
/// when the config file lives directly in the home dir (e.g. `.claude.json`) and is already
|
||||
/// covered by `HomeDirectoryWatcher`.
|
||||
fn home_subdir_to_watch(provider: MCPProvider) -> Option<PathBuf> {
|
||||
|
||||
@@ -92,7 +92,7 @@ impl MCPProvider {
|
||||
/// Returns the path of the provider's config file relative to the home directory.
|
||||
pub fn home_config_path(&self) -> &'static Path {
|
||||
match self {
|
||||
MCPProvider::Warp => Path::new(".warp/.mcp.json"),
|
||||
MCPProvider::Warp => Path::new(".warp-core/.mcp.json"),
|
||||
MCPProvider::Claude => Path::new(".claude.json"),
|
||||
MCPProvider::Codex => Path::new(".codex/config.toml"),
|
||||
MCPProvider::Agents => Path::new(".agents/.mcp.json"),
|
||||
@@ -102,7 +102,7 @@ impl MCPProvider {
|
||||
/// Returns the path of the provider's config file relative to a project root.
|
||||
pub fn project_config_path(&self) -> &'static Path {
|
||||
match self {
|
||||
MCPProvider::Warp => Path::new(".warp/.mcp.json"),
|
||||
MCPProvider::Warp => Path::new(".warp-core/.mcp.json"),
|
||||
MCPProvider::Claude => Path::new(".mcp.json"),
|
||||
MCPProvider::Codex => Path::new(".codex/config.toml"),
|
||||
MCPProvider::Agents => Path::new(".agents/.mcp.json"),
|
||||
|
||||
@@ -785,7 +785,7 @@ impl TemplatableMCPServerManager {
|
||||
|
||||
// For file-based MCP installations without an explicit `working_directory`,
|
||||
// default the spawn cwd to the directory the config was discovered in
|
||||
// (repo root for project-scoped configs, ~/.warp/ or ~ for globals). This
|
||||
// (repo root for project-scoped configs, ~/.warp-core/ or ~ for globals). This
|
||||
// matches user expectations for repo-relative commands in `.mcp.json`.
|
||||
// Cloud-templated installations (lookup returns None) are unaffected and
|
||||
// continue to inherit Warp's process cwd.
|
||||
|
||||
@@ -197,7 +197,7 @@ fn extract_skill_parent_directory_different_providers() {
|
||||
return;
|
||||
};
|
||||
let repo = home_dir.join("repo");
|
||||
let providers = [".warp", ".claude", ".codex", ".cursor", ".gemini"];
|
||||
let providers = [".warp-core", ".claude", ".codex", ".cursor", ".gemini"];
|
||||
for provider in providers {
|
||||
let path = repo
|
||||
.join(provider)
|
||||
|
||||
@@ -21,7 +21,7 @@ fn write_skill_file(path: &Path, name: &str, description: &str, body: &str) -> R
|
||||
#[test]
|
||||
fn resolve_from_skill_dirs_by_directory_scan_resolves_home_skill_dir() -> Result<()> {
|
||||
let temp_dir = tempfile::TempDir::new().context("Failed to create temp dir")?;
|
||||
let skill_dir = temp_dir.path().join(".warp").join("skills");
|
||||
let skill_dir = temp_dir.path().join(".warp-core").join("skills");
|
||||
let skill_path = skill_dir.join("my-skill").join("SKILL.md");
|
||||
|
||||
write_skill_file(
|
||||
|
||||
@@ -60,7 +60,7 @@ fn try_insert_skill(
|
||||
///
|
||||
/// Two skills are considered duplicates only when they share the same owning directory
|
||||
/// **and** identical content — which is the common case when a tool like `npx skills`
|
||||
/// symlinks the same skill under `~/.agents/skills/`, `~/.warp/skills/`, `~/.claude/skills/`, etc.
|
||||
/// symlinks the same skill under `~/.agents/skills/`, `~/.warp-core/skills/`, `~/.claude/skills/`, etc.
|
||||
///
|
||||
/// Each element of `skill_paths` is a `(dir_path, skill_file_path)` tuple where
|
||||
/// `dir_path` is the directory that owns the skill.
|
||||
|
||||
Reference in New Issue
Block a user