"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExecuteOpenMablEmailToolDefinition = exports.executeOpenMablEmailResponseSchema = exports.executeOpenMablEmailServerResultSchema = exports.executeOpenMablEmailArgumentsSchema = void 0;
var zod_1 = require("zod");
var toolDefinition_js_1 = require("../toolDefinition.js");
var agentToolNames_js_1 = require("../shared/agentToolNames.js");
exports.executeOpenMablEmailArgumentsSchema = zod_1.z.object({
    subject: zod_1.z.string().optional().meta({
        description: 'Text to match against the email subject. Uses contains matching.',
    }),
    body: zod_1.z.string().optional().meta({
        description: 'Text to match against the email body. Uses contains matching.',
    }),
    from: zod_1.z.string().optional().meta({
        description: 'Sender email address to match against.',
    }),
    mailboxAddress: zod_1.z.string().optional().meta({
        description: 'Email address of a permanent mailbox to search in. Use list_permanent_mailboxes to discover available addresses. When set, the step will search the permanent mailbox instead of the session inbox.',
    }),
    lookbackMinutes: zod_1.z.number().optional().meta({
        description: 'How far back (in minutes) to search for emails in a permanent mailbox. Only used when mailboxAddress is set. Defaults to 10 minutes.',
    }),
});
/**
 * Server prepare result schema for execute_open_mabl_email tool.
 * The server validates parameters before forwarding to the client.
 */
exports.executeOpenMablEmailServerResultSchema = zod_1.z.object({});
/**
 * Response schema for execute_open_mabl_email tool.
 */
exports.executeOpenMablEmailResponseSchema = zod_1.z.object({
    success: zod_1.z.boolean(),
    message: zod_1.z.string().optional(),
});
exports.ExecuteOpenMablEmailToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.ExecuteOpenMablEmail,
    description: 'Records a step that opens an email matching the given criteria in a new browser tab. The email will be found and opened during step execution. Use after creating a mabl mailbox and triggering an action that sends an email to the mailbox address. At least one of subject, body, or from should be provided to match the email. To open emails from a permanent mailbox, set mailboxAddress to the permanent mailbox email address (use list_permanent_mailboxes to discover addresses).',
    argumentsSchema: exports.executeOpenMablEmailArgumentsSchema,
    serverPrepareResultSchema: exports.executeOpenMablEmailServerResultSchema,
    responseSchema: exports.executeOpenMablEmailResponseSchema,
});
//# sourceMappingURL=ExecuteOpenMablEmailDefinition.js.map