"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecuteClickAndHoldToolDefinition = exports.executeClickAndHoldClientResponseSchema = exports.executeClickAndHoldServerResultSchema = exports.executeClickAndHoldArgumentsSchema = 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.executeClickAndHoldArgumentsSchema = zod_1.z.object({
    description: zod_1.z.string().max(100).describe('A brief description of what this step does (max 100 characters)'),
    elementDescription: zod_1.z.string().meta({
        description: constants_js_1.TOOL_ELEMENT_DESCRIPTION_INSTRUCTIONS,
    }),
    customFind: customFind_js_1.customFindSchema.optional(),
    isHtml5: zod_1.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: zod_1.z
        .string()
        .optional()
        .describe('Brief explanation of why this action is being taken and what it aims to achieve'),
});
exports.executeClickAndHoldServerResultSchema = zod_1.z.object({
    elementDescription: zod_1.z.string(),
    isHtml5: zod_1.z.boolean().optional(),
    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(),
});
exports.executeClickAndHoldClientResponseSchema = zod_1.z.object({
    success: zod_1.z.boolean(),
    message: zod_1.z.string().optional(),
    new_screenshot: zod_1.z.string().optional().meta({
        description: 'Base64-encoded PNG screenshot of the page after the click-and-hold action',
    }),
    current_url: zod_1.z.string().optional().meta({
        description: 'The current URL after the click-and-hold action',
    }),
});
exports.ExecuteClickAndHoldToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.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: exports.executeClickAndHoldArgumentsSchema,
    serverPrepareResultSchema: exports.executeClickAndHoldServerResultSchema,
    responseSchema: exports.executeClickAndHoldClientResponseSchema,
});
//# sourceMappingURL=ExecuteClickAndHoldDefinition.js.map