import { z } from 'zod';
import { defineTool, } from '../toolDefinition.js';
import { AgentToolNames } from '../shared/agentToolNames.js';
export const executeOpenMablEmailArgumentsSchema = z.object({
    subject: z.string().optional().meta({
        description: 'Text to match against the email subject. Uses contains matching.',
    }),
    body: z.string().optional().meta({
        description: 'Text to match against the email body. Uses contains matching.',
    }),
    from: z.string().optional().meta({
        description: 'Sender email address to match against.',
    }),
    mailboxAddress: 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: 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.
 */
export const executeOpenMablEmailServerResultSchema = z.object({});
/**
 * Response schema for execute_open_mabl_email tool.
 */
export const executeOpenMablEmailResponseSchema = z.object({
    success: z.boolean(),
    message: z.string().optional(),
});
export const ExecuteOpenMablEmailToolDefinition = defineTool({
    name: 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: executeOpenMablEmailArgumentsSchema,
    serverPrepareResultSchema: executeOpenMablEmailServerResultSchema,
    responseSchema: executeOpenMablEmailResponseSchema,
});
//# sourceMappingURL=ExecuteOpenMablEmailDefinition.js.map