import { z } from 'zod';
import { defineTool } from '../toolDefinition.js';
import { AgentToolNames } from '../shared/agentToolNames.js';
export const getAvailableVariablesArgumentsSchema = z.object({
    reasoning: z.string().optional().describe('Brief explanation of why you need to see the available variables'),
    filter: 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: 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.'),
});
export const getAvailableVariablesResponseSchema = z.object({
    success: z.boolean().describe('Whether the variable list was retrieved'),
    variables: z
        .record(z.string(), z.string())
        .describe('Map of variable names to their current values (e.g. {"user.email": "test@example.com"})'),
    message: z.string().optional().describe('Error description if retrieval failed'),
});
export const GetAvailableVariablesToolDefinition = defineTool({
    name: AgentToolNames.GetAvailableVariables,
    description: `List variables available in the current test execution context with their values.

Returns a map of variable names to values. Variable names use dotted notation (e.g. "user.email", "web.defaults.url", "flow.applicationName").

Use the \`filter\` parameter to narrow results by variable name — for example, filter "flow" to see only flow parameters.

Use the \`value_filter\` parameter to find which variables hold a specific resolved value — 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.

Use this to:
- Discover which variables exist before referencing them in execute_enter_text or other tools
- Verify a variable name is valid before calling ${AgentToolNames.GetVariableValue}
- Understand the test's data context when diagnosing variable-related failures
- Check whether a specific value came from a variable/parameter before recommending a hardcoded fix`,
    argumentsSchema: getAvailableVariablesArgumentsSchema,
    responseSchema: getAvailableVariablesResponseSchema,
});
//# sourceMappingURL=GetAvailableVariablesDefinition.js.map