diff --git a/crates/tui/src/automation_manager.rs b/crates/tui/src/automation_manager.rs index c98dc7e8..79bc8765 100644 --- a/crates/tui/src/automation_manager.rs +++ b/crates/tui/src/automation_manager.rs @@ -795,8 +795,15 @@ pub fn default_automations_dir() -> PathBuf { } } dirs::home_dir() - .map(|home| home.join(".deepseek").join("automations")) - .unwrap_or_else(|| PathBuf::from(".deepseek").join("automations")) + .map(|home| { + let primary = home.join(".codewhale").join("automations"); + if primary.exists() { + primary + } else { + home.join(".deepseek").join("automations") + } + }) + .unwrap_or_else(|| PathBuf::from(".codewhale").join("automations")) } pub type SharedAutomationManager = Arc>; diff --git a/crates/tui/src/core/capacity_memory.rs b/crates/tui/src/core/capacity_memory.rs index f41bd48a..ab598512 100644 --- a/crates/tui/src/core/capacity_memory.rs +++ b/crates/tui/src/core/capacity_memory.rs @@ -56,14 +56,21 @@ fn capacity_memory_dirs() -> Vec { let mut dirs = Vec::new(); if let Some(home) = dirs::home_dir() { + // Prefer .codewhale, fall back to .deepseek + let primary = home.join(".codewhale").join("memory"); + if primary.exists() { + dirs.push(primary); + } dirs.push(home.join(".deepseek").join("memory")); } let cwd = std::env::current_dir() - .unwrap_or_else(|_| PathBuf::from(".")) - .join(".deepseek") - .join("memory"); - dirs.push(cwd); + .unwrap_or_else(|_| PathBuf::from(".")); + let primary_cwd = cwd.join(".codewhale").join("memory"); + if primary_cwd.exists() { + dirs.push(primary_cwd); + } + dirs.push(cwd.join(".deepseek").join("memory")); dirs.dedup(); dirs diff --git a/crates/tui/src/runtime_log.rs b/crates/tui/src/runtime_log.rs index 7fa0e8ca..48373d4b 100644 --- a/crates/tui/src/runtime_log.rs +++ b/crates/tui/src/runtime_log.rs @@ -157,17 +157,24 @@ pub fn init() -> Result { } fn log_directory() -> Option { + let resolve = |base: PathBuf| -> Option { + let primary = base.join(".codewhale").join("logs"); + if primary.exists() { + return Some(primary); + } + Some(base.join(".deepseek").join("logs")) + }; if let Some(home) = std::env::var_os("HOME").map(PathBuf::from) && !home.as_os_str().is_empty() { - return Some(home.join(".deepseek").join("logs")); + return resolve(home); } if let Some(userprofile) = std::env::var_os("USERPROFILE").map(PathBuf::from) && !userprofile.as_os_str().is_empty() { - return Some(userprofile.join(".deepseek").join("logs")); + return resolve(userprofile); } - dirs::home_dir().map(|h| h.join(".deepseek").join("logs")) + dirs::home_dir().and_then(|h| resolve(h)) } fn log_file_name(date: &str, pid: u32) -> String { diff --git a/crates/tui/src/settings.rs b/crates/tui/src/settings.rs index 1a92ef2f..040ba88f 100644 --- a/crates/tui/src/settings.rs +++ b/crates/tui/src/settings.rs @@ -109,6 +109,10 @@ impl TuiPrefs { let home = dirs::home_dir() .context("Failed to resolve home directory: cannot determine tui.toml path.")?; + let primary = home.join(".codewhale").join("tui.toml"); + if primary.exists() { + return Ok(primary); + } Ok(home.join(".deepseek").join("tui.toml")) } diff --git a/crates/tui/src/tools/truncate.rs b/crates/tui/src/tools/truncate.rs index e0cadcae..6c8d6e69 100644 --- a/crates/tui/src/tools/truncate.rs +++ b/crates/tui/src/tools/truncate.rs @@ -81,6 +81,11 @@ pub fn spillover_root() -> Option { return Some(root); } + // Prefer .codewhale, fall back to .deepseek + let primary = dirs::home_dir()?.join(".codewhale").join(SPILLOVER_DIR_NAME); + if primary.exists() { + return Some(primary); + } Some(dirs::home_dir()?.join(".deepseek").join(SPILLOVER_DIR_NAME)) } diff --git a/crates/tui/src/utils.rs b/crates/tui/src/utils.rs index a260e1d5..15c23199 100644 --- a/crates/tui/src/utils.rs +++ b/crates/tui/src/utils.rs @@ -259,7 +259,17 @@ fn write_panic_dump( let home = dirs::home_dir().ok_or_else(|| { std::io::Error::new(std::io::ErrorKind::NotFound, "home directory not found") })?; - let crash_dir = home.join(".deepseek").join("crashes"); + // Prefer .codewhale, fall back to .deepseek + let crash_dir = home.join(".codewhale").join("crashes"); + if !crash_dir.exists() { + // Try legacy path for reading, but prefer new for writing + let _ = std::fs::create_dir_all(&crash_dir); + } + let crash_dir = if crash_dir.exists() { + crash_dir + } else { + home.join(".deepseek").join("crashes") + }; write_panic_dump_to(&crash_dir, name, location, message) }