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
18
//! Serializes project writes whose Agent paths may alias the same directory.

use std::sync::{Mutex, MutexGuard};

use super::error::AppError;

// Hold across scanning/checking, removal, writing and cleanup. Commands acquire
// this on spawn_blocking workers before taking any short-lived store locks.
static PROJECT_SKILL_LOCK: Mutex<()> = Mutex::new(());

pub(crate) fn lock_project_skill_mutation() -> Result<MutexGuard<'static, ()>, AppError> {
    PROJECT_SKILL_LOCK.lock().map_err(|_| {
        AppError::internal("Project skill operation lock is unavailable; restart the application")
    })
}

#[cfg(all(test, unix))]
mod tests;