/**
 * Pure decision for whether a newly-registered agent should auto-open the
 * Settings UI approval window. Kept side-effect-free so the gating (config
 * flag, display present, UI up, burst throttle) is unit-testable; the caller
 * (src/index.ts) supplies the live state and performs the openBrowser().
 */
export const AUTO_OPEN_THROTTLE_MS = 10_000;
export function shouldAutoOpenApproval(i) {
    if (!i.enabled)
        return false;
    if (!i.hasDisplay)
        return false;
    if (!i.settingsEnabled || !i.settingsUrl)
        return false;
    const throttle = i.throttleMs ?? AUTO_OPEN_THROTTLE_MS;
    if (i.lastOpenedAtMs > 0 && i.nowMs - i.lastOpenedAtMs < throttle)
        return false;
    return true;
}
//# sourceMappingURL=auto-open-approval.js.map