fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Compile proto files for Trading Agent Service
    tonic_prost_build::configure()
        .compile_protos(
            &["../../proto/trading_agent.proto"],
            &["../../proto"],
        )?;

    // ML service client for GetEnsembleVote (ensemble confidence)
    tonic_prost_build::configure()
        .build_server(false)
        .build_client(true)
        .client_mod_attribute(".", "#[allow(unused_qualifications)]")
        .compile_protos(
            &["../../proto/ml.proto"],
            &["../../proto"],
        )?;

    println!("cargo:rerun-if-changed=../../proto/trading_agent.proto");
    println!("cargo:rerun-if-changed=../../proto/ml.proto");

    Ok(())
}
