bot-forge 1.0.2

Rust CLI for installing agent skills and developer tools from configurable forms.
Documentation
//! Side-effect-free component resolution and immutable execution plans.
//!
//! Planning performs no installation or filesystem mutation. It resolves profile inheritance,
//! platform selectors, dependencies, conflicts, policies, and resource claims into an
//! [`ExecutionPlan`] suitable for preview or execution.

mod plan;
mod resolver;

pub use crate::planning::plan::{
    ExecutionNode, ExecutionPlan, NodeKind, PlanPolicy, ResolvedComponent, ResourceClaim,
    TargetPlatform, UnsupportedComponent,
};
pub use crate::planning::resolver::{PlanRequest, build_plan};

use crate::config::load_config_with_overlays;
use crate::error::ForgeError;
use crate::model::InstallOptions;

/// Load configuration and build an immutable plan for the selected profile.
///
/// # Errors
///
/// Returns [`ForgeError`] when configuration loading, validation, platform selection, dependency
/// resolution, or plan construction fails.
pub fn plan_profile(options: &InstallOptions) -> Result<ExecutionPlan, ForgeError> {
    let loaded = load_config_with_overlays(options.config_path.as_deref(), &options.overlay_paths)?;
    build_plan(PlanRequest {
        document: &loaded.document,
        origins: &loaded.origins,
        profile: options.profile.as_str(),
        target: TargetPlatform::host(),
        only: &options.only,
        exclude: &options.exclude,
        source_root: loaded.path.as_deref().and_then(std::path::Path::parent),
    })
}