Path: blob/main/test/mcp/src/automationTools/statusbar.ts
3520 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { McpServer, RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js';6import { ApplicationService } from '../application';78/**9* Status Bar Tools10*/11export function applyStatusBarTools(server: McpServer, appService: ApplicationService): RegisteredTool[] {12const tools: RegisteredTool[] = [];1314// Seems too niche15// server.tool(16// 'vscode_automation_statusbar_wait_for_element',17// 'Wait for a specific status bar element to appear',18// {19// element: z.enum([20// 'BRANCH_STATUS',21// 'SYNC_STATUS',22// 'PROBLEMS_STATUS',23// 'SELECTION_STATUS',24// 'INDENTATION_STATUS',25// 'ENCODING_STATUS',26// 'EOL_STATUS',27// 'LANGUAGE_STATUS'28// ]).describe('Status bar element to wait for')29// },30// async (args) => {31// const { element } = args;32// // Map string to enum value33// const elementMap: Record<string, number> = {34// 'BRANCH_STATUS': 0,35// 'SYNC_STATUS': 1,36// 'PROBLEMS_STATUS': 2,37// 'SELECTION_STATUS': 3,38// 'INDENTATION_STATUS': 4,39// 'ENCODING_STATUS': 5,40// 'EOL_STATUS': 6,41// 'LANGUAGE_STATUS': 742// };4344// await app.workbench.statusbar.waitForStatusbarElement(elementMap[element]);45// return {46// content: [{47// type: 'text' as const,48// text: `Status bar element found: ${element}`49// }]50// };51// }52// );5354// Playwright can probably figure this out55// server.tool(56// 'vscode_automation_statusbar_click',57// 'Click on a specific status bar element',58// {59// element: z.enum([60// 'BRANCH_STATUS',61// 'SYNC_STATUS',62// 'PROBLEMS_STATUS',63// 'SELECTION_STATUS',64// 'INDENTATION_STATUS',65// 'ENCODING_STATUS',66// 'EOL_STATUS',67// 'LANGUAGE_STATUS'68// ]).describe('Status bar element to click')69// },70// async (args) => {71// const { element } = args;72// // Map string to enum value73// const elementMap: Record<string, number> = {74// 'BRANCH_STATUS': 0,75// 'SYNC_STATUS': 1,76// 'PROBLEMS_STATUS': 2,77// 'SELECTION_STATUS': 3,78// 'INDENTATION_STATUS': 4,79// 'ENCODING_STATUS': 5,80// 'EOL_STATUS': 6,81// 'LANGUAGE_STATUS': 782// };8384// await app.workbench.statusbar.clickOn(elementMap[element]);85// return {86// content: [{87// type: 'text' as const,88// text: `Clicked status bar element: ${element}`89// }]90// };91// }92// );9394// Seems too niche95// server.tool(96// 'vscode_automation_statusbar_wait_for_eol',97// 'Wait for a specific End of Line (EOL) type in the status bar',98// {99// eol: z.string().describe('EOL type to wait for (e.g., "LF", "CRLF")')100// },101// async (args) => {102// const { eol } = args;103// const result = await app.workbench.statusbar.waitForEOL(eol);104// return {105// content: [{106// type: 'text' as const,107// text: `EOL status found: ${result}`108// }]109// };110// }111// );112113// Playwright can probably figure this out114// server.tool(115// 'vscode_automation_statusbar_wait_for_text',116// 'Wait for specific text to appear in a status bar element',117// {118// title: z.string().describe('Title/identifier of the status bar element'),119// text: z.string().describe('Text to wait for in the status bar element')120// },121// async (args) => {122// const { title, text } = args;123// await app.workbench.statusbar.waitForStatusbarText(title, text);124// return {125// content: [{126// type: 'text' as const,127// text: `Status bar text found - ${title}: "${text}"`128// }]129// };130// }131// );132133return tools;134}135136137