/** * Pre-emptive usage warnings. * * Every successful metered call carries `x-misar-usage-*` headers describing * what the caller has left. Catching someone at 80% — while their task is still * working — converts far better than an error at 100%, and reads as helpful * rather than pushy. * * The last warning seen is stashed here and drained by the tool layer, so tools * do not each have to thread usage through their return path. */ /** Quota warning appended to a response when an allowance is nearly spent. */ export interface UsageWarning { feature: string; used: number; limit: number; remaining: number; ratio: number; upgradeUrl: string | null; } /** * Read the usage headers off a response; stash a warning if we're close. * * Never throws. This runs on the hot path of EVERY API call, so a response * without a standard `headers` object — a proxy, a test double, an older * runtime — must degrade to "no warning", never break the call itself. */ export declare function noteUsage(headers: Headers | null | undefined): void; /** Take (and clear) the pending warning as a one-line footer, if any. */ export declare function takeUsageFooter(): string | null; /** Append the pending warning to a tool's text result, when there is one. */ export declare function withUsageFooter(text: string): string; //# sourceMappingURL=usage.d.ts.map