#![allow(dead_code)]
use std::time::{SystemTime, UNIX_EPOCH};
use super::marketplace_helpers::is_source_allowed_by_policy;
use super::marketplace_manager::{
DeclaredMarketplace, add_marketplace_source, get_marketplaces_cache_dir,
load_known_marketplaces_config, save_known_marketplaces_config,
};
use super::official_marketplace::{OFFICIAL_MARKETPLACE_NAME, get_official_marketplace_source};
struct RetryConfig {
max_attempts: u32,
initial_delay_ms: u64,
backoff_multiplier: u64,
max_delay_ms: u64,
}
impl Default for RetryConfig {
fn default() -> Self {
Self {
max_attempts: 10,
initial_delay_ms: 60 * 60 * 1000,
backoff_multiplier: 2,
max_delay_ms: 7 * 24 * 60 * 60 * 1000,
}
}
}
fn _calculate_next_retry_delay(retry_count: u32, config: &RetryConfig) -> u64 {
let delay = config.initial_delay_ms * config.backoff_multiplier.pow(retry_count);
delay.min(config.max_delay_ms)
}
pub fn is_official_marketplace_auto_install_disabled() -> bool {
std::env::var("CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL")
.map(|v| v == "1" || v.to_lowercase() == "true")
.unwrap_or(false)
}
pub struct OfficialMarketplaceCheckResult {
pub installed: bool,
pub skipped: bool,
pub reason: Option<String>,
}
pub async fn check_and_install_official_marketplace()
-> Result<OfficialMarketplaceCheckResult, Box<dyn std::error::Error + Send + Sync>> {
Ok(OfficialMarketplaceCheckResult {
installed: false,
skipped: true,
reason: Some("stub_implementation".to_string()),
})
}
fn _should_retry_installation(_config: &crate::utils::config::GlobalConfig) -> bool {
false
}