UNPKG

smooth-operator-agent-tools

Version:

Node.js client library for Smooth Operator Agent Tools - a toolkit for programmers developing Computer Use Agents on Windows systems

44 lines 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ScreenshotApi = void 0; const models_1 = require("../models/models"); /** * API endpoints for screenshot and analysis operations */ class ScreenshotApi { /** * Creates a new instance of the ScreenshotApi * @param client The SmoothOperatorClient instance */ constructor(client) { this.client = client; } /** * Captures a screenshot of the entire screen as Base64-encoded image * @returns Screenshot response containing ImageBase64 property */ async take() { return this.client.get('/tools-api/screenshot'); } /** * Uses AI to find the x/y coordinate of a UI element based on text description. Takes a fresh screenshot each time. * @param userElementDescription Text description of the element to find * @param mechanism The AI mechanism to use for finding the element (defaults to ScreenGrasp2) * @returns Response with X/Y coordinates */ async findUiElement(userElementDescription, mechanism = models_1.MechanismType.ScreenGrasp2) { return this.client.post('/tools-api/screenshot/find-ui-element', { taskDescription: userElementDescription, mechanism: mechanism }); } /** * Returns a string representation of the ScreenshotApi class. * @returns The string "ScreenshotApi". */ toString() { return 'ScreenshotApi'; } } exports.ScreenshotApi = ScreenshotApi; //# sourceMappingURL=screenshot-api.js.map