/**
 * Account registry CRUD operations
 * Handles loading, saving, and syncing the accounts.json file
 */
import { CLIProxyProvider } from '../types';
import { AccountsRegistry, AccountInfo } from './types';
/**
 * Load accounts registry
 */
export declare function loadAccountsRegistry(): AccountsRegistry;
/**
 * Save accounts registry
 */
export declare function saveAccountsRegistry(registry: AccountsRegistry): void;
/**
 * Sync registry with actual token files
 * Removes stale entries where token file no longer exists
 * For paused accounts, checks both auth/ and paused/ directories
 * Called automatically when loading accounts
 */
export declare function syncRegistryWithTokenFiles(registry: AccountsRegistry): boolean;
/**
 * Build an in-memory view that includes both stale-entry cleanup and any token
 * files not yet persisted into accounts.json. Used by read paths so duplicate
 * email accounts stay visible without forcing a disk write.
 */
export declare function hydrateRegistryFromTokenFiles(registry: AccountsRegistry): boolean;
/**
 * Register a new account
 * Called after successful OAuth to record the account
 *
 * For providers without email (kiro, ghcp):
 * - internal accountId is derived from token metadata
 * - nickname is optional metadata
 *
 * For providers with email:
 * - email is used as accountId
 * - nickname is auto-generated from email if not provided
 */
export declare function registerAccount(provider: CLIProxyProvider, tokenFile: string, email?: string, nickname?: string, projectId?: string): AccountInfo;
/**
 * Set default account for a provider
 */
export declare function setDefaultAccount(provider: CLIProxyProvider, accountId: string): boolean;
/**
 * Pause an account (skip in quota rotation)
 * Moves token file to paused/ subdir so CLIProxyAPI won't discover it
 */
export declare function pauseAccount(provider: CLIProxyProvider, accountId: string): boolean;
/**
 * Resume a paused account
 * Moves token file back from paused/ to auth/ so CLIProxyAPI can discover it
 */
export declare function resumeAccount(provider: CLIProxyProvider, accountId: string): boolean;
/**
 * Remove an account
 */
export declare function removeAccount(provider: CLIProxyProvider, accountId: string): boolean;
/**
 * Rename an account's nickname
 */
export declare function renameAccount(provider: CLIProxyProvider, accountId: string, newNickname: string): boolean;
/**
 * Update last used timestamp for an account
 */
export declare function touchAccount(provider: CLIProxyProvider, accountId: string): void;
/**
 * Update account tier
 */
export declare function setAccountTier(provider: CLIProxyProvider, accountId: string, tier: 'free' | 'pro' | 'ultra' | 'unknown'): boolean;
/**
 * Auto-discover accounts from existing token files
 * Called during migration or first run to populate accounts registry
 *
 * For kiro/ghcp providers without email, generates unique accountId from:
 * 1. OAuth provider + profile ID from filename (e.g., github-ABC123)
 * 2. Fallback: provider + index (e.g., kiro-1, kiro-2)
 */
export declare function discoverExistingAccounts(): void;
//# sourceMappingURL=registry.d.ts.map