pub fn resolve_token(flag: Option<&str>) -> Result<String, AppError>
Resolve the shared token from an explicit flag or the TOKEN_ENV env var.
TOKEN_ENV
Returns AppError::validation when no non-empty token is available.
AppError::validation