package com.correx.core.context.model

import kotlinx.serialization.Serializable

@Serializable
data class TokenBudget(
    val limit: Int,
    val used: Int = 0
) {
    val remaining: Int get() = limit - used

    fun consume(tokens: Int): TokenBudget = copy(used = used + tokens)

    fun canFit(tokens: Int): Boolean = tokens <= remaining
}
