import type { Database } from "./database.js"; import { type WarmGroupAggregate } from "./insights.js"; export type WorkspaceInsightsUsageBundleInput = { workspaceId: string; since: Date; until: Date; priorSince: Date; priorUntil: Date; monthSince: Date; granularity: "day" | "hour"; warmGroupLimit?: number; }; export type WorkspaceInsightsUsageBucket = { costMicros: number | null; warmSeconds: number; }; export type WorkspaceInsightsUsageBundle = { workspaceCreditMicros: number; priorWorkspaceCreditMicros: number; warmSeconds: number; priorWarmSeconds: number; buckets: Map; warmGroups: WarmGroupAggregate[]; billableTokensUsed: number; agentRunsUsed: number; }; /** * One read for the three existing usage windows. The event-type arrays are * deliberately closed so the authority function can keep selective predicates * inside its scan while all rollup math remains outside the billing path. The * current window feeds one grouping-sets pass (UTC buckets and warm groups), and * its totals are the sum of the bucket rows, so no window is materialized. */ export declare function readWorkspaceInsightsUsageBundle(db: Database, input: WorkspaceInsightsUsageBundleInput): Promise;