import {
withRetry,
withTimeout,
CircuitBreaker,
isRetryableError,
} from '@dotsetlabs/cli';
// Retry with exponential backoff
const result = await withRetry(
() => fetchSecrets(),
{ maxAttempts: 3, baseDelayMs: 1000, backoffMultiplier: 2 }
);
// Add timeout to operation
const secrets = await withTimeout(fetchSecrets(), 5000);
// Use circuit breaker for external services
const breaker = new CircuitBreaker('aws-sm', {
failureThreshold: 5,
resetTimeoutMs: 30000,
});
const secret = await breaker.execute(() => getFromAWS(key));