"use strict";
// =============================================================================
// Pure Agent - Iteration Budget
// Ported from Hermes agent/iteration_budget.py
// =============================================================================
Object.defineProperty(exports, "__esModule", { value: true });
exports.IterationBudget = void 0;
class IterationBudget {
    maxTotal;
    _used = 0;
    constructor(maxTotal) {
        this.maxTotal = maxTotal;
    }
    consume() {
        if (this._used >= this.maxTotal)
            return false;
        this._used++;
        return true;
    }
    refund() {
        if (this._used > 0)
            this._used--;
    }
    get used() { return this._used; }
    get remaining() { return Math.max(0, this.maxTotal - this._used); }
}
exports.IterationBudget = IterationBudget;
//# sourceMappingURL=iteration-budget.js.map