import type { CliContext } from '../context.js'; /** * The single place a fresh sign-in is accepted or refused. * * Every command that signs a profile in goes through here, because there is more * than one way to sign in (`ccx add` does it while registering, `ccx login` does * it on its own) and a check that only one of them performs is not a check. The * duplicate this refuses was originally created by the `add` path. */ export interface SettleResult { ok: boolean; /** Who the new login belongs to, when that could be established. */ owner?: string; /** The profile that already held this account, when it was refused. */ twin?: string; } export interface SettleOptions { /** Injectable for tests; defaults to the real API lookup. */ lookupOwner?: (dir: string) => Promise; } /** * Check a just-completed sign-in and refuse it if another profile already holds * that account. * * Refused rather than warned about, because the state is destructive and not * merely wasteful: signing in replaces a login, so two profiles sharing one * means renewing either ends the other, and that account is gone until somebody * signs it in by hand. Two accounts here were lost exactly that way. */ export declare function settleNewLogin(context: CliContext, account: { name: string; dir: string; }, options?: SettleOptions): Promise;