"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecuteReleaseToolDefinition = exports.executeReleaseClientResponseSchema = exports.executeReleaseServerResultSchema = exports.executeReleaseArgumentsSchema = 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.executeReleaseArgumentsSchema = 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 drop target uses the HTML5 Drag and Drop API. ' +
        'Must match the isHtml5 value used in the preceding execute_click_and_hold step.'),
    reasoning: zod_1.z
        .string()
        .optional()
        .describe('Brief explanation of why this action is being taken and what it aims to achieve'),
});
exports.executeReleaseServerResultSchema = 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.executeReleaseClientResponseSchema = 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 release action',
    }),
    current_url: zod_1.z.string().optional().meta({
        description: 'The current URL after the release action',
    }),
});
exports.ExecuteReleaseToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.ExecuteRelease,
    description: 'Releases the mouse on a drop target to complete a drag-and-drop operation. ' +
        'Must be preceded by execute_click_and_hold on the drag source. ' +
        'Use the same isHtml5 value as the corresponding execute_click_and_hold step.',
    argumentsSchema: exports.executeReleaseArgumentsSchema,
    serverPrepareResultSchema: exports.executeReleaseServerResultSchema,
    responseSchema: exports.executeReleaseClientResponseSchema,
});
//# sourceMappingURL=ExecuteReleaseDefinition.js.map