agent-hub-runtime 0.6.0

AgentHub desktop and companion CLI runtime for Tauri applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use anyhow::{bail, Result};
use std::path::PathBuf;

/// Resolve only a registered project; never accept a caller-supplied cwd at IPC.
pub fn project_directory(
    store: &crate::core::skill_store::SkillStore,
    project_id: &str,
) -> Result<PathBuf> {
    let project = store
        .get_project_by_id(project_id)?
        .ok_or_else(|| anyhow::anyhow!("Project is no longer registered"))?;
    let directory = std::path::Path::new(&project.path).canonicalize()?;
    if !directory.is_dir() {
        bail!("Project directory is unavailable");
    }
    Ok(directory)
}