UNPKG

donobu

Version:

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

21 lines 956 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ScrollPageTool = void 0; const Tool_1 = require("./Tool"); const ToolCallResult_1 = require("../models/ToolCallResult"); class ScrollPageTool extends Tool_1.Tool { constructor() { super(ScrollPageTool.NAME, `Scroll the current page up or down by one viewport. This helps you see more of the current page, of which may contain relevant information below the fold.`, 'ScrollPageToolCoreParameters', 'ScrollPageToolGptParameters'); } async call(context, parameters) { await context.page.press('body', parameters.direction === 'DOWN' ? 'PageDown' : 'PageUp'); return ToolCallResult_1.ToolCallResult.successful(); } async callFromGpt(context, parameters) { return this.call(context, parameters); } } exports.ScrollPageTool = ScrollPageTool; ScrollPageTool.NAME = 'scrollPage'; //# sourceMappingURL=ScrollPageTool.js.map