use std::borrow::Cow;
pub const PKG_NAME: &str = env!("CARGO_PKG_NAME");
pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
pub const DISPLAY_NAME: &str = "VantaDB";
pub const MCP_SERVER_INFO_NAME: &str = "vantadb";
pub const ENV_REPORTED_VERSION: &str = "VANTADB_REPORTED_VERSION";
#[inline]
pub fn reported_version() -> Cow<'static, str> {
match std::env::var(ENV_REPORTED_VERSION) {
Ok(s) => {
let trimmed = s.trim().to_owned();
if trimmed.is_empty() {
Cow::Borrowed(PKG_VERSION)
} else {
Cow::Owned(trimmed)
}
}
Err(_) => Cow::Borrowed(PKG_VERSION),
}
}
#[inline]
pub fn version_label() -> String {
format!("v{}", reported_version())
}