export interface Tier { id: string; name: string; price: number; maxCallsPerDay: number; maxAgents: number; features: string[]; stripePriceId?: string; } export declare const TIERS: Record; export interface Account { id: string; stripeCustomerId?: string; stripeSubscriptionId?: string; tier: string; apiKey: string; email: string; createdAt: number; } export declare class BillingService { private stripe; private webhookSecret; private db; private mailer; private emailConfig; constructor(stripeSecretKey?: string, webhookSecret?: string, dbPath?: string, emailConfig?: { host: string; port: number; user: string; pass: string; from: string; }); private migrate; createAccount(email: string, tier?: string): Promise; getAccount(apiKey: string): Account | undefined; getAccountByEmail(email: string): Account | undefined; getTierLimits(tier: string): Tier; checkRateLimit(apiKey: string, agentId?: string): { allowed: boolean; reason?: string; remaining?: number; }; getUsage(apiKey: string): { date: string; apiCalls: number; uniqueAgents: number; tier: string; limits: Tier; } | null; handleWebhook(event: any): Promise; createCheckoutSession(accountId: string, tierId: string, successUrl: string, cancelUrl: string): Promise; createPortalSession(accountId: string, returnUrl: string): Promise; private findAccountById; private findAccountByStripeCustomer; private rowToAccount; private generateKey; private today; /** * Send a 6-digit verification code to the user's email. * The code is valid for 15 minutes. */ sendRecoveryCode(email: string): Promise<{ sent: boolean; error?: string; }>; /** * Verify the code and return the API key. */ verifyRecoveryCode(email: string, code: string): { apiKey?: string; error?: string; }; close(): void; }