"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecuteAssertVariableToolDefinition = exports.executeAssertVariableResponseSchema = exports.executeAssertVariableArgumentsSchema = void 0;
var zod_1 = require("zod");
var toolDefinition_js_1 = require("../toolDefinition.js");
var agentToolNames_js_1 = require("../shared/agentToolNames.js");
var schemas_js_1 = require("../shared/schemas.js");
exports.executeAssertVariableArgumentsSchema = zod_1.z.object({
    variableName: zod_1.z.string().meta({
        description: 'The name of the variable to assert against (without the {{@}} syntax). The variable must have been created or set in a previous step.',
    }),
    assertionType: schemas_js_1.comparisonTypeEnum.meta({
        description: 'The type of comparison to perform between the variable\'s current value and the expected value. Includes negation forms: "does_not_equal", "does_not_contain", "starts_without", "ends_without".',
    }),
    expectedValue: zod_1.z.string().meta({
        description: "The expected value to compare the variable against. Use {{@otherVariable}} syntax to compare against another variable's value.",
    }),
    conditionalType: zod_1.z.enum(['IF', 'ELSEIF']).optional().meta({
        description: "When set, records this assertion as a conditional branch instead of a plain assertion. Use 'IF' to open a new conditional block (first condition only). Use 'ELSEIF' for every subsequent branch condition within the same block (after IF or another ELSEIF).",
    }),
});
exports.executeAssertVariableResponseSchema = zod_1.z.object({
    success: zod_1.z.boolean(),
    message: zod_1.z.string().optional(),
});
exports.ExecuteAssertVariableToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.ExecuteAssertVariable,
    description: 'Asserts that a variable has the expected value using the specified comparison type. Use this tool when you need to verify the value of any variable, regardless of how it was set (execute_create_or_set_variable, JavaScript snippets, API calls, or any other step that produces a variable). This tool checks the variable value directly — it does not use the DOM, screenshot, or any visual element. Examples: verify that a captured order number equals a displayed value, verify a counter variable is greater than 0, verify an extracted URL contains a specific domain. Do NOT use execute_assert or execute_assert_element for variable value checks — those tools only inspect the screenshot/DOM. To open a conditional block instead of asserting, set conditionalType="IF" (first condition in a block) or conditionalType="ELSEIF" (subsequent branch).',
    argumentsSchema: exports.executeAssertVariableArgumentsSchema,
    responseSchema: exports.executeAssertVariableResponseSchema,
});
//# sourceMappingURL=ExecuteAssertVariableDefinition.js.map