/**
 * Standalone token keep-alive process.
 *
 * Keeps OAuth tokens in auth.json fresh by running the proactive refresh timer.
 * Used by the benchmark runner to prevent LoginRequiredError when spawning
 * many short-lived agent processes concurrently.
 *
 * Usage: node dist/cli.js keep-alive
 *        pnpm.cmd exec tsx src/app/auth/keep-alive.ts
 */
import { AuthStorage } from './auth-storage.js';
import { startProactiveRefresh } from './refresh-timer.js';
const PROVIDER_ID = 'shortcut';
const authStorage = AuthStorage.create();
// Do an initial refresh immediately
await authStorage.getApiKey(PROVIDER_ID);
// Then keep refreshing on a timer
startProactiveRefresh(authStorage, PROVIDER_ID);
// Stay alive until killed
process.on('SIGINT', () => process.exit(0));
process.on('SIGTERM', () => process.exit(0));
setInterval(() => { }, 60_000);
//# sourceMappingURL=keep-alive.js.map