import { z } from 'zod';
import { defineTool, } from '../toolDefinition.js';
import { AgentToolNames } from './agentToolNames.js';
const executeSwitchTabArgumentsSchema = z.object({
    tab_id: z.string().meta({
        description: 'The unique identifier (page identifier) of the tab to switch to. Use the read_open_tabs tool to get the list of available tabs and their IDs.',
    }),
    url: z.string().optional().meta({
        description: 'The expected URL of the tab (optional, for verification purposes)',
    }),
    title: z.string().optional().meta({
        description: 'The expected title of the tab (optional, for verification purposes)',
    }),
});
/**
 * Response schema for execute_switch_tab tool.
 * The client should include the new screenshot and current URL after switching tabs
 * to show the new page state.
 */
const executeSwitchTabResponseSchema = z.object({
    success: z.boolean(),
    message: z.string().optional(),
    // Context fields - client should include these after executing the action
    new_screenshot: z.string().optional().meta({
        description: 'Base64-encoded PNG screenshot of the page after switching tabs',
    }),
    current_url: z.string().optional().meta({
        description: 'The URL of the tab after switching',
    }),
    tab_id: z.string().optional().meta({
        description: 'The tab ID that was switched to',
    }),
    tab_title: z.string().optional().meta({
        description: 'The title of the tab after switching',
    }),
});
export const ExecuteSwitchTabToolDefinition = defineTool({
    name: AgentToolNames.ExecuteSwitchTab,
    description: 'Switches to a different browser tab identified by the tab ID. Use the get_application_state tool first to get the list of available tabs and their IDs. This tool is used when testing multi-tab workflows or when you need to interact with a page that opened in a new tab. The client response will include a new screenshot of the switched-to tab.',
    argumentsSchema: executeSwitchTabArgumentsSchema,
    responseSchema: executeSwitchTabResponseSchema,
});
//# sourceMappingURL=ExecuteSwitchTabToolDefinition.js.map