export type UserRole = 'admin' | 'user'; export interface UserRow { id: string; username: string; displayName: string; password: string; role: UserRole; createdAt: number; disabled: boolean; } export interface LoginSessionRow { id: string; hash: string; userId: string; createdAt: number; expiresAt: number; lastSeenAt: number; } export interface InviteRow { id: string; hash: string; createdBy: string; usesLeft: number; expiresAt: number | null; createdAt: number; monthlyLimit: number | null; } export interface ImBindingRow { platform: string; imUserId: string; userId: string; createdAt: number; createdBy: string; } export interface QuotaRow { userId: string; monthlyLimit: number; bonus: number; periodStart: number; } export interface LedgerRow { id: string; userId: string; delta: number; reason: string; usd?: number; tokensIn?: number; tokensOut?: number; model?: string; at: number; } export interface AccountsFile { version: 1; users: UserRow[]; loginSessions: LoginSessionRow[]; invites: InviteRow[]; imBindings: ImBindingRow[]; pointsPerUsd: number; defaultMonthlyLimit: number; defaultCostPer1kIn: number; defaultCostPer1kOut: number; /** Admin overrides keyed `llm:` or `agent:`. */ modelPriceOverrides?: Record; quotas: QuotaRow[]; ledger: LedgerRow[]; /** Set after the first admin inherits or skips pre-account sessions. */ legacyUpgradeDone?: boolean; } export declare const DEFAULT_POINTS_PER_USD = 10000; export declare const DEFAULT_MONTHLY_LIMIT = 100000; export declare function accountsFilePath(): string; export declare function readAccounts(): AccountsFile; export declare function writeAccounts(data: AccountsFile): void; export declare function mutateAccounts(fn: (data: AccountsFile) => T): T; /** Test helper — drop the process cache so the next read hits disk. */ export declare function _resetAccountsCache(): void; //# sourceMappingURL=accounts-store.d.ts.map