1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! Workspace module - Global Patina configuration and first-run setup
//!
//! Manages `~/.patina/` directory structure, global config, adapter installation,
//! and workspace folder. This is the foundation for the launcher architecture.
//!
//! # Example
//!
//! ```no_run
//! use patina::workspace;
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Check if first run
//! if workspace::is_first_run() {
//! workspace::setup()?;
//! }
//!
//! // Load global config
//! let config = workspace::config()?;
//! println!("Default adapter: {}", config.adapter.default);
//! Ok(())
//! }
//! ```
use Result;
pub use ;
/// Check if this is first run (no ~/.patina/ directory)
/// Perform first-run setup
///
/// Creates:
/// - `~/.patina/` directory structure
/// - `~/Projects/Patina` workspace folder (configurable)
/// - Default adapters (claude, gemini, codex)
/// - Global config file
/// Load global config from `~/.patina/config.toml`
/// Save global config to `~/.patina/config.toml`
/// Get workspace info (paths, status)
/// Ensure ~/.patina/ exists with required structure
///
/// Safe to call multiple times - only creates what's missing.
// Path functions moved to patina::paths module
// Use paths::patina_home(), paths::adapters_dir(), etc.
/// Result of first-run setup
// Tests for path functions are in paths module