import { type ParsedSessionUsageLimitReachedRefusal, type SessionUsageLimit } from "@opengeni/sdk/session-usage-limits"; import { type OpenGeniText } from "../messages/runtime.js"; /** Share of the limit at which a quiet, dismissible near-limit notice appears. */ export declare const SESSION_USAGE_LIMIT_NEAR_FRACTION = 0.8; export type SessionUsageLimitLabels = { /** The setting's name: "Usage limit". */ title: string; /** The one explanation, shown once next to the setting. */ explanation: string; /** Short help: what the amount is not. */ notYourBill: string; noLimit: string; /** "Pause at $50.00". */ pauseAt: (limit: string) => string; /** "$12.34 of $50.00". */ usedOfLimit: (used: string, limit: string) => string; /** "At least $12.34 of $50.00" when some usage has no known price. */ atLeastOfLimit: (used: string, limit: string) => string; /** "$12.34 used" without a limit. */ used: (used: string) => string; /** "At least $12.34 used". */ atLeastUsed: (used: string) => string; preparing: string; unavailable: string; /** Notes under the amount when the total is incomplete. */ unpricedNote: string; legacyNote: string; preparingNote: string; unavailableNote: string; /** A refresh failed after a good read: the last known amount is shown. */ staleNote: string; reachedTitle: string; /** "$52.10 of $50.00 API-equivalent model usage." */ reachedAmount: (amount: string) => string; reachedRemedy: string; /** Added when the goal paused at the limit: raising it never resumes by itself. */ reachedGoalRemedy: string; /** Added to a read-only (child or no permission) reached notice. */ reachedReadOnlyRemedy: string; /** "This task has used 84% of its usage limit ($42.00 of $50.00)." */ near: (percent: string, amount: string) => string; changeLimit: string; openMainTask: string; dismiss: string; }; export declare const DEFAULT_SESSION_USAGE_LIMIT_LABELS: (t: OpenGeniText) => SessionUsageLimitLabels; export declare function sessionUsageLimitLabels(t: OpenGeniText, overrides?: Partial): SessionUsageLimitLabels; export type SessionUsageLimitState = "unknown" | "unlimited" | "within" | "near" | "reached" | "preparing" | "unavailable"; export type SessionUsageLimitSummary = { state: SessionUsageLimitState; /** Configured limit, null for none or while unreadable. */ limitMicros: number | null; /** Recorded known usage; null whenever it is not known (never $0 then). */ usedMicros: number | null; /** Some usage is missing from the total: show "at least". */ partial: boolean; /** Used share of the limit, clamped to 0..1 for a bar; null without both amounts. */ barFraction: number | null; /** Unclamped share; may exceed 1 when in-progress requests overshot. */ fraction: number | null; /** "$12.34 of $50.00", "At least $12.34 used", "Preparing usage", ... */ amountText: string | null; /** Plain sentences explaining an incomplete or unreadable total. */ notes: string[]; inherited: boolean; rootSessionId: string | null; version: number | null; /** The last refresh failed: amounts are the last known ones, maybe out of date. */ stale: boolean; }; /** * Fold the server's usage-limit projection into what to show. `null` or * `undefined` (an older server, or not loaded yet) is `unknown`: render * nothing rather than "No limit" or "$0". */ export declare function summarizeSessionUsageLimit(t: OpenGeniText, usage: SessionUsageLimit | null | undefined, overrides?: Partial, options?: { /** * The last refresh failed after this projection was read. The amounts and * any reached state stay (never $0); a note says they may be out of date. */ stale?: boolean; }): SessionUsageLimitSummary; /** * A summary for a refused Send before the projection was re-read: the refusal * carries the amounts that applied when the server refused. */ export declare function summarizeSessionUsageLimitRefusal(t: OpenGeniText, refusal: Pick, overrides?: Partial): SessionUsageLimitSummary; /** "84" for 0.84; never rounds a near-limit share up to a misleading 100. */ export declare function sessionUsageLimitPercent(fraction: number): string;