/**
 * Literacy mode handler — compiles LiteracyTaskDefinition into Promptfoo config.
 *
 * @see docs/archive/exec-plans/architecture-overhaul/phase-7-migrate-literacy.md
 */
import { compileLiteracyTask } from "./compiler.js";
import { LITERACY_PROMPT_TEMPLATES } from "./prompts.js";
// Re-export public API
export { LITERACY_PROMPT_TEMPLATES } from "./prompts.js";
export { validateLiteracyTask, } from "./validation.js";
export { compileLiteracyTask } from "./compiler.js";
// ---------------------------------------------------------------------------
// ModeHandler adapter — wraps compileLiteracyTask for registry dispatch
// ---------------------------------------------------------------------------
export const handler = {
    getPrompts() {
        return LITERACY_PROMPT_TEMPLATES;
    },
    compileTask(task, ctx) {
        if (task.mode !== "literacy") {
            throw new Error(`Literacy handler received task with mode "${task.mode}" — expected "literacy"`);
        }
        const result = compileLiteracyTask(task, {
            graderProvider: ctx.graderProvider,
            rootDir: ctx.rootDir,
            models: ctx.models,
            rubricConfig: ctx.rubricConfig,
            graderContext: ctx.graderContext,
            preflightContext: ctx.preflightContext,
            evalMode: ctx
                .evalMode,
        });
        return {
            providers: result.providers,
            tests: result.tests,
            prompts: result.prompts,
            warnings: result.warnings,
        };
    },
};
