import { jsx as _jsx } from "react/jsx-runtime";
import { TokenBudgetWarning, buildTokenBudgetWarning } from "./TokenBudgetWarning.js";
export function TokenWarning(props) {
    const model = buildTokenWarning(props);
    if (!model)
        return null;
    return _jsx(TokenBudgetWarning, { usedTokens: model.usedTokens, contextLimit: model.contextLimit, model: model.model });
}
export function buildTokenWarning(input) {
    const contextLimit = input.contextLimit ?? DEEPSEEKCODE_SOFT_CONTEXT_LIMIT;
    if (!Number.isFinite(input.tokenUsage) || input.tokenUsage < 0)
        return null;
    if (!buildTokenBudgetWarning({ usedTokens: input.tokenUsage, contextLimit, model: input.model }))
        return null;
    return {
        usedTokens: input.tokenUsage,
        contextLimit,
        model: input.model,
    };
}
export const DEEPSEEKCODE_SOFT_CONTEXT_LIMIT = 64_000;
