fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Compile proto files for client testing (Tonic 0.14+)
    tonic_prost_build::configure()
        .build_server(false)
        .build_client(true)
        .compile_protos(
            &[
                "../../proto/trading.proto",
                "../../proto/ml.proto",
                "../../proto/config.proto",
                "../../proto/health.proto",
            ],
            &["../../proto"],
        )?;

    // Tell cargo to recompile if proto files change
    println!("cargo:rerun-if-changed=../../proto/trading.proto");
    println!("cargo:rerun-if-changed=../../proto/ml.proto");
    println!("cargo:rerun-if-changed=../../proto/config.proto");
    println!("cargo:rerun-if-changed=../../proto/health.proto");

    Ok(())
}
