import{toolCallMatches}from"#evals/checks/match.js";function didNotFail(){return({result:e})=>({name:`run.didNotFail`,score:+(e.status!==`failed`&&!e.derived.parked),metadata:{status:e.status,parked:e.derived.parked}})}function usedTool(t,n={}){return({result:r})=>{let i=r.derived.toolCalls.filter(e=>e.name===t).filter(t=>toolCallMatches(t,n)),a=n.times===void 0?i.length>0:i.length===n.times;return{name:`run.usedTool(${t})`,score:+!!a,metadata:{expectedTool:t,matchingCalls:i.length,actualToolCalls:r.derived.toolCalls.map(e=>e.name)}}}}function usedNoTools(){return({result:e})=>({name:`run.usedNoTools`,score:+(e.derived.toolCallCount===0),metadata:{toolCallCount:e.derived.toolCallCount}})}function maxToolCalls(e){return({result:t})=>{let n=+(t.derived.toolCallCount<=e);return{name:`run.maxToolCalls(${e})`,score:n,metadata:{maxAllowed:e,actualToolCallCount:t.derived.toolCallCount}}}}export{didNotFail,maxToolCalls,usedNoTools,usedTool};