File tree Expand file tree Collapse file tree 5 files changed +32
-31
lines changed
migrations/shared/assistants Expand file tree Collapse file tree 5 files changed +32
-31
lines changed Original file line number Diff line number Diff line change 22
33from askui .tools .askui .askui_controller import AskUiControllerClient
44from askui .tools .computer import (
5+ ComputerConnectTool ,
56 ComputerDisconnectTool ,
67 ComputerGetMousePositionTool ,
78 ComputerKeyboardPressedTool ,
1314 ComputerMouseReleaseTool ,
1415 ComputerMouseScrollTool ,
1516 ComputerMoveMouseTool ,
16- ComputerReconnectTool ,
1717 ComputerRetrieveActiveDisplayTool ,
1818 ComputerScreenshotTool ,
1919 ComputerSetActiveDisplayTool ,
4141 ComputerScreenshotTool (COMPUTER_AGENT_OS_FACADE ),
4242 ComputerSetActiveDisplayTool (COMPUTER_AGENT_OS_FACADE ),
4343 ComputerTypeTool (COMPUTER_AGENT_OS_FACADE ),
44- ComputerReconnectTool (COMPUTER_AGENT_OS_FACADE ),
44+ ComputerConnectTool (COMPUTER_AGENT_OS_FACADE ),
4545 ComputerDisconnectTool (COMPUTER_AGENT_OS_FACADE ),
4646]
4747
Original file line number Diff line number Diff line change 2525 ),
2626 tools = [
2727 "computer_disconnect" ,
28- "computer_reconnect " ,
28+ "computer_connect " ,
2929 "computer_mouse_click" ,
3030 "computer_get_mouse_position" ,
3131 "computer_keyboard_pressed" ,
Original file line number Diff line number Diff line change 1+ from .connect_tool import ComputerConnectTool
12from .disconnect_tool import ComputerDisconnectTool
23from .get_mouse_position_tool import ComputerGetMousePositionTool
34from .keyboard_pressed_tool import ComputerKeyboardPressedTool
910from .mouse_release_tool import ComputerMouseReleaseTool
1011from .mouse_scroll_tool import ComputerMouseScrollTool
1112from .move_mouse_tool import ComputerMoveMouseTool
12- from .reconnect_tool import ComputerReconnectTool
1313from .retrieve_active_display_tool import ComputerRetrieveActiveDisplayTool
1414from .screenshot_tool import ComputerScreenshotTool
1515from .set_active_display_tool import ComputerSetActiveDisplayTool
1616from .type_tool import ComputerTypeTool
1717
1818__all__ = [
19- "ComputerReconnectTool " ,
19+ "ComputerConnectTool " ,
2020 "ComputerDisconnectTool" ,
2121 "ComputerGetMousePositionTool" ,
2222 "ComputerKeyboardPressedTool" ,
Original file line number Diff line number Diff line change 1+ from askui .models .shared import ComputerBaseTool
2+ from askui .tools .computer_agent_os_facade import ComputerAgentOsFacade
3+
4+
5+ class ComputerConnectTool (ComputerBaseTool ):
6+ """Computer Connect Tool"""
7+
8+ def __init__ (self , agent_os : ComputerAgentOsFacade | None = None ) -> None :
9+ super ().__init__ (
10+ name = "computer_connect" ,
11+ description = (
12+ "Connect to the agent OS controller to enable computer control. "
13+ "Useful for establishing an initial connection or reconnecting "
14+ "after controller errors. If already connected, this will "
15+ "disconnect and reconnect, which may cause previous configuration "
16+ "to be lost (e.g., selected display must be reconfigured)."
17+ "Must be used once before any other computer tools are used."
18+ ),
19+ agent_os = agent_os ,
20+ )
21+
22+ def __call__ (self ) -> str :
23+ try :
24+ self .agent_os .disconnect ()
25+ finally :
26+ self .agent_os .connect ()
27+ return "Agent OS controller was connected." # noqa: B012
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments