export class AdvisoryContext {
    registry;
    executor;
    evaluator;
    callHistory = [];
    budget;
    constructor(registry, executor, evaluator, budget) {
        this.registry = registry;
        this.executor = executor;
        this.evaluator = evaluator;
        this.budget = budget;
    }
    recordCall(record) {
        this.callHistory.push(record);
    }
    getBudgetStatus() {
        const used = this.callHistory.length;
        const total = this.budget?.maxCallsPerRun;
        const remaining = total !== undefined ? total - used : undefined;
        return { remaining, total, used };
    }
    checkBudget() {
        const { remaining, total } = this.getBudgetStatus();
        if (remaining !== undefined && remaining <= 0) {
            return {
                allowed: false,
                reason: `Advisory budget exhausted: ${total} calls used of ${total} allowed per run`,
            };
        }
        return { allowed: true };
    }
}
//# sourceMappingURL=context.js.map