import type { AccountIdSource, TokenResult } from "../types.js"; type TokenSuccess = Extract; export type TokenSuccessWithAccount = TokenSuccess & { accountIdOverride?: string; organizationIdOverride?: string; accountIdSource?: AccountIdSource; accountLabel?: string; }; export type AccountSelectionResult = { primary: TokenSuccessWithAccount; variantsForPersistence: TokenSuccessWithAccount[]; }; export type PersistAccountSelections = (results: TokenSuccessWithAccount[], replaceAll: boolean) => Promise; export type AccountSelectionFallbacks = Pick; export declare function resolveAccountSelection(tokens: TokenSuccess): AccountSelectionResult; export declare function applyAccountSelectionFallbacks(selection: AccountSelectionResult, fallbacks: AccountSelectionFallbacks): AccountSelectionResult; /** * Persists the already-resolved selection through the caller's * `persistSelections` callback. Windows filesystem safety remains delegated to * that callback, so callers should use `persistAccountPool` or * `withAccountStorageTransaction` to keep the rename retry and serialized * read-modify-write behavior covered by `test/login-runner.test.ts`. * Callback failures are rethrown with a redacted message so callers can log the * wrapper safely without leaking token-file paths or account identifiers. */ export declare function persistResolvedAccountSelection(selection: AccountSelectionResult, options?: { persistSelections?: PersistAccountSelections; replaceAll?: boolean; }): Promise; /** * Finalizes a resolved selection by delegating persistence to the caller's * `persistSelections` callback. Windows lock-retry and read-modify-write * serialization remain the callback's responsibility, so callers should route * through `persistAccountPool` or `withAccountStorageTransaction` to preserve * the guarantees covered by `test/login-runner.test.ts`. * Persistence callback failures are redacted inside * `persistResolvedAccountSelection()` before they propagate back to callers. */ export declare function resolveAndPersistAccountSelection(tokens: TokenSuccess, options?: { fallbacks?: AccountSelectionFallbacks; persistSelections?: PersistAccountSelections; replaceAll?: boolean; }): Promise; /** * Persists login results through the shared storage transaction so overlapping * login retries serialize their read-modify-write cycle instead of racing stale * snapshots. `withAccountStorageTransaction` also routes the final rename * through the Windows lock retry path in `lib/storage.ts`; see * `test/login-runner.test.ts` for the concurrent persist regression coverage. */ export declare function persistAccountPool(results: TokenSuccessWithAccount[], replaceAll?: boolean): Promise; export {}; //# sourceMappingURL=login-runner.d.ts.map