use schemars::schema_for;
use std::fs;
use std::path::Path;
use steer_cli::session_config::PartialSessionConfig;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut schema = schema_for!(PartialSessionConfig);
schema.ensure_object().insert(
"title".to_string(),
serde_json::json!("Steer Session Configuration"),
);
schema.ensure_object().insert("description".to_string(), serde_json::json!("Configuration file for Steer sessions, including workspace settings, tool configurations, and AI behavior customization."));
let json = serde_json::to_string_pretty(&schema)?;
let schema_dir = Path::new("schemas");
fs::create_dir_all(schema_dir)?;
let schema_path = schema_dir.join("session.schema.json");
fs::write(&schema_path, json)?;
println!("Schema written to {}", schema_path.display());
Ok(())
}