use std::path::PathBuf;
use anyhow::{Context, Result};
pub mod api;
pub mod filter;
pub mod index;
pub mod parser;
pub mod plan;
pub mod providers;
pub mod stats;
pub mod store;
pub mod time_utils;
pub mod types;
pub fn claudex_dir() -> Result<PathBuf> {
let dir = if let Some(val) = std::env::var_os("CLAUDEX_DIR")
&& !val.is_empty()
{
PathBuf::from(val)
} else {
let home = dirs::home_dir().context("could not find home directory")?;
home.join(".claudex")
};
std::fs::create_dir_all(&dir).with_context(|| format!("creating {}", dir.display()))?;
Ok(dir)
}