export declare const USAGE_ALERT_DEFAULT_DAILY_USD = 100; export declare const USAGE_ALERT_UNIT_SCALE: { readonly usd: 100; readonly "builder-credits": 1; readonly tokens: 1; }; export type UsageAlertScope = "user" | "workspace"; export type UsageAlertUnit = "usd" | "builder-credits" | "tokens"; export type UsageAlertPeriod = "day" | "month"; export type UsageAlertChannel = "in-app" | "email"; export type UsageAlertStatus = "ok" | "triggered" | "dismissed"; export interface UsageAlertAccess { ownerEmail: string; orgId?: string | null; } export interface UsageAlertRule { id: string; appId: string | null; scope: UsageAlertScope; unit: UsageAlertUnit; period: UsageAlertPeriod; limit: number; channels: UsageAlertChannel[]; enabled: boolean; isDefault: boolean; status: UsageAlertStatus; current: number; percent: number; windowStart: number; windowEnd: number; dismissedAt: number | null; updatedAt: number; } export interface UsageAlertEventSummary { status: UsageAlertStatus; current: number; limit: number; percent: number; windowStart: number; windowEnd: number; } export interface UsageAlertListOptions { scope?: UsageAlertScope; appId?: string | null; } export interface SaveUsageAlertInput { scope: UsageAlertScope; ruleId?: string; appId?: string | null; unit?: UsageAlertUnit; period?: UsageAlertPeriod; limit?: number; channels?: UsageAlertChannel[]; enabled?: boolean; } export interface UsageAlertMutationResult { rule: UsageAlertRule; rules: UsageAlertRule[]; current: UsageAlertEventSummary | null; } export declare const usageAlertsStore: import("../db/store-registry.js").Store; export declare function ensureTables(): Promise; export declare function listUsageAlerts(input: UsageAlertListOptions, access: UsageAlertAccess): Promise; export declare function saveUsageAlert(input: SaveUsageAlertInput, access: UsageAlertAccess): Promise; export declare function setUsageAlertEnabled(ruleId: string, scope: UsageAlertScope, enabled: boolean, access: UsageAlertAccess): Promise; export declare function dismissUsageAlert(ruleId: string, scope: UsageAlertScope, access: UsageAlertAccess): Promise; interface UsageAlertEvaluationRecord { ownerEmail: string; app?: string; orgId?: string | null; inputTokens: number; outputTokens: number; cacheReadTokens?: number; cacheWriteTokens?: number; costCentsX100?: number; } export declare function enqueueUsageAlertEvaluation(record: UsageAlertEvaluationRecord): void; export declare function _resetUsageAlertStoreForTests(): void; export declare function _waitForUsageAlertEvaluationsForTests(): Promise; export {};