Implement exports.retry(operation, options = {}) as an async function in solution.cjs. options.attempts defaults to 3 and must be a positive integer; reject invalid values before calling operation. Invoke operation with the 1-based attempt number. Return the first successful value (including 0 or undefined). Retry sync throws and promise rejections while attempts remain and shouldRetry(error, attempt) returns true; shouldRetry defaults to returning true. Preserve and throw the identical last Error object on exhaustion or when shouldRetry returns false. Do not call shouldRetry after the final allowed attempt. Do not mutate options, use timers or use external libraries.
