diff --git a/src/askui/tools/askui/__init__.py b/src/askui/tools/askui/__init__.py index 6f862b7d..28cbc742 100644 --- a/src/askui/tools/askui/__init__.py +++ b/src/askui/tools/askui/__init__.py @@ -1,3 +1,6 @@ -from .askui_controller import AskUiControllerClient, AskUiControllerServer +from askui.tools.askui.askui_controller import ( + AskUiControllerClient, + AskUiControllerServer, +) __all__ = ["AskUiControllerClient", "AskUiControllerServer"] diff --git a/src/askui/tools/askui/askui_controller.py b/src/askui/tools/askui/askui_controller.py index 7c385bbf..e3dd992e 100644 --- a/src/askui/tools/askui/askui_controller.py +++ b/src/askui/tools/askui/askui_controller.py @@ -1,726 +1,1083 @@ -import pathlib -import subprocess -import sys -import time -import types -import uuid -from typing import Literal, Type - -import grpc -from PIL import Image -from pydantic import BaseModel, Field, model_validator -from pydantic_settings import BaseSettings, SettingsConfigDict -from typing_extensions import Self, override - -from askui.container import telemetry -from askui.logger import logger -from askui.reporting import Reporter -from askui.tools.agent_os import AgentOs, ModifierKey, PcKey -from askui.tools.askui.askui_ui_controller_grpc import ( - Controller_V1_pb2 as controller_v1_pbs, -) -from askui.tools.askui.askui_ui_controller_grpc import ( - Controller_V1_pb2_grpc as controller_v1, -) -from askui.utils.image_utils import draw_point_on_image - -from ..utils import process_exists, wait_for_port -from .exceptions import ( - AskUiControllerOperationFailedError, - AskUiControllerOperationTimeoutError, -) - - -class RemoteDeviceController(BaseModel): - askui_remote_device_controller: pathlib.Path = Field( - alias="AskUIRemoteDeviceController" - ) - - -class Executables(BaseModel): - executables: RemoteDeviceController = Field(alias="Executables") - - -class InstalledPackages(BaseModel): - remote_device_controller_uuid: Executables = Field( - alias="{aed1b543-e856-43ad-b1bc-19365d35c33e}" - ) - - -class AskUiComponentRegistry(BaseModel): - definition_version: int = Field(alias="DefinitionVersion") - installed_packages: InstalledPackages = Field(alias="InstalledPackages") - - -class AskUiControllerSettings(BaseSettings): - model_config = SettingsConfigDict( - env_prefix="ASKUI_", - ) - - component_registry_file: pathlib.Path | None = None - installation_directory: pathlib.Path | None = None - - @model_validator(mode="after") - def validate_either_component_registry_or_installation_directory_is_set( - self, - ) -> "AskUiControllerSettings": - if self.component_registry_file is None and self.installation_directory is None: - error_msg = ( - "Either ASKUI_COMPONENT_REGISTRY_FILE or " - "ASKUI_INSTALLATION_DIRECTORY environment variable must be set" - ) - raise ValueError(error_msg) - return self - - -class AskUiControllerServer: - """ - Concrete implementation of `ControllerServer` for managing the AskUI Remote Device - Controller process. - Handles process discovery, startup, and shutdown for the native controller binary. - """ - - def __init__(self) -> None: - self._process: subprocess.Popen[bytes] | None = None - self._settings = AskUiControllerSettings() - - def _find_remote_device_controller(self) -> pathlib.Path: - if ( - self._settings.installation_directory is not None - and self._settings.component_registry_file is None - ): - logger.warning( - "Outdated AskUI Suite detected. Please update to the latest version." - ) - askui_remote_device_controller_path = ( - self._find_remote_device_controller_by_legacy_path() - ) - if not askui_remote_device_controller_path.is_file(): - error_msg = ( - "AskUIRemoteDeviceController executable does not exist under " - f"'{askui_remote_device_controller_path}'" - ) - raise FileNotFoundError(error_msg) - return askui_remote_device_controller_path - return self._find_remote_device_controller_by_component_registry() - - def _find_remote_device_controller_by_component_registry(self) -> pathlib.Path: - assert self._settings.component_registry_file is not None, ( - "Component registry file is not set" - ) - component_registry = AskUiComponentRegistry.model_validate_json( - self._settings.component_registry_file.read_text() - ) - askui_remote_device_controller_path = ( - component_registry.installed_packages.remote_device_controller_uuid.executables.askui_remote_device_controller # noqa: E501 - ) - if not askui_remote_device_controller_path.is_file(): - error_msg = ( - "AskUIRemoteDeviceController executable does not exist under " - f"'{askui_remote_device_controller_path}'" - ) - raise FileNotFoundError(error_msg) - return askui_remote_device_controller_path - - def _find_remote_device_controller_by_legacy_path(self) -> pathlib.Path: - assert self._settings.installation_directory is not None, ( - "Installation directory is not set" - ) - match sys.platform: - case "win32": - return ( - self._settings.installation_directory - / "Binaries" - / "resources" - / "assets" - / "binaries" - / "AskuiRemoteDeviceController.exe" - ) - case "darwin": - return ( - self._settings.installation_directory - / "Binaries" - / "askui-ui-controller.app" - / "Contents" - / "Resources" - / "assets" - / "binaries" - / "AskuiRemoteDeviceController" - ) - case "linux": - return ( - self._settings.installation_directory - / "Binaries" - / "resources" - / "assets" - / "binaries" - / "AskuiRemoteDeviceController" - ) - case _: - error_msg = ( - f"Platform {sys.platform} not supported by " - "AskUI Remote Device Controller" - ) - raise NotImplementedError(error_msg) - - def _start_process(self, path: pathlib.Path) -> None: - self._process = subprocess.Popen(path) - wait_for_port(23000) - - def start(self, clean_up: bool = False) -> None: - """ - Start the controller process. - - Args: - clean_up (bool, optional): Whether to clean up existing processes - (only on Windows) before starting. Defaults to `False`. - """ - if ( - sys.platform == "win32" - and clean_up - and process_exists("AskuiRemoteDeviceController.exe") - ): - self.clean_up() - remote_device_controller_path = self._find_remote_device_controller() - logger.debug( - "Starting AskUI Remote Device Controller: %s", remote_device_controller_path - ) - self._start_process(remote_device_controller_path) - time.sleep(0.5) - - def clean_up(self) -> None: - subprocess.run("taskkill.exe /IM AskUI*") - time.sleep(0.1) - - def stop(self, force: bool = False) -> None: - """ - Stop the controller process. - - Args: - force (bool, optional): Whether to forcefully terminate the process. - Defaults to `False`. - """ - if self._process is None: - return # Nothing to stop - - try: - if force: - self._process.kill() - if sys.platform == "win32": - self.clean_up() - else: - self._process.terminate() - except Exception as e: # noqa: BLE001 - We want to catch all other exceptions here - error = AskUiControllerOperationFailedError( - "stop AskUI Remote Device Controller", - e, - ) - logger.error(str(error)) - finally: - self._process = None - - -class AskUiControllerClient(AgentOs): - """ - Implementation of `AgentOs` that communicates with the AskUI Remote Device - Controller via gRPC. - - Args: - reporter (Reporter): Reporter used for reporting with the `"AgentOs"`. - display (int, optional): Display number to use. Defaults to `1`. - controller_server (AskUiControllerServer | None, optional): Custom controller - server. Defaults to `ControllerServer`. - """ - - @telemetry.record_call(exclude={"reporter", "controller_server"}) - def __init__( - self, - reporter: Reporter, - display: int = 1, - controller_server: AskUiControllerServer | None = None, - ) -> None: - self._stub: controller_v1.ControllerAPIStub | None = None - self._channel: grpc.Channel | None = None - self._session_info: controller_v1_pbs.SessionInfo | None = None - self._pre_action_wait = 0 - self._post_action_wait = 0.05 - self._max_retries = 10 - self._display = display - self._reporter = reporter - self._controller_server = controller_server or AskUiControllerServer() - - @telemetry.record_call() - @override - def connect(self) -> None: - """ - Establishes a connection to the AskUI Remote Device Controller. - - This method starts the controller server, establishes a gRPC channel, - creates a session, and sets up the initial display. - """ - self._controller_server.start() - self._channel = grpc.insecure_channel( - "localhost:23000", - options=[ - ("grpc.max_send_message_length", 2**30), - ("grpc.max_receive_message_length", 2**30), - ("grpc.default_deadline", 300000), - ], - ) - self._stub = controller_v1.ControllerAPIStub(self._channel) - self._start_session() - self._start_execution() - self.set_display(self._display) - - def _run_recorder_action( - self, - acion_class_id: controller_v1_pbs.ActionClassID, - action_parameters: controller_v1_pbs.ActionParameters, - ) -> controller_v1_pbs.Response_RunRecordedAction: - time.sleep(self._pre_action_wait) - assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( - "Stub is not initialized" - ) - response: controller_v1_pbs.Response_RunRecordedAction = ( - self._stub.RunRecordedAction( - controller_v1_pbs.Request_RunRecordedAction( - sessionInfo=self._session_info, - actionClassID=acion_class_id, - actionParameters=action_parameters, - ) - ) - ) - - time.sleep((response.requiredMilliseconds / 1000)) - num_retries = 0 - for _ in range(self._max_retries): - assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( - "Stub is not initialized" - ) - poll_response: controller_v1_pbs.Response_Poll = self._stub.Poll( - controller_v1_pbs.Request_Poll( - sessionInfo=self._session_info, - pollEventID=controller_v1_pbs.PollEventID.PollEventID_ActionFinished, - ) - ) - if ( - poll_response.pollEventParameters.actionFinished.actionID - == response.actionID - ): - break - time.sleep(self._post_action_wait) - num_retries += 1 - if num_retries == self._max_retries - 1: - raise AskUiControllerOperationTimeoutError - return response - - @telemetry.record_call() - @override - def disconnect(self) -> None: - """ - Terminates the connection to the AskUI Remote Device Controller. - - This method stops the execution, ends the session, closes the gRPC channel, - and stops the controller server. - """ - self._stop_execution() - self._stop_session() - if self._channel is not None: - self._channel.close() - self._controller_server.stop() - - @telemetry.record_call() - def __enter__(self) -> Self: - """ - Context manager entry point that establishes the connection. - - Returns: - Self: The instance of AskUiControllerClient. - """ - self.connect() - return self - - @telemetry.record_call(exclude={"exc_value", "traceback"}) - def __exit__( - self, - exc_type: Type[BaseException] | None, - exc_value: BaseException | None, - traceback: types.TracebackType | None, - ) -> None: - """ - Context manager exit point that disconnects the client. - - Args: - exc_type: The exception type if an exception was raised. - exc_value: The exception value if an exception was raised. - traceback: The traceback if an exception was raised. - """ - self.disconnect() - - def _start_session(self) -> None: - assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( - "Stub is not initialized" - ) - response = self._stub.StartSession( - controller_v1_pbs.Request_StartSession( - sessionGUID="{" + str(uuid.uuid4()) + "}", immediateExecution=True - ) - ) - self._session_info = response.sessionInfo - - def _stop_session(self) -> None: - assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( - "Stub is not initialized" - ) - self._stub.EndSession( - controller_v1_pbs.Request_EndSession(sessionInfo=self._session_info) - ) - - def _start_execution(self) -> None: - assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( - "Stub is not initialized" - ) - self._stub.StartExecution( - controller_v1_pbs.Request_StartExecution(sessionInfo=self._session_info) - ) - - def _stop_execution(self) -> None: - assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( - "Stub is not initialized" - ) - self._stub.StopExecution( - controller_v1_pbs.Request_StopExecution(sessionInfo=self._session_info) - ) - - @telemetry.record_call() - @override - def screenshot(self, report: bool = True) -> Image.Image: - """ - Take a screenshot of the current screen. - - Args: - report (bool, optional): Whether to include the screenshot in reporting. - Defaults to `True`. - - Returns: - Image.Image: A PIL Image object containing the screenshot. - """ - assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( - "Stub is not initialized" - ) - screenResponse = self._stub.CaptureScreen( - controller_v1_pbs.Request_CaptureScreen( - sessionInfo=self._session_info, - captureParameters=controller_v1_pbs.CaptureParameters( - displayID=self._display - ), - ) - ) - r, g, b, _ = Image.frombytes( - "RGBA", - (screenResponse.bitmap.width, screenResponse.bitmap.height), - screenResponse.bitmap.data, - ).split() - image = Image.merge("RGB", (b, g, r)) - self._reporter.add_message("AgentOS", "screenshot()", image) - return image - - @telemetry.record_call() - @override - def mouse_move(self, x: int, y: int) -> None: - """ - Moves the mouse cursor to specified screen coordinates. - - Args: - x (int): The horizontal coordinate (in pixels) to move to. - y (int): The vertical coordinate (in pixels) to move to. - """ - self._reporter.add_message( - "AgentOS", - f"mouse_move({x}, {y})", - draw_point_on_image(self.screenshot(report=False), x, y, size=5), - ) - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_MouseMove, - action_parameters=controller_v1_pbs.ActionParameters( - mouseMove=controller_v1_pbs.ActionParameters_MouseMove( - position=controller_v1_pbs.Coordinate2(x=x, y=y), - milliseconds=500, - ) - ), - ) - - @telemetry.record_call(exclude={"text"}) - @override - def type(self, text: str, typing_speed: int = 50) -> None: - """ - Type text at current cursor position as if entered on a keyboard. - - Args: - text (str): The text to type. - typing_speed (int, optional): The speed of typing in characters per second. - Defaults to `50`. - """ - self._reporter.add_message("AgentOS", f'type("{text}", {typing_speed})') - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_KeyboardType_UnicodeText, - action_parameters=controller_v1_pbs.ActionParameters( - keyboardTypeUnicodeText=controller_v1_pbs.ActionParameters_KeyboardType_UnicodeText( - text=text.encode("utf-16-le"), - typingSpeed=typing_speed, - typingSpeedValue=controller_v1_pbs.TypingSpeedValue.TypingSpeedValue_CharactersPerSecond, - ) - ), - ) - - @telemetry.record_call() - @override - def click( - self, button: Literal["left", "middle", "right"] = "left", count: int = 1 - ) -> None: - """ - Click a mouse button. - - Args: - button (Literal["left", "middle", "right"], optional): The mouse button to - click. Defaults to `"left"`. - count (int, optional): Number of times to click. Defaults to `1`. - """ - self._reporter.add_message("AgentOS", f'click("{button}", {count})') - mouse_button = None - match button: - case "left": - mouse_button = controller_v1_pbs.MouseButton_Left - case "middle": - mouse_button = controller_v1_pbs.MouseButton_Middle - case "right": - mouse_button = controller_v1_pbs.MouseButton_Right - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_PressAndRelease, - action_parameters=controller_v1_pbs.ActionParameters( - mouseButtonPressAndRelease=controller_v1_pbs.ActionParameters_MouseButton_PressAndRelease( - mouseButton=mouse_button, count=count - ) - ), - ) - - @telemetry.record_call() - @override - def mouse_down(self, button: Literal["left", "middle", "right"] = "left") -> None: - """ - Press and hold a mouse button. - - Args: - button (Literal["left", "middle", "right"], optional): The mouse button to - press. Defaults to `"left"`. - """ - self._reporter.add_message("AgentOS", f'mouse_down("{button}")') - mouse_button = None - match button: - case "left": - mouse_button = controller_v1_pbs.MouseButton_Left - case "middle": - mouse_button = controller_v1_pbs.MouseButton_Middle - case "right": - mouse_button = controller_v1_pbs.MouseButton_Right - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_Press, - action_parameters=controller_v1_pbs.ActionParameters( - mouseButtonPress=controller_v1_pbs.ActionParameters_MouseButton_Press( - mouseButton=mouse_button - ) - ), - ) - - @telemetry.record_call() - @override - def mouse_up(self, button: Literal["left", "middle", "right"] = "left") -> None: - """ - Release a mouse button. - - Args: - button (Literal["left", "middle", "right"], optional): The mouse button to - release. Defaults to `"left"`. - """ - self._reporter.add_message("AgentOS", f'mouse_up("{button}")') - mouse_button = None - match button: - case "left": - mouse_button = controller_v1_pbs.MouseButton_Left - case "middle": - mouse_button = controller_v1_pbs.MouseButton_Middle - case "right": - mouse_button = controller_v1_pbs.MouseButton_Right - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_Release, - action_parameters=controller_v1_pbs.ActionParameters( - mouseButtonRelease=controller_v1_pbs.ActionParameters_MouseButton_Release( - mouseButton=mouse_button - ) - ), - ) - - @telemetry.record_call() - @override - def mouse_scroll(self, x: int, y: int) -> None: - """ - Scroll the mouse wheel. - - Args: - x (int): The horizontal scroll amount. Positive values scroll right, - negative values scroll left. - y (int): The vertical scroll amount. Positive values scroll down, - negative values scroll up. - """ - self._reporter.add_message("AgentOS", f"mouse_scroll({x}, {y})") - if x != 0: - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_MouseWheelScroll, - action_parameters=controller_v1_pbs.ActionParameters( - mouseWheelScroll=controller_v1_pbs.ActionParameters_MouseWheelScroll( - direction=controller_v1_pbs.MouseWheelScrollDirection.MouseWheelScrollDirection_Horizontal, - deltaType=controller_v1_pbs.MouseWheelDeltaType.MouseWheelDelta_Raw, - delta=x, - milliseconds=50, - ) - ), - ) - if y != 0: - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_MouseWheelScroll, - action_parameters=controller_v1_pbs.ActionParameters( - mouseWheelScroll=controller_v1_pbs.ActionParameters_MouseWheelScroll( - direction=controller_v1_pbs.MouseWheelScrollDirection.MouseWheelScrollDirection_Vertical, - deltaType=controller_v1_pbs.MouseWheelDeltaType.MouseWheelDelta_Raw, - delta=y, - milliseconds=50, - ) - ), - ) - - @telemetry.record_call() - @override - def keyboard_pressed( - self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None - ) -> None: - """ - Press and hold a keyboard key. - - Args: - key (PcKey | ModifierKey): The key to press. - modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to - press along with the main key. Defaults to `None`. - """ - self._reporter.add_message( - "AgentOS", f'keyboard_pressed("{key}", {modifier_keys})' - ) - if modifier_keys is None: - modifier_keys = [] - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_Press, - action_parameters=controller_v1_pbs.ActionParameters( - keyboardKeyPress=controller_v1_pbs.ActionParameters_KeyboardKey_Press( - keyName=key, modifierKeyNames=modifier_keys - ) - ), - ) - - @telemetry.record_call() - @override - def keyboard_release( - self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None - ) -> None: - """ - Release a keyboard key. - - Args: - key (PcKey | ModifierKey): The key to release. - modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to - release along with the main key. Defaults to `None`. - """ - self._reporter.add_message( - "AgentOS", f'keyboard_release("{key}", {modifier_keys})' - ) - if modifier_keys is None: - modifier_keys = [] - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_Release, - action_parameters=controller_v1_pbs.ActionParameters( - keyboardKeyRelease=controller_v1_pbs.ActionParameters_KeyboardKey_Release( - keyName=key, modifierKeyNames=modifier_keys - ) - ), - ) - - @telemetry.record_call() - @override - def keyboard_tap( - self, - key: PcKey | ModifierKey, - modifier_keys: list[ModifierKey] | None = None, - count: int = 1, - ) -> None: - """ - Press and immediately release a keyboard key. - - Args: - key (PcKey | ModifierKey): The key to tap. - modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to - press along with the main key. Defaults to `None`. - count (int, optional): The number of times to tap the key. Defaults to `1`. - """ - self._reporter.add_message( - "AgentOS", - f'keyboard_tap("{key}", {modifier_keys}, {count})', - ) - if modifier_keys is None: - modifier_keys = [] - for _ in range(count): - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_PressAndRelease, - action_parameters=controller_v1_pbs.ActionParameters( - keyboardKeyPressAndRelease=controller_v1_pbs.ActionParameters_KeyboardKey_PressAndRelease( - keyName=key, modifierKeyNames=modifier_keys - ) - ), - ) - - @telemetry.record_call() - @override - def set_display(self, display: int = 1) -> None: - """ - Set the active display. - - Args: - display (int, optional): The display ID to set as active. - Defaults to `1`. - """ - assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( - "Stub is not initialized" - ) - self._reporter.add_message("AgentOS", f"set_display({display})") - self._stub.SetActiveDisplay( - controller_v1_pbs.Request_SetActiveDisplay(displayID=display) - ) - self._display = display - - @telemetry.record_call(exclude={"command"}) - @override - def run_command(self, command: str, timeout_ms: int = 30000) -> None: - """ - Execute a shell command. - - Args: - command (str): The command to execute. - timeout_ms (int, optional): The timeout for command - execution in milliseconds. Defaults to `30000` (30 seconds). - """ - self._reporter.add_message("AgentOS", f'run_command("{command}", {timeout_ms})') - self._run_recorder_action( - acion_class_id=controller_v1_pbs.ActionClassID_RunCommand, - action_parameters=controller_v1_pbs.ActionParameters( - runcommand=controller_v1_pbs.ActionParameters_RunCommand( - command=command, timeoutInMilliseconds=timeout_ms - ) - ), - ) +import json +import pathlib +import subprocess +import sys +import time +import types +import uuid +from typing import Literal, Type, Union + +import grpc +from PIL import Image +from pydantic import BaseModel, Field, model_validator +from pydantic_settings import BaseSettings, SettingsConfigDict +from typing_extensions import Self, override + +from askui.container import telemetry +from askui.logger import logger +from askui.reporting import Reporter +from askui.tools.agent_os import AgentOs, ModifierKey, PcKey +from askui.tools.askui.askui_ui_controller_grpc import ( + Controller_V1_pb2 as controller_v1_pbs, +) +from askui.tools.askui.askui_ui_controller_grpc import ( + Controller_V1_pb2_grpc as controller_v1, +) +from askui.utils.image_utils import draw_point_on_image + +from ..utils import process_exists, wait_for_port +from .exceptions import ( + AskUiControllerOperationFailedError, + AskUiControllerOperationTimeoutError, +) +from .mouse_cursor import MouseCursor +from .render_objects import ( + AddRenderObjectResponse, + GetMousePositionResponse, + Location, + RenderCommand, + RenderObject, + RenderObjectStyle, + RenderResponseMessage, + create_clear_render_objects_command, + create_delete_render_object_command, + create_get_mouse_position_command, + create_image_command, + create_line_command, + create_quad_command, + create_set_mouse_position_command, + create_text_command, + create_update_render_object_command, +) + + +class RemoteDeviceController(BaseModel): + askui_remote_device_controller: pathlib.Path = Field( + alias="AskUIRemoteDeviceController" + ) + + +class Executables(BaseModel): + executables: RemoteDeviceController = Field(alias="Executables") + + +class InstalledPackages(BaseModel): + remote_device_controller_uuid: Executables = Field( + alias="{aed1b543-e856-43ad-b1bc-19365d35c33e}" + ) + + +class AskUiComponentRegistry(BaseModel): + definition_version: int = Field(alias="DefinitionVersion") + installed_packages: InstalledPackages = Field(alias="InstalledPackages") + + +class AskUiControllerSettings(BaseSettings): + model_config = SettingsConfigDict( + env_prefix="ASKUI_", + ) + + component_registry_file: pathlib.Path | None = None + installation_directory: pathlib.Path | None = None + + @model_validator(mode="after") + def validate_either_component_registry_or_installation_directory_is_set( + self, + ) -> "AskUiControllerSettings": + if self.component_registry_file is None and self.installation_directory is None: + error_msg = ( + "Either ASKUI_COMPONENT_REGISTRY_FILE or " + "ASKUI_INSTALLATION_DIRECTORY environment variable must be set" + ) + raise ValueError(error_msg) + return self + + +class AskUiControllerServer: + """ + Concrete implementation of `ControllerServer` for managing the AskUI Remote Device + Controller process. + Handles process discovery, startup, and shutdown for the native controller binary. + """ + + def __init__(self) -> None: + self._process: subprocess.Popen[bytes] | None = None + self._settings = AskUiControllerSettings() + + def _find_remote_device_controller(self) -> pathlib.Path: + if ( + self._settings.installation_directory is not None + and self._settings.component_registry_file is None + ): + logger.warning( + "Outdated AskUI Suite detected. Please update to the latest version." + ) + askui_remote_device_controller_path = ( + self._find_remote_device_controller_by_legacy_path() + ) + if not askui_remote_device_controller_path.is_file(): + error_msg = ( + "AskUIRemoteDeviceController executable does not exist under " + f"'{askui_remote_device_controller_path}'" + ) + raise FileNotFoundError(error_msg) + return askui_remote_device_controller_path + return self._find_remote_device_controller_by_component_registry() + + def _find_remote_device_controller_by_component_registry(self) -> pathlib.Path: + assert self._settings.component_registry_file is not None, ( + "Component registry file is not set" + ) + component_registry = AskUiComponentRegistry.model_validate_json( + self._settings.component_registry_file.read_text() + ) + askui_remote_device_controller_path = ( + component_registry.installed_packages.remote_device_controller_uuid.executables.askui_remote_device_controller # noqa: E501 + ) + if not askui_remote_device_controller_path.is_file(): + error_msg = ( + "AskUIRemoteDeviceController executable does not exist under " + f"'{askui_remote_device_controller_path}'" + ) + raise FileNotFoundError(error_msg) + return askui_remote_device_controller_path + + def _find_remote_device_controller_by_legacy_path(self) -> pathlib.Path: + assert self._settings.installation_directory is not None, ( + "Installation directory is not set" + ) + match sys.platform: + case "win32": + return ( + self._settings.installation_directory + / "Binaries" + / "resources" + / "assets" + / "binaries" + / "AskuiRemoteDeviceController.exe" + ) + case "darwin": + return ( + self._settings.installation_directory + / "Binaries" + / "askui-ui-controller.app" + / "Contents" + / "Resources" + / "assets" + / "binaries" + / "AskuiRemoteDeviceController" + ) + case "linux": + return ( + self._settings.installation_directory + / "Binaries" + / "resources" + / "assets" + / "binaries" + / "AskuiRemoteDeviceController" + ) + case _: + error_msg = ( + f"Platform {sys.platform} not supported by " + "AskUI Remote Device Controller" + ) + raise NotImplementedError(error_msg) + + def _start_process(self, path: pathlib.Path) -> None: + self._process = subprocess.Popen(path) + wait_for_port(23000) + + def start(self, clean_up: bool = False) -> None: + """ + Start the controller process. + + Args: + clean_up (bool, optional): Whether to clean up existing processes + (only on Windows) before starting. Defaults to `False`. + """ + if ( + sys.platform == "win32" + and clean_up + and process_exists("AskuiRemoteDeviceController.exe") + ): + self.clean_up() + remote_device_controller_path = self._find_remote_device_controller() + logger.debug( + "Starting AskUI Remote Device Controller: %s", remote_device_controller_path + ) + self._start_process(remote_device_controller_path) + time.sleep(0.5) + + def clean_up(self) -> None: + subprocess.run("taskkill.exe /IM AskUI*") + time.sleep(0.1) + + def stop(self, force: bool = False) -> None: + """ + Stop the controller process. + + Args: + force (bool, optional): Whether to forcefully terminate the process. + Defaults to `False`. + """ + if self._process is None: + return # Nothing to stop + + try: + if force: + self._process.kill() + if sys.platform == "win32": + self.clean_up() + else: + self._process.terminate() + except Exception as e: # noqa: BLE001 - We want to catch all other exceptions here + error = AskUiControllerOperationFailedError( + "stop AskUI Remote Device Controller", + e, + ) + logger.error(str(error)) + finally: + self._process = None + + +class AskUiControllerClient(AgentOs): + """ + Implementation of `AgentOs` that communicates with the AskUI Remote Device + Controller via gRPC. + + Args: + reporter (Reporter): Reporter used for reporting with the `"AgentOs"`. + display (int, optional): Display number to use. Defaults to `1`. + controller_server (AskUiControllerServer | None, optional): Custom controller + server. Defaults to `ControllerServer`. + """ + + @telemetry.record_call(exclude={"reporter", "controller_server"}) + def __init__( + self, + reporter: Reporter, + display: int = 1, + controller_server: AskUiControllerServer | None = None, + ) -> None: + self._stub: controller_v1.ControllerAPIStub | None = None + self._channel: grpc.Channel | None = None + self._session_info: controller_v1_pbs.SessionInfo | None = None + self._session_guid: str = str(uuid.uuid4()) + self._pre_action_wait = 0 + self._post_action_wait = 0.05 + self._max_retries = 10 + self._display = display + self._reporter = reporter + self._controller_server = controller_server or AskUiControllerServer() + self._cursor: MouseCursor | None = None + + @telemetry.record_call() + @override + def connect(self) -> None: + """ + Establishes a connection to the AskUI Remote Device Controller. + + This method starts the controller server, establishes a gRPC channel, + creates a session, and sets up the initial display. + """ + self._controller_server.start() + self._channel = grpc.insecure_channel( + "localhost:23000", + options=[ + ("grpc.max_send_message_length", 2**30), + ("grpc.max_receive_message_length", 2**30), + ("grpc.default_deadline", 300000), + ], + ) + self._stub = controller_v1.ControllerAPIStub(self._channel) + self._start_session() + self._start_execution() + self.set_display(self._display) + + def _run_recorder_action( + self, + acion_class_id: controller_v1_pbs.ActionClassID, + action_parameters: controller_v1_pbs.ActionParameters, + ) -> controller_v1_pbs.Response_RunRecordedAction: + time.sleep(self._pre_action_wait) + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + response: controller_v1_pbs.Response_RunRecordedAction = ( + self._stub.RunRecordedAction( + controller_v1_pbs.Request_RunRecordedAction( + sessionInfo=self._session_info, + actionClassID=acion_class_id, + actionParameters=action_parameters, + ) + ) + ) + + time.sleep((response.requiredMilliseconds / 1000)) + num_retries = 0 + for _ in range(self._max_retries): + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + poll_response: controller_v1_pbs.Response_Poll = self._stub.Poll( + controller_v1_pbs.Request_Poll( + sessionInfo=self._session_info, + pollEventID=controller_v1_pbs.PollEventID.PollEventID_ActionFinished, + ) + ) + if ( + poll_response.pollEventParameters.actionFinished.actionID + == response.actionID + ): + break + time.sleep(self._post_action_wait) + num_retries += 1 + if num_retries == self._max_retries - 1: + raise AskUiControllerOperationTimeoutError + return response + + @telemetry.record_call() + @override + def disconnect(self) -> None: + """ + Terminates the connection to the AskUI Remote Device Controller. + + This method stops the execution, ends the session, closes the gRPC channel, + and stops the controller server. + """ + self._stop_execution() + self._stop_session() + if self._channel is not None: + self._channel.close() + self._controller_server.stop() + + @telemetry.record_call() + def __enter__(self) -> Self: + """ + Context manager entry point that establishes the connection. + + Returns: + Self: The instance of AskUiControllerClient. + """ + self.connect() + return self + + @telemetry.record_call(exclude={"exc_value", "traceback"}) + def __exit__( + self, + exc_type: Type[BaseException] | None, + exc_value: BaseException | None, + traceback: types.TracebackType | None, + ) -> None: + """ + Context manager exit point that disconnects the client. + + Args: + exc_type: The exception type if an exception was raised. + exc_value: The exception value if an exception was raised. + traceback: The traceback if an exception was raised. + """ + self.disconnect() + + def _start_session(self) -> None: + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + session_guid = "{" + self._session_guid + "}" + response = self._stub.StartSession( + controller_v1_pbs.Request_StartSession( + sessionGUID=session_guid, immediateExecution=True + ) + ) + self._session_info = response.sessionInfo + + def _stop_session(self) -> None: + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + self._stub.EndSession( + controller_v1_pbs.Request_EndSession(sessionInfo=self._session_info) + ) + + def _start_execution(self) -> None: + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + self._stub.StartExecution( + controller_v1_pbs.Request_StartExecution(sessionInfo=self._session_info) + ) + + def _stop_execution(self) -> None: + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + self._stub.StopExecution( + controller_v1_pbs.Request_StopExecution(sessionInfo=self._session_info) + ) + + def _create_authenticated_request( + self, command: RenderCommand + ) -> controller_v1_pbs.Request_Send: + session_guid = "{" + self._session_guid + "}" + message = { + "message": {"header": {"authentication": session_guid}, "command": command} + } + request = controller_v1_pbs.Request_Send() + request.message = json.dumps(message) + return request + + @telemetry.record_call() + @override + def screenshot(self, report: bool = True) -> Image.Image: + """ + Take a screenshot of the current screen. + + Args: + report (bool, optional): Whether to include the screenshot in reporting. + Defaults to `True`. + + Returns: + Image.Image: A PIL Image object containing the screenshot. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + screenResponse = self._stub.CaptureScreen( + controller_v1_pbs.Request_CaptureScreen( + sessionInfo=self._session_info, + captureParameters=controller_v1_pbs.CaptureParameters( + displayID=self._display + ), + ) + ) + r, g, b, _ = Image.frombytes( + "RGBA", + (screenResponse.bitmap.width, screenResponse.bitmap.height), + screenResponse.bitmap.data, + ).split() + image = Image.merge("RGB", (b, g, r)) + self._reporter.add_message("AgentOS", "screenshot()", image) + return image + + @telemetry.record_call() + @override + def mouse_move(self, x: int, y: int) -> None: + """ + Moves the mouse cursor to specified screen coordinates. + + Args: + x (int): The horizontal coordinate (in pixels) to move to. + y (int): The vertical coordinate (in pixels) to move to. + """ + self._reporter.add_message( + "AgentOS", + f"mouse_move({x}, {y})", + draw_point_on_image(self.screenshot(report=False), x, y, size=5), + ) + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_MouseMove, + action_parameters=controller_v1_pbs.ActionParameters( + mouseMove=controller_v1_pbs.ActionParameters_MouseMove( + position=controller_v1_pbs.Coordinate2(x=x, y=y), + milliseconds=500, + ) + ), + ) + + @telemetry.record_call(exclude={"text"}) + @override + def type(self, text: str, typing_speed: int = 50) -> None: + """ + Type text at current cursor position as if entered on a keyboard. + + Args: + text (str): The text to type. + typing_speed (int, optional): The speed of typing in characters per second. + Defaults to `50`. + """ + self._reporter.add_message("AgentOS", f'type("{text}", {typing_speed})') + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_KeyboardType_UnicodeText, + action_parameters=controller_v1_pbs.ActionParameters( + keyboardTypeUnicodeText=controller_v1_pbs.ActionParameters_KeyboardType_UnicodeText( + text=text.encode("utf-16-le"), + typingSpeed=typing_speed, + typingSpeedValue=controller_v1_pbs.TypingSpeedValue.TypingSpeedValue_CharactersPerSecond, + ) + ), + ) + + @telemetry.record_call() + @override + def click( + self, button: Literal["left", "middle", "right"] = "left", count: int = 1 + ) -> None: + """ + Click a mouse button. + + Args: + button (Literal["left", "middle", "right"], optional): The mouse button to + click. Defaults to `"left"`. + count (int, optional): Number of times to click. Defaults to `1`. + """ + self._reporter.add_message("AgentOS", f'click("{button}", {count})') + mouse_button = None + match button: + case "left": + mouse_button = controller_v1_pbs.MouseButton_Left + case "middle": + mouse_button = controller_v1_pbs.MouseButton_Middle + case "right": + mouse_button = controller_v1_pbs.MouseButton_Right + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_PressAndRelease, + action_parameters=controller_v1_pbs.ActionParameters( + mouseButtonPressAndRelease=controller_v1_pbs.ActionParameters_MouseButton_PressAndRelease( + mouseButton=mouse_button, count=count + ) + ), + ) + + @telemetry.record_call() + @override + def mouse_down(self, button: Literal["left", "middle", "right"] = "left") -> None: + """ + Press and hold a mouse button. + + Args: + button (Literal["left", "middle", "right"], optional): The mouse button to + press. Defaults to `"left"`. + """ + self._reporter.add_message("AgentOS", f'mouse_down("{button}")') + mouse_button = None + match button: + case "left": + mouse_button = controller_v1_pbs.MouseButton_Left + case "middle": + mouse_button = controller_v1_pbs.MouseButton_Middle + case "right": + mouse_button = controller_v1_pbs.MouseButton_Right + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_Press, + action_parameters=controller_v1_pbs.ActionParameters( + mouseButtonPress=controller_v1_pbs.ActionParameters_MouseButton_Press( + mouseButton=mouse_button + ) + ), + ) + + @telemetry.record_call() + @override + def mouse_up(self, button: Literal["left", "middle", "right"] = "left") -> None: + """ + Release a mouse button. + + Args: + button (Literal["left", "middle", "right"], optional): The mouse button to + release. Defaults to `"left"`. + """ + self._reporter.add_message("AgentOS", f'mouse_up("{button}")') + mouse_button = None + match button: + case "left": + mouse_button = controller_v1_pbs.MouseButton_Left + case "middle": + mouse_button = controller_v1_pbs.MouseButton_Middle + case "right": + mouse_button = controller_v1_pbs.MouseButton_Right + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_MouseButton_Release, + action_parameters=controller_v1_pbs.ActionParameters( + mouseButtonRelease=controller_v1_pbs.ActionParameters_MouseButton_Release( + mouseButton=mouse_button + ) + ), + ) + + @telemetry.record_call() + @override + def mouse_scroll(self, x: int, y: int) -> None: + """ + Scroll the mouse wheel. + + Args: + x (int): The horizontal scroll amount. Positive values scroll right, + negative values scroll left. + y (int): The vertical scroll amount. Positive values scroll down, + negative values scroll up. + """ + self._reporter.add_message("AgentOS", f"mouse_scroll({x}, {y})") + if x != 0: + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_MouseWheelScroll, + action_parameters=controller_v1_pbs.ActionParameters( + mouseWheelScroll=controller_v1_pbs.ActionParameters_MouseWheelScroll( + direction=controller_v1_pbs.MouseWheelScrollDirection.MouseWheelScrollDirection_Horizontal, + deltaType=controller_v1_pbs.MouseWheelDeltaType.MouseWheelDelta_Raw, + delta=x, + milliseconds=50, + ) + ), + ) + if y != 0: + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_MouseWheelScroll, + action_parameters=controller_v1_pbs.ActionParameters( + mouseWheelScroll=controller_v1_pbs.ActionParameters_MouseWheelScroll( + direction=controller_v1_pbs.MouseWheelScrollDirection.MouseWheelScrollDirection_Vertical, + deltaType=controller_v1_pbs.MouseWheelDeltaType.MouseWheelDelta_Raw, + delta=y, + milliseconds=50, + ) + ), + ) + + @telemetry.record_call() + @override + def keyboard_pressed( + self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None + ) -> None: + """ + Press and hold a keyboard key. + + Args: + key (PcKey | ModifierKey): The key to press. + modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to + press along with the main key. Defaults to `None`. + """ + self._reporter.add_message( + "AgentOS", f'keyboard_pressed("{key}", {modifier_keys})' + ) + if modifier_keys is None: + modifier_keys = [] + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_Press, + action_parameters=controller_v1_pbs.ActionParameters( + keyboardKeyPress=controller_v1_pbs.ActionParameters_KeyboardKey_Press( + keyName=key, modifierKeyNames=modifier_keys + ) + ), + ) + + @telemetry.record_call() + @override + def keyboard_release( + self, key: PcKey | ModifierKey, modifier_keys: list[ModifierKey] | None = None + ) -> None: + """ + Release a keyboard key. + + Args: + key (PcKey | ModifierKey): The key to release. + modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to + release along with the main key. Defaults to `None`. + """ + self._reporter.add_message( + "AgentOS", f'keyboard_release("{key}", {modifier_keys})' + ) + if modifier_keys is None: + modifier_keys = [] + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_Release, + action_parameters=controller_v1_pbs.ActionParameters( + keyboardKeyRelease=controller_v1_pbs.ActionParameters_KeyboardKey_Release( + keyName=key, modifierKeyNames=modifier_keys + ) + ), + ) + + @telemetry.record_call() + @override + def keyboard_tap( + self, + key: PcKey | ModifierKey, + modifier_keys: list[ModifierKey] | None = None, + count: int = 1, + ) -> None: + """ + Press and immediately release a keyboard key. + + Args: + key (PcKey | ModifierKey): The key to tap. + modifier_keys (list[ModifierKey] | None, optional): List of modifier keys to + press along with the main key. Defaults to `None`. + count (int, optional): The number of times to tap the key. Defaults to `1`. + """ + self._reporter.add_message( + "AgentOS", + f'keyboard_tap("{key}", {modifier_keys}, {count})', + ) + if modifier_keys is None: + modifier_keys = [] + for _ in range(count): + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_KeyboardKey_PressAndRelease, + action_parameters=controller_v1_pbs.ActionParameters( + keyboardKeyPressAndRelease=controller_v1_pbs.ActionParameters_KeyboardKey_PressAndRelease( + keyName=key, modifierKeyNames=modifier_keys + ) + ), + ) + + @telemetry.record_call() + @override + def set_display(self, display: int = 1) -> None: + """ + Set the active display. + + Args: + display (int, optional): The display ID to set as active. + Defaults to `1`. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + self._reporter.add_message("AgentOS", f"set_display({display})") + self._stub.SetActiveDisplay( + controller_v1_pbs.Request_SetActiveDisplay(displayID=display) + ) + self._display = display + + @telemetry.record_call(exclude={"command"}) + @override + def run_command(self, command: str, timeout_ms: int = 30000) -> None: + """ + Execute a shell command. + + Args: + command (str): The command to execute. + timeout_ms (int, optional): The timeout for command + execution in milliseconds. Defaults to `30000` (30 seconds). + """ + self._reporter.add_message("AgentOS", f'run_command("{command}", {timeout_ms})') + self._run_recorder_action( + acion_class_id=controller_v1_pbs.ActionClassID_RunCommand, + action_parameters=controller_v1_pbs.ActionParameters( + runcommand=controller_v1_pbs.ActionParameters_RunCommand( + command=command, timeoutInMilliseconds=timeout_ms + ) + ), + ) + + @telemetry.record_call() + def get_mouse_position(self) -> Location: + """ + Get the current mouse position in absolute coordinates. + + Returns: + Location: The current mouse position as (x, y) coordinates. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + command = create_get_mouse_position_command() + request = self._create_authenticated_request(command) + + response = self._stub.Send(request) + response_data: RenderResponseMessage = json.loads(response.message) + mouse_response: GetMousePositionResponse = response_data["message"]["command"] + + self._reporter.add_message("AgentOS", "get_mouse_position()") + return mouse_response["response"]["position"] + + @telemetry.record_call() + def set_mouse_position(self, x: int, y: int) -> None: + """ + Set the mouse position to the specified coordinates. + + Args: + x (int): The horizontal coordinate (in pixels) to set. + y (int): The vertical coordinate (in pixels) to set. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + command = create_set_mouse_position_command(x, y) + request = self._create_authenticated_request(command) + + response = self._stub.Send(request) + self._reporter.add_message("AgentOS", f"set_mouse_position({x}, {y})") + + def add_quad_render_object(self, style: RenderObjectStyle) -> int: + """ + Add a Quad render object with the specified style. + + Args: + style (RenderObjectStyle): The style properties for the quad. + + Returns: + int: The ID of the created render object. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + command = create_quad_command(style) + request = self._create_authenticated_request(command) + + response = self._stub.Send(request) + response_data: RenderResponseMessage = json.loads(response.message) + add_response: AddRenderObjectResponse = response_data["message"]["command"] + + self._reporter.add_message("AgentOS", f"add_quad_render_object({style})") + return add_response["response"]["id"] + + def add_line_render_object( + self, style: RenderObjectStyle, points: list[Location] + ) -> int: + """ + Add a Line render object with the specified style and points. + + Args: + style (RenderObjectStyle): The style properties for the line. + points (list[Location]): Array of point coordinates for the line. + + Returns: + int: The ID of the created render object. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + command = create_line_command(style, points) + request = self._create_authenticated_request(command) + + response = self._stub.Send(request) + response_data: RenderResponseMessage = json.loads(response.message) + add_response: AddRenderObjectResponse = response_data["message"]["command"] + + self._reporter.add_message( + "AgentOS", f"add_line_render_object({style}, {points})" + ) + return add_response["response"]["id"] + + def add_image_render_object( + self, style: RenderObjectStyle, bitmap_data: str + ) -> int: + """ + Add an Image render object with the specified style and bitmap data. + + Args: + style (RenderObjectStyle): The style properties for the image. + bitmap_data (str): Base64 string of the bitmap data. + + Returns: + int: The ID of the created render object. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + command = create_image_command(style, bitmap_data) + request = self._create_authenticated_request(command) + + response = self._stub.Send(request) + response_data: RenderResponseMessage = json.loads(response.message) + add_response: AddRenderObjectResponse = response_data["message"]["command"] + + self._reporter.add_message("AgentOS", f"add_image_render_object({style})") + return add_response["response"]["id"] + + def add_text_render_object(self, style: RenderObjectStyle, text: str) -> int: + """ + Add a Text render object with the specified style and text content. + + Args: + style (RenderObjectStyle): The style properties for the text. + text (str): The text content to display. + + Returns: + int: The ID of the created render object. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + command = create_text_command(style, text) + request = self._create_authenticated_request(command) + + response = self._stub.Send(request) + response_data: RenderResponseMessage = json.loads(response.message) + add_response: AddRenderObjectResponse = response_data["message"]["command"] + + self._reporter.add_message( + "AgentOS", f'add_text_render_object({style}, "{text}")' + ) + return add_response["response"]["id"] + + def update_render_object( + self, + object_id: int, + style: RenderObjectStyle, + additional_params: Union[list[Location], str, None] = None, + ) -> None: + """ + Update an existing render object with new style and optional additional parameters. + + Args: + object_id (int): The ID of the render object to update. + style (RenderObjectStyle): The new style properties. + additional_params (RenderObject | str | None, optional): Additional type-specific parameters. + Defaults to `None`. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + command = create_update_render_object_command( + object_id, style, additional_params + ) + request = self._create_authenticated_request(command) + + self._stub.Send(request) + self._reporter.add_message( + "AgentOS", f"update_render_object({object_id}, {style})" + ) + + def delete_render_object(self, object_id: int) -> None: + """ + Delete a render object by its ID. + + Args: + object_id (int): The ID of the render object to delete. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + command = create_delete_render_object_command(object_id) + request = self._create_authenticated_request(command) + + self._stub.Send(request) + self._reporter.add_message("AgentOS", f"delete_render_object({object_id})") + + def clear_render_objects(self) -> None: + """ + Clear all render objects in the current session. + """ + assert isinstance(self._stub, controller_v1.ControllerAPIStub), ( + "Stub is not initialized" + ) + command = create_clear_render_objects_command() + request = self._create_authenticated_request(command) + + self._stub.Send(request) + self._reporter.add_message("AgentOS", "clear_render_objects()") + + def create_mouse_cursor( + self, + x: int = 0, + y: int = 0, + color: str = "#000000", + opacity: float = 1.0, + line_width: int = 3, + ) -> MouseCursor: + """ + Create a mouse cursor at the specified position. + + Args: + x: Initial horizontal position + y: Initial vertical position + color: Cursor color (hex format) + opacity: Cursor opacity (0.0 to 1.0) + line_width: Line width for cursor outline + + Returns: + MouseCursor: The created cursor instance + """ + if self._cursor is not None: + self._cursor.destroy_cursor() + + self._cursor = MouseCursor( + controller=self, + x=x, + y=y, + color=color, + opacity=opacity, + line_width=line_width, + ) + + self._cursor.create_cursor() + self._reporter.add_message("AgentOS", f"create_mouse_cursor({x}, {y}, {color})") + return self._cursor + + def update_cursor_position(self, x: int, y: int) -> None: + """ + Update the cursor position if a cursor exists. + + Args: + x: New horizontal position + y: New vertical position + """ + if self._cursor is None: + raise RuntimeError("No cursor created. Call create_mouse_cursor() first.") + + self._cursor.update_cursor_position(x, y) + self._reporter.add_message("AgentOS", f"update_cursor_position({x}, {y})") + + def update_cursor_color(self, color: str) -> None: + """ + Update the cursor color if a cursor exists. + + Args: + color: New cursor color (hex format) + """ + if self._cursor is None: + raise RuntimeError("No cursor created. Call create_mouse_cursor() first.") + + self._cursor.update_cursor_color(color) + self._reporter.add_message("AgentOS", f"update_cursor_color({color})") + + def set_cursor_opacity(self, opacity: float) -> None: + """ + Set the cursor opacity if a cursor exists. + + Args: + opacity: New opacity value (0.0 to 1.0) + """ + if self._cursor is None: + raise RuntimeError("No cursor created. Call create_mouse_cursor() first.") + + self._cursor.set_opacity(opacity) + self._reporter.add_message("AgentOS", f"set_cursor_opacity({opacity})") + + def show_cursor(self) -> None: + """Show the cursor if it exists.""" + if self._cursor is None: + raise RuntimeError("No cursor created. Call create_mouse_cursor() first.") + + self._cursor.show_cursor() + self._reporter.add_message("AgentOS", "show_cursor()") + + def hide_cursor(self) -> None: + """Hide the cursor if it exists.""" + if self._cursor is None: + raise RuntimeError("No cursor created. Call create_mouse_cursor() first.") + + self._cursor.hide_cursor() + self._reporter.add_message("AgentOS", "hide_cursor()") + + def destroy_cursor(self) -> None: + """Destroy the cursor and clean up resources.""" + if self._cursor is not None: + self._cursor.destroy_cursor() + self._cursor = None + self._reporter.add_message("AgentOS", "destroy_cursor()") + + def animate_cursor_to( + self, target_x: int, target_y: int, duration_ms: int = 500 + ) -> None: + """ + Smoothly animate cursor to target position. + + Args: + target_x: Target horizontal position + target_y: Target vertical position + duration_ms: Animation duration in milliseconds + """ + if self._cursor is None: + raise RuntimeError("No cursor created. Call create_mouse_cursor() first.") + + self._cursor.animate_to(target_x, target_y, duration_ms) + self._reporter.add_message( + "AgentOS", f"animate_cursor_to({target_x}, {target_y}, {duration_ms})" + ) + + @property + def cursor(self) -> MouseCursor | None: + """Get the current cursor instance.""" + return self._cursor diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.py b/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.py deleted file mode 100644 index e0eb6a50..00000000 --- a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.py +++ /dev/null @@ -1,172 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: Controller_V1.proto -# Protobuf Python Version: 5.26.1 -"""Generated protocol buffer code.""" - -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x13\x43ontroller_V1.proto\x12\x0f\x41skui.API.TDKv1"\x06\n\x04Void"\x0e\n\x0cRequest_Void"\x0f\n\rResponse_Void"&\n\x05Size2\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r"\x1e\n\x06\x44\x65lta2\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"#\n\x0b\x43oordinate2\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"E\n\tRectangle\x12\x0c\n\x04left\x18\x01 \x01(\x05\x12\x0b\n\x03top\x18\x02 \x01(\x05\x12\r\n\x05right\x18\x03 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x04 \x01(\x05"u\n\x06\x42itmap\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\x12\x11\n\tlineWidth\x18\x03 \x01(\r\x12\x14\n\x0c\x62itsPerPixel\x18\x04 \x01(\r\x12\x15\n\rbytesPerPixel\x18\x05 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x06 \x01(\x0c"(\n\x05\x43olor\x12\t\n\x01r\x18\x01 \x01(\r\x12\t\n\x01g\x18\x02 \x01(\r\x12\t\n\x01\x62\x18\x03 \x01(\r")\n\x04GUID\x12\x10\n\x08highPart\x18\x01 \x01(\x04\x12\x0f\n\x07lowPart\x18\x02 \x01(\x04"L\n\x0bSessionInfo\x12*\n\x0bsessionGUID\x18\x01 \x01(\x0b\x32\x15.Askui.API.TDKv1.GUID\x12\x11\n\tsessionID\x18\x02 \x01(\x04"e\n\x0b\x43\x61ptureArea\x12$\n\x04size\x18\x03 \x01(\x0b\x32\x16.Askui.API.TDKv1.Size2\x12\x30\n\ncoordinate\x18\x02 \x01(\x0b\x32\x1c.Askui.API.TDKv1.Coordinate2"\x81\x01\n\x11\x43\x61ptureParameters\x12\x16\n\tdisplayID\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x36\n\x0b\x63\x61ptureArea\x18\x02 \x01(\x0b\x32\x1c.Askui.API.TDKv1.CaptureAreaH\x01\x88\x01\x01\x42\x0c\n\n_displayIDB\x0e\n\x0c_captureArea"6\n"PollEventParameters_ActionFinished\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r"n\n\x13PollEventParameters\x12M\n\x0e\x61\x63tionFinished\x18\x01 \x01(\x0b\x32\x33.Askui.API.TDKv1.PollEventParameters_ActionFinishedH\x00\x42\x08\n\x06\x64\x61taOf"-\n\x15\x41\x63tionParameters_Wait\x12\x14\n\x0cmilliseconds\x18\x01 \x01(\r"W\n"ActionParameters_MouseButton_Press\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton"Y\n$ActionParameters_MouseButton_Release\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton"p\n,ActionParameters_MouseButton_PressAndRelease\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton\x12\r\n\x05\x63ount\x18\x02 \x01(\r"\xc0\x01\n!ActionParameters_MouseWheelScroll\x12=\n\tdirection\x18\x01 \x01(\x0e\x32*.Askui.API.TDKv1.MouseWheelScrollDirection\x12\x37\n\tdeltaType\x18\x02 \x01(\x0e\x32$.Askui.API.TDKv1.MouseWheelDeltaType\x12\r\n\x05\x64\x65lta\x18\x03 \x01(\x05\x12\x14\n\x0cmilliseconds\x18\x04 \x01(\x05"x\n\x1a\x41\x63tionParameters_MouseMove\x12.\n\x08position\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.Coordinate2\x12\x19\n\x0cmilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x0f\n\r_milliseconds"v\n ActionParameters_MouseMove_Delta\x12&\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Delta2\x12\x19\n\x0cmilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x0f\n\r_milliseconds"O\n"ActionParameters_KeyboardKey_Press\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"Q\n$ActionParameters_KeyboardKey_Release\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"Y\n,ActionParameters_KeyboardKey_PressAndRelease\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"Q\n#ActionParameters_KeyboardKeys_Press\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"S\n%ActionParameters_KeyboardKeys_Release\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"[\n-ActionParameters_KeyboardKeys_PressAndRelease\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t"\x99\x01\n"ActionParameters_KeyboardType_Text\x12\x0c\n\x04text\x18\x01 \x01(\t\x12;\n\x10typingSpeedValue\x18\x02 \x01(\x0e\x32!.Askui.API.TDKv1.TypingSpeedValue\x12\x18\n\x0btypingSpeed\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\x0e\n\x0c_typingSpeed"\xa0\x01\n)ActionParameters_KeyboardType_UnicodeText\x12\x0c\n\x04text\x18\x01 \x01(\x0c\x12;\n\x10typingSpeedValue\x18\x02 \x01(\x0e\x32!.Askui.API.TDKv1.TypingSpeedValue\x12\x18\n\x0btypingSpeed\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\x0e\n\x0c_typingSpeed"l\n\x1b\x41\x63tionParameters_RunCommand\x12\x0f\n\x07\x63ommand\x18\x01 \x01(\t\x12"\n\x15timeoutInMilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x18\n\x16_timeoutInMilliseconds"\xf5\n\n\x10\x41\x63tionParameters\x12%\n\x04none\x18\x01 \x01(\x0b\x32\x15.Askui.API.TDKv1.VoidH\x00\x12\x36\n\x04wait\x18\x02 \x01(\x0b\x32&.Askui.API.TDKv1.ActionParameters_WaitH\x00\x12O\n\x10mouseButtonPress\x18\x03 \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_MouseButton_PressH\x00\x12S\n\x12mouseButtonRelease\x18\x04 \x01(\x0b\x32\x35.Askui.API.TDKv1.ActionParameters_MouseButton_ReleaseH\x00\x12\x63\n\x1amouseButtonPressAndRelease\x18\x05 \x01(\x0b\x32=.Askui.API.TDKv1.ActionParameters_MouseButton_PressAndReleaseH\x00\x12N\n\x10mouseWheelScroll\x18\x06 \x01(\x0b\x32\x32.Askui.API.TDKv1.ActionParameters_MouseWheelScrollH\x00\x12@\n\tmouseMove\x18\x07 \x01(\x0b\x32+.Askui.API.TDKv1.ActionParameters_MouseMoveH\x00\x12K\n\x0emouseMoveDelta\x18\x08 \x01(\x0b\x32\x31.Askui.API.TDKv1.ActionParameters_MouseMove_DeltaH\x00\x12O\n\x10keyboardKeyPress\x18\t \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_KeyboardKey_PressH\x00\x12S\n\x12keyboardKeyRelease\x18\n \x01(\x0b\x32\x35.Askui.API.TDKv1.ActionParameters_KeyboardKey_ReleaseH\x00\x12\x63\n\x1akeyboardKeyPressAndRelease\x18\x0b \x01(\x0b\x32=.Askui.API.TDKv1.ActionParameters_KeyboardKey_PressAndReleaseH\x00\x12Q\n\x11keyboardKeysPress\x18\x0c \x01(\x0b\x32\x34.Askui.API.TDKv1.ActionParameters_KeyboardKeys_PressH\x00\x12U\n\x13keyboardKeysRelease\x18\r \x01(\x0b\x32\x36.Askui.API.TDKv1.ActionParameters_KeyboardKeys_ReleaseH\x00\x12\x65\n\x1bkeyboardKeysPressAndRelease\x18\x0e \x01(\x0b\x32>.Askui.API.TDKv1.ActionParameters_KeyboardKeys_PressAndReleaseH\x00\x12O\n\x10keyboardTypeText\x18\x0f \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_KeyboardType_TextH\x00\x12]\n\x17keyboardTypeUnicodeText\x18\x10 \x01(\x0b\x32:.Askui.API.TDKv1.ActionParameters_KeyboardType_UnicodeTextH\x00\x12\x42\n\nruncommand\x18\x11 \x01(\x0b\x32,.Askui.API.TDKv1.ActionParameters_RunCommandH\x00\x42\x08\n\x06\x64\x61taOf"G\n\x14Request_StartSession\x12\x13\n\x0bsessionGUID\x18\x01 \x01(\t\x12\x1a\n\x12immediateExecution\x18\x02 \x01(\x08"J\n\x15Response_StartSession\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"G\n\x12Request_EndSession\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"t\n\x0cRequest_Poll\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x31\n\x0bpollEventID\x18\x02 \x01(\x0e\x32\x1c.Askui.API.TDKv1.PollEventID"K\n\x16Request_StartExecution\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"J\n\x15Request_StopExecution\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"\x85\x01\n\rResponse_Poll\x12\x31\n\x0bpollEventID\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.PollEventID\x12\x41\n\x13pollEventParameters\x18\x02 \x01(\x0b\x32$.Askui.API.TDKv1.PollEventParameters"\xc2\x01\n\x19Request_RunRecordedAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters"L\n\x1aResponse_RunRecordedAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\x12\x1c\n\x14requiredMilliseconds\x18\x02 \x01(\r"\xc6\x01\n\x1dRequest_ScheduleBatchedAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters"2\n\x1eResponse_ScheduleBatchedAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r"K\n\x16Request_GetActionCount\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo".\n\x17Response_GetActionCount\x12\x13\n\x0b\x61\x63tionCount\x18\x01 \x01(\r"[\n\x11Request_GetAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x13\n\x0b\x61\x63tionIndex\x18\x02 \x01(\r"\x9a\x01\n\x12Response_GetAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters"[\n\x14Request_RemoveAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x10\n\x08\x61\x63tionID\x18\x02 \x01(\r"M\n\x18Request_RemoveAllActions\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"J\n\x15Request_StartBatchRun\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"I\n\x14Request_StopBatchRun\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo"\xa4\x01\n\x15Request_CaptureScreen\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x42\n\x11\x63\x61ptureParameters\x18\x02 \x01(\x0b\x32".Askui.API.TDKv1.CaptureParametersH\x00\x88\x01\x01\x42\x14\n\x12_captureParameters"A\n\x16Response_CaptureScreen\x12\'\n\x06\x62itmap\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap"O\n$Response_GetContinuousCapturedScreen\x12\'\n\x06\x62itmap\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap"\xde\x01\n\x1cReuqest_SetTestConfiguration\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x44\n\x18\x64\x65\x66\x61ultCaptureParameters\x18\x02 \x01(\x0b\x32".Askui.API.TDKv1.CaptureParameters\x12 \n\x18mouseDelayInMilliseconds\x18\x03 \x01(\r\x12#\n\x1bkeyboardDelayInMilliseconds\x18\x04 \x01(\r"g\n\x15Request_SetMouseDelay\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x1b\n\x13\x64\x65layInMilliseconds\x18\x02 \x01(\r"j\n\x18Request_SetKeyboardDelay\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x1b\n\x13\x64\x65layInMilliseconds\x18\x02 \x01(\r"\x9f\x01\n\x12\x44isplayInformation\x12\x11\n\tdisplayID\x18\x01 \x01(\r\x12\x0c\n\x04name\x18\x02 \x01(\t\x12,\n\x0csizeInPixels\x18\x03 \x01(\x0b\x32\x16.Askui.API.TDKv1.Size2\x12:\n\x16virtualScreenRectangle\x18\x04 \x01(\x0b\x32\x1a.Askui.API.TDKv1.Rectangle"\x93\x01\n\x1eResponse_GetDisplayInformation\x12\x35\n\x08\x64isplays\x18\x01 \x03(\x0b\x32#.Askui.API.TDKv1.DisplayInformation\x12:\n\x16virtualScreenRectangle\x18\x02 \x01(\x0b\x32\x1a.Askui.API.TDKv1.Rectangle"1\n\x19Response_GetMousePosition\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"-\n\x18Request_SetActiveDisplay\x12\x11\n\tdisplayID\x18\x01 \x01(\r"Q\n\x10Request_GetColor\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\x12\'\n\x06\x62itmap\x18\x03 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap":\n\x11Response_GetColor\x12%\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x16.Askui.API.TDKv1.Color"-\n\x15Request_GetPixelColor\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"?\n\x16Response_GetPixelColor\x12%\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x16.Askui.API.TDKv1.Color"n\n\x17Request_SetDisplayLabel\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x11\n\tdisplayID\x18\x02 \x01(\r\x12\r\n\x05label\x18\x03 \x01(\t*N\n\x0bPollEventID\x12\x19\n\x15PollEventID_Undefined\x10\x00\x12\x1e\n\x1aPollEventID_ActionFinished\x10\x02"\x04\x08\x01\x10\x01*m\n\x0bMouseButton\x12\x19\n\x15MouseButton_Undefined\x10\x00\x12\x14\n\x10MouseButton_Left\x10\x01\x12\x15\n\x11MouseButton_Right\x10\x02\x12\x16\n\x12MouseButton_Middle\x10\x03*\x8b\x05\n\rActionClassID\x12\x1b\n\x17\x41\x63tionClassID_Undefined\x10\x00\x12\x16\n\x12\x41\x63tionClassID_Wait\x10\x01\x12#\n\x1f\x41\x63tionClassID_MouseButton_Press\x10\x08\x12%\n!ActionClassID_MouseButton_Release\x10\t\x12-\n)ActionClassID_MouseButton_PressAndRelease\x10\n\x12"\n\x1e\x41\x63tionClassID_MouseWheelScroll\x10\x0b\x12\x1b\n\x17\x41\x63tionClassID_MouseMove\x10\x0c\x12!\n\x1d\x41\x63tionClassID_MouseMove_Delta\x10\r\x12#\n\x1f\x41\x63tionClassID_KeyboardKey_Press\x10\x0e\x12%\n!ActionClassID_KeyboardKey_Release\x10\x0f\x12-\n)ActionClassID_KeyboardKey_PressAndRelease\x10\x10\x12$\n ActionClassID_KeyboardKeys_Press\x10\x11\x12&\n"ActionClassID_KeyboardKeys_Release\x10\x12\x12.\n*ActionClassID_KeyboardKeys_PressAndRelease\x10\x13\x12#\n\x1f\x41\x63tionClassID_KeyboardType_Text\x10\x14\x12*\n&ActionClassID_KeyboardType_UnicodeText\x10\x15\x12\x1c\n\x18\x41\x63tionClassID_RunCommand\x10\x16*i\n\x13MouseWheelDeltaType\x12\x1d\n\x19MouseWheelDelta_Undefined\x10\x00\x12\x17\n\x13MouseWheelDelta_Raw\x10\x01\x12\x1a\n\x16MouseWheelDelta_Detent\x10\x02*\x96\x01\n\x19MouseWheelScrollDirection\x12\'\n#MouseWheelScrollDirection_Undefined\x10\x00\x12&\n"MouseWheelScrollDirection_Vertical\x10\x01\x12(\n$MouseWheelScrollDirection_Horizontal\x10\x02*z\n\x10TypingSpeedValue\x12\x1e\n\x1aTypingSpeedValue_Undefined\x10\x00\x12(\n$TypingSpeedValue_CharactersPerSecond\x10\x01\x12\x1c\n\x18TypingSpeedValue_Seconds\x10\x02\x32\xad\x11\n\rControllerAPI\x12_\n\x0cStartSession\x12%.Askui.API.TDKv1.Request_StartSession\x1a&.Askui.API.TDKv1.Response_StartSession"\x00\x12S\n\nEndSession\x12#.Askui.API.TDKv1.Request_EndSession\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12G\n\x04Poll\x12\x1d.Askui.API.TDKv1.Request_Poll\x1a\x1e.Askui.API.TDKv1.Response_Poll"\x00\x12[\n\x0eStartExecution\x12\'.Askui.API.TDKv1.Request_StartExecution\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12Y\n\rStopExecution\x12&.Askui.API.TDKv1.Request_StopExecution\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12n\n\x11RunRecordedAction\x12*.Askui.API.TDKv1.Request_RunRecordedAction\x1a+.Askui.API.TDKv1.Response_RunRecordedAction"\x00\x12z\n\x15ScheduleBatchedAction\x12..Askui.API.TDKv1.Request_ScheduleBatchedAction\x1a/.Askui.API.TDKv1.Response_ScheduleBatchedAction"\x00\x12Y\n\rStartBatchRun\x12&.Askui.API.TDKv1.Request_StartBatchRun\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12W\n\x0cStopBatchRun\x12%.Askui.API.TDKv1.Request_StopBatchRun\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12\x65\n\x0eGetActionCount\x12\'.Askui.API.TDKv1.Request_GetActionCount\x1a(.Askui.API.TDKv1.Response_GetActionCount"\x00\x12V\n\tGetAction\x12".Askui.API.TDKv1.Request_GetAction\x1a#.Askui.API.TDKv1.Response_GetAction"\x00\x12W\n\x0cRemoveAction\x12%.Askui.API.TDKv1.Request_RemoveAction\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12_\n\x10RemoveAllActions\x12).Askui.API.TDKv1.Request_RemoveAllActions\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12\x62\n\rCaptureScreen\x12&.Askui.API.TDKv1.Request_CaptureScreen\x1a\'.Askui.API.TDKv1.Response_CaptureScreen"\x00\x12g\n\x14SetTestConfiguration\x12-.Askui.API.TDKv1.Reuqest_SetTestConfiguration\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12Y\n\rSetMouseDelay\x12&.Askui.API.TDKv1.Request_SetMouseDelay\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12_\n\x10SetKeyboardDelay\x12).Askui.API.TDKv1.Request_SetKeyboardDelay\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12i\n\x15GetDisplayInformation\x12\x1d.Askui.API.TDKv1.Request_Void\x1a/.Askui.API.TDKv1.Response_GetDisplayInformation"\x00\x12_\n\x10GetMousePosition\x12\x1d.Askui.API.TDKv1.Request_Void\x1a*.Askui.API.TDKv1.Response_GetMousePosition"\x00\x12_\n\x10SetActiveDisplay\x12).Askui.API.TDKv1.Request_SetActiveDisplay\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x12S\n\x08GetColor\x12!.Askui.API.TDKv1.Request_GetColor\x1a".Askui.API.TDKv1.Response_GetColor"\x00\x12\x62\n\rGetPixelColor\x12&.Askui.API.TDKv1.Request_GetPixelColor\x1a\'.Askui.API.TDKv1.Response_GetPixelColor"\x00\x12]\n\x0fSetDisplayLabel\x12(.Askui.API.TDKv1.Request_SetDisplayLabel\x1a\x1e.Askui.API.TDKv1.Response_Void"\x00\x62\x06proto3' -) - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "Controller_V1_pb2", _globals) -if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals["_POLLEVENTID"]._serialized_start = 7454 - _globals["_POLLEVENTID"]._serialized_end = 7532 - _globals["_MOUSEBUTTON"]._serialized_start = 7534 - _globals["_MOUSEBUTTON"]._serialized_end = 7643 - _globals["_ACTIONCLASSID"]._serialized_start = 7646 - _globals["_ACTIONCLASSID"]._serialized_end = 8297 - _globals["_MOUSEWHEELDELTATYPE"]._serialized_start = 8299 - _globals["_MOUSEWHEELDELTATYPE"]._serialized_end = 8404 - _globals["_MOUSEWHEELSCROLLDIRECTION"]._serialized_start = 8407 - _globals["_MOUSEWHEELSCROLLDIRECTION"]._serialized_end = 8557 - _globals["_TYPINGSPEEDVALUE"]._serialized_start = 8559 - _globals["_TYPINGSPEEDVALUE"]._serialized_end = 8681 - _globals["_VOID"]._serialized_start = 40 - _globals["_VOID"]._serialized_end = 46 - _globals["_REQUEST_VOID"]._serialized_start = 48 - _globals["_REQUEST_VOID"]._serialized_end = 62 - _globals["_RESPONSE_VOID"]._serialized_start = 64 - _globals["_RESPONSE_VOID"]._serialized_end = 79 - _globals["_SIZE2"]._serialized_start = 81 - _globals["_SIZE2"]._serialized_end = 119 - _globals["_DELTA2"]._serialized_start = 121 - _globals["_DELTA2"]._serialized_end = 151 - _globals["_COORDINATE2"]._serialized_start = 153 - _globals["_COORDINATE2"]._serialized_end = 188 - _globals["_RECTANGLE"]._serialized_start = 190 - _globals["_RECTANGLE"]._serialized_end = 259 - _globals["_BITMAP"]._serialized_start = 261 - _globals["_BITMAP"]._serialized_end = 378 - _globals["_COLOR"]._serialized_start = 380 - _globals["_COLOR"]._serialized_end = 420 - _globals["_GUID"]._serialized_start = 422 - _globals["_GUID"]._serialized_end = 463 - _globals["_SESSIONINFO"]._serialized_start = 465 - _globals["_SESSIONINFO"]._serialized_end = 541 - _globals["_CAPTUREAREA"]._serialized_start = 543 - _globals["_CAPTUREAREA"]._serialized_end = 644 - _globals["_CAPTUREPARAMETERS"]._serialized_start = 647 - _globals["_CAPTUREPARAMETERS"]._serialized_end = 776 - _globals["_POLLEVENTPARAMETERS_ACTIONFINISHED"]._serialized_start = 778 - _globals["_POLLEVENTPARAMETERS_ACTIONFINISHED"]._serialized_end = 832 - _globals["_POLLEVENTPARAMETERS"]._serialized_start = 834 - _globals["_POLLEVENTPARAMETERS"]._serialized_end = 944 - _globals["_ACTIONPARAMETERS_WAIT"]._serialized_start = 946 - _globals["_ACTIONPARAMETERS_WAIT"]._serialized_end = 991 - _globals["_ACTIONPARAMETERS_MOUSEBUTTON_PRESS"]._serialized_start = 993 - _globals["_ACTIONPARAMETERS_MOUSEBUTTON_PRESS"]._serialized_end = 1080 - _globals["_ACTIONPARAMETERS_MOUSEBUTTON_RELEASE"]._serialized_start = 1082 - _globals["_ACTIONPARAMETERS_MOUSEBUTTON_RELEASE"]._serialized_end = 1171 - _globals["_ACTIONPARAMETERS_MOUSEBUTTON_PRESSANDRELEASE"]._serialized_start = 1173 - _globals["_ACTIONPARAMETERS_MOUSEBUTTON_PRESSANDRELEASE"]._serialized_end = 1285 - _globals["_ACTIONPARAMETERS_MOUSEWHEELSCROLL"]._serialized_start = 1288 - _globals["_ACTIONPARAMETERS_MOUSEWHEELSCROLL"]._serialized_end = 1480 - _globals["_ACTIONPARAMETERS_MOUSEMOVE"]._serialized_start = 1482 - _globals["_ACTIONPARAMETERS_MOUSEMOVE"]._serialized_end = 1602 - _globals["_ACTIONPARAMETERS_MOUSEMOVE_DELTA"]._serialized_start = 1604 - _globals["_ACTIONPARAMETERS_MOUSEMOVE_DELTA"]._serialized_end = 1722 - _globals["_ACTIONPARAMETERS_KEYBOARDKEY_PRESS"]._serialized_start = 1724 - _globals["_ACTIONPARAMETERS_KEYBOARDKEY_PRESS"]._serialized_end = 1803 - _globals["_ACTIONPARAMETERS_KEYBOARDKEY_RELEASE"]._serialized_start = 1805 - _globals["_ACTIONPARAMETERS_KEYBOARDKEY_RELEASE"]._serialized_end = 1886 - _globals["_ACTIONPARAMETERS_KEYBOARDKEY_PRESSANDRELEASE"]._serialized_start = 1888 - _globals["_ACTIONPARAMETERS_KEYBOARDKEY_PRESSANDRELEASE"]._serialized_end = 1977 - _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_PRESS"]._serialized_start = 1979 - _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_PRESS"]._serialized_end = 2060 - _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_RELEASE"]._serialized_start = 2062 - _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_RELEASE"]._serialized_end = 2145 - _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_PRESSANDRELEASE"]._serialized_start = 2147 - _globals["_ACTIONPARAMETERS_KEYBOARDKEYS_PRESSANDRELEASE"]._serialized_end = 2238 - _globals["_ACTIONPARAMETERS_KEYBOARDTYPE_TEXT"]._serialized_start = 2241 - _globals["_ACTIONPARAMETERS_KEYBOARDTYPE_TEXT"]._serialized_end = 2394 - _globals["_ACTIONPARAMETERS_KEYBOARDTYPE_UNICODETEXT"]._serialized_start = 2397 - _globals["_ACTIONPARAMETERS_KEYBOARDTYPE_UNICODETEXT"]._serialized_end = 2557 - _globals["_ACTIONPARAMETERS_RUNCOMMAND"]._serialized_start = 2559 - _globals["_ACTIONPARAMETERS_RUNCOMMAND"]._serialized_end = 2667 - _globals["_ACTIONPARAMETERS"]._serialized_start = 2670 - _globals["_ACTIONPARAMETERS"]._serialized_end = 4067 - _globals["_REQUEST_STARTSESSION"]._serialized_start = 4069 - _globals["_REQUEST_STARTSESSION"]._serialized_end = 4140 - _globals["_RESPONSE_STARTSESSION"]._serialized_start = 4142 - _globals["_RESPONSE_STARTSESSION"]._serialized_end = 4216 - _globals["_REQUEST_ENDSESSION"]._serialized_start = 4218 - _globals["_REQUEST_ENDSESSION"]._serialized_end = 4289 - _globals["_REQUEST_POLL"]._serialized_start = 4291 - _globals["_REQUEST_POLL"]._serialized_end = 4407 - _globals["_REQUEST_STARTEXECUTION"]._serialized_start = 4409 - _globals["_REQUEST_STARTEXECUTION"]._serialized_end = 4484 - _globals["_REQUEST_STOPEXECUTION"]._serialized_start = 4486 - _globals["_REQUEST_STOPEXECUTION"]._serialized_end = 4560 - _globals["_RESPONSE_POLL"]._serialized_start = 4563 - _globals["_RESPONSE_POLL"]._serialized_end = 4696 - _globals["_REQUEST_RUNRECORDEDACTION"]._serialized_start = 4699 - _globals["_REQUEST_RUNRECORDEDACTION"]._serialized_end = 4893 - _globals["_RESPONSE_RUNRECORDEDACTION"]._serialized_start = 4895 - _globals["_RESPONSE_RUNRECORDEDACTION"]._serialized_end = 4971 - _globals["_REQUEST_SCHEDULEBATCHEDACTION"]._serialized_start = 4974 - _globals["_REQUEST_SCHEDULEBATCHEDACTION"]._serialized_end = 5172 - _globals["_RESPONSE_SCHEDULEBATCHEDACTION"]._serialized_start = 5174 - _globals["_RESPONSE_SCHEDULEBATCHEDACTION"]._serialized_end = 5224 - _globals["_REQUEST_GETACTIONCOUNT"]._serialized_start = 5226 - _globals["_REQUEST_GETACTIONCOUNT"]._serialized_end = 5301 - _globals["_RESPONSE_GETACTIONCOUNT"]._serialized_start = 5303 - _globals["_RESPONSE_GETACTIONCOUNT"]._serialized_end = 5349 - _globals["_REQUEST_GETACTION"]._serialized_start = 5351 - _globals["_REQUEST_GETACTION"]._serialized_end = 5442 - _globals["_RESPONSE_GETACTION"]._serialized_start = 5445 - _globals["_RESPONSE_GETACTION"]._serialized_end = 5599 - _globals["_REQUEST_REMOVEACTION"]._serialized_start = 5601 - _globals["_REQUEST_REMOVEACTION"]._serialized_end = 5692 - _globals["_REQUEST_REMOVEALLACTIONS"]._serialized_start = 5694 - _globals["_REQUEST_REMOVEALLACTIONS"]._serialized_end = 5771 - _globals["_REQUEST_STARTBATCHRUN"]._serialized_start = 5773 - _globals["_REQUEST_STARTBATCHRUN"]._serialized_end = 5847 - _globals["_REQUEST_STOPBATCHRUN"]._serialized_start = 5849 - _globals["_REQUEST_STOPBATCHRUN"]._serialized_end = 5922 - _globals["_REQUEST_CAPTURESCREEN"]._serialized_start = 5925 - _globals["_REQUEST_CAPTURESCREEN"]._serialized_end = 6089 - _globals["_RESPONSE_CAPTURESCREEN"]._serialized_start = 6091 - _globals["_RESPONSE_CAPTURESCREEN"]._serialized_end = 6156 - _globals["_RESPONSE_GETCONTINUOUSCAPTUREDSCREEN"]._serialized_start = 6158 - _globals["_RESPONSE_GETCONTINUOUSCAPTUREDSCREEN"]._serialized_end = 6237 - _globals["_REUQEST_SETTESTCONFIGURATION"]._serialized_start = 6240 - _globals["_REUQEST_SETTESTCONFIGURATION"]._serialized_end = 6462 - _globals["_REQUEST_SETMOUSEDELAY"]._serialized_start = 6464 - _globals["_REQUEST_SETMOUSEDELAY"]._serialized_end = 6567 - _globals["_REQUEST_SETKEYBOARDDELAY"]._serialized_start = 6569 - _globals["_REQUEST_SETKEYBOARDDELAY"]._serialized_end = 6675 - _globals["_DISPLAYINFORMATION"]._serialized_start = 6678 - _globals["_DISPLAYINFORMATION"]._serialized_end = 6837 - _globals["_RESPONSE_GETDISPLAYINFORMATION"]._serialized_start = 6840 - _globals["_RESPONSE_GETDISPLAYINFORMATION"]._serialized_end = 6987 - _globals["_RESPONSE_GETMOUSEPOSITION"]._serialized_start = 6989 - _globals["_RESPONSE_GETMOUSEPOSITION"]._serialized_end = 7038 - _globals["_REQUEST_SETACTIVEDISPLAY"]._serialized_start = 7040 - _globals["_REQUEST_SETACTIVEDISPLAY"]._serialized_end = 7085 - _globals["_REQUEST_GETCOLOR"]._serialized_start = 7087 - _globals["_REQUEST_GETCOLOR"]._serialized_end = 7168 - _globals["_RESPONSE_GETCOLOR"]._serialized_start = 7170 - _globals["_RESPONSE_GETCOLOR"]._serialized_end = 7228 - _globals["_REQUEST_GETPIXELCOLOR"]._serialized_start = 7230 - _globals["_REQUEST_GETPIXELCOLOR"]._serialized_end = 7275 - _globals["_RESPONSE_GETPIXELCOLOR"]._serialized_start = 7277 - _globals["_RESPONSE_GETPIXELCOLOR"]._serialized_end = 7340 - _globals["_REQUEST_SETDISPLAYLABEL"]._serialized_start = 7342 - _globals["_REQUEST_SETDISPLAYLABEL"]._serialized_end = 7452 - _globals["_CONTROLLERAPI"]._serialized_start = 8684 - _globals["_CONTROLLERAPI"]._serialized_end = 10905 -# @@protoc_insertion_point(module_scope) diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2_grpc.py b/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2_grpc.py deleted file mode 100644 index ecac6ac1..00000000 --- a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2_grpc.py +++ /dev/null @@ -1,1148 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" - -import warnings - -import grpc - -import askui.tools.askui.askui_ui_controller_grpc.Controller_V1_pb2 as Controller__V1__pb2 - -GRPC_GENERATED_VERSION = "1.64.1" -GRPC_VERSION = grpc.__version__ -EXPECTED_ERROR_RELEASE = "1.65.0" -SCHEDULED_RELEASE_DATE = "June 25, 2024" -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - - _version_not_supported = first_version_is_lower( - GRPC_VERSION, GRPC_GENERATED_VERSION - ) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - warnings.warn( - f"The grpc package installed is at version {GRPC_VERSION}," - + " but the generated code in Controller_V1_pb2_grpc.py depends on" - + f" grpcio>={GRPC_GENERATED_VERSION}." - + f" Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}" - + f" or downgrade your generated code using grpcio-tools<={GRPC_VERSION}." - + f" This warning will become an error in {EXPECTED_ERROR_RELEASE}," - + f" scheduled for release on {SCHEDULED_RELEASE_DATE}.", - RuntimeWarning, - ) - - -class ControllerAPIStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.StartSession = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/StartSession", - request_serializer=Controller__V1__pb2.Request_StartSession.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_StartSession.FromString, - _registered_method=True, - ) - self.EndSession = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/EndSession", - request_serializer=Controller__V1__pb2.Request_EndSession.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.Poll = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/Poll", - request_serializer=Controller__V1__pb2.Request_Poll.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Poll.FromString, - _registered_method=True, - ) - self.StartExecution = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/StartExecution", - request_serializer=Controller__V1__pb2.Request_StartExecution.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.StopExecution = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/StopExecution", - request_serializer=Controller__V1__pb2.Request_StopExecution.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.RunRecordedAction = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/RunRecordedAction", - request_serializer=Controller__V1__pb2.Request_RunRecordedAction.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_RunRecordedAction.FromString, - _registered_method=True, - ) - self.ScheduleBatchedAction = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/ScheduleBatchedAction", - request_serializer=Controller__V1__pb2.Request_ScheduleBatchedAction.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_ScheduleBatchedAction.FromString, - _registered_method=True, - ) - self.StartBatchRun = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/StartBatchRun", - request_serializer=Controller__V1__pb2.Request_StartBatchRun.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.StopBatchRun = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/StopBatchRun", - request_serializer=Controller__V1__pb2.Request_StopBatchRun.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.GetActionCount = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/GetActionCount", - request_serializer=Controller__V1__pb2.Request_GetActionCount.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_GetActionCount.FromString, - _registered_method=True, - ) - self.GetAction = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/GetAction", - request_serializer=Controller__V1__pb2.Request_GetAction.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_GetAction.FromString, - _registered_method=True, - ) - self.RemoveAction = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/RemoveAction", - request_serializer=Controller__V1__pb2.Request_RemoveAction.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.RemoveAllActions = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/RemoveAllActions", - request_serializer=Controller__V1__pb2.Request_RemoveAllActions.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.CaptureScreen = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/CaptureScreen", - request_serializer=Controller__V1__pb2.Request_CaptureScreen.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_CaptureScreen.FromString, - _registered_method=True, - ) - self.SetTestConfiguration = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/SetTestConfiguration", - request_serializer=Controller__V1__pb2.Reuqest_SetTestConfiguration.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.SetMouseDelay = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/SetMouseDelay", - request_serializer=Controller__V1__pb2.Request_SetMouseDelay.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.SetKeyboardDelay = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/SetKeyboardDelay", - request_serializer=Controller__V1__pb2.Request_SetKeyboardDelay.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.GetDisplayInformation = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/GetDisplayInformation", - request_serializer=Controller__V1__pb2.Request_Void.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_GetDisplayInformation.FromString, - _registered_method=True, - ) - self.GetMousePosition = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/GetMousePosition", - request_serializer=Controller__V1__pb2.Request_Void.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_GetMousePosition.FromString, - _registered_method=True, - ) - self.SetActiveDisplay = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/SetActiveDisplay", - request_serializer=Controller__V1__pb2.Request_SetActiveDisplay.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - self.GetColor = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/GetColor", - request_serializer=Controller__V1__pb2.Request_GetColor.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_GetColor.FromString, - _registered_method=True, - ) - self.GetPixelColor = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/GetPixelColor", - request_serializer=Controller__V1__pb2.Request_GetPixelColor.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_GetPixelColor.FromString, - _registered_method=True, - ) - self.SetDisplayLabel = channel.unary_unary( - "/Askui.API.TDKv1.ControllerAPI/SetDisplayLabel", - request_serializer=Controller__V1__pb2.Request_SetDisplayLabel.SerializeToString, - response_deserializer=Controller__V1__pb2.Response_Void.FromString, - _registered_method=True, - ) - - -class ControllerAPIServicer(object): - """Missing associated documentation comment in .proto file.""" - - def StartSession(self, request, context): - """General""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def EndSession(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def Poll(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StartExecution(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StopExecution(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RunRecordedAction(self, request, context): - """Run action and record it""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ScheduleBatchedAction(self, request, context): - """Schedule an action""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StartBatchRun(self, request, context): - """Start and stop batched execution""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StopBatchRun(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetActionCount(self, request, context): - """Recorded or batched actions access""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetAction(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RemoveAction(self, request, context): - """Modify acvtions batch""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RemoveAllActions(self, request, context): - """Clear all batched or recorded actions""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CaptureScreen(self, request, context): - """Capturing""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetTestConfiguration(self, request, context): - """Configuration""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetMouseDelay(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetKeyboardDelay(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetDisplayInformation(self, request, context): - """Device Information""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetMousePosition(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetActiveDisplay(self, request, context): - """Device Configuration""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetColor(self, request, context): - """Deprecated Utilities""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetPixelColor(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SetDisplayLabel(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ControllerAPIServicer_to_server(servicer, server): - rpc_method_handlers = { - "StartSession": grpc.unary_unary_rpc_method_handler( - servicer.StartSession, - request_deserializer=Controller__V1__pb2.Request_StartSession.FromString, - response_serializer=Controller__V1__pb2.Response_StartSession.SerializeToString, - ), - "EndSession": grpc.unary_unary_rpc_method_handler( - servicer.EndSession, - request_deserializer=Controller__V1__pb2.Request_EndSession.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "Poll": grpc.unary_unary_rpc_method_handler( - servicer.Poll, - request_deserializer=Controller__V1__pb2.Request_Poll.FromString, - response_serializer=Controller__V1__pb2.Response_Poll.SerializeToString, - ), - "StartExecution": grpc.unary_unary_rpc_method_handler( - servicer.StartExecution, - request_deserializer=Controller__V1__pb2.Request_StartExecution.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "StopExecution": grpc.unary_unary_rpc_method_handler( - servicer.StopExecution, - request_deserializer=Controller__V1__pb2.Request_StopExecution.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "RunRecordedAction": grpc.unary_unary_rpc_method_handler( - servicer.RunRecordedAction, - request_deserializer=Controller__V1__pb2.Request_RunRecordedAction.FromString, - response_serializer=Controller__V1__pb2.Response_RunRecordedAction.SerializeToString, - ), - "ScheduleBatchedAction": grpc.unary_unary_rpc_method_handler( - servicer.ScheduleBatchedAction, - request_deserializer=Controller__V1__pb2.Request_ScheduleBatchedAction.FromString, - response_serializer=Controller__V1__pb2.Response_ScheduleBatchedAction.SerializeToString, - ), - "StartBatchRun": grpc.unary_unary_rpc_method_handler( - servicer.StartBatchRun, - request_deserializer=Controller__V1__pb2.Request_StartBatchRun.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "StopBatchRun": grpc.unary_unary_rpc_method_handler( - servicer.StopBatchRun, - request_deserializer=Controller__V1__pb2.Request_StopBatchRun.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "GetActionCount": grpc.unary_unary_rpc_method_handler( - servicer.GetActionCount, - request_deserializer=Controller__V1__pb2.Request_GetActionCount.FromString, - response_serializer=Controller__V1__pb2.Response_GetActionCount.SerializeToString, - ), - "GetAction": grpc.unary_unary_rpc_method_handler( - servicer.GetAction, - request_deserializer=Controller__V1__pb2.Request_GetAction.FromString, - response_serializer=Controller__V1__pb2.Response_GetAction.SerializeToString, - ), - "RemoveAction": grpc.unary_unary_rpc_method_handler( - servicer.RemoveAction, - request_deserializer=Controller__V1__pb2.Request_RemoveAction.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "RemoveAllActions": grpc.unary_unary_rpc_method_handler( - servicer.RemoveAllActions, - request_deserializer=Controller__V1__pb2.Request_RemoveAllActions.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "CaptureScreen": grpc.unary_unary_rpc_method_handler( - servicer.CaptureScreen, - request_deserializer=Controller__V1__pb2.Request_CaptureScreen.FromString, - response_serializer=Controller__V1__pb2.Response_CaptureScreen.SerializeToString, - ), - "SetTestConfiguration": grpc.unary_unary_rpc_method_handler( - servicer.SetTestConfiguration, - request_deserializer=Controller__V1__pb2.Reuqest_SetTestConfiguration.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "SetMouseDelay": grpc.unary_unary_rpc_method_handler( - servicer.SetMouseDelay, - request_deserializer=Controller__V1__pb2.Request_SetMouseDelay.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "SetKeyboardDelay": grpc.unary_unary_rpc_method_handler( - servicer.SetKeyboardDelay, - request_deserializer=Controller__V1__pb2.Request_SetKeyboardDelay.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "GetDisplayInformation": grpc.unary_unary_rpc_method_handler( - servicer.GetDisplayInformation, - request_deserializer=Controller__V1__pb2.Request_Void.FromString, - response_serializer=Controller__V1__pb2.Response_GetDisplayInformation.SerializeToString, - ), - "GetMousePosition": grpc.unary_unary_rpc_method_handler( - servicer.GetMousePosition, - request_deserializer=Controller__V1__pb2.Request_Void.FromString, - response_serializer=Controller__V1__pb2.Response_GetMousePosition.SerializeToString, - ), - "SetActiveDisplay": grpc.unary_unary_rpc_method_handler( - servicer.SetActiveDisplay, - request_deserializer=Controller__V1__pb2.Request_SetActiveDisplay.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - "GetColor": grpc.unary_unary_rpc_method_handler( - servicer.GetColor, - request_deserializer=Controller__V1__pb2.Request_GetColor.FromString, - response_serializer=Controller__V1__pb2.Response_GetColor.SerializeToString, - ), - "GetPixelColor": grpc.unary_unary_rpc_method_handler( - servicer.GetPixelColor, - request_deserializer=Controller__V1__pb2.Request_GetPixelColor.FromString, - response_serializer=Controller__V1__pb2.Response_GetPixelColor.SerializeToString, - ), - "SetDisplayLabel": grpc.unary_unary_rpc_method_handler( - servicer.SetDisplayLabel, - request_deserializer=Controller__V1__pb2.Request_SetDisplayLabel.FromString, - response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "Askui.API.TDKv1.ControllerAPI", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers( - "Askui.API.TDKv1.ControllerAPI", rpc_method_handlers - ) - - -# This class is part of an EXPERIMENTAL API. -class ControllerAPI(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def StartSession( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/StartSession", - Controller__V1__pb2.Request_StartSession.SerializeToString, - Controller__V1__pb2.Response_StartSession.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def EndSession( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/EndSession", - Controller__V1__pb2.Request_EndSession.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def Poll( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/Poll", - Controller__V1__pb2.Request_Poll.SerializeToString, - Controller__V1__pb2.Response_Poll.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def StartExecution( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/StartExecution", - Controller__V1__pb2.Request_StartExecution.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def StopExecution( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/StopExecution", - Controller__V1__pb2.Request_StopExecution.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def RunRecordedAction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/RunRecordedAction", - Controller__V1__pb2.Request_RunRecordedAction.SerializeToString, - Controller__V1__pb2.Response_RunRecordedAction.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def ScheduleBatchedAction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/ScheduleBatchedAction", - Controller__V1__pb2.Request_ScheduleBatchedAction.SerializeToString, - Controller__V1__pb2.Response_ScheduleBatchedAction.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def StartBatchRun( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/StartBatchRun", - Controller__V1__pb2.Request_StartBatchRun.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def StopBatchRun( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/StopBatchRun", - Controller__V1__pb2.Request_StopBatchRun.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def GetActionCount( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/GetActionCount", - Controller__V1__pb2.Request_GetActionCount.SerializeToString, - Controller__V1__pb2.Response_GetActionCount.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def GetAction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/GetAction", - Controller__V1__pb2.Request_GetAction.SerializeToString, - Controller__V1__pb2.Response_GetAction.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def RemoveAction( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/RemoveAction", - Controller__V1__pb2.Request_RemoveAction.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def RemoveAllActions( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/RemoveAllActions", - Controller__V1__pb2.Request_RemoveAllActions.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def CaptureScreen( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/CaptureScreen", - Controller__V1__pb2.Request_CaptureScreen.SerializeToString, - Controller__V1__pb2.Response_CaptureScreen.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def SetTestConfiguration( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/SetTestConfiguration", - Controller__V1__pb2.Reuqest_SetTestConfiguration.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def SetMouseDelay( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/SetMouseDelay", - Controller__V1__pb2.Request_SetMouseDelay.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def SetKeyboardDelay( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/SetKeyboardDelay", - Controller__V1__pb2.Request_SetKeyboardDelay.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def GetDisplayInformation( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/GetDisplayInformation", - Controller__V1__pb2.Request_Void.SerializeToString, - Controller__V1__pb2.Response_GetDisplayInformation.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def GetMousePosition( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/GetMousePosition", - Controller__V1__pb2.Request_Void.SerializeToString, - Controller__V1__pb2.Response_GetMousePosition.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def SetActiveDisplay( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/SetActiveDisplay", - Controller__V1__pb2.Request_SetActiveDisplay.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def GetColor( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/GetColor", - Controller__V1__pb2.Request_GetColor.SerializeToString, - Controller__V1__pb2.Response_GetColor.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def GetPixelColor( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/GetPixelColor", - Controller__V1__pb2.Request_GetPixelColor.SerializeToString, - Controller__V1__pb2.Response_GetPixelColor.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) - - @staticmethod - def SetDisplayLabel( - request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None, - ): - return grpc.experimental.unary_unary( - request, - target, - "/Askui.API.TDKv1.ControllerAPI/SetDisplayLabel", - Controller__V1__pb2.Request_SetDisplayLabel.SerializeToString, - Controller__V1__pb2.Response_Void.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True, - ) diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/__init__.py b/src/askui/tools/askui/askui_ui_controller_grpc/__init__.py index e69de29b..b97799cb 100644 --- a/src/askui/tools/askui/askui_ui_controller_grpc/__init__.py +++ b/src/askui/tools/askui/askui_ui_controller_grpc/__init__.py @@ -0,0 +1,9 @@ +from askui.tools.askui.askui_ui_controller_grpc.generated import ( + Controller_V1_pb2, + Controller_V1_pb2_grpc, +) + +__all__ = [ + "Controller_V1_pb2", + "Controller_V1_pb2_grpc", +] diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/generated/Controller_V1_pb2.py b/src/askui/tools/askui/askui_ui_controller_grpc/generated/Controller_V1_pb2.py new file mode 100644 index 00000000..ec91bee0 --- /dev/null +++ b/src/askui/tools/askui/askui_ui_controller_grpc/generated/Controller_V1_pb2.py @@ -0,0 +1,208 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: Controller_V1.proto +# Protobuf Python Version: 5.29.0 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 29, + 0, + '', + 'Controller_V1.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x43ontroller_V1.proto\x12\x0f\x41skui.API.TDKv1\"\x06\n\x04Void\"\x0e\n\x0cRequest_Void\"\x0f\n\rResponse_Void\"&\n\x05Size2\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\"\x1e\n\x06\x44\x65lta2\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"#\n\x0b\x43oordinate2\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"E\n\tRectangle\x12\x0c\n\x04left\x18\x01 \x01(\x05\x12\x0b\n\x03top\x18\x02 \x01(\x05\x12\r\n\x05right\x18\x03 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x04 \x01(\x05\"u\n\x06\x42itmap\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\x12\x11\n\tlineWidth\x18\x03 \x01(\r\x12\x14\n\x0c\x62itsPerPixel\x18\x04 \x01(\r\x12\x15\n\rbytesPerPixel\x18\x05 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x06 \x01(\x0c\"(\n\x05\x43olor\x12\t\n\x01r\x18\x01 \x01(\r\x12\t\n\x01g\x18\x02 \x01(\r\x12\t\n\x01\x62\x18\x03 \x01(\r\")\n\x04GUID\x12\x10\n\x08highPart\x18\x01 \x01(\x04\x12\x0f\n\x07lowPart\x18\x02 \x01(\x04\"L\n\x0bSessionInfo\x12*\n\x0bsessionGUID\x18\x01 \x01(\x0b\x32\x15.Askui.API.TDKv1.GUID\x12\x11\n\tsessionID\x18\x02 \x01(\x04\"e\n\x0b\x43\x61ptureArea\x12$\n\x04size\x18\x03 \x01(\x0b\x32\x16.Askui.API.TDKv1.Size2\x12\x30\n\ncoordinate\x18\x02 \x01(\x0b\x32\x1c.Askui.API.TDKv1.Coordinate2\"\x81\x01\n\x11\x43\x61ptureParameters\x12\x16\n\tdisplayID\x18\x01 \x01(\rH\x00\x88\x01\x01\x12\x36\n\x0b\x63\x61ptureArea\x18\x02 \x01(\x0b\x32\x1c.Askui.API.TDKv1.CaptureAreaH\x01\x88\x01\x01\x42\x0c\n\n_displayIDB\x0e\n\x0c_captureArea\"6\n\"PollEventParameters_ActionFinished\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\"n\n\x13PollEventParameters\x12M\n\x0e\x61\x63tionFinished\x18\x01 \x01(\x0b\x32\x33.Askui.API.TDKv1.PollEventParameters_ActionFinishedH\x00\x42\x08\n\x06\x64\x61taOf\"-\n\x15\x41\x63tionParameters_Wait\x12\x14\n\x0cmilliseconds\x18\x01 \x01(\r\"W\n\"ActionParameters_MouseButton_Press\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton\"Y\n$ActionParameters_MouseButton_Release\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton\"p\n,ActionParameters_MouseButton_PressAndRelease\x12\x31\n\x0bmouseButton\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.MouseButton\x12\r\n\x05\x63ount\x18\x02 \x01(\r\"\xc0\x01\n!ActionParameters_MouseWheelScroll\x12=\n\tdirection\x18\x01 \x01(\x0e\x32*.Askui.API.TDKv1.MouseWheelScrollDirection\x12\x37\n\tdeltaType\x18\x02 \x01(\x0e\x32$.Askui.API.TDKv1.MouseWheelDeltaType\x12\r\n\x05\x64\x65lta\x18\x03 \x01(\x05\x12\x14\n\x0cmilliseconds\x18\x04 \x01(\x05\"x\n\x1a\x41\x63tionParameters_MouseMove\x12.\n\x08position\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.Coordinate2\x12\x19\n\x0cmilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x0f\n\r_milliseconds\"v\n ActionParameters_MouseMove_Delta\x12&\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Delta2\x12\x19\n\x0cmilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x0f\n\r_milliseconds\"O\n\"ActionParameters_KeyboardKey_Press\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"Q\n$ActionParameters_KeyboardKey_Release\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"Y\n,ActionParameters_KeyboardKey_PressAndRelease\x12\x0f\n\x07keyName\x18\x01 \x01(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"Q\n#ActionParameters_KeyboardKeys_Press\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"S\n%ActionParameters_KeyboardKeys_Release\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"[\n-ActionParameters_KeyboardKeys_PressAndRelease\x12\x10\n\x08keyNames\x18\x01 \x03(\t\x12\x18\n\x10modifierKeyNames\x18\x02 \x03(\t\"\x99\x01\n\"ActionParameters_KeyboardType_Text\x12\x0c\n\x04text\x18\x01 \x01(\t\x12;\n\x10typingSpeedValue\x18\x02 \x01(\x0e\x32!.Askui.API.TDKv1.TypingSpeedValue\x12\x18\n\x0btypingSpeed\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\x0e\n\x0c_typingSpeed\"\xa0\x01\n)ActionParameters_KeyboardType_UnicodeText\x12\x0c\n\x04text\x18\x01 \x01(\x0c\x12;\n\x10typingSpeedValue\x18\x02 \x01(\x0e\x32!.Askui.API.TDKv1.TypingSpeedValue\x12\x18\n\x0btypingSpeed\x18\x03 \x01(\rH\x00\x88\x01\x01\x42\x0e\n\x0c_typingSpeed\"l\n\x1b\x41\x63tionParameters_RunCommand\x12\x0f\n\x07\x63ommand\x18\x01 \x01(\t\x12\"\n\x15timeoutInMilliseconds\x18\x02 \x01(\rH\x00\x88\x01\x01\x42\x18\n\x16_timeoutInMilliseconds\"\xf5\n\n\x10\x41\x63tionParameters\x12%\n\x04none\x18\x01 \x01(\x0b\x32\x15.Askui.API.TDKv1.VoidH\x00\x12\x36\n\x04wait\x18\x02 \x01(\x0b\x32&.Askui.API.TDKv1.ActionParameters_WaitH\x00\x12O\n\x10mouseButtonPress\x18\x03 \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_MouseButton_PressH\x00\x12S\n\x12mouseButtonRelease\x18\x04 \x01(\x0b\x32\x35.Askui.API.TDKv1.ActionParameters_MouseButton_ReleaseH\x00\x12\x63\n\x1amouseButtonPressAndRelease\x18\x05 \x01(\x0b\x32=.Askui.API.TDKv1.ActionParameters_MouseButton_PressAndReleaseH\x00\x12N\n\x10mouseWheelScroll\x18\x06 \x01(\x0b\x32\x32.Askui.API.TDKv1.ActionParameters_MouseWheelScrollH\x00\x12@\n\tmouseMove\x18\x07 \x01(\x0b\x32+.Askui.API.TDKv1.ActionParameters_MouseMoveH\x00\x12K\n\x0emouseMoveDelta\x18\x08 \x01(\x0b\x32\x31.Askui.API.TDKv1.ActionParameters_MouseMove_DeltaH\x00\x12O\n\x10keyboardKeyPress\x18\t \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_KeyboardKey_PressH\x00\x12S\n\x12keyboardKeyRelease\x18\n \x01(\x0b\x32\x35.Askui.API.TDKv1.ActionParameters_KeyboardKey_ReleaseH\x00\x12\x63\n\x1akeyboardKeyPressAndRelease\x18\x0b \x01(\x0b\x32=.Askui.API.TDKv1.ActionParameters_KeyboardKey_PressAndReleaseH\x00\x12Q\n\x11keyboardKeysPress\x18\x0c \x01(\x0b\x32\x34.Askui.API.TDKv1.ActionParameters_KeyboardKeys_PressH\x00\x12U\n\x13keyboardKeysRelease\x18\r \x01(\x0b\x32\x36.Askui.API.TDKv1.ActionParameters_KeyboardKeys_ReleaseH\x00\x12\x65\n\x1bkeyboardKeysPressAndRelease\x18\x0e \x01(\x0b\x32>.Askui.API.TDKv1.ActionParameters_KeyboardKeys_PressAndReleaseH\x00\x12O\n\x10keyboardTypeText\x18\x0f \x01(\x0b\x32\x33.Askui.API.TDKv1.ActionParameters_KeyboardType_TextH\x00\x12]\n\x17keyboardTypeUnicodeText\x18\x10 \x01(\x0b\x32:.Askui.API.TDKv1.ActionParameters_KeyboardType_UnicodeTextH\x00\x12\x42\n\nruncommand\x18\x11 \x01(\x0b\x32,.Askui.API.TDKv1.ActionParameters_RunCommandH\x00\x42\x08\n\x06\x64\x61taOf\"G\n\x14Request_StartSession\x12\x13\n\x0bsessionGUID\x18\x01 \x01(\t\x12\x1a\n\x12immediateExecution\x18\x02 \x01(\x08\"J\n\x15Response_StartSession\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"G\n\x12Request_EndSession\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"\x1f\n\x0cRequest_Send\x12\x0f\n\x07message\x18\x01 \x01(\t\"t\n\x0cRequest_Poll\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x31\n\x0bpollEventID\x18\x02 \x01(\x0e\x32\x1c.Askui.API.TDKv1.PollEventID\"K\n\x16Request_StartExecution\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"J\n\x15Request_StopExecution\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\" \n\rResponse_Send\x12\x0f\n\x07message\x18\x01 \x01(\t\"\x85\x01\n\rResponse_Poll\x12\x31\n\x0bpollEventID\x18\x01 \x01(\x0e\x32\x1c.Askui.API.TDKv1.PollEventID\x12\x41\n\x13pollEventParameters\x18\x02 \x01(\x0b\x32$.Askui.API.TDKv1.PollEventParameters\"\xc2\x01\n\x19Request_RunRecordedAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters\"L\n\x1aResponse_RunRecordedAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\x12\x1c\n\x14requiredMilliseconds\x18\x02 \x01(\r\"\xc6\x01\n\x1dRequest_ScheduleBatchedAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters\"2\n\x1eResponse_ScheduleBatchedAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\"K\n\x16Request_GetActionCount\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\".\n\x17Response_GetActionCount\x12\x13\n\x0b\x61\x63tionCount\x18\x01 \x01(\r\"[\n\x11Request_GetAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x13\n\x0b\x61\x63tionIndex\x18\x02 \x01(\r\"\x9a\x01\n\x12Response_GetAction\x12\x10\n\x08\x61\x63tionID\x18\x01 \x01(\r\x12\x35\n\ractionClassID\x18\x02 \x01(\x0e\x32\x1e.Askui.API.TDKv1.ActionClassID\x12;\n\x10\x61\x63tionParameters\x18\x03 \x01(\x0b\x32!.Askui.API.TDKv1.ActionParameters\"[\n\x14Request_RemoveAction\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x10\n\x08\x61\x63tionID\x18\x02 \x01(\r\"M\n\x18Request_RemoveAllActions\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"J\n\x15Request_StartBatchRun\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"I\n\x14Request_StopBatchRun\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\"\xa4\x01\n\x15Request_CaptureScreen\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x42\n\x11\x63\x61ptureParameters\x18\x02 \x01(\x0b\x32\".Askui.API.TDKv1.CaptureParametersH\x00\x88\x01\x01\x42\x14\n\x12_captureParameters\"A\n\x16Response_CaptureScreen\x12\'\n\x06\x62itmap\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap\"O\n$Response_GetContinuousCapturedScreen\x12\'\n\x06\x62itmap\x18\x01 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap\"\xde\x01\n\x1cReuqest_SetTestConfiguration\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x44\n\x18\x64\x65\x66\x61ultCaptureParameters\x18\x02 \x01(\x0b\x32\".Askui.API.TDKv1.CaptureParameters\x12 \n\x18mouseDelayInMilliseconds\x18\x03 \x01(\r\x12#\n\x1bkeyboardDelayInMilliseconds\x18\x04 \x01(\r\"g\n\x15Request_SetMouseDelay\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x1b\n\x13\x64\x65layInMilliseconds\x18\x02 \x01(\r\"j\n\x18Request_SetKeyboardDelay\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x1b\n\x13\x64\x65layInMilliseconds\x18\x02 \x01(\r\"\x9f\x01\n\x12\x44isplayInformation\x12\x11\n\tdisplayID\x18\x01 \x01(\r\x12\x0c\n\x04name\x18\x02 \x01(\t\x12,\n\x0csizeInPixels\x18\x03 \x01(\x0b\x32\x16.Askui.API.TDKv1.Size2\x12:\n\x16virtualScreenRectangle\x18\x04 \x01(\x0b\x32\x1a.Askui.API.TDKv1.Rectangle\"\x93\x01\n\x1eResponse_GetDisplayInformation\x12\x35\n\x08\x64isplays\x18\x01 \x03(\x0b\x32#.Askui.API.TDKv1.DisplayInformation\x12:\n\x16virtualScreenRectangle\x18\x02 \x01(\x0b\x32\x1a.Askui.API.TDKv1.Rectangle\"1\n\x19Response_GetMousePosition\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x13ProcessInfoExtended\x12\x11\n\thasWindow\x18\x01 \x01(\x08\"y\n\x0bProcessInfo\x12\n\n\x02ID\x18\x01 \x01(\x04\x12\x0c\n\x04name\x18\x02 \x01(\t\x12?\n\x0c\x65xtendedInfo\x18\x03 \x01(\x0b\x32$.Askui.API.TDKv1.ProcessInfoExtendedH\x00\x88\x01\x01\x42\x0f\n\r_extendedInfo\"1\n\x16Request_GetProcessList\x12\x17\n\x0fgetExtendedInfo\x18\x01 \x01(\x08\"J\n\x17Response_GetProcessList\x12/\n\tprocesses\x18\x01 \x03(\x0b\x32\x1c.Askui.API.TDKv1.ProcessInfo\"*\n\x15Request_GetWindowList\x12\x11\n\tprocessID\x18\x01 \x01(\x04\"&\n\nWindowInfo\x12\n\n\x02ID\x18\x01 \x01(\x04\x12\x0c\n\x04name\x18\x02 \x01(\t\"F\n\x16Response_GetWindowList\x12,\n\x07windows\x18\x01 \x03(\x0b\x32\x1b.Askui.API.TDKv1.WindowInfo\"-\n\x18Request_SetActiveDisplay\x12\x11\n\tdisplayID\x18\x01 \x01(\r\">\n\x17Request_SetActiveWindow\x12\x11\n\tprocessID\x18\x01 \x01(\x04\x12\x10\n\x08windowID\x18\x02 \x01(\x04\"q\n\x10\x41utomationTarget\x12\n\n\x02ID\x18\x01 \x01(\x04\x12\x33\n\x04type\x18\x02 \x01(\x0e\x32%.Askui.API.TDKv1.AutomationTargetType\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x0e\n\x06\x61\x63tive\x18\x04 \x01(\x08\"V\n Response_GetAutomationTargetList\x12\x32\n\x07targets\x18\x01 \x03(\x0b\x32!.Askui.API.TDKv1.AutomationTarget\"/\n!Request_SetActiveAutomationTarget\x12\n\n\x02ID\x18\x01 \x01(\x04\"Q\n\x10Request_GetColor\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\x12\'\n\x06\x62itmap\x18\x03 \x01(\x0b\x32\x17.Askui.API.TDKv1.Bitmap\":\n\x11Response_GetColor\x12%\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x16.Askui.API.TDKv1.Color\"-\n\x15Request_GetPixelColor\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"?\n\x16Response_GetPixelColor\x12%\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x16.Askui.API.TDKv1.Color\"n\n\x17Request_SetDisplayLabel\x12\x31\n\x0bsessionInfo\x18\x01 \x01(\x0b\x32\x1c.Askui.API.TDKv1.SessionInfo\x12\x11\n\tdisplayID\x18\x02 \x01(\r\x12\r\n\x05label\x18\x03 \x01(\t*N\n\x0bPollEventID\x12\x19\n\x15PollEventID_Undefined\x10\x00\x12\x1e\n\x1aPollEventID_ActionFinished\x10\x02\"\x04\x08\x01\x10\x01*m\n\x0bMouseButton\x12\x19\n\x15MouseButton_Undefined\x10\x00\x12\x14\n\x10MouseButton_Left\x10\x01\x12\x15\n\x11MouseButton_Right\x10\x02\x12\x16\n\x12MouseButton_Middle\x10\x03*\x8b\x05\n\rActionClassID\x12\x1b\n\x17\x41\x63tionClassID_Undefined\x10\x00\x12\x16\n\x12\x41\x63tionClassID_Wait\x10\x01\x12#\n\x1f\x41\x63tionClassID_MouseButton_Press\x10\x08\x12%\n!ActionClassID_MouseButton_Release\x10\t\x12-\n)ActionClassID_MouseButton_PressAndRelease\x10\n\x12\"\n\x1e\x41\x63tionClassID_MouseWheelScroll\x10\x0b\x12\x1b\n\x17\x41\x63tionClassID_MouseMove\x10\x0c\x12!\n\x1d\x41\x63tionClassID_MouseMove_Delta\x10\r\x12#\n\x1f\x41\x63tionClassID_KeyboardKey_Press\x10\x0e\x12%\n!ActionClassID_KeyboardKey_Release\x10\x0f\x12-\n)ActionClassID_KeyboardKey_PressAndRelease\x10\x10\x12$\n ActionClassID_KeyboardKeys_Press\x10\x11\x12&\n\"ActionClassID_KeyboardKeys_Release\x10\x12\x12.\n*ActionClassID_KeyboardKeys_PressAndRelease\x10\x13\x12#\n\x1f\x41\x63tionClassID_KeyboardType_Text\x10\x14\x12*\n&ActionClassID_KeyboardType_UnicodeText\x10\x15\x12\x1c\n\x18\x41\x63tionClassID_RunCommand\x10\x16*i\n\x13MouseWheelDeltaType\x12\x1d\n\x19MouseWheelDelta_Undefined\x10\x00\x12\x17\n\x13MouseWheelDelta_Raw\x10\x01\x12\x1a\n\x16MouseWheelDelta_Detent\x10\x02*\x96\x01\n\x19MouseWheelScrollDirection\x12\'\n#MouseWheelScrollDirection_Undefined\x10\x00\x12&\n\"MouseWheelScrollDirection_Vertical\x10\x01\x12(\n$MouseWheelScrollDirection_Horizontal\x10\x02*z\n\x10TypingSpeedValue\x12\x1e\n\x1aTypingSpeedValue_Undefined\x10\x00\x12(\n$TypingSpeedValue_CharactersPerSecond\x10\x01\x12\x1c\n\x18TypingSpeedValue_Seconds\x10\x02*s\n\x14\x41utomationTargetType\x12\x1a\n\x16\x41utomationTarget_Local\x10\x00\x12\x1f\n\x1b\x41utomationTarget_Background\x10\x01\x12\x1e\n\x1a\x41utomationTarget_Companion\x10\x02\x32\x82\x16\n\rControllerAPI\x12_\n\x0cStartSession\x12%.Askui.API.TDKv1.Request_StartSession\x1a&.Askui.API.TDKv1.Response_StartSession\"\x00\x12S\n\nEndSession\x12#.Askui.API.TDKv1.Request_EndSession\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12G\n\x04Send\x12\x1d.Askui.API.TDKv1.Request_Send\x1a\x1e.Askui.API.TDKv1.Response_Send\"\x00\x12G\n\x04Poll\x12\x1d.Askui.API.TDKv1.Request_Poll\x1a\x1e.Askui.API.TDKv1.Response_Poll\"\x00\x12[\n\x0eStartExecution\x12\'.Askui.API.TDKv1.Request_StartExecution\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12Y\n\rStopExecution\x12&.Askui.API.TDKv1.Request_StopExecution\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12n\n\x11RunRecordedAction\x12*.Askui.API.TDKv1.Request_RunRecordedAction\x1a+.Askui.API.TDKv1.Response_RunRecordedAction\"\x00\x12z\n\x15ScheduleBatchedAction\x12..Askui.API.TDKv1.Request_ScheduleBatchedAction\x1a/.Askui.API.TDKv1.Response_ScheduleBatchedAction\"\x00\x12Y\n\rStartBatchRun\x12&.Askui.API.TDKv1.Request_StartBatchRun\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12W\n\x0cStopBatchRun\x12%.Askui.API.TDKv1.Request_StopBatchRun\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12\x65\n\x0eGetActionCount\x12\'.Askui.API.TDKv1.Request_GetActionCount\x1a(.Askui.API.TDKv1.Response_GetActionCount\"\x00\x12V\n\tGetAction\x12\".Askui.API.TDKv1.Request_GetAction\x1a#.Askui.API.TDKv1.Response_GetAction\"\x00\x12W\n\x0cRemoveAction\x12%.Askui.API.TDKv1.Request_RemoveAction\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12_\n\x10RemoveAllActions\x12).Askui.API.TDKv1.Request_RemoveAllActions\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12\x62\n\rCaptureScreen\x12&.Askui.API.TDKv1.Request_CaptureScreen\x1a\'.Askui.API.TDKv1.Response_CaptureScreen\"\x00\x12g\n\x14SetTestConfiguration\x12-.Askui.API.TDKv1.Reuqest_SetTestConfiguration\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12Y\n\rSetMouseDelay\x12&.Askui.API.TDKv1.Request_SetMouseDelay\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12_\n\x10SetKeyboardDelay\x12).Askui.API.TDKv1.Request_SetKeyboardDelay\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12i\n\x15GetDisplayInformation\x12\x1d.Askui.API.TDKv1.Request_Void\x1a/.Askui.API.TDKv1.Response_GetDisplayInformation\"\x00\x12_\n\x10GetMousePosition\x12\x1d.Askui.API.TDKv1.Request_Void\x1a*.Askui.API.TDKv1.Response_GetMousePosition\"\x00\x12\x65\n\x0eGetProcessList\x12\'.Askui.API.TDKv1.Request_GetProcessList\x1a(.Askui.API.TDKv1.Response_GetProcessList\"\x00\x12\x62\n\rGetWindowList\x12&.Askui.API.TDKv1.Request_GetWindowList\x1a\'.Askui.API.TDKv1.Response_GetWindowList\"\x00\x12m\n\x17GetAutomationTargetList\x12\x1d.Askui.API.TDKv1.Request_Void\x1a\x31.Askui.API.TDKv1.Response_GetAutomationTargetList\"\x00\x12_\n\x10SetActiveDisplay\x12).Askui.API.TDKv1.Request_SetActiveDisplay\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12]\n\x0fSetActiveWindow\x12(.Askui.API.TDKv1.Request_SetActiveWindow\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12q\n\x19SetActiveAutomationTarget\x12\x32.Askui.API.TDKv1.Request_SetActiveAutomationTarget\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x12S\n\x08GetColor\x12!.Askui.API.TDKv1.Request_GetColor\x1a\".Askui.API.TDKv1.Response_GetColor\"\x00\x12\x62\n\rGetPixelColor\x12&.Askui.API.TDKv1.Request_GetPixelColor\x1a\'.Askui.API.TDKv1.Response_GetPixelColor\"\x00\x12]\n\x0fSetDisplayLabel\x12(.Askui.API.TDKv1.Request_SetDisplayLabel\x1a\x1e.Askui.API.TDKv1.Response_Void\"\x00\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'Controller_V1_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_POLLEVENTID']._serialized_start=8285 + _globals['_POLLEVENTID']._serialized_end=8363 + _globals['_MOUSEBUTTON']._serialized_start=8365 + _globals['_MOUSEBUTTON']._serialized_end=8474 + _globals['_ACTIONCLASSID']._serialized_start=8477 + _globals['_ACTIONCLASSID']._serialized_end=9128 + _globals['_MOUSEWHEELDELTATYPE']._serialized_start=9130 + _globals['_MOUSEWHEELDELTATYPE']._serialized_end=9235 + _globals['_MOUSEWHEELSCROLLDIRECTION']._serialized_start=9238 + _globals['_MOUSEWHEELSCROLLDIRECTION']._serialized_end=9388 + _globals['_TYPINGSPEEDVALUE']._serialized_start=9390 + _globals['_TYPINGSPEEDVALUE']._serialized_end=9512 + _globals['_AUTOMATIONTARGETTYPE']._serialized_start=9514 + _globals['_AUTOMATIONTARGETTYPE']._serialized_end=9629 + _globals['_VOID']._serialized_start=40 + _globals['_VOID']._serialized_end=46 + _globals['_REQUEST_VOID']._serialized_start=48 + _globals['_REQUEST_VOID']._serialized_end=62 + _globals['_RESPONSE_VOID']._serialized_start=64 + _globals['_RESPONSE_VOID']._serialized_end=79 + _globals['_SIZE2']._serialized_start=81 + _globals['_SIZE2']._serialized_end=119 + _globals['_DELTA2']._serialized_start=121 + _globals['_DELTA2']._serialized_end=151 + _globals['_COORDINATE2']._serialized_start=153 + _globals['_COORDINATE2']._serialized_end=188 + _globals['_RECTANGLE']._serialized_start=190 + _globals['_RECTANGLE']._serialized_end=259 + _globals['_BITMAP']._serialized_start=261 + _globals['_BITMAP']._serialized_end=378 + _globals['_COLOR']._serialized_start=380 + _globals['_COLOR']._serialized_end=420 + _globals['_GUID']._serialized_start=422 + _globals['_GUID']._serialized_end=463 + _globals['_SESSIONINFO']._serialized_start=465 + _globals['_SESSIONINFO']._serialized_end=541 + _globals['_CAPTUREAREA']._serialized_start=543 + _globals['_CAPTUREAREA']._serialized_end=644 + _globals['_CAPTUREPARAMETERS']._serialized_start=647 + _globals['_CAPTUREPARAMETERS']._serialized_end=776 + _globals['_POLLEVENTPARAMETERS_ACTIONFINISHED']._serialized_start=778 + _globals['_POLLEVENTPARAMETERS_ACTIONFINISHED']._serialized_end=832 + _globals['_POLLEVENTPARAMETERS']._serialized_start=834 + _globals['_POLLEVENTPARAMETERS']._serialized_end=944 + _globals['_ACTIONPARAMETERS_WAIT']._serialized_start=946 + _globals['_ACTIONPARAMETERS_WAIT']._serialized_end=991 + _globals['_ACTIONPARAMETERS_MOUSEBUTTON_PRESS']._serialized_start=993 + _globals['_ACTIONPARAMETERS_MOUSEBUTTON_PRESS']._serialized_end=1080 + _globals['_ACTIONPARAMETERS_MOUSEBUTTON_RELEASE']._serialized_start=1082 + _globals['_ACTIONPARAMETERS_MOUSEBUTTON_RELEASE']._serialized_end=1171 + _globals['_ACTIONPARAMETERS_MOUSEBUTTON_PRESSANDRELEASE']._serialized_start=1173 + _globals['_ACTIONPARAMETERS_MOUSEBUTTON_PRESSANDRELEASE']._serialized_end=1285 + _globals['_ACTIONPARAMETERS_MOUSEWHEELSCROLL']._serialized_start=1288 + _globals['_ACTIONPARAMETERS_MOUSEWHEELSCROLL']._serialized_end=1480 + _globals['_ACTIONPARAMETERS_MOUSEMOVE']._serialized_start=1482 + _globals['_ACTIONPARAMETERS_MOUSEMOVE']._serialized_end=1602 + _globals['_ACTIONPARAMETERS_MOUSEMOVE_DELTA']._serialized_start=1604 + _globals['_ACTIONPARAMETERS_MOUSEMOVE_DELTA']._serialized_end=1722 + _globals['_ACTIONPARAMETERS_KEYBOARDKEY_PRESS']._serialized_start=1724 + _globals['_ACTIONPARAMETERS_KEYBOARDKEY_PRESS']._serialized_end=1803 + _globals['_ACTIONPARAMETERS_KEYBOARDKEY_RELEASE']._serialized_start=1805 + _globals['_ACTIONPARAMETERS_KEYBOARDKEY_RELEASE']._serialized_end=1886 + _globals['_ACTIONPARAMETERS_KEYBOARDKEY_PRESSANDRELEASE']._serialized_start=1888 + _globals['_ACTIONPARAMETERS_KEYBOARDKEY_PRESSANDRELEASE']._serialized_end=1977 + _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_PRESS']._serialized_start=1979 + _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_PRESS']._serialized_end=2060 + _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_RELEASE']._serialized_start=2062 + _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_RELEASE']._serialized_end=2145 + _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_PRESSANDRELEASE']._serialized_start=2147 + _globals['_ACTIONPARAMETERS_KEYBOARDKEYS_PRESSANDRELEASE']._serialized_end=2238 + _globals['_ACTIONPARAMETERS_KEYBOARDTYPE_TEXT']._serialized_start=2241 + _globals['_ACTIONPARAMETERS_KEYBOARDTYPE_TEXT']._serialized_end=2394 + _globals['_ACTIONPARAMETERS_KEYBOARDTYPE_UNICODETEXT']._serialized_start=2397 + _globals['_ACTIONPARAMETERS_KEYBOARDTYPE_UNICODETEXT']._serialized_end=2557 + _globals['_ACTIONPARAMETERS_RUNCOMMAND']._serialized_start=2559 + _globals['_ACTIONPARAMETERS_RUNCOMMAND']._serialized_end=2667 + _globals['_ACTIONPARAMETERS']._serialized_start=2670 + _globals['_ACTIONPARAMETERS']._serialized_end=4067 + _globals['_REQUEST_STARTSESSION']._serialized_start=4069 + _globals['_REQUEST_STARTSESSION']._serialized_end=4140 + _globals['_RESPONSE_STARTSESSION']._serialized_start=4142 + _globals['_RESPONSE_STARTSESSION']._serialized_end=4216 + _globals['_REQUEST_ENDSESSION']._serialized_start=4218 + _globals['_REQUEST_ENDSESSION']._serialized_end=4289 + _globals['_REQUEST_SEND']._serialized_start=4291 + _globals['_REQUEST_SEND']._serialized_end=4322 + _globals['_REQUEST_POLL']._serialized_start=4324 + _globals['_REQUEST_POLL']._serialized_end=4440 + _globals['_REQUEST_STARTEXECUTION']._serialized_start=4442 + _globals['_REQUEST_STARTEXECUTION']._serialized_end=4517 + _globals['_REQUEST_STOPEXECUTION']._serialized_start=4519 + _globals['_REQUEST_STOPEXECUTION']._serialized_end=4593 + _globals['_RESPONSE_SEND']._serialized_start=4595 + _globals['_RESPONSE_SEND']._serialized_end=4627 + _globals['_RESPONSE_POLL']._serialized_start=4630 + _globals['_RESPONSE_POLL']._serialized_end=4763 + _globals['_REQUEST_RUNRECORDEDACTION']._serialized_start=4766 + _globals['_REQUEST_RUNRECORDEDACTION']._serialized_end=4960 + _globals['_RESPONSE_RUNRECORDEDACTION']._serialized_start=4962 + _globals['_RESPONSE_RUNRECORDEDACTION']._serialized_end=5038 + _globals['_REQUEST_SCHEDULEBATCHEDACTION']._serialized_start=5041 + _globals['_REQUEST_SCHEDULEBATCHEDACTION']._serialized_end=5239 + _globals['_RESPONSE_SCHEDULEBATCHEDACTION']._serialized_start=5241 + _globals['_RESPONSE_SCHEDULEBATCHEDACTION']._serialized_end=5291 + _globals['_REQUEST_GETACTIONCOUNT']._serialized_start=5293 + _globals['_REQUEST_GETACTIONCOUNT']._serialized_end=5368 + _globals['_RESPONSE_GETACTIONCOUNT']._serialized_start=5370 + _globals['_RESPONSE_GETACTIONCOUNT']._serialized_end=5416 + _globals['_REQUEST_GETACTION']._serialized_start=5418 + _globals['_REQUEST_GETACTION']._serialized_end=5509 + _globals['_RESPONSE_GETACTION']._serialized_start=5512 + _globals['_RESPONSE_GETACTION']._serialized_end=5666 + _globals['_REQUEST_REMOVEACTION']._serialized_start=5668 + _globals['_REQUEST_REMOVEACTION']._serialized_end=5759 + _globals['_REQUEST_REMOVEALLACTIONS']._serialized_start=5761 + _globals['_REQUEST_REMOVEALLACTIONS']._serialized_end=5838 + _globals['_REQUEST_STARTBATCHRUN']._serialized_start=5840 + _globals['_REQUEST_STARTBATCHRUN']._serialized_end=5914 + _globals['_REQUEST_STOPBATCHRUN']._serialized_start=5916 + _globals['_REQUEST_STOPBATCHRUN']._serialized_end=5989 + _globals['_REQUEST_CAPTURESCREEN']._serialized_start=5992 + _globals['_REQUEST_CAPTURESCREEN']._serialized_end=6156 + _globals['_RESPONSE_CAPTURESCREEN']._serialized_start=6158 + _globals['_RESPONSE_CAPTURESCREEN']._serialized_end=6223 + _globals['_RESPONSE_GETCONTINUOUSCAPTUREDSCREEN']._serialized_start=6225 + _globals['_RESPONSE_GETCONTINUOUSCAPTUREDSCREEN']._serialized_end=6304 + _globals['_REUQEST_SETTESTCONFIGURATION']._serialized_start=6307 + _globals['_REUQEST_SETTESTCONFIGURATION']._serialized_end=6529 + _globals['_REQUEST_SETMOUSEDELAY']._serialized_start=6531 + _globals['_REQUEST_SETMOUSEDELAY']._serialized_end=6634 + _globals['_REQUEST_SETKEYBOARDDELAY']._serialized_start=6636 + _globals['_REQUEST_SETKEYBOARDDELAY']._serialized_end=6742 + _globals['_DISPLAYINFORMATION']._serialized_start=6745 + _globals['_DISPLAYINFORMATION']._serialized_end=6904 + _globals['_RESPONSE_GETDISPLAYINFORMATION']._serialized_start=6907 + _globals['_RESPONSE_GETDISPLAYINFORMATION']._serialized_end=7054 + _globals['_RESPONSE_GETMOUSEPOSITION']._serialized_start=7056 + _globals['_RESPONSE_GETMOUSEPOSITION']._serialized_end=7105 + _globals['_PROCESSINFOEXTENDED']._serialized_start=7107 + _globals['_PROCESSINFOEXTENDED']._serialized_end=7147 + _globals['_PROCESSINFO']._serialized_start=7149 + _globals['_PROCESSINFO']._serialized_end=7270 + _globals['_REQUEST_GETPROCESSLIST']._serialized_start=7272 + _globals['_REQUEST_GETPROCESSLIST']._serialized_end=7321 + _globals['_RESPONSE_GETPROCESSLIST']._serialized_start=7323 + _globals['_RESPONSE_GETPROCESSLIST']._serialized_end=7397 + _globals['_REQUEST_GETWINDOWLIST']._serialized_start=7399 + _globals['_REQUEST_GETWINDOWLIST']._serialized_end=7441 + _globals['_WINDOWINFO']._serialized_start=7443 + _globals['_WINDOWINFO']._serialized_end=7481 + _globals['_RESPONSE_GETWINDOWLIST']._serialized_start=7483 + _globals['_RESPONSE_GETWINDOWLIST']._serialized_end=7553 + _globals['_REQUEST_SETACTIVEDISPLAY']._serialized_start=7555 + _globals['_REQUEST_SETACTIVEDISPLAY']._serialized_end=7600 + _globals['_REQUEST_SETACTIVEWINDOW']._serialized_start=7602 + _globals['_REQUEST_SETACTIVEWINDOW']._serialized_end=7664 + _globals['_AUTOMATIONTARGET']._serialized_start=7666 + _globals['_AUTOMATIONTARGET']._serialized_end=7779 + _globals['_RESPONSE_GETAUTOMATIONTARGETLIST']._serialized_start=7781 + _globals['_RESPONSE_GETAUTOMATIONTARGETLIST']._serialized_end=7867 + _globals['_REQUEST_SETACTIVEAUTOMATIONTARGET']._serialized_start=7869 + _globals['_REQUEST_SETACTIVEAUTOMATIONTARGET']._serialized_end=7916 + _globals['_REQUEST_GETCOLOR']._serialized_start=7918 + _globals['_REQUEST_GETCOLOR']._serialized_end=7999 + _globals['_RESPONSE_GETCOLOR']._serialized_start=8001 + _globals['_RESPONSE_GETCOLOR']._serialized_end=8059 + _globals['_REQUEST_GETPIXELCOLOR']._serialized_start=8061 + _globals['_REQUEST_GETPIXELCOLOR']._serialized_end=8106 + _globals['_RESPONSE_GETPIXELCOLOR']._serialized_start=8108 + _globals['_RESPONSE_GETPIXELCOLOR']._serialized_end=8171 + _globals['_REQUEST_SETDISPLAYLABEL']._serialized_start=8173 + _globals['_REQUEST_SETDISPLAYLABEL']._serialized_end=8283 + _globals['_CONTROLLERAPI']._serialized_start=9632 + _globals['_CONTROLLERAPI']._serialized_end=12450 +# @@protoc_insertion_point(module_scope) diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.pyi b/src/askui/tools/askui/askui_ui_controller_grpc/generated/Controller_V1_pb2.pyi similarity index 62% rename from src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.pyi rename to src/askui/tools/askui/askui_ui_controller_grpc/generated/Controller_V1_pb2.pyi index 58bb9f9e..409383f9 100644 --- a/src/askui/tools/askui/askui_ui_controller_grpc/Controller_V1_pb2.pyi +++ b/src/askui/tools/askui/askui_ui_controller_grpc/generated/Controller_V1_pb2.pyi @@ -1,23 +1,8 @@ -from typing import ( - ClassVar as _ClassVar, -) -from typing import ( - Iterable as _Iterable, -) -from typing import ( - Mapping as _Mapping, -) -from typing import ( - Optional as _Optional, -) -from typing import ( - Union as _Union, -) - -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor @@ -71,6 +56,11 @@ class TypingSpeedValue(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): TypingSpeedValue_CharactersPerSecond: _ClassVar[TypingSpeedValue] TypingSpeedValue_Seconds: _ClassVar[TypingSpeedValue] +class AutomationTargetType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + AutomationTarget_Local: _ClassVar[AutomationTargetType] + AutomationTarget_Background: _ClassVar[AutomationTargetType] + AutomationTarget_Companion: _ClassVar[AutomationTargetType] PollEventID_Undefined: PollEventID PollEventID_ActionFinished: PollEventID MouseButton_Undefined: MouseButton @@ -103,6 +93,9 @@ MouseWheelScrollDirection_Horizontal: MouseWheelScrollDirection TypingSpeedValue_Undefined: TypingSpeedValue TypingSpeedValue_CharactersPerSecond: TypingSpeedValue TypingSpeedValue_Seconds: TypingSpeedValue +AutomationTarget_Local: AutomationTargetType +AutomationTarget_Background: AutomationTargetType +AutomationTarget_Companion: AutomationTargetType class Void(_message.Message): __slots__ = () @@ -122,9 +115,7 @@ class Size2(_message.Message): HEIGHT_FIELD_NUMBER: _ClassVar[int] width: int height: int - def __init__( - self, width: _Optional[int] = ..., height: _Optional[int] = ... - ) -> None: ... + def __init__(self, width: _Optional[int] = ..., height: _Optional[int] = ...) -> None: ... class Delta2(_message.Message): __slots__ = ("x", "y") @@ -152,23 +143,10 @@ class Rectangle(_message.Message): top: int right: int bottom: int - def __init__( - self, - left: _Optional[int] = ..., - top: _Optional[int] = ..., - right: _Optional[int] = ..., - bottom: _Optional[int] = ..., - ) -> None: ... + def __init__(self, left: _Optional[int] = ..., top: _Optional[int] = ..., right: _Optional[int] = ..., bottom: _Optional[int] = ...) -> None: ... class Bitmap(_message.Message): - __slots__ = ( - "width", - "height", - "lineWidth", - "bitsPerPixel", - "bytesPerPixel", - "data", - ) + __slots__ = ("width", "height", "lineWidth", "bitsPerPixel", "bytesPerPixel", "data") WIDTH_FIELD_NUMBER: _ClassVar[int] HEIGHT_FIELD_NUMBER: _ClassVar[int] LINEWIDTH_FIELD_NUMBER: _ClassVar[int] @@ -181,15 +159,7 @@ class Bitmap(_message.Message): bitsPerPixel: int bytesPerPixel: int data: bytes - def __init__( - self, - width: _Optional[int] = ..., - height: _Optional[int] = ..., - lineWidth: _Optional[int] = ..., - bitsPerPixel: _Optional[int] = ..., - bytesPerPixel: _Optional[int] = ..., - data: _Optional[bytes] = ..., - ) -> None: ... + def __init__(self, width: _Optional[int] = ..., height: _Optional[int] = ..., lineWidth: _Optional[int] = ..., bitsPerPixel: _Optional[int] = ..., bytesPerPixel: _Optional[int] = ..., data: _Optional[bytes] = ...) -> None: ... class Color(_message.Message): __slots__ = ("r", "g", "b") @@ -199,9 +169,7 @@ class Color(_message.Message): r: int g: int b: int - def __init__( - self, r: _Optional[int] = ..., g: _Optional[int] = ..., b: _Optional[int] = ... - ) -> None: ... + def __init__(self, r: _Optional[int] = ..., g: _Optional[int] = ..., b: _Optional[int] = ...) -> None: ... class GUID(_message.Message): __slots__ = ("highPart", "lowPart") @@ -209,9 +177,7 @@ class GUID(_message.Message): LOWPART_FIELD_NUMBER: _ClassVar[int] highPart: int lowPart: int - def __init__( - self, highPart: _Optional[int] = ..., lowPart: _Optional[int] = ... - ) -> None: ... + def __init__(self, highPart: _Optional[int] = ..., lowPart: _Optional[int] = ...) -> None: ... class SessionInfo(_message.Message): __slots__ = ("sessionGUID", "sessionID") @@ -219,11 +185,7 @@ class SessionInfo(_message.Message): SESSIONID_FIELD_NUMBER: _ClassVar[int] sessionGUID: GUID sessionID: int - def __init__( - self, - sessionGUID: _Optional[_Union[GUID, _Mapping]] = ..., - sessionID: _Optional[int] = ..., - ) -> None: ... + def __init__(self, sessionGUID: _Optional[_Union[GUID, _Mapping]] = ..., sessionID: _Optional[int] = ...) -> None: ... class CaptureArea(_message.Message): __slots__ = ("size", "coordinate") @@ -231,11 +193,7 @@ class CaptureArea(_message.Message): COORDINATE_FIELD_NUMBER: _ClassVar[int] size: Size2 coordinate: Coordinate2 - def __init__( - self, - size: _Optional[_Union[Size2, _Mapping]] = ..., - coordinate: _Optional[_Union[Coordinate2, _Mapping]] = ..., - ) -> None: ... + def __init__(self, size: _Optional[_Union[Size2, _Mapping]] = ..., coordinate: _Optional[_Union[Coordinate2, _Mapping]] = ...) -> None: ... class CaptureParameters(_message.Message): __slots__ = ("displayID", "captureArea") @@ -243,11 +201,7 @@ class CaptureParameters(_message.Message): CAPTUREAREA_FIELD_NUMBER: _ClassVar[int] displayID: int captureArea: CaptureArea - def __init__( - self, - displayID: _Optional[int] = ..., - captureArea: _Optional[_Union[CaptureArea, _Mapping]] = ..., - ) -> None: ... + def __init__(self, displayID: _Optional[int] = ..., captureArea: _Optional[_Union[CaptureArea, _Mapping]] = ...) -> None: ... class PollEventParameters_ActionFinished(_message.Message): __slots__ = ("actionID",) @@ -259,12 +213,7 @@ class PollEventParameters(_message.Message): __slots__ = ("actionFinished",) ACTIONFINISHED_FIELD_NUMBER: _ClassVar[int] actionFinished: PollEventParameters_ActionFinished - def __init__( - self, - actionFinished: _Optional[ - _Union[PollEventParameters_ActionFinished, _Mapping] - ] = ..., - ) -> None: ... + def __init__(self, actionFinished: _Optional[_Union[PollEventParameters_ActionFinished, _Mapping]] = ...) -> None: ... class ActionParameters_Wait(_message.Message): __slots__ = ("milliseconds",) @@ -276,17 +225,13 @@ class ActionParameters_MouseButton_Press(_message.Message): __slots__ = ("mouseButton",) MOUSEBUTTON_FIELD_NUMBER: _ClassVar[int] mouseButton: MouseButton - def __init__( - self, mouseButton: _Optional[_Union[MouseButton, str]] = ... - ) -> None: ... + def __init__(self, mouseButton: _Optional[_Union[MouseButton, str]] = ...) -> None: ... class ActionParameters_MouseButton_Release(_message.Message): __slots__ = ("mouseButton",) MOUSEBUTTON_FIELD_NUMBER: _ClassVar[int] mouseButton: MouseButton - def __init__( - self, mouseButton: _Optional[_Union[MouseButton, str]] = ... - ) -> None: ... + def __init__(self, mouseButton: _Optional[_Union[MouseButton, str]] = ...) -> None: ... class ActionParameters_MouseButton_PressAndRelease(_message.Message): __slots__ = ("mouseButton", "count") @@ -294,11 +239,7 @@ class ActionParameters_MouseButton_PressAndRelease(_message.Message): COUNT_FIELD_NUMBER: _ClassVar[int] mouseButton: MouseButton count: int - def __init__( - self, - mouseButton: _Optional[_Union[MouseButton, str]] = ..., - count: _Optional[int] = ..., - ) -> None: ... + def __init__(self, mouseButton: _Optional[_Union[MouseButton, str]] = ..., count: _Optional[int] = ...) -> None: ... class ActionParameters_MouseWheelScroll(_message.Message): __slots__ = ("direction", "deltaType", "delta", "milliseconds") @@ -310,13 +251,7 @@ class ActionParameters_MouseWheelScroll(_message.Message): deltaType: MouseWheelDeltaType delta: int milliseconds: int - def __init__( - self, - direction: _Optional[_Union[MouseWheelScrollDirection, str]] = ..., - deltaType: _Optional[_Union[MouseWheelDeltaType, str]] = ..., - delta: _Optional[int] = ..., - milliseconds: _Optional[int] = ..., - ) -> None: ... + def __init__(self, direction: _Optional[_Union[MouseWheelScrollDirection, str]] = ..., deltaType: _Optional[_Union[MouseWheelDeltaType, str]] = ..., delta: _Optional[int] = ..., milliseconds: _Optional[int] = ...) -> None: ... class ActionParameters_MouseMove(_message.Message): __slots__ = ("position", "milliseconds") @@ -324,11 +259,7 @@ class ActionParameters_MouseMove(_message.Message): MILLISECONDS_FIELD_NUMBER: _ClassVar[int] position: Coordinate2 milliseconds: int - def __init__( - self, - position: _Optional[_Union[Coordinate2, _Mapping]] = ..., - milliseconds: _Optional[int] = ..., - ) -> None: ... + def __init__(self, position: _Optional[_Union[Coordinate2, _Mapping]] = ..., milliseconds: _Optional[int] = ...) -> None: ... class ActionParameters_MouseMove_Delta(_message.Message): __slots__ = ("delta", "milliseconds") @@ -336,11 +267,7 @@ class ActionParameters_MouseMove_Delta(_message.Message): MILLISECONDS_FIELD_NUMBER: _ClassVar[int] delta: Delta2 milliseconds: int - def __init__( - self, - delta: _Optional[_Union[Delta2, _Mapping]] = ..., - milliseconds: _Optional[int] = ..., - ) -> None: ... + def __init__(self, delta: _Optional[_Union[Delta2, _Mapping]] = ..., milliseconds: _Optional[int] = ...) -> None: ... class ActionParameters_KeyboardKey_Press(_message.Message): __slots__ = ("keyName", "modifierKeyNames") @@ -348,11 +275,7 @@ class ActionParameters_KeyboardKey_Press(_message.Message): MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int] keyName: str modifierKeyNames: _containers.RepeatedScalarFieldContainer[str] - def __init__( - self, - keyName: _Optional[str] = ..., - modifierKeyNames: _Optional[_Iterable[str]] = ..., - ) -> None: ... + def __init__(self, keyName: _Optional[str] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ... class ActionParameters_KeyboardKey_Release(_message.Message): __slots__ = ("keyName", "modifierKeyNames") @@ -360,11 +283,7 @@ class ActionParameters_KeyboardKey_Release(_message.Message): MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int] keyName: str modifierKeyNames: _containers.RepeatedScalarFieldContainer[str] - def __init__( - self, - keyName: _Optional[str] = ..., - modifierKeyNames: _Optional[_Iterable[str]] = ..., - ) -> None: ... + def __init__(self, keyName: _Optional[str] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ... class ActionParameters_KeyboardKey_PressAndRelease(_message.Message): __slots__ = ("keyName", "modifierKeyNames") @@ -372,11 +291,7 @@ class ActionParameters_KeyboardKey_PressAndRelease(_message.Message): MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int] keyName: str modifierKeyNames: _containers.RepeatedScalarFieldContainer[str] - def __init__( - self, - keyName: _Optional[str] = ..., - modifierKeyNames: _Optional[_Iterable[str]] = ..., - ) -> None: ... + def __init__(self, keyName: _Optional[str] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ... class ActionParameters_KeyboardKeys_Press(_message.Message): __slots__ = ("keyNames", "modifierKeyNames") @@ -384,11 +299,7 @@ class ActionParameters_KeyboardKeys_Press(_message.Message): MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int] keyNames: _containers.RepeatedScalarFieldContainer[str] modifierKeyNames: _containers.RepeatedScalarFieldContainer[str] - def __init__( - self, - keyNames: _Optional[_Iterable[str]] = ..., - modifierKeyNames: _Optional[_Iterable[str]] = ..., - ) -> None: ... + def __init__(self, keyNames: _Optional[_Iterable[str]] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ... class ActionParameters_KeyboardKeys_Release(_message.Message): __slots__ = ("keyNames", "modifierKeyNames") @@ -396,11 +307,7 @@ class ActionParameters_KeyboardKeys_Release(_message.Message): MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int] keyNames: _containers.RepeatedScalarFieldContainer[str] modifierKeyNames: _containers.RepeatedScalarFieldContainer[str] - def __init__( - self, - keyNames: _Optional[_Iterable[str]] = ..., - modifierKeyNames: _Optional[_Iterable[str]] = ..., - ) -> None: ... + def __init__(self, keyNames: _Optional[_Iterable[str]] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ... class ActionParameters_KeyboardKeys_PressAndRelease(_message.Message): __slots__ = ("keyNames", "modifierKeyNames") @@ -408,11 +315,7 @@ class ActionParameters_KeyboardKeys_PressAndRelease(_message.Message): MODIFIERKEYNAMES_FIELD_NUMBER: _ClassVar[int] keyNames: _containers.RepeatedScalarFieldContainer[str] modifierKeyNames: _containers.RepeatedScalarFieldContainer[str] - def __init__( - self, - keyNames: _Optional[_Iterable[str]] = ..., - modifierKeyNames: _Optional[_Iterable[str]] = ..., - ) -> None: ... + def __init__(self, keyNames: _Optional[_Iterable[str]] = ..., modifierKeyNames: _Optional[_Iterable[str]] = ...) -> None: ... class ActionParameters_KeyboardType_Text(_message.Message): __slots__ = ("text", "typingSpeedValue", "typingSpeed") @@ -422,12 +325,7 @@ class ActionParameters_KeyboardType_Text(_message.Message): text: str typingSpeedValue: TypingSpeedValue typingSpeed: int - def __init__( - self, - text: _Optional[str] = ..., - typingSpeedValue: _Optional[_Union[TypingSpeedValue, str]] = ..., - typingSpeed: _Optional[int] = ..., - ) -> None: ... + def __init__(self, text: _Optional[str] = ..., typingSpeedValue: _Optional[_Union[TypingSpeedValue, str]] = ..., typingSpeed: _Optional[int] = ...) -> None: ... class ActionParameters_KeyboardType_UnicodeText(_message.Message): __slots__ = ("text", "typingSpeedValue", "typingSpeed") @@ -437,12 +335,7 @@ class ActionParameters_KeyboardType_UnicodeText(_message.Message): text: bytes typingSpeedValue: TypingSpeedValue typingSpeed: int - def __init__( - self, - text: _Optional[bytes] = ..., - typingSpeedValue: _Optional[_Union[TypingSpeedValue, str]] = ..., - typingSpeed: _Optional[int] = ..., - ) -> None: ... + def __init__(self, text: _Optional[bytes] = ..., typingSpeedValue: _Optional[_Union[TypingSpeedValue, str]] = ..., typingSpeed: _Optional[int] = ...) -> None: ... class ActionParameters_RunCommand(_message.Message): __slots__ = ("command", "timeoutInMilliseconds") @@ -450,30 +343,10 @@ class ActionParameters_RunCommand(_message.Message): TIMEOUTINMILLISECONDS_FIELD_NUMBER: _ClassVar[int] command: str timeoutInMilliseconds: int - def __init__( - self, command: _Optional[str] = ..., timeoutInMilliseconds: _Optional[int] = ... - ) -> None: ... + def __init__(self, command: _Optional[str] = ..., timeoutInMilliseconds: _Optional[int] = ...) -> None: ... class ActionParameters(_message.Message): - __slots__ = ( - "none", - "wait", - "mouseButtonPress", - "mouseButtonRelease", - "mouseButtonPressAndRelease", - "mouseWheelScroll", - "mouseMove", - "mouseMoveDelta", - "keyboardKeyPress", - "keyboardKeyRelease", - "keyboardKeyPressAndRelease", - "keyboardKeysPress", - "keyboardKeysRelease", - "keyboardKeysPressAndRelease", - "keyboardTypeText", - "keyboardTypeUnicodeText", - "runcommand", - ) + __slots__ = ("none", "wait", "mouseButtonPress", "mouseButtonRelease", "mouseButtonPressAndRelease", "mouseWheelScroll", "mouseMove", "mouseMoveDelta", "keyboardKeyPress", "keyboardKeyRelease", "keyboardKeyPressAndRelease", "keyboardKeysPress", "keyboardKeysRelease", "keyboardKeysPressAndRelease", "keyboardTypeText", "keyboardTypeUnicodeText", "runcommand") NONE_FIELD_NUMBER: _ClassVar[int] WAIT_FIELD_NUMBER: _ClassVar[int] MOUSEBUTTONPRESS_FIELD_NUMBER: _ClassVar[int] @@ -508,52 +381,7 @@ class ActionParameters(_message.Message): keyboardTypeText: ActionParameters_KeyboardType_Text keyboardTypeUnicodeText: ActionParameters_KeyboardType_UnicodeText runcommand: ActionParameters_RunCommand - def __init__( - self, - none: _Optional[_Union[Void, _Mapping]] = ..., - wait: _Optional[_Union[ActionParameters_Wait, _Mapping]] = ..., - mouseButtonPress: _Optional[ - _Union[ActionParameters_MouseButton_Press, _Mapping] - ] = ..., - mouseButtonRelease: _Optional[ - _Union[ActionParameters_MouseButton_Release, _Mapping] - ] = ..., - mouseButtonPressAndRelease: _Optional[ - _Union[ActionParameters_MouseButton_PressAndRelease, _Mapping] - ] = ..., - mouseWheelScroll: _Optional[ - _Union[ActionParameters_MouseWheelScroll, _Mapping] - ] = ..., - mouseMove: _Optional[_Union[ActionParameters_MouseMove, _Mapping]] = ..., - mouseMoveDelta: _Optional[ - _Union[ActionParameters_MouseMove_Delta, _Mapping] - ] = ..., - keyboardKeyPress: _Optional[ - _Union[ActionParameters_KeyboardKey_Press, _Mapping] - ] = ..., - keyboardKeyRelease: _Optional[ - _Union[ActionParameters_KeyboardKey_Release, _Mapping] - ] = ..., - keyboardKeyPressAndRelease: _Optional[ - _Union[ActionParameters_KeyboardKey_PressAndRelease, _Mapping] - ] = ..., - keyboardKeysPress: _Optional[ - _Union[ActionParameters_KeyboardKeys_Press, _Mapping] - ] = ..., - keyboardKeysRelease: _Optional[ - _Union[ActionParameters_KeyboardKeys_Release, _Mapping] - ] = ..., - keyboardKeysPressAndRelease: _Optional[ - _Union[ActionParameters_KeyboardKeys_PressAndRelease, _Mapping] - ] = ..., - keyboardTypeText: _Optional[ - _Union[ActionParameters_KeyboardType_Text, _Mapping] - ] = ..., - keyboardTypeUnicodeText: _Optional[ - _Union[ActionParameters_KeyboardType_UnicodeText, _Mapping] - ] = ..., - runcommand: _Optional[_Union[ActionParameters_RunCommand, _Mapping]] = ..., - ) -> None: ... + def __init__(self, none: _Optional[_Union[Void, _Mapping]] = ..., wait: _Optional[_Union[ActionParameters_Wait, _Mapping]] = ..., mouseButtonPress: _Optional[_Union[ActionParameters_MouseButton_Press, _Mapping]] = ..., mouseButtonRelease: _Optional[_Union[ActionParameters_MouseButton_Release, _Mapping]] = ..., mouseButtonPressAndRelease: _Optional[_Union[ActionParameters_MouseButton_PressAndRelease, _Mapping]] = ..., mouseWheelScroll: _Optional[_Union[ActionParameters_MouseWheelScroll, _Mapping]] = ..., mouseMove: _Optional[_Union[ActionParameters_MouseMove, _Mapping]] = ..., mouseMoveDelta: _Optional[_Union[ActionParameters_MouseMove_Delta, _Mapping]] = ..., keyboardKeyPress: _Optional[_Union[ActionParameters_KeyboardKey_Press, _Mapping]] = ..., keyboardKeyRelease: _Optional[_Union[ActionParameters_KeyboardKey_Release, _Mapping]] = ..., keyboardKeyPressAndRelease: _Optional[_Union[ActionParameters_KeyboardKey_PressAndRelease, _Mapping]] = ..., keyboardKeysPress: _Optional[_Union[ActionParameters_KeyboardKeys_Press, _Mapping]] = ..., keyboardKeysRelease: _Optional[_Union[ActionParameters_KeyboardKeys_Release, _Mapping]] = ..., keyboardKeysPressAndRelease: _Optional[_Union[ActionParameters_KeyboardKeys_PressAndRelease, _Mapping]] = ..., keyboardTypeText: _Optional[_Union[ActionParameters_KeyboardType_Text, _Mapping]] = ..., keyboardTypeUnicodeText: _Optional[_Union[ActionParameters_KeyboardType_UnicodeText, _Mapping]] = ..., runcommand: _Optional[_Union[ActionParameters_RunCommand, _Mapping]] = ...) -> None: ... class Request_StartSession(_message.Message): __slots__ = ("sessionGUID", "immediateExecution") @@ -561,25 +389,25 @@ class Request_StartSession(_message.Message): IMMEDIATEEXECUTION_FIELD_NUMBER: _ClassVar[int] sessionGUID: str immediateExecution: bool - def __init__( - self, sessionGUID: _Optional[str] = ..., immediateExecution: bool = ... - ) -> None: ... + def __init__(self, sessionGUID: _Optional[str] = ..., immediateExecution: bool = ...) -> None: ... class Response_StartSession(_message.Message): __slots__ = ("sessionInfo",) SESSIONINFO_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo - def __init__( - self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ... class Request_EndSession(_message.Message): __slots__ = ("sessionInfo",) SESSIONINFO_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo - def __init__( - self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ... + +class Request_Send(_message.Message): + __slots__ = ("message",) + MESSAGE_FIELD_NUMBER: _ClassVar[int] + message: str + def __init__(self, message: _Optional[str] = ...) -> None: ... class Request_Poll(_message.Message): __slots__ = ("sessionInfo", "pollEventID") @@ -587,27 +415,25 @@ class Request_Poll(_message.Message): POLLEVENTID_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo pollEventID: PollEventID - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - pollEventID: _Optional[_Union[PollEventID, str]] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., pollEventID: _Optional[_Union[PollEventID, str]] = ...) -> None: ... class Request_StartExecution(_message.Message): __slots__ = ("sessionInfo",) SESSIONINFO_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo - def __init__( - self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ... class Request_StopExecution(_message.Message): __slots__ = ("sessionInfo",) SESSIONINFO_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo - def __init__( - self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ... + +class Response_Send(_message.Message): + __slots__ = ("message",) + MESSAGE_FIELD_NUMBER: _ClassVar[int] + message: str + def __init__(self, message: _Optional[str] = ...) -> None: ... class Response_Poll(_message.Message): __slots__ = ("pollEventID", "pollEventParameters") @@ -615,11 +441,7 @@ class Response_Poll(_message.Message): POLLEVENTPARAMETERS_FIELD_NUMBER: _ClassVar[int] pollEventID: PollEventID pollEventParameters: PollEventParameters - def __init__( - self, - pollEventID: _Optional[_Union[PollEventID, str]] = ..., - pollEventParameters: _Optional[_Union[PollEventParameters, _Mapping]] = ..., - ) -> None: ... + def __init__(self, pollEventID: _Optional[_Union[PollEventID, str]] = ..., pollEventParameters: _Optional[_Union[PollEventParameters, _Mapping]] = ...) -> None: ... class Request_RunRecordedAction(_message.Message): __slots__ = ("sessionInfo", "actionClassID", "actionParameters") @@ -629,12 +451,7 @@ class Request_RunRecordedAction(_message.Message): sessionInfo: SessionInfo actionClassID: ActionClassID actionParameters: ActionParameters - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - actionClassID: _Optional[_Union[ActionClassID, str]] = ..., - actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., actionClassID: _Optional[_Union[ActionClassID, str]] = ..., actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ...) -> None: ... class Response_RunRecordedAction(_message.Message): __slots__ = ("actionID", "requiredMilliseconds") @@ -642,9 +459,7 @@ class Response_RunRecordedAction(_message.Message): REQUIREDMILLISECONDS_FIELD_NUMBER: _ClassVar[int] actionID: int requiredMilliseconds: int - def __init__( - self, actionID: _Optional[int] = ..., requiredMilliseconds: _Optional[int] = ... - ) -> None: ... + def __init__(self, actionID: _Optional[int] = ..., requiredMilliseconds: _Optional[int] = ...) -> None: ... class Request_ScheduleBatchedAction(_message.Message): __slots__ = ("sessionInfo", "actionClassID", "actionParameters") @@ -654,12 +469,7 @@ class Request_ScheduleBatchedAction(_message.Message): sessionInfo: SessionInfo actionClassID: ActionClassID actionParameters: ActionParameters - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - actionClassID: _Optional[_Union[ActionClassID, str]] = ..., - actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., actionClassID: _Optional[_Union[ActionClassID, str]] = ..., actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ...) -> None: ... class Response_ScheduleBatchedAction(_message.Message): __slots__ = ("actionID",) @@ -671,9 +481,7 @@ class Request_GetActionCount(_message.Message): __slots__ = ("sessionInfo",) SESSIONINFO_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo - def __init__( - self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ... class Response_GetActionCount(_message.Message): __slots__ = ("actionCount",) @@ -687,11 +495,7 @@ class Request_GetAction(_message.Message): ACTIONINDEX_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo actionIndex: int - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - actionIndex: _Optional[int] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., actionIndex: _Optional[int] = ...) -> None: ... class Response_GetAction(_message.Message): __slots__ = ("actionID", "actionClassID", "actionParameters") @@ -701,12 +505,7 @@ class Response_GetAction(_message.Message): actionID: int actionClassID: ActionClassID actionParameters: ActionParameters - def __init__( - self, - actionID: _Optional[int] = ..., - actionClassID: _Optional[_Union[ActionClassID, str]] = ..., - actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ..., - ) -> None: ... + def __init__(self, actionID: _Optional[int] = ..., actionClassID: _Optional[_Union[ActionClassID, str]] = ..., actionParameters: _Optional[_Union[ActionParameters, _Mapping]] = ...) -> None: ... class Request_RemoveAction(_message.Message): __slots__ = ("sessionInfo", "actionID") @@ -714,35 +513,25 @@ class Request_RemoveAction(_message.Message): ACTIONID_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo actionID: int - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - actionID: _Optional[int] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., actionID: _Optional[int] = ...) -> None: ... class Request_RemoveAllActions(_message.Message): __slots__ = ("sessionInfo",) SESSIONINFO_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo - def __init__( - self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ... class Request_StartBatchRun(_message.Message): __slots__ = ("sessionInfo",) SESSIONINFO_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo - def __init__( - self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ... class Request_StopBatchRun(_message.Message): __slots__ = ("sessionInfo",) SESSIONINFO_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo - def __init__( - self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ... - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ...) -> None: ... class Request_CaptureScreen(_message.Message): __slots__ = ("sessionInfo", "captureParameters") @@ -750,11 +539,7 @@ class Request_CaptureScreen(_message.Message): CAPTUREPARAMETERS_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo captureParameters: CaptureParameters - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - captureParameters: _Optional[_Union[CaptureParameters, _Mapping]] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., captureParameters: _Optional[_Union[CaptureParameters, _Mapping]] = ...) -> None: ... class Response_CaptureScreen(_message.Message): __slots__ = ("bitmap",) @@ -769,12 +554,7 @@ class Response_GetContinuousCapturedScreen(_message.Message): def __init__(self, bitmap: _Optional[_Union[Bitmap, _Mapping]] = ...) -> None: ... class Reuqest_SetTestConfiguration(_message.Message): - __slots__ = ( - "sessionInfo", - "defaultCaptureParameters", - "mouseDelayInMilliseconds", - "keyboardDelayInMilliseconds", - ) + __slots__ = ("sessionInfo", "defaultCaptureParameters", "mouseDelayInMilliseconds", "keyboardDelayInMilliseconds") SESSIONINFO_FIELD_NUMBER: _ClassVar[int] DEFAULTCAPTUREPARAMETERS_FIELD_NUMBER: _ClassVar[int] MOUSEDELAYINMILLISECONDS_FIELD_NUMBER: _ClassVar[int] @@ -783,13 +563,7 @@ class Reuqest_SetTestConfiguration(_message.Message): defaultCaptureParameters: CaptureParameters mouseDelayInMilliseconds: int keyboardDelayInMilliseconds: int - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - defaultCaptureParameters: _Optional[_Union[CaptureParameters, _Mapping]] = ..., - mouseDelayInMilliseconds: _Optional[int] = ..., - keyboardDelayInMilliseconds: _Optional[int] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., defaultCaptureParameters: _Optional[_Union[CaptureParameters, _Mapping]] = ..., mouseDelayInMilliseconds: _Optional[int] = ..., keyboardDelayInMilliseconds: _Optional[int] = ...) -> None: ... class Request_SetMouseDelay(_message.Message): __slots__ = ("sessionInfo", "delayInMilliseconds") @@ -797,11 +571,7 @@ class Request_SetMouseDelay(_message.Message): DELAYINMILLISECONDS_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo delayInMilliseconds: int - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - delayInMilliseconds: _Optional[int] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., delayInMilliseconds: _Optional[int] = ...) -> None: ... class Request_SetKeyboardDelay(_message.Message): __slots__ = ("sessionInfo", "delayInMilliseconds") @@ -809,11 +579,7 @@ class Request_SetKeyboardDelay(_message.Message): DELAYINMILLISECONDS_FIELD_NUMBER: _ClassVar[int] sessionInfo: SessionInfo delayInMilliseconds: int - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - delayInMilliseconds: _Optional[int] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., delayInMilliseconds: _Optional[int] = ...) -> None: ... class DisplayInformation(_message.Message): __slots__ = ("displayID", "name", "sizeInPixels", "virtualScreenRectangle") @@ -825,13 +591,7 @@ class DisplayInformation(_message.Message): name: str sizeInPixels: Size2 virtualScreenRectangle: Rectangle - def __init__( - self, - displayID: _Optional[int] = ..., - name: _Optional[str] = ..., - sizeInPixels: _Optional[_Union[Size2, _Mapping]] = ..., - virtualScreenRectangle: _Optional[_Union[Rectangle, _Mapping]] = ..., - ) -> None: ... + def __init__(self, displayID: _Optional[int] = ..., name: _Optional[str] = ..., sizeInPixels: _Optional[_Union[Size2, _Mapping]] = ..., virtualScreenRectangle: _Optional[_Union[Rectangle, _Mapping]] = ...) -> None: ... class Response_GetDisplayInformation(_message.Message): __slots__ = ("displays", "virtualScreenRectangle") @@ -839,11 +599,7 @@ class Response_GetDisplayInformation(_message.Message): VIRTUALSCREENRECTANGLE_FIELD_NUMBER: _ClassVar[int] displays: _containers.RepeatedCompositeFieldContainer[DisplayInformation] virtualScreenRectangle: Rectangle - def __init__( - self, - displays: _Optional[_Iterable[_Union[DisplayInformation, _Mapping]]] = ..., - virtualScreenRectangle: _Optional[_Union[Rectangle, _Mapping]] = ..., - ) -> None: ... + def __init__(self, displays: _Optional[_Iterable[_Union[DisplayInformation, _Mapping]]] = ..., virtualScreenRectangle: _Optional[_Union[Rectangle, _Mapping]] = ...) -> None: ... class Response_GetMousePosition(_message.Message): __slots__ = ("x", "y") @@ -853,12 +609,92 @@ class Response_GetMousePosition(_message.Message): y: int def __init__(self, x: _Optional[int] = ..., y: _Optional[int] = ...) -> None: ... +class ProcessInfoExtended(_message.Message): + __slots__ = ("hasWindow",) + HASWINDOW_FIELD_NUMBER: _ClassVar[int] + hasWindow: bool + def __init__(self, hasWindow: bool = ...) -> None: ... + +class ProcessInfo(_message.Message): + __slots__ = ("ID", "name", "extendedInfo") + ID_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + EXTENDEDINFO_FIELD_NUMBER: _ClassVar[int] + ID: int + name: str + extendedInfo: ProcessInfoExtended + def __init__(self, ID: _Optional[int] = ..., name: _Optional[str] = ..., extendedInfo: _Optional[_Union[ProcessInfoExtended, _Mapping]] = ...) -> None: ... + +class Request_GetProcessList(_message.Message): + __slots__ = ("getExtendedInfo",) + GETEXTENDEDINFO_FIELD_NUMBER: _ClassVar[int] + getExtendedInfo: bool + def __init__(self, getExtendedInfo: bool = ...) -> None: ... + +class Response_GetProcessList(_message.Message): + __slots__ = ("processes",) + PROCESSES_FIELD_NUMBER: _ClassVar[int] + processes: _containers.RepeatedCompositeFieldContainer[ProcessInfo] + def __init__(self, processes: _Optional[_Iterable[_Union[ProcessInfo, _Mapping]]] = ...) -> None: ... + +class Request_GetWindowList(_message.Message): + __slots__ = ("processID",) + PROCESSID_FIELD_NUMBER: _ClassVar[int] + processID: int + def __init__(self, processID: _Optional[int] = ...) -> None: ... + +class WindowInfo(_message.Message): + __slots__ = ("ID", "name") + ID_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + ID: int + name: str + def __init__(self, ID: _Optional[int] = ..., name: _Optional[str] = ...) -> None: ... + +class Response_GetWindowList(_message.Message): + __slots__ = ("windows",) + WINDOWS_FIELD_NUMBER: _ClassVar[int] + windows: _containers.RepeatedCompositeFieldContainer[WindowInfo] + def __init__(self, windows: _Optional[_Iterable[_Union[WindowInfo, _Mapping]]] = ...) -> None: ... + class Request_SetActiveDisplay(_message.Message): __slots__ = ("displayID",) DISPLAYID_FIELD_NUMBER: _ClassVar[int] displayID: int def __init__(self, displayID: _Optional[int] = ...) -> None: ... +class Request_SetActiveWindow(_message.Message): + __slots__ = ("processID", "windowID") + PROCESSID_FIELD_NUMBER: _ClassVar[int] + WINDOWID_FIELD_NUMBER: _ClassVar[int] + processID: int + windowID: int + def __init__(self, processID: _Optional[int] = ..., windowID: _Optional[int] = ...) -> None: ... + +class AutomationTarget(_message.Message): + __slots__ = ("ID", "type", "name", "active") + ID_FIELD_NUMBER: _ClassVar[int] + TYPE_FIELD_NUMBER: _ClassVar[int] + NAME_FIELD_NUMBER: _ClassVar[int] + ACTIVE_FIELD_NUMBER: _ClassVar[int] + ID: int + type: AutomationTargetType + name: str + active: bool + def __init__(self, ID: _Optional[int] = ..., type: _Optional[_Union[AutomationTargetType, str]] = ..., name: _Optional[str] = ..., active: bool = ...) -> None: ... + +class Response_GetAutomationTargetList(_message.Message): + __slots__ = ("targets",) + TARGETS_FIELD_NUMBER: _ClassVar[int] + targets: _containers.RepeatedCompositeFieldContainer[AutomationTarget] + def __init__(self, targets: _Optional[_Iterable[_Union[AutomationTarget, _Mapping]]] = ...) -> None: ... + +class Request_SetActiveAutomationTarget(_message.Message): + __slots__ = ("ID",) + ID_FIELD_NUMBER: _ClassVar[int] + ID: int + def __init__(self, ID: _Optional[int] = ...) -> None: ... + class Request_GetColor(_message.Message): __slots__ = ("x", "y", "bitmap") X_FIELD_NUMBER: _ClassVar[int] @@ -867,12 +703,7 @@ class Request_GetColor(_message.Message): x: int y: int bitmap: Bitmap - def __init__( - self, - x: _Optional[int] = ..., - y: _Optional[int] = ..., - bitmap: _Optional[_Union[Bitmap, _Mapping]] = ..., - ) -> None: ... + def __init__(self, x: _Optional[int] = ..., y: _Optional[int] = ..., bitmap: _Optional[_Union[Bitmap, _Mapping]] = ...) -> None: ... class Response_GetColor(_message.Message): __slots__ = ("color",) @@ -902,9 +733,4 @@ class Request_SetDisplayLabel(_message.Message): sessionInfo: SessionInfo displayID: int label: str - def __init__( - self, - sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., - displayID: _Optional[int] = ..., - label: _Optional[str] = ..., - ) -> None: ... + def __init__(self, sessionInfo: _Optional[_Union[SessionInfo, _Mapping]] = ..., displayID: _Optional[int] = ..., label: _Optional[str] = ...) -> None: ... diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/generated/Controller_V1_pb2_grpc.py b/src/askui/tools/askui/askui_ui_controller_grpc/generated/Controller_V1_pb2_grpc.py new file mode 100644 index 00000000..b831fb54 --- /dev/null +++ b/src/askui/tools/askui/askui_ui_controller_grpc/generated/Controller_V1_pb2_grpc.py @@ -0,0 +1,1314 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +# NOTE(OS): https://github.com/protocolbuffers/protobuf/issues/1491 +from . import Controller_V1_pb2 as Controller__V1__pb2 + +GRPC_GENERATED_VERSION = '1.71.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + f' but the generated code in Controller_V1_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class ControllerAPIStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.StartSession = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/StartSession', + request_serializer=Controller__V1__pb2.Request_StartSession.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_StartSession.FromString, + _registered_method=True) + self.EndSession = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/EndSession', + request_serializer=Controller__V1__pb2.Request_EndSession.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.Send = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/Send', + request_serializer=Controller__V1__pb2.Request_Send.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Send.FromString, + _registered_method=True) + self.Poll = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/Poll', + request_serializer=Controller__V1__pb2.Request_Poll.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Poll.FromString, + _registered_method=True) + self.StartExecution = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/StartExecution', + request_serializer=Controller__V1__pb2.Request_StartExecution.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.StopExecution = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/StopExecution', + request_serializer=Controller__V1__pb2.Request_StopExecution.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.RunRecordedAction = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/RunRecordedAction', + request_serializer=Controller__V1__pb2.Request_RunRecordedAction.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_RunRecordedAction.FromString, + _registered_method=True) + self.ScheduleBatchedAction = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/ScheduleBatchedAction', + request_serializer=Controller__V1__pb2.Request_ScheduleBatchedAction.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_ScheduleBatchedAction.FromString, + _registered_method=True) + self.StartBatchRun = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/StartBatchRun', + request_serializer=Controller__V1__pb2.Request_StartBatchRun.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.StopBatchRun = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/StopBatchRun', + request_serializer=Controller__V1__pb2.Request_StopBatchRun.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.GetActionCount = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/GetActionCount', + request_serializer=Controller__V1__pb2.Request_GetActionCount.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_GetActionCount.FromString, + _registered_method=True) + self.GetAction = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/GetAction', + request_serializer=Controller__V1__pb2.Request_GetAction.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_GetAction.FromString, + _registered_method=True) + self.RemoveAction = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/RemoveAction', + request_serializer=Controller__V1__pb2.Request_RemoveAction.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.RemoveAllActions = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/RemoveAllActions', + request_serializer=Controller__V1__pb2.Request_RemoveAllActions.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.CaptureScreen = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/CaptureScreen', + request_serializer=Controller__V1__pb2.Request_CaptureScreen.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_CaptureScreen.FromString, + _registered_method=True) + self.SetTestConfiguration = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/SetTestConfiguration', + request_serializer=Controller__V1__pb2.Reuqest_SetTestConfiguration.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.SetMouseDelay = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/SetMouseDelay', + request_serializer=Controller__V1__pb2.Request_SetMouseDelay.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.SetKeyboardDelay = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/SetKeyboardDelay', + request_serializer=Controller__V1__pb2.Request_SetKeyboardDelay.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.GetDisplayInformation = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/GetDisplayInformation', + request_serializer=Controller__V1__pb2.Request_Void.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_GetDisplayInformation.FromString, + _registered_method=True) + self.GetMousePosition = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/GetMousePosition', + request_serializer=Controller__V1__pb2.Request_Void.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_GetMousePosition.FromString, + _registered_method=True) + self.GetProcessList = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/GetProcessList', + request_serializer=Controller__V1__pb2.Request_GetProcessList.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_GetProcessList.FromString, + _registered_method=True) + self.GetWindowList = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/GetWindowList', + request_serializer=Controller__V1__pb2.Request_GetWindowList.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_GetWindowList.FromString, + _registered_method=True) + self.GetAutomationTargetList = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/GetAutomationTargetList', + request_serializer=Controller__V1__pb2.Request_Void.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_GetAutomationTargetList.FromString, + _registered_method=True) + self.SetActiveDisplay = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/SetActiveDisplay', + request_serializer=Controller__V1__pb2.Request_SetActiveDisplay.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.SetActiveWindow = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/SetActiveWindow', + request_serializer=Controller__V1__pb2.Request_SetActiveWindow.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.SetActiveAutomationTarget = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/SetActiveAutomationTarget', + request_serializer=Controller__V1__pb2.Request_SetActiveAutomationTarget.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + self.GetColor = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/GetColor', + request_serializer=Controller__V1__pb2.Request_GetColor.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_GetColor.FromString, + _registered_method=True) + self.GetPixelColor = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/GetPixelColor', + request_serializer=Controller__V1__pb2.Request_GetPixelColor.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_GetPixelColor.FromString, + _registered_method=True) + self.SetDisplayLabel = channel.unary_unary( + '/Askui.API.TDKv1.ControllerAPI/SetDisplayLabel', + request_serializer=Controller__V1__pb2.Request_SetDisplayLabel.SerializeToString, + response_deserializer=Controller__V1__pb2.Response_Void.FromString, + _registered_method=True) + + +class ControllerAPIServicer(object): + """Missing associated documentation comment in .proto file.""" + + def StartSession(self, request, context): + """General + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def EndSession(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Send(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Poll(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StartExecution(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StopExecution(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RunRecordedAction(self, request, context): + """Run action and record it + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ScheduleBatchedAction(self, request, context): + """Schedule an action + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StartBatchRun(self, request, context): + """Start and stop batched execution + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StopBatchRun(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetActionCount(self, request, context): + """Recorded or batched actions access + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetAction(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RemoveAction(self, request, context): + """Modify actions batch + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RemoveAllActions(self, request, context): + """Clear all batched or recorded actions + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CaptureScreen(self, request, context): + """Capturing + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetTestConfiguration(self, request, context): + """Configuration + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetMouseDelay(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetKeyboardDelay(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetDisplayInformation(self, request, context): + """Device Information + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetMousePosition(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetProcessList(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetWindowList(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetAutomationTargetList(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetActiveDisplay(self, request, context): + """Device Configuration + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetActiveWindow(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetActiveAutomationTarget(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetColor(self, request, context): + """Deprecated Utilities + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetPixelColor(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetDisplayLabel(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ControllerAPIServicer_to_server(servicer, server): + rpc_method_handlers = { + 'StartSession': grpc.unary_unary_rpc_method_handler( + servicer.StartSession, + request_deserializer=Controller__V1__pb2.Request_StartSession.FromString, + response_serializer=Controller__V1__pb2.Response_StartSession.SerializeToString, + ), + 'EndSession': grpc.unary_unary_rpc_method_handler( + servicer.EndSession, + request_deserializer=Controller__V1__pb2.Request_EndSession.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'Send': grpc.unary_unary_rpc_method_handler( + servicer.Send, + request_deserializer=Controller__V1__pb2.Request_Send.FromString, + response_serializer=Controller__V1__pb2.Response_Send.SerializeToString, + ), + 'Poll': grpc.unary_unary_rpc_method_handler( + servicer.Poll, + request_deserializer=Controller__V1__pb2.Request_Poll.FromString, + response_serializer=Controller__V1__pb2.Response_Poll.SerializeToString, + ), + 'StartExecution': grpc.unary_unary_rpc_method_handler( + servicer.StartExecution, + request_deserializer=Controller__V1__pb2.Request_StartExecution.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'StopExecution': grpc.unary_unary_rpc_method_handler( + servicer.StopExecution, + request_deserializer=Controller__V1__pb2.Request_StopExecution.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'RunRecordedAction': grpc.unary_unary_rpc_method_handler( + servicer.RunRecordedAction, + request_deserializer=Controller__V1__pb2.Request_RunRecordedAction.FromString, + response_serializer=Controller__V1__pb2.Response_RunRecordedAction.SerializeToString, + ), + 'ScheduleBatchedAction': grpc.unary_unary_rpc_method_handler( + servicer.ScheduleBatchedAction, + request_deserializer=Controller__V1__pb2.Request_ScheduleBatchedAction.FromString, + response_serializer=Controller__V1__pb2.Response_ScheduleBatchedAction.SerializeToString, + ), + 'StartBatchRun': grpc.unary_unary_rpc_method_handler( + servicer.StartBatchRun, + request_deserializer=Controller__V1__pb2.Request_StartBatchRun.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'StopBatchRun': grpc.unary_unary_rpc_method_handler( + servicer.StopBatchRun, + request_deserializer=Controller__V1__pb2.Request_StopBatchRun.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'GetActionCount': grpc.unary_unary_rpc_method_handler( + servicer.GetActionCount, + request_deserializer=Controller__V1__pb2.Request_GetActionCount.FromString, + response_serializer=Controller__V1__pb2.Response_GetActionCount.SerializeToString, + ), + 'GetAction': grpc.unary_unary_rpc_method_handler( + servicer.GetAction, + request_deserializer=Controller__V1__pb2.Request_GetAction.FromString, + response_serializer=Controller__V1__pb2.Response_GetAction.SerializeToString, + ), + 'RemoveAction': grpc.unary_unary_rpc_method_handler( + servicer.RemoveAction, + request_deserializer=Controller__V1__pb2.Request_RemoveAction.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'RemoveAllActions': grpc.unary_unary_rpc_method_handler( + servicer.RemoveAllActions, + request_deserializer=Controller__V1__pb2.Request_RemoveAllActions.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'CaptureScreen': grpc.unary_unary_rpc_method_handler( + servicer.CaptureScreen, + request_deserializer=Controller__V1__pb2.Request_CaptureScreen.FromString, + response_serializer=Controller__V1__pb2.Response_CaptureScreen.SerializeToString, + ), + 'SetTestConfiguration': grpc.unary_unary_rpc_method_handler( + servicer.SetTestConfiguration, + request_deserializer=Controller__V1__pb2.Reuqest_SetTestConfiguration.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'SetMouseDelay': grpc.unary_unary_rpc_method_handler( + servicer.SetMouseDelay, + request_deserializer=Controller__V1__pb2.Request_SetMouseDelay.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'SetKeyboardDelay': grpc.unary_unary_rpc_method_handler( + servicer.SetKeyboardDelay, + request_deserializer=Controller__V1__pb2.Request_SetKeyboardDelay.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'GetDisplayInformation': grpc.unary_unary_rpc_method_handler( + servicer.GetDisplayInformation, + request_deserializer=Controller__V1__pb2.Request_Void.FromString, + response_serializer=Controller__V1__pb2.Response_GetDisplayInformation.SerializeToString, + ), + 'GetMousePosition': grpc.unary_unary_rpc_method_handler( + servicer.GetMousePosition, + request_deserializer=Controller__V1__pb2.Request_Void.FromString, + response_serializer=Controller__V1__pb2.Response_GetMousePosition.SerializeToString, + ), + 'GetProcessList': grpc.unary_unary_rpc_method_handler( + servicer.GetProcessList, + request_deserializer=Controller__V1__pb2.Request_GetProcessList.FromString, + response_serializer=Controller__V1__pb2.Response_GetProcessList.SerializeToString, + ), + 'GetWindowList': grpc.unary_unary_rpc_method_handler( + servicer.GetWindowList, + request_deserializer=Controller__V1__pb2.Request_GetWindowList.FromString, + response_serializer=Controller__V1__pb2.Response_GetWindowList.SerializeToString, + ), + 'GetAutomationTargetList': grpc.unary_unary_rpc_method_handler( + servicer.GetAutomationTargetList, + request_deserializer=Controller__V1__pb2.Request_Void.FromString, + response_serializer=Controller__V1__pb2.Response_GetAutomationTargetList.SerializeToString, + ), + 'SetActiveDisplay': grpc.unary_unary_rpc_method_handler( + servicer.SetActiveDisplay, + request_deserializer=Controller__V1__pb2.Request_SetActiveDisplay.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'SetActiveWindow': grpc.unary_unary_rpc_method_handler( + servicer.SetActiveWindow, + request_deserializer=Controller__V1__pb2.Request_SetActiveWindow.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'SetActiveAutomationTarget': grpc.unary_unary_rpc_method_handler( + servicer.SetActiveAutomationTarget, + request_deserializer=Controller__V1__pb2.Request_SetActiveAutomationTarget.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + 'GetColor': grpc.unary_unary_rpc_method_handler( + servicer.GetColor, + request_deserializer=Controller__V1__pb2.Request_GetColor.FromString, + response_serializer=Controller__V1__pb2.Response_GetColor.SerializeToString, + ), + 'GetPixelColor': grpc.unary_unary_rpc_method_handler( + servicer.GetPixelColor, + request_deserializer=Controller__V1__pb2.Request_GetPixelColor.FromString, + response_serializer=Controller__V1__pb2.Response_GetPixelColor.SerializeToString, + ), + 'SetDisplayLabel': grpc.unary_unary_rpc_method_handler( + servicer.SetDisplayLabel, + request_deserializer=Controller__V1__pb2.Request_SetDisplayLabel.FromString, + response_serializer=Controller__V1__pb2.Response_Void.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'Askui.API.TDKv1.ControllerAPI', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('Askui.API.TDKv1.ControllerAPI', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class ControllerAPI(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def StartSession(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/StartSession', + Controller__V1__pb2.Request_StartSession.SerializeToString, + Controller__V1__pb2.Response_StartSession.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def EndSession(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/EndSession', + Controller__V1__pb2.Request_EndSession.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Send(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/Send', + Controller__V1__pb2.Request_Send.SerializeToString, + Controller__V1__pb2.Response_Send.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def Poll(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/Poll', + Controller__V1__pb2.Request_Poll.SerializeToString, + Controller__V1__pb2.Response_Poll.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def StartExecution(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/StartExecution', + Controller__V1__pb2.Request_StartExecution.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def StopExecution(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/StopExecution', + Controller__V1__pb2.Request_StopExecution.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RunRecordedAction(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/RunRecordedAction', + Controller__V1__pb2.Request_RunRecordedAction.SerializeToString, + Controller__V1__pb2.Response_RunRecordedAction.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ScheduleBatchedAction(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/ScheduleBatchedAction', + Controller__V1__pb2.Request_ScheduleBatchedAction.SerializeToString, + Controller__V1__pb2.Response_ScheduleBatchedAction.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def StartBatchRun(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/StartBatchRun', + Controller__V1__pb2.Request_StartBatchRun.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def StopBatchRun(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/StopBatchRun', + Controller__V1__pb2.Request_StopBatchRun.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetActionCount(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/GetActionCount', + Controller__V1__pb2.Request_GetActionCount.SerializeToString, + Controller__V1__pb2.Response_GetActionCount.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetAction(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/GetAction', + Controller__V1__pb2.Request_GetAction.SerializeToString, + Controller__V1__pb2.Response_GetAction.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RemoveAction(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/RemoveAction', + Controller__V1__pb2.Request_RemoveAction.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RemoveAllActions(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/RemoveAllActions', + Controller__V1__pb2.Request_RemoveAllActions.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CaptureScreen(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/CaptureScreen', + Controller__V1__pb2.Request_CaptureScreen.SerializeToString, + Controller__V1__pb2.Response_CaptureScreen.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SetTestConfiguration(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/SetTestConfiguration', + Controller__V1__pb2.Reuqest_SetTestConfiguration.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SetMouseDelay(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/SetMouseDelay', + Controller__V1__pb2.Request_SetMouseDelay.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SetKeyboardDelay(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/SetKeyboardDelay', + Controller__V1__pb2.Request_SetKeyboardDelay.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetDisplayInformation(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/GetDisplayInformation', + Controller__V1__pb2.Request_Void.SerializeToString, + Controller__V1__pb2.Response_GetDisplayInformation.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetMousePosition(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/GetMousePosition', + Controller__V1__pb2.Request_Void.SerializeToString, + Controller__V1__pb2.Response_GetMousePosition.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetProcessList(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/GetProcessList', + Controller__V1__pb2.Request_GetProcessList.SerializeToString, + Controller__V1__pb2.Response_GetProcessList.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetWindowList(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/GetWindowList', + Controller__V1__pb2.Request_GetWindowList.SerializeToString, + Controller__V1__pb2.Response_GetWindowList.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetAutomationTargetList(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/GetAutomationTargetList', + Controller__V1__pb2.Request_Void.SerializeToString, + Controller__V1__pb2.Response_GetAutomationTargetList.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SetActiveDisplay(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/SetActiveDisplay', + Controller__V1__pb2.Request_SetActiveDisplay.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SetActiveWindow(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/SetActiveWindow', + Controller__V1__pb2.Request_SetActiveWindow.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SetActiveAutomationTarget(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/SetActiveAutomationTarget', + Controller__V1__pb2.Request_SetActiveAutomationTarget.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetColor(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/GetColor', + Controller__V1__pb2.Request_GetColor.SerializeToString, + Controller__V1__pb2.Response_GetColor.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetPixelColor(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/GetPixelColor', + Controller__V1__pb2.Request_GetPixelColor.SerializeToString, + Controller__V1__pb2.Response_GetPixelColor.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SetDisplayLabel(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/Askui.API.TDKv1.ControllerAPI/SetDisplayLabel', + Controller__V1__pb2.Request_SetDisplayLabel.SerializeToString, + Controller__V1__pb2.Response_Void.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/generated/__init__.py b/src/askui/tools/askui/askui_ui_controller_grpc/generated/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/askui/tools/askui/askui_ui_controller_grpc/proto/Controller_V1.proto b/src/askui/tools/askui/askui_ui_controller_grpc/proto/Controller_V1.proto new file mode 100644 index 00000000..e8adc62a --- /dev/null +++ b/src/askui/tools/askui/askui_ui_controller_grpc/proto/Controller_V1.proto @@ -0,0 +1,539 @@ +syntax = "proto3"; + +package Askui.API.TDKv1; + +service ControllerAPI { + // General + rpc StartSession (Request_StartSession) returns (Response_StartSession) {} + rpc EndSession (Request_EndSession) returns (Response_Void) {} + + rpc Send (Request_Send) returns (Response_Send) {} + rpc Poll (Request_Poll) returns (Response_Poll) {} + + rpc StartExecution (Request_StartExecution) returns (Response_Void) {} + rpc StopExecution (Request_StopExecution) returns (Response_Void) {} + + // Run action and record it + rpc RunRecordedAction (Request_RunRecordedAction) returns (Response_RunRecordedAction) {} + + // Schedule an action + rpc ScheduleBatchedAction (Request_ScheduleBatchedAction) returns (Response_ScheduleBatchedAction) {} + + // Start and stop batched execution + rpc StartBatchRun (Request_StartBatchRun) returns (Response_Void) {} + rpc StopBatchRun(Request_StopBatchRun) returns (Response_Void) {} + + // Recorded or batched actions access + rpc GetActionCount (Request_GetActionCount) returns (Response_GetActionCount) {} + rpc GetAction (Request_GetAction) returns (Response_GetAction) {} + + // Modify actions batch + rpc RemoveAction (Request_RemoveAction) returns (Response_Void) {} + + // Clear all batched or recorded actions + rpc RemoveAllActions (Request_RemoveAllActions) returns (Response_Void) {} + + // Capturing + rpc CaptureScreen (Request_CaptureScreen) returns (Response_CaptureScreen) {} + + // Configuration + rpc SetTestConfiguration (Reuqest_SetTestConfiguration) returns (Response_Void) {} + rpc SetMouseDelay (Request_SetMouseDelay) returns (Response_Void) {} // TODO: TDKv2 should use push and pop instead. + rpc SetKeyboardDelay (Request_SetKeyboardDelay) returns (Response_Void) {} // TODO: TDKv2 should use push and pop instead. + + // Device Information + rpc GetDisplayInformation (Request_Void) returns (Response_GetDisplayInformation) {} + rpc GetMousePosition (Request_Void) returns (Response_GetMousePosition) {} + rpc GetProcessList (Request_GetProcessList) returns (Response_GetProcessList) {} + rpc GetWindowList (Request_GetWindowList) returns (Response_GetWindowList) {} + rpc GetAutomationTargetList (Request_Void) returns (Response_GetAutomationTargetList) {} + + // Device Configuration + rpc SetActiveDisplay (Request_SetActiveDisplay) returns (Response_Void) {} + rpc SetActiveWindow (Request_SetActiveWindow) returns (Response_Void) {} + rpc SetActiveAutomationTarget (Request_SetActiveAutomationTarget) returns (Response_Void) {} + + // Deprecated Utilities + rpc GetColor (Request_GetColor) returns (Response_GetColor) {} + rpc GetPixelColor (Request_GetPixelColor) returns (Response_GetPixelColor) {} + + rpc SetDisplayLabel(Request_SetDisplayLabel) returns (Response_Void) {} // TODO: Not yet implemented, supposded to be deleted if not needed. +} + +message Void {} + +message Request_Void {} +message Response_Void {} + +message Size2 { + uint32 width = 1; + uint32 height = 2; +} + +message Delta2 { + int32 x = 1; + int32 y = 2; +} + +message Coordinate2 { + int32 x = 1; + int32 y = 2; +} + +message Rectangle { + int32 left = 1; + int32 top = 2; + int32 right = 3; + int32 bottom = 4; +} + +message Bitmap { + uint32 width = 1; + uint32 height = 2; + uint32 lineWidth = 3; + uint32 bitsPerPixel = 4; + uint32 bytesPerPixel = 5; + bytes data = 6; +} + +message Color { + uint32 r = 1; + uint32 g = 2; + uint32 b = 3; +} + +message GUID { + uint64 highPart = 1; + uint64 lowPart = 2; +} + +message SessionInfo { + GUID sessionGUID = 1; + uint64 sessionID = 2; +} + +message CaptureArea { + Size2 size = 3; + Coordinate2 coordinate = 2; +} + +// Usage +// +// displayID: +// Value from 'DisplayInformation::displayID', use '0' if screenshots shall be taked from virtual sreen. +// +// captureArea: +// Defines either the area to capture on virtual screen or of the display if 'displayID'. +message CaptureParameters { + optional uint32 displayID = 1; + optional CaptureArea captureArea = 2; +} + +// +// Poll +enum PollEventID { + reserved 1; + + PollEventID_Undefined = 0; + //Any = 1; + PollEventID_ActionFinished = 2; +} + +message PollEventParameters_ActionFinished { + uint32 actionID = 1; +} + +message PollEventParameters { + oneof dataOf { + PollEventParameters_ActionFinished actionFinished = 1; + } +} + +// +// +enum MouseButton { + MouseButton_Undefined = 0; + + MouseButton_Left = 1; + MouseButton_Right = 2; + MouseButton_Middle = 3; +} + +// +// Action Parameters +enum ActionClassID { + ActionClassID_Undefined = 0; + + ActionClassID_Wait = 1; + + ActionClassID_MouseButton_Press = 8; + ActionClassID_MouseButton_Release = 9; + ActionClassID_MouseButton_PressAndRelease = 10; + ActionClassID_MouseWheelScroll = 11; + ActionClassID_MouseMove = 12; + ActionClassID_MouseMove_Delta = 13; + + ActionClassID_KeyboardKey_Press = 14; + ActionClassID_KeyboardKey_Release = 15; + ActionClassID_KeyboardKey_PressAndRelease = 16; + ActionClassID_KeyboardKeys_Press = 17; + ActionClassID_KeyboardKeys_Release = 18; + ActionClassID_KeyboardKeys_PressAndRelease = 19; + + ActionClassID_KeyboardType_Text = 20; + ActionClassID_KeyboardType_UnicodeText = 21; + + ActionClassID_RunCommand = 22; +} + +message ActionParameters_Wait { + uint32 milliseconds = 1; +} + +message ActionParameters_MouseButton_Press { + MouseButton mouseButton = 1; +} + +message ActionParameters_MouseButton_Release { + MouseButton mouseButton = 1; +} + +message ActionParameters_MouseButton_PressAndRelease { + MouseButton mouseButton = 1; + uint32 count = 2; +} + +enum MouseWheelDeltaType { + MouseWheelDelta_Undefined = 0; + MouseWheelDelta_Raw = 1; + MouseWheelDelta_Detent = 2; +} + +enum MouseWheelScrollDirection { + MouseWheelScrollDirection_Undefined = 0; + MouseWheelScrollDirection_Vertical = 1; + MouseWheelScrollDirection_Horizontal = 2; +} + +message ActionParameters_MouseWheelScroll { + MouseWheelScrollDirection direction = 1; + MouseWheelDeltaType deltaType = 2; + int32 delta = 3; + int32 milliseconds = 4; +} + +message ActionParameters_MouseMove { + Coordinate2 position = 1; + optional uint32 milliseconds = 2; +} + +message ActionParameters_MouseMove_Delta { + Delta2 delta = 1; + optional uint32 milliseconds = 2; +} + +message ActionParameters_KeyboardKey_Press { + string keyName = 1; + repeated string modifierKeyNames = 2; +} + +message ActionParameters_KeyboardKey_Release { + string keyName = 1; + repeated string modifierKeyNames = 2; +} + +message ActionParameters_KeyboardKey_PressAndRelease { + string keyName = 1; + repeated string modifierKeyNames = 2; +} + +message ActionParameters_KeyboardKeys_Press { + repeated string keyNames = 1; + repeated string modifierKeyNames = 2; +} + +message ActionParameters_KeyboardKeys_Release { + repeated string keyNames = 1; + repeated string modifierKeyNames = 2; +} + +message ActionParameters_KeyboardKeys_PressAndRelease { + repeated string keyNames = 1; + repeated string modifierKeyNames = 2; +} + +enum TypingSpeedValue { + TypingSpeedValue_Undefined = 0; + TypingSpeedValue_CharactersPerSecond = 1; + TypingSpeedValue_Seconds = 2; +} + +message ActionParameters_KeyboardType_Text { + string text = 1; + TypingSpeedValue typingSpeedValue = 2; + optional uint32 typingSpeed = 3; +} + +message ActionParameters_KeyboardType_UnicodeText { + bytes text = 1; + TypingSpeedValue typingSpeedValue = 2; + optional uint32 typingSpeed = 3; +} + +message ActionParameters_RunCommand { + string command = 1; + optional uint32 timeoutInMilliseconds = 2; +} + +message ActionParameters { + oneof dataOf { + Void none = 1; + ActionParameters_Wait wait = 2; + ActionParameters_MouseButton_Press mouseButtonPress = 3; + ActionParameters_MouseButton_Release mouseButtonRelease = 4; + ActionParameters_MouseButton_PressAndRelease mouseButtonPressAndRelease = 5; + ActionParameters_MouseWheelScroll mouseWheelScroll = 6; + ActionParameters_MouseMove mouseMove = 7; + ActionParameters_MouseMove_Delta mouseMoveDelta = 8; + ActionParameters_KeyboardKey_Press keyboardKeyPress = 9; + ActionParameters_KeyboardKey_Release keyboardKeyRelease = 10; + ActionParameters_KeyboardKey_PressAndRelease keyboardKeyPressAndRelease = 11; + ActionParameters_KeyboardKeys_Press keyboardKeysPress = 12; + ActionParameters_KeyboardKeys_Release keyboardKeysRelease = 13; + ActionParameters_KeyboardKeys_PressAndRelease keyboardKeysPressAndRelease = 14; + ActionParameters_KeyboardType_Text keyboardTypeText = 15; + ActionParameters_KeyboardType_UnicodeText keyboardTypeUnicodeText = 16; + ActionParameters_RunCommand runcommand = 17; + } +} + +// +// Request and Response Messages +message Request_StartSession { + string sessionGUID = 1; // "{62F7CE3F-D73B-4F96-826F-43D767DAB5C1}" + bool immediateExecution = 2; // true +} + +message Response_StartSession { + SessionInfo sessionInfo = 1; +} + +message Request_EndSession { + SessionInfo sessionInfo = 1; +} + +message Request_Send { + string message = 1; +} + +message Request_Poll { + SessionInfo sessionInfo = 1; + PollEventID pollEventID = 2; +} + +message Request_StartExecution { + SessionInfo sessionInfo = 1; +} + +message Request_StopExecution { + SessionInfo sessionInfo = 1; +} + +message Response_Send { + string message = 1; +} + +message Response_Poll { + PollEventID pollEventID = 1; + PollEventParameters pollEventParameters = 2; +} + +message Request_RunRecordedAction { + SessionInfo sessionInfo = 1; + ActionClassID actionClassID = 2; + ActionParameters actionParameters = 3; +} + +message Response_RunRecordedAction { + uint32 actionID = 1; + uint32 requiredMilliseconds = 2; +} + +message Request_ScheduleBatchedAction { + SessionInfo sessionInfo = 1; + ActionClassID actionClassID = 2; + ActionParameters actionParameters = 3; +} + +message Response_ScheduleBatchedAction { + uint32 actionID = 1; +} + +message Request_GetActionCount { + SessionInfo sessionInfo = 1; +} + +message Response_GetActionCount { + uint32 actionCount = 1; +} + +message Request_GetAction { + SessionInfo sessionInfo = 1; + uint32 actionIndex = 2; +} + +message Response_GetAction { + uint32 actionID = 1; + ActionClassID actionClassID = 2; + ActionParameters actionParameters = 3; +} + +message Request_RemoveAction { + SessionInfo sessionInfo = 1; + uint32 actionID = 2; +} + +message Request_RemoveAllActions { + SessionInfo sessionInfo = 1; +} + +message Request_StartBatchRun { + SessionInfo sessionInfo = 1; +} + +message Request_StopBatchRun { + SessionInfo sessionInfo = 1; +} + +message Request_CaptureScreen { + SessionInfo sessionInfo = 1; + optional CaptureParameters captureParameters = 2; +} + +message Response_CaptureScreen { + Bitmap bitmap = 1; +} + +message Response_GetContinuousCapturedScreen { + Bitmap bitmap = 1; +} + +message Reuqest_SetTestConfiguration { + SessionInfo sessionInfo = 1; + CaptureParameters defaultCaptureParameters = 2; + uint32 mouseDelayInMilliseconds = 3; + uint32 keyboardDelayInMilliseconds = 4; +} + +message Request_SetMouseDelay { + SessionInfo sessionInfo = 1; + uint32 delayInMilliseconds = 2; +} + +message Request_SetKeyboardDelay { + SessionInfo sessionInfo = 1; + uint32 delayInMilliseconds = 2; +} + +message DisplayInformation { + uint32 displayID = 1; + string name = 2; + Size2 sizeInPixels = 3; + Rectangle virtualScreenRectangle = 4; +} + +message Response_GetDisplayInformation { + repeated DisplayInformation displays = 1; + Rectangle virtualScreenRectangle = 2; +} + +message Response_GetMousePosition { + int32 x = 1; + int32 y = 2; +} + +message ProcessInfoExtended { + bool hasWindow = 1; +} + +message ProcessInfo { + uint64 ID = 1; + string name = 2; + optional ProcessInfoExtended extendedInfo = 3; +} + +message Request_GetProcessList { + bool getExtendedInfo = 1; +} + +message Response_GetProcessList { + repeated ProcessInfo processes = 1; +} + +message Request_GetWindowList { + uint64 processID = 1; +} + +message WindowInfo { + uint64 ID = 1; + string name = 2; +} + +message Response_GetWindowList { + repeated WindowInfo windows = 1; +} + +message Request_SetActiveDisplay { + uint32 displayID = 1; +} + +message Request_SetActiveWindow { + uint64 processID = 1; + uint64 windowID = 2; +} + +enum AutomationTargetType { + AutomationTarget_Local = 0; + AutomationTarget_Background = 1; + AutomationTarget_Companion = 2; +} + +message AutomationTarget { + uint64 ID = 1; + AutomationTargetType type = 2; + string name = 3; + bool active = 4; +} + +message Response_GetAutomationTargetList { + repeated AutomationTarget targets = 1; +} + +message Request_SetActiveAutomationTarget { + uint64 ID = 1; +} + +message Request_GetColor { + int32 x = 1; + int32 y = 2; + Bitmap bitmap = 3; +} + +message Response_GetColor { + Color color = 1; +} + +message Request_GetPixelColor { + int32 x = 1; + int32 y = 2; +} + +message Response_GetPixelColor { + Color color = 1; +} + +message Request_SetDisplayLabel { + SessionInfo sessionInfo = 1; + uint32 displayID = 2; + string label = 3; +} diff --git a/src/askui/tools/askui/mouse_cursor.py b/src/askui/tools/askui/mouse_cursor.py new file mode 100644 index 00000000..2e5d71ec --- /dev/null +++ b/src/askui/tools/askui/mouse_cursor.py @@ -0,0 +1,236 @@ +import time +from typing import TYPE_CHECKING, List + +from .render_objects import Location, RenderObjectStyle, create_location, create_style + +if TYPE_CHECKING: + from .askui_controller import AskUiControllerClient + + +class MouseCursor: + """ + A mouse cursor implementation using the AskUI rendering system. + + Creates and manages a visual mouse cursor that can be positioned and styled dynamically. + """ + + def __init__( + self, + controller: "AskUiControllerClient", + x: int = 0, + y: int = 0, + color: str = "#000000", + opacity: float = 1.0, + line_width: int = 2, + ) -> None: + """ + Initialize the mouse cursor. + + Args: + controller: The AskUI controller instance + x: Initial horizontal position + y: Initial vertical position + color: Cursor color (hex format) + opacity: Cursor opacity (0.0 to 1.0) + line_width: Line width for cursor outline + """ + self._controller = controller + self._cursor_id: int | None = None + self._current_x = x + self._current_y = y + self._color = color + self._opacity = opacity + self._line_width = line_width + self._visible = True + + self._base_cursor_shape: List[Location] = [ + {"x": 0, "y": 0}, # Tip + {"x": 5, "y": -15}, # Left bottom + {"x": 15, "y": -5}, # Right bottom + {"x": 0, "y": 0}, # Back to tip + ] + + self._current_style = self._create_current_style() + + def _create_current_style(self) -> RenderObjectStyle: + """Create the current style object for the cursor.""" + return create_style( + top=self._current_y, + left=self._current_x, + color=self._color, + opacity=self._opacity, + line_width=self._line_width, + visible=self._visible, + ) + + def create_cursor(self) -> int: + """ + Create the cursor render object. + + Returns: + The render object ID of the created cursor. + """ + if self._cursor_id is not None: + raise RuntimeError("Cursor already created") + + self._cursor_id = self._controller.add_line_render_object( + self._current_style, self._base_cursor_shape + ) + return self._cursor_id + + def update_cursor_position(self, x: int, y: int) -> None: + """ + Update the cursor position. + + Args: + x: New horizontal position + y: New vertical position + """ + if self._cursor_id is None: + raise RuntimeError("Cursor not created yet") + + if x == self._current_x and y == self._current_y: + return + + self._current_x = x + self._current_y = y + self._current_style = self._create_current_style() + + self._controller.update_render_object( + self._cursor_id, self._current_style, self._base_cursor_shape + ) + + def animate_to( + self, target_x: int, target_y: int, duration_ms: int = 500, frame_rate: int = 60 + ) -> None: + """ + Smoothly animate cursor to target position. + + Args: + target_x: Target horizontal position + target_y: Target vertical position + duration_ms: Animation duration in milliseconds + frame_rate: Animation frame rate (fps) + """ + if self._cursor_id is None: + raise RuntimeError("Cursor not created yet") + + start_x, start_y = self._current_x, self._current_y + + if start_x == target_x and start_y == target_y: + return + + total_frames = int((duration_ms / 1000) * frame_rate) + frame_delay = 1 / frame_rate + + for frame in range(total_frames + 1): + progress = frame / total_frames if total_frames > 0 else 1.0 + + current_x = int(start_x + (target_x - start_x) * progress) + current_y = int(start_y + (target_y - start_y) * progress) + + self.update_cursor_position(current_x, current_y) + + if frame < total_frames: + time.sleep(frame_delay) + + def update_cursor_color(self, color: str) -> None: + """ + Update the cursor color. + + Args: + color: New color (hex format like "#FF0000") + """ + if self._cursor_id is None: + raise RuntimeError("Cursor not created yet") + + if color == self._color: + return + + self._color = color + self._current_style = self._create_current_style() + + self._controller.update_render_object( + self._cursor_id, self._current_style, self._base_cursor_shape + ) + + def set_opacity(self, opacity: float) -> None: + """ + Set the cursor opacity. + + Args: + opacity: Opacity value (0.0 to 1.0) + """ + if self._cursor_id is None: + raise RuntimeError("Cursor not created yet") + + if opacity == self._opacity: + return + + self._opacity = opacity + self._current_style = self._create_current_style() + + self._controller.update_render_object( + self._cursor_id, self._current_style, self._base_cursor_shape + ) + + def show_cursor(self) -> None: + """Make the cursor visible.""" + if self._cursor_id is None: + raise RuntimeError("Cursor not created yet") + + if self._visible: + return + + self._visible = True + self._current_style = self._create_current_style() + + self._controller.update_render_object( + self._cursor_id, self._current_style, self._base_cursor_shape + ) + + def hide_cursor(self) -> None: + """Hide the cursor.""" + if self._cursor_id is None: + raise RuntimeError("Cursor not created yet") + + if not self._visible: + return + + self._visible = False + self._current_style = self._create_current_style() + + self._controller.update_render_object( + self._cursor_id, self._current_style, self._base_cursor_shape + ) + + def destroy_cursor(self) -> None: + """Destroy the cursor and clean up resources.""" + if self._cursor_id is not None: + self._controller.delete_render_object(self._cursor_id) + self._cursor_id = None + + @property + def cursor_id(self) -> int | None: + """Get the render object ID of the cursor.""" + return self._cursor_id + + @property + def position(self) -> Location: + """Get the current cursor position.""" + return create_location(self._current_x, self._current_y) + + @property + def color(self) -> str: + """Get the current cursor color.""" + return self._color + + @property + def opacity(self) -> float: + """Get the current cursor opacity.""" + return self._opacity + + @property + def visible(self) -> bool: + """Check if the cursor is visible.""" + return self._visible diff --git a/src/askui/tools/askui/render_objects.py b/src/askui/tools/askui/render_objects.py new file mode 100644 index 00000000..a70a00f4 --- /dev/null +++ b/src/askui/tools/askui/render_objects.py @@ -0,0 +1,343 @@ +from typing import Literal, TypedDict, Union + +from typing_extensions import NotRequired + +Length = Union[int, float, str] +Color = str + + +class Location(TypedDict): + x: Length + y: Length + + +class RenderObjectStyle(TypedDict, total=False): + """Style properties for render objects.""" + + top: NotRequired[Length] + left: NotRequired[Length] + bottom: NotRequired[Length] + right: NotRequired[Length] + width: NotRequired[Length] + height: NotRequired[Length] + color: NotRequired[Color] + opacity: NotRequired[float] + visible: NotRequired[bool] + font_size: NotRequired[Length] + line_width: NotRequired[Length] + + +class QuadRenderObject(TypedDict): + """Quad render object with no additional parameters.""" + + type: Literal["Quad"] + + +class LineRenderObject(TypedDict): + """Line render object with points array.""" + + type: Literal["Line"] + points: list[Location] + + +class ImageRenderObject(TypedDict): + """Image render object with base64 bitmap data.""" + + type: Literal["Image"] + bitmap_data: str + + +class TextRenderObject(TypedDict): + """Text render object with text content.""" + + type: Literal["Text"] + text: str + + +RenderObject = Union[ + QuadRenderObject, LineRenderObject, ImageRenderObject, TextRenderObject +] + + +class GetMousePositionCommand(TypedDict): + """Get mouse position command.""" + + name: Literal["GetMousePosition"] + parameters: list[None] + + +class SetMousePositionCommand(TypedDict): + """Set mouse position command.""" + + name: Literal["SetMousePosition"] + parameters: list[Location] + + +class AddRenderObjectCommand(TypedDict): + """Add render object command.""" + + name: Literal["AddRenderObject"] + parameters: list[Union[str, dict[str, object], list[Location]]] + + +class UpdateRenderObjectCommand(TypedDict): + """Update render object command.""" + + name: Literal["UpdateRenderObject"] + parameters: list[Union[int, dict[str, object], list[Location], str]] + + +class DeleteRenderObjectCommand(TypedDict): + """Delete render object command.""" + + name: Literal["DeleteRenderObject"] + parameters: list[int] + + +class ClearRenderObjectsCommand(TypedDict): + """Clear all render objects command.""" + + name: Literal["ClearRenderObjects"] + parameters: list[None] + + +RenderCommand = Union[ + GetMousePositionCommand, + SetMousePositionCommand, + AddRenderObjectCommand, + UpdateRenderObjectCommand, + DeleteRenderObjectCommand, + ClearRenderObjectsCommand, +] + + +class MousePositionData(TypedDict): + """Mouse position response data.""" + + position: Location + + +class RenderObjectIdData(TypedDict): + """Render object ID response data.""" + + id: int + + +class CommandResponse(TypedDict): + """Base response for commands.""" + + name: str + actionId: int + + +class AddRenderObjectResponse(TypedDict): + """Response for AddRenderObject command.""" + + name: Literal["AddRenderObject"] + actionId: int + response: RenderObjectIdData + + +class UpdateRenderObjectResponse(TypedDict): + """Response for UpdateRenderObject command.""" + + name: Literal["UpdateRenderObject"] + actionId: int + + +class DeleteRenderObjectResponse(TypedDict): + """Response for DeleteRenderObject command.""" + + name: Literal["DeleteRenderObject"] + actionId: int + + +class ClearRenderObjectsResponse(TypedDict): + """Response for ClearRenderObjects command.""" + + name: Literal["ClearRenderObjects"] + actionId: int + + +class GetMousePositionResponse(TypedDict): + """Response for GetMousePosition command.""" + + name: Literal["GetMousePosition"] + actionId: int + response: MousePositionData + + +class SetMousePositionResponse(TypedDict): + """Response for SetMousePosition command.""" + + name: Literal["SetMousePosition"] + actionId: int + + +RenderCommandResponse = Union[ + GetMousePositionResponse, + AddRenderObjectResponse, + UpdateRenderObjectResponse, + DeleteRenderObjectResponse, + ClearRenderObjectsResponse, + SetMousePositionResponse, +] + + +class RenderMessage(TypedDict): + """Message structure for render object API.""" + + header: dict[str, str] + command: RenderCommand + + +class ResponseCommandWrapper(TypedDict): + """Command wrapper for response messages.""" + + command: RenderCommandResponse + + +class RenderResponseMessage(TypedDict): + """Response message structure.""" + + message: ResponseCommandWrapper + + +def create_quad_command(style: RenderObjectStyle) -> AddRenderObjectCommand: + """Create a Quad render object command.""" + transformed_style = transform_style_for_serialization(style) + return { + "name": "AddRenderObject", + "parameters": ["Quad", transformed_style], + } + + +def create_line_command( + style: RenderObjectStyle, points: list[Location] +) -> AddRenderObjectCommand: + """Create a Line render object command.""" + transformed_style = transform_style_for_serialization(style) + return { + "name": "AddRenderObject", + "parameters": ["Line", transformed_style, points], + } + + +def create_image_command( + style: RenderObjectStyle, bitmap_data: str +) -> AddRenderObjectCommand: + """Create an Image render object command.""" + transformed_style = transform_style_for_serialization(style) + return { + "name": "AddRenderObject", + "parameters": ["Image", transformed_style, bitmap_data], + } + + +def create_text_command(style: RenderObjectStyle, text: str) -> AddRenderObjectCommand: + """Create a Text render object command.""" + transformed_style = transform_style_for_serialization(style) + return { + "name": "AddRenderObject", + "parameters": ["Text", transformed_style, text], + } + + +def create_get_mouse_position_command() -> GetMousePositionCommand: + """Create a GetMousePosition command.""" + return {"name": "GetMousePosition", "parameters": []} + + +def create_set_mouse_position_command(x: Length, y: Length) -> SetMousePositionCommand: + """Create a SetMousePosition command.""" + return {"name": "SetMousePosition", "parameters": [{"x": x, "y": y}]} + + +def create_update_render_object_command( + object_id: int, + style: RenderObjectStyle, + additional_params: Union[list[Location], str, None] = None, +) -> UpdateRenderObjectCommand: + """Create an UpdateRenderObject command.""" + transformed_style = transform_style_for_serialization(style) + parameters: list[Union[int, dict[str, object], list[Location], str]] = [ + object_id, + transformed_style, + ] + if additional_params is not None: + parameters.append(additional_params) + return {"name": "UpdateRenderObject", "parameters": parameters} + + +def create_delete_render_object_command(object_id: int) -> DeleteRenderObjectCommand: + """Create a DeleteRenderObject command.""" + return {"name": "DeleteRenderObject", "parameters": [object_id]} + + +def create_clear_render_objects_command() -> ClearRenderObjectsCommand: + """Create a ClearRenderObjects command.""" + return {"name": "ClearRenderObjects", "parameters": []} + + +def create_style( + top: Length | None = None, + left: Length | None = None, + bottom: Length | None = None, + right: Length | None = None, + width: Length | None = None, + height: Length | None = None, + color: Color | None = None, + opacity: float | None = None, + visible: bool | None = None, + font_size: Length | None = None, + line_width: Length | None = None, +) -> RenderObjectStyle: + """Create a style object with the specified properties.""" + style = RenderObjectStyle() + args_to_process = { + "top": top, + "left": left, + "bottom": bottom, + "right": right, + "width": width, + "height": height, + "color": color, + "opacity": opacity, + "visible": visible, + "font_size": font_size, + "line_width": line_width, + } + + for key, value in args_to_process.items(): + if value is not None: + style[key] = value # type: ignore[literal-required] + return style + + +def transform_style_for_serialization( + style: RenderObjectStyle, +) -> dict[str, object]: + """ + Transform style keys from snake_case to kebab-case for serialization. + + Args: + style (RenderObjectStyle): The style object to transform. + + Returns: + dict[str, object]: A new dictionary with transformed keys. + """ + key_mapping = { + "font_size": "font-size", + "line_width": "line-width", + } + + transformed_style: dict[str, object] = {} + for k, v in style.items(): + transformed_key = key_mapping.get(k, k) + transformed_style[transformed_key] = v + + return transformed_style + + +def create_location(x: Length, y: Length) -> Location: + return {"x": x, "y": y} diff --git a/tests/e2e/tools/askui/__init__.py b/tests/e2e/tools/askui/__init__.py new file mode 100644 index 00000000..480d03b7 --- /dev/null +++ b/tests/e2e/tools/askui/__init__.py @@ -0,0 +1 @@ +"""E2E tests for AskUI tools.""" diff --git a/tests/e2e/tools/askui/demo.py b/tests/e2e/tools/askui/demo.py new file mode 100644 index 00000000..77a4a1d7 --- /dev/null +++ b/tests/e2e/tools/askui/demo.py @@ -0,0 +1,147 @@ +from time import sleep + +import pytest + +from askui.reporting import CompositeReporter +from askui.tools.askui.askui_controller import ( + AskUiControllerClient, + AskUiControllerServer, +) +from askui.tools.askui.render_objects import create_style + + +@pytest.fixture +def controller_server() -> AskUiControllerServer: + """Fixture providing an AskUI controller server.""" + return AskUiControllerServer() + + +@pytest.fixture +def controller_client( + controller_server: AskUiControllerServer, +) -> AskUiControllerClient: + """Fixture providing an AskUI controller client.""" + return AskUiControllerClient( + reporter=CompositeReporter(), + display=1, + controller_server=controller_server, + ) + + +def test_demo(controller_client: AskUiControllerClient) -> None: + with controller_client: + text_array = [ + "Locating search bar", + "Search bar located", + "Moving cursor to search bar", + "Left clicked (400, 100)", + ] + + while True: + box_style = create_style( + top=1.0, + left=0.0, + width=0.2, + height=1.0, + color="#fafafa", + opacity=0.9, + visible=True, + ) + + box_id = controller_client.add_quad_render_object(box_style) + + font_size = 18 + line_height = font_size * 1.5 + start_y = 30 + start_x = 10 + + text_object_ids = [] + + # Locating search bar + y_position = start_y + (0 * line_height) + text_style = create_style( + top=f"{y_position}px", + left=start_x, + color="#404040", + font_size=font_size, + opacity=1.0, + visible=True, + ) + text_id = controller_client.add_text_render_object( + text_style, text_array[0] + ) + text_object_ids.append(text_id) + sleep(2) + + # search bar located + y_position = start_y + (1 * line_height) + text_style = create_style( + top=f"{y_position}px", + left=start_x, + color="#404040", + font_size=font_size, + opacity=1.0, + visible=True, + ) + text_id = controller_client.add_text_render_object( + text_style, text_array[1] + ) + text_object_ids.append(text_id) + + # draw search box overlay + box_style = create_style( + top=477, + left=525, + width=750, + height=50, + color="#c026d3", + opacity=0.5, + visible=True, + ) + box_id = controller_client.add_quad_render_object(box_style) + sleep(2) + + # moving cursor + y_position = start_y + (2 * line_height) + text_style = create_style( + top=f"{y_position}px", + left=start_x, + color="#404040", + font_size=font_size, + opacity=1.0, + visible=True, + ) + text_id = controller_client.add_text_render_object( + text_style, text_array[2] + ) + text_object_ids.append(text_id) + + # move cursor + cursor = controller_client.create_mouse_cursor(x=0, y=0, color="#00d492") + controller_client.animate_cursor_to(650, 455, 500) + sleep(1) + cursor.update_cursor_color(color="#00bcff") + sleep(2) + + # clicked + y_position = start_y + (3 * line_height) + text_style = create_style( + top=f"{y_position}px", + left=start_x, + color="#404040", + font_size=font_size, + opacity=1.0, + visible=True, + ) + text_id = controller_client.add_text_render_object( + text_style, text_array[3] + ) + text_object_ids.append(text_id) + sleep(2) + + for text_id in text_object_ids: + controller_client.delete_render_object(text_id) + + controller_client.delete_render_object(box_id) + controller_client.clear_render_objects() + diff --git a/tests/e2e/tools/askui/test_render_objects.py b/tests/e2e/tools/askui/test_render_objects.py new file mode 100644 index 00000000..c7b5e356 --- /dev/null +++ b/tests/e2e/tools/askui/test_render_objects.py @@ -0,0 +1,147 @@ +from time import sleep +import time + +import pytest + +from askui.reporting import CompositeReporter +from askui.tools.askui.askui_controller import ( + AskUiControllerClient, + AskUiControllerServer, +) +from askui.tools.askui.render_objects import create_location, create_style + + +@pytest.fixture +def controller_server() -> AskUiControllerServer: + """Fixture providing an AskUI controller server.""" + return AskUiControllerServer() + + +@pytest.fixture +def controller_client( + controller_server: AskUiControllerServer, +) -> AskUiControllerClient: + """Fixture providing an AskUI controller client.""" + return AskUiControllerClient( + reporter=CompositeReporter(), + display=1, + controller_server=controller_server, + ) + + +def test_add_quad_render_object(controller_client: AskUiControllerClient) -> None: + """Test adding a quad render object.""" + style = create_style( + top=100, + left=200, + width=50, + height=50, + color="#FF0000", + opacity=0.8 + ) + + with controller_client: + object_id = controller_client.add_quad_render_object(style) + assert isinstance(object_id, int) + assert object_id > 0 + + +def test_add_line_render_object(controller_client: AskUiControllerClient) -> None: + """Test adding a line render object.""" + style = create_style( + color="#00FF00", + line_width=3, + opacity=1.0 + ) + points = [ + create_location(100, 100), + create_location(200, 150), + create_location(150, 200) + ] + + with controller_client: + object_id = controller_client.add_line_render_object(style, points) + assert isinstance(object_id, int) + assert object_id > 0 + + +def test_add_image_render_object(controller_client: AskUiControllerClient) -> None: + """Test adding an image render object.""" + style = create_style( + top=50, + left=50, + width=100, + height=100, + opacity=0.9 + ) + # Simple 1x1 pixel red image as base64 + bitmap_data = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==" + + with controller_client: + object_id = controller_client.add_image_render_object(style, bitmap_data) + assert isinstance(object_id, int) + assert object_id > 0 + + +def test_add_text_render_object(controller_client: AskUiControllerClient) -> None: + """Test adding a text render object.""" + style = create_style( + top=300, + left=100, + color="#0000FF", + font_size=16, + opacity=1.0 + ) + text = "Test Text" + + with controller_client: + object_id = controller_client.add_text_render_object(style, text) + assert isinstance(object_id, int) + assert object_id > 0 + + +def test_get_mouse_position(controller_client: AskUiControllerClient) -> None: + """Test getting mouse position.""" + with controller_client: + position = controller_client.get_mouse_position() + assert "x" in position + assert "y" in position + assert isinstance(position["x"], (int, float)) + assert isinstance(position["y"], (int, float)) + + +def test_set_mouse_position(controller_client: AskUiControllerClient) -> None: + """Test setting mouse position.""" + target_x, target_y = 400, 300 + + with controller_client: + controller_client.set_mouse_position(target_x, target_y) + + current_position = controller_client.get_mouse_position() + assert current_position["x"] == target_x + assert current_position["y"] == target_y + + +def test_create_mouse_cursor(controller_client: AskUiControllerClient) -> None: + """Test creating a mouse cursor.""" + x, y = 100, 200 + color = "#FF0000" + + with controller_client: + cursor = controller_client.create_mouse_cursor(x, y, color) + assert cursor is not None + assert controller_client.cursor is cursor + + +def test_update_cursor_position(controller_client: AskUiControllerClient) -> None: + """Test updating cursor position.""" + initial_x, initial_y = 100, 200 + new_x, new_y = 300, 400 + + with controller_client: + controller_client.create_mouse_cursor(initial_x, initial_y) + controller_client.update_cursor_position(new_x, new_y) + assert controller_client.cursor is not None + assert controller_client.cursor.position["x"] == new_x + assert controller_client.cursor.position["y"] == new_y +