UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

18 lines 914 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HoverOverElementTool = void 0; const ReplayableInteraction_1 = require("./ReplayableInteraction"); class HoverOverElementTool extends ReplayableInteraction_1.ReplayableInteraction { constructor() { super(HoverOverElementTool.NAME, 'Hover the mouse over a specified element on a webpage.', 'SelectorBasedHoverOverElementToolParameters', 'AnnotationBasedHoverOverElementToolParameters'); } async invoke(context, _parameters, element) { await element.hover({ timeout: 3000 }); await context.page.waitForTimeout(HoverOverElementTool.HOVER_DURATION_MS); return 'Hovered over element.'; } } exports.HoverOverElementTool = HoverOverElementTool; HoverOverElementTool.NAME = 'hoverOverElement'; HoverOverElementTool.HOVER_DURATION_MS = 1000; //# sourceMappingURL=HoverOverElementTool.js.map