"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.workerEventHookResultSchema = void 0;
exports.buildWorkerEventHookContract = buildWorkerEventHookContract;
const zod_1 = require("zod");
const catalog_1 = require("../i18n/catalog");
const structured_contract_support_1 = require("./structured-contract-support");
exports.workerEventHookResultSchema = zod_1.z
    .object({
    status: zod_1.z
        .enum(["completed", "skipped", "failed"])
        .describe("Outcome of the hook execution."),
    summary: zod_1.z
        .string()
        .min(1)
        .describe("Short human-readable summary of the hook action."),
})
    .strict()
    .describe("Event hook result.");
function buildWorkerEventHookContract(outputLanguage = catalog_1.DEFAULT_APP_LOCALE) {
    return (0, structured_contract_support_1.buildWorkerStructuredContract)({
        schema: exports.workerEventHookResultSchema,
        example: {
            status: "completed",
            summary: buildWorkerEventHookExampleSummary(outputLanguage),
        },
        rules: [
            "Return only the event hook result JSON inside the required decision markers.",
            "Use status completed when the hook side effect was performed successfully.",
            "Use status skipped when the hook intentionally did nothing.",
            "Use status failed when the hook could not complete, and explain the failure in summary.",
        ],
    });
}
function buildWorkerEventHookExampleSummary(locale) {
    switch (locale) {
        case "ja":
            return "通知を送信しました。";
        case "zh":
            return "已发送通知。";
        case "en":
            return "Sent notification.";
    }
}
