oagi-core 0.13.1__py3-none-any.whl → 0.13.2__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.
- oagi/handler/pyautogui_action_handler.py +17 -4
- {oagi_core-0.13.1.dist-info → oagi_core-0.13.2.dist-info}/METADATA +1 -1
- {oagi_core-0.13.1.dist-info → oagi_core-0.13.2.dist-info}/RECORD +6 -6
- {oagi_core-0.13.1.dist-info → oagi_core-0.13.2.dist-info}/WHEEL +0 -0
- {oagi_core-0.13.1.dist-info → oagi_core-0.13.2.dist-info}/entry_points.txt +0 -0
- {oagi_core-0.13.1.dist-info → oagi_core-0.13.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -51,6 +51,10 @@ class PyautoguiConfig(BaseModel):
|
|
|
51
51
|
default=True,
|
|
52
52
|
description="Replace 'ctrl' with 'command' in hotkey combinations on macOS",
|
|
53
53
|
)
|
|
54
|
+
click_pre_delay: float = Field(
|
|
55
|
+
default=0.1,
|
|
56
|
+
description="Delay in seconds after moving to position before clicking",
|
|
57
|
+
)
|
|
54
58
|
|
|
55
59
|
|
|
56
60
|
class PyautoguiActionHandler:
|
|
@@ -158,6 +162,11 @@ class PyautoguiActionHandler:
|
|
|
158
162
|
keys = [self._normalize_key(key) for key in args_str.split("+")]
|
|
159
163
|
return keys
|
|
160
164
|
|
|
165
|
+
def _move_and_wait(self, x: int, y: int) -> None:
|
|
166
|
+
"""Move cursor to position and wait before clicking."""
|
|
167
|
+
pyautogui.moveTo(x, y)
|
|
168
|
+
time.sleep(self.config.click_pre_delay)
|
|
169
|
+
|
|
161
170
|
def _execute_single_action(self, action: Action) -> None:
|
|
162
171
|
"""Execute a single action once."""
|
|
163
172
|
arg = action.argument.strip("()") # Remove outer parentheses if present
|
|
@@ -165,25 +174,29 @@ class PyautoguiActionHandler:
|
|
|
165
174
|
match action.type:
|
|
166
175
|
case ActionType.CLICK:
|
|
167
176
|
x, y = self._parse_coords(arg)
|
|
168
|
-
|
|
177
|
+
self._move_and_wait(x, y)
|
|
178
|
+
pyautogui.click()
|
|
169
179
|
|
|
170
180
|
case ActionType.LEFT_DOUBLE:
|
|
171
181
|
x, y = self._parse_coords(arg)
|
|
182
|
+
self._move_and_wait(x, y)
|
|
172
183
|
if sys.platform == "darwin":
|
|
173
184
|
_macos.macos_click(x, y, clicks=2)
|
|
174
185
|
else:
|
|
175
|
-
pyautogui.doubleClick(
|
|
186
|
+
pyautogui.doubleClick()
|
|
176
187
|
|
|
177
188
|
case ActionType.LEFT_TRIPLE:
|
|
178
189
|
x, y = self._parse_coords(arg)
|
|
190
|
+
self._move_and_wait(x, y)
|
|
179
191
|
if sys.platform == "darwin":
|
|
180
192
|
_macos.macos_click(x, y, clicks=3)
|
|
181
193
|
else:
|
|
182
|
-
pyautogui.tripleClick(
|
|
194
|
+
pyautogui.tripleClick()
|
|
183
195
|
|
|
184
196
|
case ActionType.RIGHT_SINGLE:
|
|
185
197
|
x, y = self._parse_coords(arg)
|
|
186
|
-
|
|
198
|
+
self._move_and_wait(x, y)
|
|
199
|
+
pyautogui.rightClick()
|
|
187
200
|
|
|
188
201
|
case ActionType.DRAG:
|
|
189
202
|
x1, y1, x2, y2 = self._parse_drag_coords(arg)
|
|
@@ -46,7 +46,7 @@ oagi/handler/async_screenshot_maker.py,sha256=8QCtUV59ozpOpvkqhUMb8QDI2qje2gsoFT
|
|
|
46
46
|
oagi/handler/async_ydotool_action_handler.py,sha256=BRGqZB2u1k7R1acUX9k0TfdrmWS2eh3opc8LoqnlwJ4,1848
|
|
47
47
|
oagi/handler/capslock_manager.py,sha256=40LzWt1_1wbncF5koUTdbd9V3eo5Ex_mEWwjtEmHAf4,1878
|
|
48
48
|
oagi/handler/pil_image.py,sha256=GQw2o8ORQinrM3AxhgNBbLhrkZajOL8YagU7UF-kkes,4357
|
|
49
|
-
oagi/handler/pyautogui_action_handler.py,sha256=
|
|
49
|
+
oagi/handler/pyautogui_action_handler.py,sha256=P6YPgsXr3mQn_lh6rVLzWBomg9s5EIwbKZYbOgCAa5A,10640
|
|
50
50
|
oagi/handler/screenshot_maker.py,sha256=j1jTW-awx3vAnb1N5_FIMBC0Z-rNVQbiBP-S6Gh5dlE,1284
|
|
51
51
|
oagi/handler/utils.py,sha256=jj10z-v4_LUuVb8aClyXkUfZVEaqsWgi3be4t3Gw7oI,697
|
|
52
52
|
oagi/handler/wayland_support.py,sha256=jeQDqpwAxxREaGAYePQuK14nuEMPGmMEvMz2ymS-rT4,7727
|
|
@@ -75,8 +75,8 @@ oagi/types/models/step.py,sha256=RSI4H_2rrUBq_xyCoWKaq7JHdJWNobtQppaKC1l0aWU,471
|
|
|
75
75
|
oagi/utils/__init__.py,sha256=vHXyX66hEsf33OJJkmZSUjaTYU0UngfbtjcZgxfOj3A,441
|
|
76
76
|
oagi/utils/output_parser.py,sha256=U7vzmoD8pyzDg23z3vy-L9a_jKPsAlr3x8lIdPszrY8,5322
|
|
77
77
|
oagi/utils/prompt_builder.py,sha256=_Q1HY82YUrq3jSCTZ3Rszu3qmI3Wn_fmq8hf14NuwQM,2180
|
|
78
|
-
oagi_core-0.13.
|
|
79
|
-
oagi_core-0.13.
|
|
80
|
-
oagi_core-0.13.
|
|
81
|
-
oagi_core-0.13.
|
|
82
|
-
oagi_core-0.13.
|
|
78
|
+
oagi_core-0.13.2.dist-info/METADATA,sha256=DfZTkJyg0UmS4UH4V67rHhrsdfonwImQnSz7zOdI3QQ,14203
|
|
79
|
+
oagi_core-0.13.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
80
|
+
oagi_core-0.13.2.dist-info/entry_points.txt,sha256=zzgsOSWX6aN3KUB0Z1it8DMxFFBJBqmZVqMVAJRjYuw,44
|
|
81
|
+
oagi_core-0.13.2.dist-info/licenses/LICENSE,sha256=sy5DLA2M29jFT4UfWsuBF9BAr3FnRkYtnAu6oDZiIf8,1075
|
|
82
|
+
oagi_core-0.13.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|