export interface UsageInfo { input: number; output: number; cacheRead: number; cacheWrite: number; /** Dollars, as pi prices it (notional for a subscription). */ cost: number; /** The part of `cost` since local midnight (when the worker last counted). */ today: number; /** Local midnight (ms epoch) of the day `today` is for. */ day: number; /** Billed to a subscription (pi's "(sub)"): the cost is what it would be per token. */ sub: boolean; /** Cost and tokens per model ("provider/id"), the largest few. */ models: Record; } /** Models kept per session in a report (the rest are summed under "other"). */ export declare const USAGE_MODELS = 8; /** pi's bucket for usage no model is named for (tool results, summaries). */ export declare const SUMMARIES = "Tools/summaries"; export declare function localMidnight(now: number): number; /** A session's usage from its entries (pi's sessionManager.getEntries()). */ export declare function sessionUsage(entries: readonly unknown[], now: number, sub: boolean): UsageInfo; /** A UsageInfo from untrusted JSON (a report, state.json), or null. */ export declare function usageFrom(v: unknown): UsageInfo | null; export declare function sameUsage(a: UsageInfo | null | undefined, b: UsageInfo | null | undefined): boolean; /** Today's share as of `now`: none once the day it was counted for is over. */ export declare function todayOf(u: UsageInfo, now: number): number; /** $0.42, $12.30, $1.2k: short enough for a row. */ export declare function formatCost(dollars: number): string; export interface UsageTotals { cost: number; today: number; tokens: number; /** The part of cost billed to subscriptions (notional). */ subCost: number; models: Record; } /** M24: totals over rows (the agent view's header and /usage). */ export declare function totalUsage(rows: readonly { usage?: UsageInfo | null; }[], now: number): UsageTotals;