oagi-core 0.13.0__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/actor/base.py CHANGED
@@ -10,8 +10,8 @@ from uuid import uuid4
10
10
 
11
11
  from ..constants import (
12
12
  DEFAULT_MAX_STEPS,
13
- MAX_STEPS_ACTOR,
14
- MAX_STEPS_THINKER,
13
+ MAX_STEPS_ALLOWED_ACTOR,
14
+ MAX_STEPS_ALLOWED_THINKER,
15
15
  MODEL_THINKER,
16
16
  )
17
17
  from ..logging import get_logger
@@ -51,7 +51,11 @@ class BaseActor:
51
51
  Returns:
52
52
  Validated max_steps (capped to model limit if exceeded)
53
53
  """
54
- limit = MAX_STEPS_THINKER if self.model == MODEL_THINKER else MAX_STEPS_ACTOR
54
+ limit = (
55
+ MAX_STEPS_ALLOWED_THINKER
56
+ if self.model == MODEL_THINKER
57
+ else MAX_STEPS_ALLOWED_ACTOR
58
+ )
55
59
  if max_steps > limit:
56
60
  logger.warning(
57
61
  f"max_steps ({max_steps}) exceeds limit for model '{self.model}'. "
oagi/constants.py CHANGED
@@ -27,8 +27,8 @@ DEFAULT_MAX_STEPS_THINKER = 100
27
27
  DEFAULT_MAX_STEPS_TASKER = 60
28
28
 
29
29
  # Maximum allowed steps per model (hard limits)
30
- MAX_STEPS_ACTOR = 30
31
- MAX_STEPS_THINKER = 120
30
+ MAX_STEPS_ALLOWED_ACTOR = 100
31
+ MAX_STEPS_ALLOWED_THINKER = 300
32
32
 
33
33
  # Reflection intervals
34
34
  DEFAULT_REFLECTION_INTERVAL = 4
@@ -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
- pyautogui.click(x, y)
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(x, y)
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(x, y)
194
+ pyautogui.tripleClick()
183
195
 
184
196
  case ActionType.RIGHT_SINGLE:
185
197
  x, y = self._parse_coords(arg)
186
- pyautogui.rightClick(x, y)
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: oagi-core
3
- Version: 0.13.0
3
+ Version: 0.13.2
4
4
  Summary: Official API of OpenAGI Foundation
5
5
  Project-URL: Homepage, https://github.com/agiopen-org/oagi
6
6
  Author-email: OpenAGI Foundation <contact@agiopen.org>
@@ -1,12 +1,12 @@
1
1
  oagi/__init__.py,sha256=ly956qE0F4FlzaU-kPsKAhpG2Kc3D9T_BJDZmWqioOc,5616
2
- oagi/constants.py,sha256=ywyMimjh15tC5p4MBZjkJIqOVElPRS50iJtrPE3VClw,1211
2
+ oagi/constants.py,sha256=VUEgpwup55rTrvPC2xhtjZgpUHJlVaNRidiUlXXEjx0,1228
3
3
  oagi/exceptions.py,sha256=Rco37GQTPYUfc2vRO3hozxPF_s8mKFDpFvBg2UKWo3Y,3066
4
4
  oagi/logging.py,sha256=YT3KCMFj5fzO98R9xlDDgfSotUuz1xRD6OZeYM2rKoo,1760
5
5
  oagi/platform_info.py,sha256=GEqNWnwePszVEM21toGGi07o3PaX8O059CYRr0RUM_M,1424
6
6
  oagi/actor/__init__.py,sha256=g_8_7ZLDLKuCGzyrB42OzY3gSOjd_SxzkJW3_pf-PXs,662
7
7
  oagi/actor/async_.py,sha256=DcU6ifAcrYI1GSrTFgMPrWhikjmnJfZVaFsun15DG_k,3768
8
8
  oagi/actor/async_short.py,sha256=QSo67aPsd_rxA2J2TR1fv6nJD6wO00q3S-QQYNK93q4,2821
9
- oagi/actor/base.py,sha256=UUZdS1tufZDIbtQHLs-es6ptGHQpa-EPWf7RSbVpQnU,7921
9
+ oagi/actor/base.py,sha256=-ecocyZ9-NQ4C4jjsHLUcs3ixZ99rFbzqwFsiVKZVR0,8001
10
10
  oagi/actor/short.py,sha256=wKLCxvf7Ys6rYxXpHe4zbZdbf_1q1qcmm5WyWubwj3E,2630
11
11
  oagi/actor/sync.py,sha256=QTY1WNTI75jwkWBghdVViHIp5rYkbm3kumlLedU8YeQ,3588
12
12
  oagi/agent/__init__.py,sha256=KTVLUMhbjgpTJoOWMUZkkiqwhgumvbOZV2tJ9XCLfao,901
@@ -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=BVmpKuYAMINJ5Ue_PK_WxFScAqLeyXC64g4NWQUtG_M,10146
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.0.dist-info/METADATA,sha256=ZndadhpFZ4R5JEvm6O3jA_7zc8c2K0evAJRN_zaGa1I,14203
79
- oagi_core-0.13.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
80
- oagi_core-0.13.0.dist-info/entry_points.txt,sha256=zzgsOSWX6aN3KUB0Z1it8DMxFFBJBqmZVqMVAJRjYuw,44
81
- oagi_core-0.13.0.dist-info/licenses/LICENSE,sha256=sy5DLA2M29jFT4UfWsuBF9BAr3FnRkYtnAu6oDZiIf8,1075
82
- oagi_core-0.13.0.dist-info/RECORD,,
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,,