Initial commit
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# Default worktree tab config
|
||||
# Stored in ~/.warp/default_tab_configs/ — you can customize this file!
|
||||
# Stored in ~/.warp-core/default_tab_configs/ — you can customize this file!
|
||||
# Any customizations will apply for any new worktree configs going forward that are created from the "New worktree config" flow
|
||||
#
|
||||
# This config is used by the "Worktree in" submenu to quickly create
|
||||
# worktrees under ~/.warp/worktrees/<repo-name>/<worktree-name> for your
|
||||
# worktrees under ~/.warp-core/worktrees/<repo-name>/<worktree-name> for your
|
||||
# known repositories.
|
||||
|
||||
name = "Worktree"
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -93,9 +93,9 @@ pub fn run() -> Result<()> {
|
||||
|
||||
/// Returns a vector of validated plugin directory paths in the plugins directory.
|
||||
///
|
||||
/// This assumes that all plugins are located in ~/.warp/plugins.
|
||||
/// This assumes that all plugins are located in ~/.warp-core/plugins.
|
||||
fn plugin_paths() -> Vec<PathBuf> {
|
||||
const PLUGIN_PATH_SUFFIX: &str = ".warp/plugins";
|
||||
const PLUGIN_PATH_SUFFIX: &str = ".warp-core/plugins";
|
||||
|
||||
dirs::home_dir()
|
||||
.map(|home_dir| home_dir.join(PLUGIN_PATH_SUFFIX))
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//! One-time migration that gives the Preview channel its own config
|
||||
//! directory (`~/.warp-preview`) on macOS.
|
||||
//! directory (`~/.warp-core-preview`) on macOS.
|
||||
//!
|
||||
//! Historically, Stable and Preview shared `~/.warp` on macOS. To give
|
||||
//! Historically, Stable and Preview shared `~/.warp-core` on macOS. To give
|
||||
//! Preview its own directory without breaking existing users, this migration
|
||||
//! symlinks each top-level entry from `~/.warp` into `~/.warp-preview` on
|
||||
//! symlinks each top-level entry from `~/.warp-core` into `~/.warp-core-preview` on
|
||||
//! first launch, so existing configuration (keybindings, themes, workflows,
|
||||
//! etc.) remains available to Preview.
|
||||
//!
|
||||
|
||||
@@ -13,8 +13,8 @@ fn is_symlink_to(link: &Path, expected_target: &Path) -> bool {
|
||||
#[test]
|
||||
fn creates_symlinks_for_top_level_entries() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let old_dir = tmp.path().join(".warp");
|
||||
let new_dir = tmp.path().join(".warp-preview");
|
||||
let old_dir = tmp.path().join(".warp-core");
|
||||
let new_dir = tmp.path().join(".warp-core-preview");
|
||||
|
||||
fs::create_dir(&old_dir).unwrap();
|
||||
fs::write(old_dir.join("keybindings.yaml"), "bindings").unwrap();
|
||||
@@ -42,8 +42,8 @@ fn creates_symlinks_for_top_level_entries() {
|
||||
#[test]
|
||||
fn skips_when_new_dir_already_exists() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let old_dir = tmp.path().join(".warp");
|
||||
let new_dir = tmp.path().join(".warp-preview");
|
||||
let old_dir = tmp.path().join(".warp-core");
|
||||
let new_dir = tmp.path().join(".warp-core-preview");
|
||||
|
||||
fs::create_dir(&old_dir).unwrap();
|
||||
fs::write(old_dir.join("keybindings.yaml"), "bindings").unwrap();
|
||||
@@ -58,8 +58,8 @@ fn skips_when_new_dir_already_exists() {
|
||||
#[test]
|
||||
fn skips_when_old_dir_does_not_exist() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let old_dir = tmp.path().join(".warp");
|
||||
let new_dir = tmp.path().join(".warp-preview");
|
||||
let old_dir = tmp.path().join(".warp-core");
|
||||
let new_dir = tmp.path().join(".warp-core-preview");
|
||||
|
||||
// old_dir intentionally not created.
|
||||
migrate_config_dir_via_symlinks(&old_dir, &new_dir);
|
||||
@@ -70,8 +70,8 @@ fn skips_when_old_dir_does_not_exist() {
|
||||
#[test]
|
||||
fn skips_ds_store_and_dot_underscore_files() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let old_dir = tmp.path().join(".warp");
|
||||
let new_dir = tmp.path().join(".warp-preview");
|
||||
let old_dir = tmp.path().join(".warp-core");
|
||||
let new_dir = tmp.path().join(".warp-core-preview");
|
||||
|
||||
fs::create_dir(&old_dir).unwrap();
|
||||
fs::write(old_dir.join(".DS_Store"), "metadata").unwrap();
|
||||
@@ -88,8 +88,8 @@ fn skips_ds_store_and_dot_underscore_files() {
|
||||
#[test]
|
||||
fn skips_excluded_files() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let old_dir = tmp.path().join(".warp");
|
||||
let new_dir = tmp.path().join(".warp-preview");
|
||||
let old_dir = tmp.path().join(".warp-core");
|
||||
let new_dir = tmp.path().join(".warp-core-preview");
|
||||
|
||||
fs::create_dir(&old_dir).unwrap();
|
||||
fs::write(old_dir.join("settings.toml"), "[settings]").unwrap();
|
||||
@@ -104,8 +104,8 @@ fn skips_excluded_files() {
|
||||
#[test]
|
||||
fn is_idempotent() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let old_dir = tmp.path().join(".warp");
|
||||
let new_dir = tmp.path().join(".warp-preview");
|
||||
let old_dir = tmp.path().join(".warp-core");
|
||||
let new_dir = tmp.path().join(".warp-core-preview");
|
||||
|
||||
fs::create_dir(&old_dir).unwrap();
|
||||
fs::write(old_dir.join("keybindings.yaml"), "bindings").unwrap();
|
||||
|
||||
@@ -1373,7 +1373,7 @@ define_settings_group!(AISettings, settings: [
|
||||
}
|
||||
|
||||
// Whether file-based MCP servers from third-party AI tools (e.g. Claude, Codex) should
|
||||
// be automatically detected and spawned. Warp-native config files (.warp/.mcp.json) are
|
||||
// be automatically detected and spawned. Warp-native config files (.warp-core/.mcp.json) are
|
||||
// always detected and spawned, regardless of this setting.
|
||||
file_based_mcp_enabled: FileBasedMcpEnabled {
|
||||
type: bool,
|
||||
|
||||
@@ -135,7 +135,7 @@ pub struct TabConfigPaneNode {
|
||||
|
||||
// ── TabConfig ───────────────────────────────────────────────────────
|
||||
|
||||
/// A tab config loaded from a `.toml` file in `~/.warp/tab_configs/`.
|
||||
/// A tab config loaded from a `.toml` file in `~/.warp-core/tab_configs/`.
|
||||
///
|
||||
/// Pane layout is defined with a flat `[[panes]]` array where the first entry
|
||||
/// is the root and splits reference children by ID.
|
||||
|
||||
@@ -218,7 +218,7 @@ pub fn is_tab_config_toml(path: &Path) -> bool {
|
||||
.any(|dir| path.starts_with(dir))
|
||||
}
|
||||
|
||||
/// Ensures `~/.warp/default_tab_configs/worktree.toml` exists, creating it
|
||||
/// Ensures `~/.warp-core/default_tab_configs/worktree.toml` exists, creating it
|
||||
/// from the embedded template if missing. Returns the path to the file.
|
||||
#[cfg(feature = "local_fs")]
|
||||
pub(crate) fn ensure_default_worktree_config() -> PathBuf {
|
||||
|
||||
@@ -82,7 +82,7 @@ impl LocalWorkflows {
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns an iterator over file-based workflows loaded from the `.warp/workflows` directory in
|
||||
/// Returns an iterator over file-based workflows loaded from the `.warp-core/workflows` directory in
|
||||
/// the `working_directory`.
|
||||
///
|
||||
/// The loaded workflows vector is cached.
|
||||
|
||||
@@ -6348,7 +6348,7 @@ impl Workspace {
|
||||
}
|
||||
}
|
||||
|
||||
/// Writes the default tab config template to an unused path in `~/.warp/tab_configs/`
|
||||
/// Writes the default tab config template to an unused path in `~/.warp-core/tab_configs/`
|
||||
/// and opens it respecting the user's configured editor setting.
|
||||
#[cfg(feature = "local_fs")]
|
||||
fn create_and_open_new_tab_config(&mut self, ctx: &mut ViewContext<Self>) {
|
||||
@@ -6387,7 +6387,7 @@ impl Workspace {
|
||||
}
|
||||
|
||||
/// Snapshots the given tab's pane layout and writes it as a new tab config
|
||||
/// TOML to `~/.warp/tab_configs/`, then opens the file in the user's editor.
|
||||
/// TOML to `~/.warp-core/tab_configs/`, then opens the file in the user's editor.
|
||||
#[cfg(feature = "local_fs")]
|
||||
fn save_current_tab_as_new_config(&mut self, tab_index: usize, ctx: &mut ViewContext<Self>) {
|
||||
use crate::tab_configs::session_config::{tab_config_from_pane_snapshot, write_tab_config};
|
||||
@@ -9234,7 +9234,7 @@ impl Workspace {
|
||||
}
|
||||
|
||||
/// Opens a worktree in the given repo using the default worktree tab config,
|
||||
/// saving the materialized config to `~/.warp/tab_configs/` first.
|
||||
/// saving the materialized config to `~/.warp-core/tab_configs/` first.
|
||||
/// The branch name is auto-generated.
|
||||
#[cfg(feature = "local_fs")]
|
||||
fn open_worktree_in_repo(&mut self, repo_path: String, ctx: &mut ViewContext<Self>) {
|
||||
|
||||
Reference in New Issue
Block a user