Initial commit
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user