UNPKG

askui

Version:

Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on

53 lines (52 loc) 2.3 kB
import { ControlCommand } from '../../core/ui-control-commands'; import { UiControllerClientConnectionState } from '../ui-controller-client-connection-state'; import { DeviceClient } from '../device-client'; /** * Client for the AskUI AgentOS (AskUI Remote Device Controller). Talks gRPC to the * `Askui.API.TDKv1.ControllerAPI` service, mirroring the connection approach of the * AskUI Python SDK (askui/vision-agent): open an insecure channel to a locally running * AgentOS, start a session, start execution, and set the active display. * * The AgentOS listens on `localhost:23000` when running standalone and on * `localhost:26000` when managed by the AskUI OS service (`AskuiCoreService`). */ export declare class AgentOsClient implements DeviceClient { url: string; private static readonly INSTALLATION_DOCS_URL; private static readonly DEFAULT_PORT; private static readonly REQUEST_TIMEOUT_IN_MS; private static readonly CONNECT_TIMEOUT_IN_MS; private static readonly ACTION_POLL_MAX_RETRIES; private static readonly ACTION_POLL_INTERVAL_IN_MS; private static readonly TYPING_SPEED_IN_CHARACTERS_PER_SECOND; private static readonly MOUSE_MOVE_DURATION_IN_MS; private static readonly MOUSE_SCROLL_DURATION_IN_MS; private static readonly MODIFIER_KEYS; connectionState: UiControllerClientConnectionState; private client; private sessionInfo; private address; private displayId; constructor(url: string); private static buildControllerApiConstructor; private static normalizeAddress; private static openChannel; private requireClient; private static invokeOn; private invoke; connect(): Promise<UiControllerClientConnectionState>; private startSession; disconnect(): void; setActiveDisplay(displayId: number): Promise<void>; private runAction; requestControl(controlCommand: ControlCommand): Promise<void>; private static mouseButtonPressAndRelease; private static parseKeySequence; private static typeText; private static mouseScroll; private static keyPressOrRelease; private static mapAction; private static bitmapToRgba; requestScreenshot(): Promise<string>; getStartingArguments(): Promise<Record<string, string | number | boolean>>; }