use std::path::{Path, PathBuf};
use argonauts_core::layout::{project_files, repo_state};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Store {
pub state_dir: PathBuf,
pub repo_root: PathBuf,
}
pub const SKILLS_DIR: &str = ".agents/skills";
pub const CLAUDE_SKILLS_DIR: &str = ".claude/skills";
pub const AGENTS_FILE: &str = "AGENTS.md";
pub const CLAUDE_FILE: &str = "CLAUDE.md";
impl Store {
pub fn new(state_dir: impl Into<PathBuf>, repo_root: impl Into<PathBuf>) -> Self {
Self {
state_dir: state_dir.into(),
repo_root: repo_root.into(),
}
}
pub fn outcomes_dir(&self) -> PathBuf {
self.state_dir.join(repo_state::OUTCOMES)
}
pub fn replay_dir(&self) -> PathBuf {
self.state_dir.join(repo_state::REPLAY)
}
pub fn evolution_dir(&self) -> PathBuf {
self.state_dir.join(repo_state::EVOLUTION)
}
pub fn imports_dir(&self) -> PathBuf {
self.state_dir.join(repo_state::IMPORTS)
}
pub fn argonauts_dir(&self) -> PathBuf {
self.repo_root.join(".argonauts")
}
pub fn learned_workflows_dir(&self) -> PathBuf {
self.argonauts_dir().join(project_files::LEARNED_WORKFLOWS)
}
pub fn shared_outcomes_dir(&self) -> PathBuf {
self.argonauts_dir().join(project_files::OUTCOMES)
}
pub fn notes_dir(&self) -> PathBuf {
self.argonauts_dir().join(project_files::NOTES)
}
pub fn conventions(&self) -> PathBuf {
self.argonauts_dir().join(project_files::CONVENTIONS)
}
pub fn skills_dir(&self) -> PathBuf {
self.repo_root.join(SKILLS_DIR)
}
pub fn claude_skills_dir(&self) -> PathBuf {
self.repo_root.join(CLAUDE_SKILLS_DIR)
}
pub fn repo_relative<'a>(&self, path: &'a Path) -> Option<&'a Path> {
path.strip_prefix(&self.repo_root).ok()
}
}