#![allow(dead_code)]
pub mod catalog;
pub mod environment_config;
pub mod generator;
pub mod lister;
pub mod profile;
pub mod robot_generator;
pub mod selector;
pub mod validator;
pub use catalog::EnvironmentCatalog;
pub use environment_config::{CubeObject, EnvironmentConfig, EnvironmentFeatures, ImageObject, SceneObject};
#[allow(unused_imports)]
pub use lister::list_environments;
pub use profile::RobotProfile;
pub use robot_generator::RobotGenerator;
pub use selector::EnvironmentSelector;
#[allow(unused_imports)]
pub use validator::{validate_catalog, validate_config};
use anyhow::{Context, Result};
use std::path::Path;
pub(crate) fn load_json<T: serde::de::DeserializeOwned>(path: &Path, description: &str) -> Result<T> {
let content =
std::fs::read_to_string(path).with_context(|| format!("Failed to read {description}: {}", path.display()))?;
serde_json::from_str(&content).with_context(|| format!("Failed to parse {description}: {}", path.display()))
}
pub fn generate_robot(config_path: &Path, output_path: &Path) -> Result<()> {
println!("🤖 Mecha10 Robot Generator\n");
let generator = RobotGenerator::from_config_file(config_path)?;
generator.generate(output_path)?;
println!("\n✅ Robot generation complete!");
println!("\nOutput: {}", output_path.display());
Ok(())
}