computer-use-ootb-internal 0.0.144__py3-none-any.whl → 0.0.146__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +1,40 @@
1
- """
2
- Test script to verify cursor animation is working
3
- """
4
- import asyncio
5
- import sys
6
- import time
7
- from pathlib import Path
8
- from computer_use_ootb_internal.computer_use_demo.tools.computer import ComputerTool
9
-
10
- async def test_animations():
11
-
12
- # Initialize the computer tool
13
- computer = ComputerTool()
14
-
15
- # Test mouse move animation
16
- print("Testing mouse move animation...")
17
- await computer(action="mouse_move_windll", coordinate=(500, 500))
18
- print("Waiting 2 seconds...")
19
- await asyncio.sleep(2)
20
-
21
- # Test click animation
22
- print("Testing click animation...")
23
- await computer(action="left_click_windll", coordinate=(700, 300))
24
- print("Waiting 2 seconds...")
25
- await asyncio.sleep(2)
26
-
27
- # Test another move
28
- print("Testing move and click sequence...")
29
- await computer(action="mouse_move_windll", coordinate=(300, 300))
30
- await asyncio.sleep(1)
31
- await computer(action="left_click_windll", coordinate=(300, 300))
32
-
33
- # Wait for animations to complete
34
- print("Waiting for animations to complete...")
35
- await asyncio.sleep(3)
36
-
37
- print("Test completed")
38
-
39
- if __name__ == "__main__":
1
+ """
2
+ Test script to verify cursor animation is working
3
+ """
4
+ import asyncio
5
+ import sys
6
+ import time
7
+ from pathlib import Path
8
+ from computer_use_ootb_internal.computer_use_demo.tools.computer import ComputerTool
9
+
10
+ async def test_animations():
11
+
12
+ # Initialize the computer tool
13
+ computer = ComputerTool()
14
+
15
+ # Test mouse move animation
16
+ print("Testing mouse move animation...")
17
+ await computer(action="mouse_move_windll", coordinate=(500, 500))
18
+ print("Waiting 2 seconds...")
19
+ await asyncio.sleep(2)
20
+
21
+ # Test click animation
22
+ print("Testing click animation...")
23
+ await computer(action="left_click_windll", coordinate=(700, 300))
24
+ print("Waiting 2 seconds...")
25
+ await asyncio.sleep(2)
26
+
27
+ # Test another move
28
+ print("Testing move and click sequence...")
29
+ await computer(action="mouse_move_windll", coordinate=(300, 300))
30
+ await asyncio.sleep(1)
31
+ await computer(action="left_click_windll", coordinate=(300, 300))
32
+
33
+ # Wait for animations to complete
34
+ print("Waiting for animations to complete...")
35
+ await asyncio.sleep(3)
36
+
37
+ print("Test completed")
38
+
39
+ if __name__ == "__main__":
40
40
  asyncio.run(test_animations())
@@ -374,6 +374,7 @@ class ComputerTool(BaseAnthropicTool):
374
374
  if action in ("left_click_windll", "mouse_move_windll", "right_click_windll", "key_down_windll", "key_up_windll"):
375
375
  if action == "left_click_windll":
376
376
  if coordinate is None:
377
+ time.sleep(0.5)
377
378
  x, y = pyautogui.position()
378
379
  show_click(x, y)
379
380
  self.marbot_auto_gui.click()
@@ -381,6 +382,8 @@ class ComputerTool(BaseAnthropicTool):
381
382
  x = coordinate[0]+self.offset_x
382
383
  y = coordinate[1]+self.offset_y
383
384
  show_click(x, y)
385
+ time.sleep(0.25)
386
+ self.marbot_auto_gui.click(x=x, y=y)
384
387
  self.marbot_auto_gui.click(x=x, y=y)
385
388
  return ToolResult(output=f"Left click", action_base_type="click")
386
389
 
@@ -388,6 +391,7 @@ class ComputerTool(BaseAnthropicTool):
388
391
  if coordinate is None:
389
392
  raise ToolError(output=f"coordinate is required for {action}", action_base_type="error")
390
393
 
394
+ time.sleep(0.25)
391
395
  x0, y0 = pyautogui.position()
392
396
  # x0, y0 = self.scale_coordinates(ScalingSource.COMPUTER, x0, y0)
393
397
  x1 = coordinate[0]+self.offset_x
@@ -395,6 +399,7 @@ class ComputerTool(BaseAnthropicTool):
395
399
 
396
400
  show_move_to(x0, y0, x1, y1)
397
401
  self.marbot_auto_gui.moveTo(x=x1, y=y1)
402
+ time.sleep(0.5)
398
403
 
399
404
  return ToolResult(output=f"Mouse move", action_base_type="move")
400
405
 
@@ -402,9 +407,11 @@ class ComputerTool(BaseAnthropicTool):
402
407
  # self.marbot_auto_gui.rightClick(x=coordinate[0], y=coordinate[1])
403
408
  elif action == "key_down_windll":
404
409
  self.marbot_auto_gui.keyDown(text)
410
+ time.sleep(0.5)
405
411
  return ToolResult(output=f"Key down '{text}'", type="hidden", action_base_type="key")
406
412
 
407
413
  elif action == "key_up_windll":
414
+ time.sleep(0.5)
408
415
  self.marbot_auto_gui.keyUp(text)
409
416
  return ToolResult(output=f"Key up '{text}'", type="hidden", action_base_type="key")
410
417