1 denied or expired, 20 conflict,
30 openmerit unreachable, 1 other error.
`;
class stop extends error { constructor(message, code, next) { super(message); this.exit = code; this.next = next; } }
const server = () => (process.env.openmerit_url ?? 'https://openmerit.ai').replace(/\/+$/, '');
const configdir = () => resolve(process.env.openmerit_config_dir ?? join(process.env.xdg_config_home ?? join(homedir(), '.config'), 'openmerit'));
const credentialspath = () => join(configdir(), 'credentials.json');
const pendingpath = () => join(configdir(), 'login.json');
async function optional(path) {
try { return await readfile(path, 'utf8'); } catch (error) { if (error.code === 'en