import { z } from 'zod';
import { defineTool, } from '../toolDefinition.js';
import { AgentToolNames } from '../shared/agentToolNames.js';
import { TOOL_ELEMENT_DESCRIPTION_INSTRUCTIONS } from '../shared/constants.js';
import { customFindSchema } from '../shared/customFind.js';
export const executeHoverArgumentsSchema = z.object({
    elementDescription: z.string().describe(TOOL_ELEMENT_DESCRIPTION_INSTRUCTIONS),
    customFind: customFindSchema.optional(),
});
export const executeHoverServerResultSchema = z.object({
    elementDescription: z.string(),
    elementBoundingBox: z
        .object({
        top: z.number(),
        left: z.number(),
        bottom: z.number(),
        right: z.number(),
    })
        .optional(),
    elementTargetPoint: z
        .object({
        x: z.number(),
        y: 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.
 */
export const executeHoverClientResponseSchema = z.object({
    success: z.boolean(),
    message: z.string().optional(),
    // Context fields - client should include these after executing the action
    new_screenshot: z.string().optional().meta({
        description: 'Base64-encoded PNG screenshot of the page after the hover action',
    }),
    current_url: z.string().optional().meta({
        description: 'The current URL (typically unchanged for hover)',
    }),
});
export const ExecuteHoverToolDefinition = defineTool({
    name: 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: executeHoverArgumentsSchema,
    serverPrepareResultSchema: executeHoverServerResultSchema,
    responseSchema: executeHoverClientResponseSchema,
});
//# sourceMappingURL=ExecuteHoverDefinition.js.map