import type { EffectiveTokenCost, ModelCost, TimeBasedCost, TokenCost } from "./types.js"; /** Serialized time-based pricing schedule, as cached model rows carry it. */ export declare const TimeBasedCostShape: import("@oh-my-pi-zen/omptype").FluentType<{ effectiveRates?: ({ cacheRead: number; cacheWrite: number; input: number; output: number; } & { effectiveFrom: number; longContext?: ({ cacheRead: number; cacheWrite: number; input: number; output: number; } & { inputThreshold: number; inputThresholdInclusive?: boolean | undefined; }) | undefined; })[] | undefined; offPeakMultiplier: number; peakWindows: { endMinute: number; startMinute: number; weekdays: number[]; }[]; }, { effectiveRates?: ({ cacheRead: number; cacheWrite: number; input: number; output: number; } & { effectiveFrom: number; longContext?: ({ cacheRead: number; cacheWrite: number; input: number; output: number; } & { inputThreshold: number; inputThresholdInclusive?: boolean | undefined; }) | undefined; })[] | undefined; offPeakMultiplier: number; peakWindows: { endMinute: number; startMinute: number; weekdays: number[]; }[]; }>; /** Validate serialized schedules before admitting cached model rows. */ export declare function isTimeBasedCost(value: unknown): value is TimeBasedCost; /** KDL object children are named records; normalize them once while constructing the model. */ export declare function materializeTimeBasedCost(value: unknown): TimeBasedCost; /** * The dated card due at `timestamp`: the one with the latest `effectiveFrom` * at or before it, in any order, or undefined before the first card. */ export declare function dueDatedCard(cards: readonly T[], timestamp: number): T | undefined; /** * The latest `effectiveRates` card of a materialized schedule due at * `timestamp`, or undefined before the first one (or without a schedule). */ export declare function dueEffectiveRate(schedule: TimeBasedCost | undefined, timestamp: number): EffectiveTokenCost | undefined; /** * A dated `effective-rates` card of a `cost-patch`, `cost-fallback` or * `credit-rates` rule: the legs it overwrites from `effectiveFrom` (Unix ms). */ export interface DatedCostCard extends Partial { effectiveFrom: number; } /** * Parse the compiled `effective-rates` block of a `cost-patch`, * `cost-fallback` or Factory Droid `credit-rates` payload into dated cards, * ascending by date. Throws on a malformed card, so a typo in a rule fails the * build instead of silently leaving the old price in force. */ export declare function parseDatedCostCards(costAxis: unknown, axis: "cost-patch" | "cost-fallback" | "credit-rates"): DatedCostCard[]; /** * Earliest instant a rate card can name (the `Date` range minimum). A leading * card from here holds the price in force before the first dated change. */ export declare const EARLIEST_EFFECTIVE_FROM = -8640000000000000; /** A schedule of dated rate cards alone: no peak windows, no off-peak discount. */ export declare const NO_RECURRING_TARIFF: TimeBasedCost; /** * A flat card plus its dated overrides as a request-time `ModelCost`: the * card due at `now` in the scalar legs, and every period (a leading card for * the base price, then each dated card over the previous one) in a * `timeBased` schedule without a recurring tariff. The plain card when no * dated card exists. */ export declare function datedCost(base: TokenCost, cards: readonly DatedCostCard[], now?: number): ModelCost; /** * Overwrite `cost` legs with the latest dated card due at `now`. Leaves * `cost` unchanged before the first card. */ export declare function applyDueDatedCostCard(cost: TokenCost, cards: readonly DatedCostCard[], now?: number): void;