// tools/eval-skill-handler.ts — MCP tool handlers for eval_skill and eval_rule (SPEC-316)
import { evaluateSkill, evaluateRule, resolveSkillPath, resolveRulePath, } from '../engine/skill-evaluator.js';
import { jsonResult, errText } from './response-helpers.js';
// ---------------------------------------------------------------------------
// eval_skill
// ---------------------------------------------------------------------------
export async function handleEvalSkill(input) {
    if (input.testScenarios.length === 0) {
        return errText('No test scenarios provided. Provide at least one scenario with input, expectedOutput, and criteria.');
    }
    const skillPath = resolveSkillPath(input.projectPath, input.skillName);
    const result = await evaluateSkill(skillPath, input.testScenarios);
    return jsonResult(result);
}
// ---------------------------------------------------------------------------
// eval_rule
// ---------------------------------------------------------------------------
export async function handleEvalRule(input) {
    if (input.testScenarios.length === 0) {
        return errText('No test scenarios provided. Provide at least one scenario with input, expectedOutput, and criteria.');
    }
    const rulePath = resolveRulePath(input.projectPath, input.ruleName);
    const result = await evaluateRule(rulePath, input.testScenarios);
    return jsonResult(result);
}
//# sourceMappingURL=eval-skill-handler.js.map