apm-server 0.1.22

Web UI and agent dispatcher for APM, a git-native project manager for parallel AI coding agents.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::path::PathBuf;
use crate::AppError;

pub async fn blocking<F, T>(f: F) -> Result<T, AppError>
where
    F: FnOnce() -> anyhow::Result<T> + Send + 'static,
    T: Send + 'static,
{
    tokio::task::spawn_blocking(f)
        .await
        .map_err(AppError::from)?
        .map_err(AppError::from)
}

pub async fn load_config(root: PathBuf) -> Result<apm_core::config::Config, AppError> {
    blocking(move || apm_core::config::Config::load(&root)).await
}