"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SendAutoAnalysisResultToolDefinition = void 0;
var zod_1 = require("zod");
var toolDefinition_js_1 = require("../toolDefinition.js");
var agentToolNames_js_1 = require("./agentToolNames.js");
var sendAutoAnalysisResultArgumentsSchema = zod_1.z.object({
    title: zod_1.z.string().meta({
        description: 'Short title summarizing the analysis result (e.g., "Login test fails due to missing CSRF token" or "Checkout flow broken by API 500 error"). Keep under 100 characters.',
    }),
    summary: zod_1.z.string().meta({
        description: "Structured markdown summary. Always include **### Root cause** and **### Next steps** (bullets under each) only. Do not add extra **###** subsections \u2014 put automatic-recovery step detail in the evidence file when **traSessionId** appears on steps.\n\n**Root cause** \u2014 Expected vs actual, new vs recurring.\n\n**Next steps** \u2014 Actionable recommendation (flaky vs broken vs app change vs escalate).\n\nKeep root cause and next steps tight; put detail (including recovery steps) in the evidence file.",
    }),
    failure_category: zod_1.z.string().optional().meta({
        description: 'Suggested failure category ID. MUST be one of the IDs listed under "failure_category" in the system prompt for this workspace (mabl defaults + any workspace-custom reasons). When no listed category is a clear match, use "other" (the default catch-all) — do not invent new IDs.',
    }),
    evidence_filename: zod_1.z.string().optional().meta({
        description: 'Filename of a saved evidence file to attach. The file should contain detailed visual and technical evidence supporting the analysis.',
    }),
});
var sendAutoAnalysisResultServerPrepareResultSchema = zod_1.z.object({
    file_content: zod_1.z.string().optional().meta({
        description: 'The content of the evidence file, if a filename was provided and validated.',
    }),
    validation_warnings: zod_1.z.array(zod_1.z.string()).optional().meta({
        description: 'Warnings about potential issues with the evidence file content, such as missing evidence URLs.',
    }),
});
var sendAutoAnalysisResultResponseSchema = zod_1.z.object({
    status: zod_1.z.string().meta({
        description: 'Confirmation that the analysis was received.',
    }),
});
exports.SendAutoAnalysisResultToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.SendAutoAnalysisResult,
    description: "Submit the final structured failure analysis. This tool MUST be called exactly once to complete the analysis.\n\nUse this tool after you have investigated the failure and gathered evidence. Provide:\n- A concise title summarizing the failure\n- A structured summary with root cause and next steps\n- An optional failure category if one clearly matches\n- An optional evidence file with detailed visual and technical evidence\n\nThis tool ends the analysis session. Do not call any other tools after this.",
    argumentsSchema: sendAutoAnalysisResultArgumentsSchema,
    serverPrepareResultSchema: sendAutoAnalysisResultServerPrepareResultSchema,
    responseSchema: sendAutoAnalysisResultResponseSchema,
});
//# sourceMappingURL=SendAutoAnalysisResultDefinition.js.map