Skip to content

Commit 40d4e6f

Browse files
committed
remove comments
1 parent f9f51e8 commit 40d4e6f

File tree

1 file changed

+2
-47
lines changed

1 file changed

+2
-47
lines changed

browserbase/src/tools/keyboard.ts

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,6 @@
11
import { z } from 'zod';
2-
// import type { ToolSchema, ToolResult } from "./tool.js";
3-
// import type { Context } from '../context.js';
4-
// import type { ToolActionResult } from '../context.js';
52
import { defineTool, type ToolFactory } from './tool.js';
63

7-
// --- Tool: Press Key ---
8-
// const PressKeyInputSchema = z.object({
9-
// key: z.string().describe("Key to press (e.g., 'Enter', 'Tab', 'a', 'Shift+A')"),
10-
// selector: z.string().optional().describe("Optional CSS selector for target element"),
11-
// sessionId: z.string().optional(),
12-
// });
13-
// type PressKeyInput = z.infer<typeof PressKeyInputSchema>;
14-
15-
// const pressKeySchema: ToolSchema<typeof PressKeyInputSchema> = {
16-
// name: "browserbase_press_key",
17-
// description: "Press a specific key on a selected element or globally.",
18-
// inputSchema: PressKeyInputSchema,
19-
// };
20-
21-
// // Handle function for PressKey
22-
// async function handlePressKey(context: Context, params: PressKeyInput): Promise<ToolResult> {
23-
// const action = async (): Promise<ToolActionResult> => {
24-
// const page = await context.getActivePage();
25-
// if (!page) {
26-
// throw new Error('No active page found for pressKey');
27-
// }
28-
// try {
29-
// if (params.selector) {
30-
// await page.press(params.selector, params.key, { timeout: 10000 });
31-
// } else {
32-
// await page.keyboard.press(params.key);
33-
// }
34-
// return { content: [{ type: 'text', text: `Pressed key: ${params.key}${params.selector ? ' on ' + params.selector : ' globally'}` }] };
35-
// } catch (error) {
36-
// console.error(`PressKey action failed: ${error}`);
37-
// throw error; // Rethrow
38-
// }
39-
// };
40-
41-
// return {
42-
// action,
43-
// code: [], // Add code property
44-
// captureSnapshot: true, // Pressing key might change state
45-
// waitForNetwork: true, // Pressing key might trigger navigation/requests
46-
// };
47-
// }
48-
494
const pressKey: ToolFactory = captureSnapshot => defineTool({
505
capability: 'core',
516

@@ -73,8 +28,8 @@ const pressKey: ToolFactory = captureSnapshot => defineTool({
7328
return {
7429
code,
7530
action,
76-
captureSnapshot, // Passed from factory
77-
waitForNetwork: true // Kept from user's code
31+
captureSnapshot,
32+
waitForNetwork: true
7833
};
7934
},
8035
});

0 commit comments

Comments
 (0)