"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecuteHoverToolDefinition = exports.executeHoverClientResponseSchema = exports.executeHoverServerResultSchema = exports.executeHoverArgumentsSchema = void 0;
var zod_1 = require("zod");
var toolDefinition_js_1 = require("../toolDefinition.js");
var agentToolNames_js_1 = require("../shared/agentToolNames.js");
var constants_js_1 = require("../shared/constants.js");
var customFind_js_1 = require("../shared/customFind.js");
exports.executeHoverArgumentsSchema = zod_1.z.object({
    elementDescription: zod_1.z.string().describe(constants_js_1.TOOL_ELEMENT_DESCRIPTION_INSTRUCTIONS),
    customFind: customFind_js_1.customFindSchema.optional(),
});
exports.executeHoverServerResultSchema = zod_1.z.object({
    elementDescription: zod_1.z.string(),
    elementBoundingBox: zod_1.z
        .object({
        top: zod_1.z.number(),
        left: zod_1.z.number(),
        bottom: zod_1.z.number(),
        right: zod_1.z.number(),
    })
        .optional(),
    elementTargetPoint: zod_1.z
        .object({
        x: zod_1.z.number(),
        y: zod_1.z.number(),
    })
        .optional(),
});
/**
 * Response schema for execute_hover tool.
 * The client should include the new screenshot after the hover action
 * to show any hover states, tooltips, or menus that appeared.
 */
exports.executeHoverClientResponseSchema = zod_1.z.object({
    success: zod_1.z.boolean(),
    message: zod_1.z.string().optional(),
    // Context fields - client should include these after executing the action
    new_screenshot: zod_1.z.string().optional().meta({
        description: 'Base64-encoded PNG screenshot of the page after the hover action',
    }),
    current_url: zod_1.z.string().optional().meta({
        description: 'The current URL (typically unchanged for hover)',
    }),
});
exports.ExecuteHoverToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.ExecuteHover,
    description: 'Hovers over the specified element on the page. The elementDescription describes the element to hover over. This action can trigger hover states, tooltips, dropdown menus, or other interactive elements that appear on mouse hover. The client response will include a new screenshot showing any visual changes.',
    argumentsSchema: exports.executeHoverArgumentsSchema,
    serverPrepareResultSchema: exports.executeHoverServerResultSchema,
    responseSchema: exports.executeHoverClientResponseSchema,
});
//# sourceMappingURL=ExecuteHoverDefinition.js.map