"use strict";
/**
 * Token Refresh Configuration
 *
 * Loads token refresh worker settings from unified config.
 * Returns null if disabled or not configured.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTokenRefreshConfig = void 0;
const config_loader_facade_1 = require("../../config/config-loader-facade");
/**
 * Get token refresh configuration from unified config
 * @returns Config if enabled, null if disabled or not configured
 */
function getTokenRefreshConfig() {
    const config = (0, config_loader_facade_1.loadOrCreateUnifiedConfig)();
    // Return null if not configured or explicitly disabled
    if (!config.cliproxy?.token_refresh?.enabled) {
        return null;
    }
    // Return config with defaults
    return {
        enabled: true,
        interval_minutes: config.cliproxy.token_refresh.interval_minutes ?? 30,
        preemptive_minutes: config.cliproxy.token_refresh.preemptive_minutes ?? 45,
        max_retries: config.cliproxy.token_refresh.max_retries ?? 3,
        verbose: config.cliproxy.token_refresh.verbose ?? false,
    };
}
exports.getTokenRefreshConfig = getTokenRefreshConfig;
//# sourceMappingURL=token-refresh-config.js.map