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

82 lines (81 loc) 2.69 kB
import { ScreenshotApi } from './api/screenshot-api'; import { SystemApi } from './api/system-api'; import { MouseApi } from './api/mouse-api'; import { KeyboardApi } from './api/keyboard-api'; import { ChromeApi } from './api/chrome-api'; import { AutomationApi } from './api/automation-api'; import { CodeApi } from './api/code-api'; /** * Main client for the Smooth Operator Agent Tools API */ export declare class SmoothOperatorClient { private static readonly LOG_TIMING; private httpClient; private baseUrl; private serverProcess; private disposed; private apiKey; /** * Screenshot and analysis operations */ screenshot: ScreenshotApi; /** * System operations */ system: SystemApi; /** * Mouse operations */ mouse: MouseApi; /** * Keyboard operations */ keyboard: KeyboardApi; /** * Chrome browser operations */ chrome: ChromeApi; /** * Windows automation operations */ automation: AutomationApi; /** * Code execution operations */ code: CodeApi; /** * Creates a new instance of the SmoothOperatorClient * @param apiKey Optional: API key for authentication. Most methods don't require an API Key, but for some, especially the ones that use AI, you need to provide a Screengrasp.com API Key * @param baseUrl Optional: Base URL of the API. By Default the url is automatically determined by calling startServer(), alternatively you can also just point to an already running Server instance by providing its base url here. */ constructor(apiKey?: string, baseUrl?: string); /** * Starts the Smooth Operator Agent Tools Server * @throws Error when server is already running or base URL is already set manually * @throws Error when server files cannot be extracted or accessed */ startServer(): Promise<void>; /** * Helper method to get the expected installation folder path. * This logic should match the postinstall script. * @returns The installation folder path */ private static getInstallationFolder; /** * Stops the Smooth Operator Agent Tools Server if it was started by this client */ stopServer(): void; /** * Sends a GET request to the specified endpoint * @param endpoint API endpoint * @returns Deserialized response */ get<T>(endpoint: string): Promise<T>; /** * Sends a POST request to the specified endpoint * @param endpoint API endpoint * @param data Request data * @returns Deserialized response */ post<T>(endpoint: string, data?: any): Promise<T>; }