import { ChatModel, ResponseTokenUsage } from '@theia/ai-chat'; import { MarkdownString } from '@theia/core/lib/common/markdown-rendering'; /** Fallback denominator for the token usage indicator when the active model does not report its own input limit. */ export declare const CHAT_CONTEXT_WINDOW_SIZE_FALLBACK = 200000; export type TokenUsageWarningDecision = 'notify' | 'reset' | 'skip'; /** Returns true when the given total has crossed (>=) the configured warning threshold. */ export declare function isAboveTokenUsageWarningThreshold(totalTokens: number, threshold: number): boolean; /** * Pure decision function for whether to show the token usage warning for a session. * Callers are expected to short-circuit before invoking this when the warning feature * is disabled, so this helper is not concerned with the enabled state. * - `reset`: usage is below the threshold; any prior "already notified" state for this session should be cleared. * - `skip`: we already notified for this session while still above the threshold. * - `notify`: warning should be shown now and the session marked as notified. */ export declare function decideTokenUsageWarning(args: { totalTokens: number; threshold: number; alreadyNotified: boolean; }): TokenUsageWarningDecision; export declare function formatTokenCount(count: number | undefined): string; /** * Returns the CSS class for the token usage indicator based on the current * total, the configured warning threshold, and the assumed context window size. * Yellow band: [threshold, contextWindowSize). Red band: [contextWindowSize, ∞). */ export declare function getUsageColorClass(totalTokens: number, threshold: number, contextWindowSize?: number): string; export declare function computeSessionTokenUsage(chatModel?: ChatModel): number; /** Sum of input + output (+ cache) tokens across every response in the session. Represents cumulative billed usage. */ export declare function computeCumulativeTokenUsage(chatModel?: ChatModel): number; /** * Number of provider compaction events recorded across the session. * Counts every `compaction` content part; a single response may contain more than one. */ export declare function countCompactions(chatModel?: ChatModel): number; export declare function getLatestTokenUsage(chatModel?: ChatModel): ResponseTokenUsage | undefined; export declare function buildBarTooltip(usage: ResponseTokenUsage | undefined, totalTokens: number, threshold: number, contextWindowSize?: number, chatModel?: ChatModel): MarkdownString | undefined; //# sourceMappingURL=chat-token-usage-indicator-util.d.ts.map