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

100 lines (99 loc) 4.91 kB
import { ActionResponse, MechanismType } from '../models/models'; import { SmoothOperatorClient } from '../smooth-operator-client'; /** * API endpoints for mouse operations */ export declare class MouseApi { private client; /** * Creates a new instance of the MouseApi * @param client The SmoothOperatorClient instance */ constructor(client: SmoothOperatorClient); /** * Performs left mouse click at screen coordinates (0,0 is top-left) * @param x Horizontal pixel coordinate * @param y Vertical pixel coordinate * @returns Action response with success status */ click(x: number, y: number): Promise<ActionResponse>; /** * Perform a double click at the specified coordinates * @param x X coordinate * @param y Y coordinate * @returns Action response */ doubleClick(x: number, y: number): Promise<ActionResponse>; /** * Perform a right mouse button click at the specified coordinates * @param x X coordinate * @param y Y coordinate * @returns Action response */ rightClick(x: number, y: number): Promise<ActionResponse>; /** * Move the mouse cursor to the specified coordinates * @param x X coordinate * @param y Y coordinate * @returns Action response */ move(x: number, y: number): Promise<ActionResponse>; /** * Perform a mouse drag operation from start coordinates to end coordinates * @param startX Start X coordinate * @param startY Start Y coordinate * @param endX End X coordinate * @param endY End Y coordinate * @returns Action response */ drag(startX: number, startY: number, endX: number, endY: number): Promise<ActionResponse>; /** * Scrolls mouse wheel at specified coordinates * @param x Horizontal pixel coordinate * @param y Vertical pixel coordinate * @param clicks Number of scroll clicks (positive for down, negative for up) * @param direction Direction to scroll ("up" or "down"). Overrides clicks sign if provided. * @returns Action response with success status */ scroll(x: number, y: number, clicks: number, direction?: string): Promise<ActionResponse>; /** * Uses AI vision to find and click a UI element based on description (consumes 50-100 tokens) * @param userElementDescription Natural language description of element (be specific and include unique identifiers) * @param mechanism The AI mechanism to use for finding the element (defaults to ScreenGrasp2) * @returns Action response with success status and coordinates */ clickByDescription(userElementDescription: string, mechanism?: MechanismType): Promise<ActionResponse>; /** * Uses AI vision to find and double-click a UI element based on description (consumes 50-100 tokens) * @param userElementDescription Natural language description of element (be specific and include unique identifiers) * @param mechanism The AI mechanism to use for finding the element (defaults to ScreenGrasp2) * @returns Action response with success status and coordinates */ doubleClickByDescription(userElementDescription: string, mechanism?: MechanismType): Promise<ActionResponse>; /** * Uses AI vision to drag from source to target elements based on descriptions (consumes 100-200 tokens) * @param startElementDescription Natural language description of source element * @param endElementDescription Natural language description of target element * @returns Action response with success status and coordinates */ dragByDescription(startElementDescription: string, endElementDescription: string): Promise<ActionResponse>; /** * Uses AI vision to find and right-click a UI element based on description (consumes 50-100 tokens) * @param userElementDescription Natural language description of element (be specific and include unique identifiers) * @param mechanism The AI mechanism to use for finding the element (defaults to ScreenGrasp2) * @returns Action response with success status and coordinates */ rightClickByDescription(userElementDescription: string, mechanism?: MechanismType): Promise<ActionResponse>; /** * Uses AI vision to move mouse cursor to element based on description (consumes 50-100 tokens) * @param userElementDescription Natural language description of element (be specific and include unique identifiers) * @param mechanism The AI mechanism to use for finding the element (defaults to ScreenGrasp2) * @returns Action response with success status and coordinates */ moveByDescription(userElementDescription: string, mechanism?: MechanismType): Promise<ActionResponse>; /** * Returns a string representation of the MouseApi class. * @returns The string "MouseApi". */ toString(): string; }