3232from astrbot .core .provider .entites import ProviderRequest
3333from astrbot .core .provider .register import llm_tools
3434from astrbot .core .tools .computer_tools import (
35+ CuaKeyboardTypeTool ,
36+ CuaMouseClickTool ,
37+ CuaScreenshotTool ,
3538 ExecuteShellTool ,
3639 FileDownloadTool ,
3740 FileEditTool ,
@@ -187,7 +190,9 @@ def _get_runtime_computer_tools(
187190 cls ,
188191 runtime : str ,
189192 tool_mgr ,
193+ booter : str | None = None ,
190194 ) -> dict [str , FunctionTool ]:
195+ booter = "" if booter is None else str (booter ).lower ()
191196 if runtime == "sandbox" :
192197 shell_tool = tool_mgr .get_builtin_tool (ExecuteShellTool )
193198 python_tool = tool_mgr .get_builtin_tool (PythonTool )
@@ -197,7 +202,7 @@ def _get_runtime_computer_tools(
197202 write_tool = tool_mgr .get_builtin_tool (FileWriteTool )
198203 edit_tool = tool_mgr .get_builtin_tool (FileEditTool )
199204 grep_tool = tool_mgr .get_builtin_tool (GrepTool )
200- return {
205+ tools = {
201206 shell_tool .name : shell_tool ,
202207 python_tool .name : python_tool ,
203208 upload_tool .name : upload_tool ,
@@ -207,6 +212,18 @@ def _get_runtime_computer_tools(
207212 edit_tool .name : edit_tool ,
208213 grep_tool .name : grep_tool ,
209214 }
215+ if booter == "cua" :
216+ screenshot_tool = tool_mgr .get_builtin_tool (CuaScreenshotTool )
217+ mouse_click_tool = tool_mgr .get_builtin_tool (CuaMouseClickTool )
218+ keyboard_type_tool = tool_mgr .get_builtin_tool (CuaKeyboardTypeTool )
219+ tools .update (
220+ {
221+ screenshot_tool .name : screenshot_tool ,
222+ mouse_click_tool .name : mouse_click_tool ,
223+ keyboard_type_tool .name : keyboard_type_tool ,
224+ }
225+ )
226+ return tools
210227 if runtime == "local" :
211228 shell_tool = tool_mgr .get_builtin_tool (ExecuteShellTool )
212229 python_tool = tool_mgr .get_builtin_tool (LocalPythonTool )
@@ -243,6 +260,7 @@ def _build_handoff_toolset(
243260 runtime_computer_tools = cls ._get_runtime_computer_tools (
244261 runtime ,
245262 tool_mgr ,
263+ provider_settings .get ("sandbox" , {}).get ("booter" ),
246264 )
247265
248266 # Keep persona semantics aligned with the main agent: tools=None means
0 commit comments