//#region src/tui/tui-context-usage.ts
/** Compute context window usage percent (0–100), rounded. */
function computeContextUsagePercent(estimatedTokens, contextWindow) {
	if (estimatedTokens == null || contextWindow == null || contextWindow <= 0) return null;
	return Math.min(100, Math.round(estimatedTokens / contextWindow * 100));
}
function formatContextUsageLabel(percent) {
	if (percent == null) return null;
	return `${percent}% ctx`;
}
//#endregion
export { computeContextUsagePercent, formatContextUsageLabel };

//# sourceMappingURL=tui-context-usage.js.map