"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetAvailableVariablesToolDefinition = exports.getAvailableVariablesResponseSchema = exports.getAvailableVariablesArgumentsSchema = void 0;
var zod_1 = require("zod");
var toolDefinition_js_1 = require("../toolDefinition.js");
var agentToolNames_js_1 = require("../shared/agentToolNames.js");
exports.getAvailableVariablesArgumentsSchema = zod_1.z.object({
    reasoning: zod_1.z.string().optional().describe('Brief explanation of why you need to see the available variables'),
    filter: zod_1.z
        .string()
        .optional()
        .describe('Optional regex pattern to filter variable names. Only variables whose names match the pattern are returned. Example: "user" returns all variables containing "user" in their name.'),
    value_filter: zod_1.z
        .string()
        .optional()
        .describe('Optional string to filter by resolved value. Only variables whose current value contains this string (case-insensitive) are returned. Use this to check whether a specific value came from a variable reference before treating it as hardcoded.'),
});
exports.getAvailableVariablesResponseSchema = zod_1.z.object({
    success: zod_1.z.boolean().describe('Whether the variable list was retrieved'),
    variables: zod_1.z
        .record(zod_1.z.string(), zod_1.z.string())
        .describe('Map of variable names to their current values (e.g. {"user.email": "test@example.com"})'),
    message: zod_1.z.string().optional().describe('Error description if retrieval failed'),
});
exports.GetAvailableVariablesToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.GetAvailableVariables,
    description: "List variables available in the current test execution context with their values.\n\nReturns a map of variable names to values. Variable names use dotted notation (e.g. \"user.email\", \"web.defaults.url\", \"flow.applicationName\").\n\nUse the `filter` parameter to narrow results by variable name \u2014 for example, filter \"flow\" to see only flow parameters.\n\nUse the `value_filter` parameter to find which variables hold a specific resolved value \u2014 for example, value_filter \"acme-corp\" returns all variables whose current value contains \"acme-corp\". Use this to detect whether a value you are about to hardcode actually came from a variable reference.\n\nUse this to:\n- Discover which variables exist before referencing them in execute_enter_text or other tools\n- Verify a variable name is valid before calling ".concat(agentToolNames_js_1.AgentToolNames.GetVariableValue, "\n- Understand the test's data context when diagnosing variable-related failures\n- Check whether a specific value came from a variable/parameter before recommending a hardcoded fix"),
    argumentsSchema: exports.getAvailableVariablesArgumentsSchema,
    responseSchema: exports.getAvailableVariablesResponseSchema,
});
//# sourceMappingURL=GetAvailableVariablesDefinition.js.map