refactor(kon): clean up storage and cloud-providers — remove unused deps, add safety docs

- Remove unused chrono and uuid dependencies from kon-storage
- Add schema versioning TODO to run_migrations() for pre-release safety
- Add doc comment and usage example to log_error() (uncalled public API)
- Add TODO to consolidate app_data_dir() with model_manager::dirs_path()
- Add safety comments and #[allow(deprecated)] to keystore set_var usage
- Add TODO for keyring crate migration in cloud-providers keystore
- Apply cargo fmt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jake
2026-03-17 00:23:30 +00:00
parent 2ac98e6d40
commit 6e959ed0c9
5 changed files with 57 additions and 34 deletions

View File

@@ -3,14 +3,16 @@ use std::path::PathBuf;
/// Resolve the app data directory.
/// Windows: %LOCALAPPDATA%/kon
/// Unix: ~/.kon
///
/// TODO: Consolidate with `crates/transcription/src/model_manager.rs::dirs_path()`
/// into a shared helper in `crates/core/` to avoid duplicating platform-specific
/// path logic across crates.
pub fn app_data_dir() -> PathBuf {
if cfg!(target_os = "windows") {
let local_app_data =
std::env::var("LOCALAPPDATA").unwrap_or_else(|_| ".".to_string());
let local_app_data = std::env::var("LOCALAPPDATA").unwrap_or_else(|_| ".".to_string());
PathBuf::from(local_app_data).join("kon")
} else {
let home =
std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string());
let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string());
PathBuf::from(home).join(".kon")
}
}