Root directory for all integration state: `~/.atomic/integrations`. `ATOMIC_INTEGRATIONS_HOME` overrides the root — used by tests and by sandboxes that must not touch the real home directory.
()
| 25 | /// `ATOMIC_INTEGRATIONS_HOME` overrides the root — used by tests and by |
| 26 | /// sandboxes that must not touch the real home directory. |
| 27 | pub fn integrations_root() -> AgentResult<PathBuf> { |
| 28 | if let Some(root) = std::env::var_os("ATOMIC_INTEGRATIONS_HOME") { |
| 29 | return Ok(PathBuf::from(root)); |
| 30 | } |
| 31 | dirs::home_dir() |
| 32 | .map(|h| h.join(".atomic").join("integrations")) |
| 33 | .ok_or_else(|| AgentError::Integration { |
| 34 | agent: "<any>".to_string(), |
| 35 | reason: "cannot resolve home directory".to_string(), |
| 36 | }) |
| 37 | } |
| 38 | |
| 39 | /// Per-agent integration directory: `~/.atomic/integrations/<agent>`. |
| 40 | pub fn agent_dir(agent: &str) -> AgentResult<PathBuf> { |