import { type SubscriptionUsagePool } from "@opengeni/contracts"; import { type Database } from "./database.js"; import { type SubscriptionCoreConnectionRow } from "./subscription-core/administration.js"; import { projectSubscriptionCoreAccountUsage } from "./subscription-core/account-usage-presentation.js"; type Provider = SubscriptionUsagePool["provider"]; type Window = "five_hour" | "weekly"; type PoolAccountRow = Pick; /** Each pooled Claude account's usage-credits state, from its stored usage reading. */ export declare function subscriptionPoolUsageCredits(rows: readonly PoolAccountRow[]): NonNullable; /** * Windows the provider refuses until a later time, as the account list shows * "Limit reached": an exhausted window, or the account's usage-limit deadline * matched to the window that resets then (otherwise by its distance, among * the windows the account has). */ export declare function blockedSubscriptionWindows(provider: Provider, usage: ReturnType, now: number, absent?: readonly Window[]): Partial>; /** * Windows the account does not have: a usage-endpoint snapshot of a provider * whose usage readings are complete reports every window that limits the * account and replaces the stored windows, so a window it omits does not * exist for that plan (a weekly-only plan has no five-hour window). Any other * snapshot (a refusal, response headers, an incomplete provider) can omit a * running window, so nothing is absent. */ export declare function absentSubscriptionWindows(provider: Provider, usage: ReturnType, usageReadingsComplete: boolean): Window[]; /** Relative estimates, not promised provider allowances; observations supersede these. */ export declare function subscriptionPlanWeight(provider: Provider, plan: string | null): number; export declare function readSubscriptionUsagePool(db: Database, input: { accountId: string; workspaceId: string | null; subjectId: string; provider: Provider; now?: number; }): Promise; export declare function subscriptionUsageHistoryPruneDue(db: Database): Promise; export declare function pruneSubscriptionUsageHistory(db: Database): Promise; export {};