import type { EscalationRule } from './types';

export const maxTurnsRule: EscalationRule = {
  id: 'max-turns',
  label: 'מקסימום קריאות כלים',
  description: 'הסוכן הגיע למגבלת קריאות כלים',
  async check(ctx) {
    if (ctx.currentToolCalls < ctx.definition.maxToolCalls) return null;
    return {
      ruleId: 'max-turns',
      reason: `${ctx.currentToolCalls} קריאות כלים (מקסימום ${ctx.definition.maxToolCalls})`,
      severity: 'low',
    };
  },
};
