|
7 | 7 | from askui.models.shared.tool_tags import ToolTags |
8 | 8 |
|
9 | 9 | if TYPE_CHECKING: |
| 10 | + from askui.tools.askui.askui_ui_controller_grpc.generated import ( |
| 11 | + Controller_V1_pb2 as controller_v1_pbs, |
| 12 | + ) |
10 | 13 | from askui.tools.askui.askui_ui_controller_grpc.generated.AgentOS_Send_Request_2501 import ( # noqa: E501 |
11 | 14 | RenderObjectStyle, |
12 | 15 | ) |
| 16 | + from askui.tools.askui.askui_ui_controller_grpc.generated.AgentOS_Send_Response_2501 import ( # noqa: E501 |
| 17 | + GetActiveProcessResponseModel, |
| 18 | + GetActiveWindowResponseModel, |
| 19 | + GetSystemInfoResponseModel, |
| 20 | + ) |
13 | 21 |
|
14 | 22 | MouseButton = Literal["left", "middle", "right"] |
15 | 23 |
|
@@ -175,12 +183,16 @@ class Display(BaseModel): |
175 | 183 | ) |
176 | 184 |
|
177 | 185 | id: int = Field(validation_alias="displayID") |
| 186 | + name: str = Field(validation_alias="name") |
178 | 187 | size: DisplaySize = Field(validation_alias="sizeInPixels") |
179 | 188 |
|
180 | 189 |
|
181 | 190 | class DisplaysListResponse(BaseModel): |
182 | 191 | data: list[Display] = Field(validation_alias="displays") |
183 | 192 |
|
| 193 | + def __str__(self) -> str: |
| 194 | + return ",".join([str(display) for display in self.data]) |
| 195 | + |
184 | 196 |
|
185 | 197 | InputEvent = ClickEvent |
186 | 198 |
|
@@ -529,3 +541,121 @@ def clear_render_objects(self) -> None: |
529 | 541 | Response confirming the clearing. |
530 | 542 | """ |
531 | 543 | raise NotImplementedError |
| 544 | + |
| 545 | + def get_process_list( |
| 546 | + self, get_extended_info: bool = False |
| 547 | + ) -> "controller_v1_pbs.Response_GetProcessList": |
| 548 | + """ |
| 549 | + Get a list of running processes. |
| 550 | +
|
| 551 | + Args: |
| 552 | + get_extended_info (bool, optional): Whether to include |
| 553 | + extended process information. |
| 554 | + Defaults to `False`. |
| 555 | +
|
| 556 | + Returns: |
| 557 | + controller_v1_pbs.Response_GetProcessList: Process list response containing: |
| 558 | + - processes: List of ProcessInfo objects |
| 559 | + """ |
| 560 | + raise NotImplementedError |
| 561 | + |
| 562 | + def get_window_list( |
| 563 | + self, process_id: int |
| 564 | + ) -> "controller_v1_pbs.Response_GetWindowList": |
| 565 | + """ |
| 566 | + Get a list of windows for a specific process. |
| 567 | +
|
| 568 | + Args: |
| 569 | + process_id (int): The ID of the process to get windows for. |
| 570 | +
|
| 571 | + Returns: |
| 572 | + controller_v1_pbs.Response_GetWindowList: Window list response containing: |
| 573 | + - windows: List of WindowInfo objects with ID and name |
| 574 | + """ |
| 575 | + raise NotImplementedError |
| 576 | + |
| 577 | + def set_mouse_delay(self, delay_ms: int) -> None: |
| 578 | + """ |
| 579 | + Configure mouse action delay. |
| 580 | +
|
| 581 | + Args: |
| 582 | + delay_ms (int): The delay in milliseconds to set for mouse actions. |
| 583 | + """ |
| 584 | + raise NotImplementedError |
| 585 | + |
| 586 | + def set_keyboard_delay(self, delay_ms: int) -> None: |
| 587 | + """ |
| 588 | + Configure keyboard action delay. |
| 589 | +
|
| 590 | + Args: |
| 591 | + delay_ms (int): The delay in milliseconds to set for keyboard actions. |
| 592 | + """ |
| 593 | + raise NotImplementedError |
| 594 | + |
| 595 | + def set_active_window(self, process_id: int, window_id: int) -> int: |
| 596 | + """ |
| 597 | + Set the active window for automation. |
| 598 | + Adds the window as a virtual display and returns the display ID. |
| 599 | + It raises an error if display length is not increased after adding the window. |
| 600 | +
|
| 601 | + Args: |
| 602 | + process_id (int): The ID of the process that owns the window. |
| 603 | + window_id (int): The ID of the window to set as active. |
| 604 | +
|
| 605 | + Returns: |
| 606 | + int: The new Display ID. |
| 607 | +
|
| 608 | + Raises: |
| 609 | + AskUiControllerError: |
| 610 | + If display length is not increased after adding the window. |
| 611 | + """ |
| 612 | + raise NotImplementedError |
| 613 | + |
| 614 | + def get_system_info(self) -> "GetSystemInfoResponseModel": |
| 615 | + """ |
| 616 | + Get the system information. |
| 617 | +
|
| 618 | + Returns: |
| 619 | + GetSystemInfoResponseModel: The system information. |
| 620 | + """ |
| 621 | + raise NotImplementedError |
| 622 | + |
| 623 | + def get_active_process(self) -> "GetActiveProcessResponseModel": |
| 624 | + """ |
| 625 | + Get the active process. |
| 626 | +
|
| 627 | + Returns: |
| 628 | + GetActiveProcessResponseModel: The active process. |
| 629 | + """ |
| 630 | + raise NotImplementedError |
| 631 | + |
| 632 | + def set_active_process(self, process_id: int) -> None: |
| 633 | + """ |
| 634 | + Set the active process. |
| 635 | +
|
| 636 | + Args: |
| 637 | + process_id (int): The ID of the process to set as active. |
| 638 | + """ |
| 639 | + raise NotImplementedError |
| 640 | + |
| 641 | + def get_active_window(self) -> "GetActiveWindowResponseModel": |
| 642 | + """ |
| 643 | + Gets the window id and name in addition to the process id |
| 644 | + and name of the currently active window (in focus). |
| 645 | +
|
| 646 | + Returns: |
| 647 | + GetActiveWindowResponseModel: The active window. |
| 648 | + """ |
| 649 | + raise NotImplementedError |
| 650 | + |
| 651 | + def set_window_in_focus(self, process_id: int, window_id: int) -> None: |
| 652 | + """ |
| 653 | + Sets the window with the specified windowId of the process |
| 654 | + with the specified processId active, |
| 655 | + which brings it to the front and gives it focus. |
| 656 | +
|
| 657 | + Args: |
| 658 | + process_id (int): The ID of the process that owns the window. |
| 659 | + window_id (int): The ID of the window to set as active. |
| 660 | + """ |
| 661 | + raise NotImplementedError |
0 commit comments