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 executeClickAndHoldArgumentsSchema = z.object({
    description: z.string().max(100).describe('A brief description of what this step does (max 100 characters)'),
    elementDescription: z.string().meta({
        description: TOOL_ELEMENT_DESCRIPTION_INSTRUCTIONS,
    }),
    customFind: customFindSchema.optional(),
    isHtml5: z
        .boolean()
        .optional()
        .describe('Whether the drag target uses the HTML5 Drag and Drop API (dragstart/drop events). ' +
        'Set to true for native HTML5 DnD (e.g. file upload drop zones, some native widgets). ' +
        'Set to false (default) for mouse-event-based libraries such as React DnD or Sortable.js.'),
    reasoning: z
        .string()
        .optional()
        .describe('Brief explanation of why this action is being taken and what it aims to achieve'),
});
export const executeClickAndHoldServerResultSchema = z.object({
    elementDescription: z.string(),
    isHtml5: z.boolean().optional(),
    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(),
});
export const executeClickAndHoldClientResponseSchema = z.object({
    success: z.boolean(),
    message: z.string().optional(),
    new_screenshot: z.string().optional().meta({
        description: 'Base64-encoded PNG screenshot of the page after the click-and-hold action',
    }),
    current_url: z.string().optional().meta({
        description: 'The current URL after the click-and-hold action',
    }),
});
export const ExecuteClickAndHoldToolDefinition = defineTool({
    name: AgentToolNames.ExecuteClickAndHold,
    description: 'Clicks and holds on an element to begin a drag operation. Must be paired with execute_release on the drop target. ' +
        'Use isHtml5=true for native HTML5 drag-and-drop targets; use isHtml5=false (default) for mouse-event-based drag libraries.',
    argumentsSchema: executeClickAndHoldArgumentsSchema,
    serverPrepareResultSchema: executeClickAndHoldServerResultSchema,
    responseSchema: executeClickAndHoldClientResponseSchema,
});
//# sourceMappingURL=ExecuteClickAndHoldDefinition.js.map