oagi-core 0.10.1__py3-none-any.whl → 0.10.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/agent/default.py +7 -0
- oagi/agent/factories.py +6 -0
- oagi/agent/observer/exporters.py +142 -251
- oagi/agent/observer/report_template.html +455 -0
- oagi/agent/tasker/taskee_agent.py +8 -0
- oagi/agent/tasker/tasker_agent.py +4 -0
- oagi/cli/agent.py +9 -1
- oagi/handler/pyautogui_action_handler.py +12 -22
- oagi/server/socketio_server.py +20 -19
- oagi/types/__init__.py +12 -1
- oagi/types/models/__init__.py +10 -1
- oagi/types/models/action.py +51 -0
- {oagi_core-0.10.1.dist-info → oagi_core-0.10.2.dist-info}/METADATA +1 -1
- {oagi_core-0.10.1.dist-info → oagi_core-0.10.2.dist-info}/RECORD +17 -16
- {oagi_core-0.10.1.dist-info → oagi_core-0.10.2.dist-info}/WHEEL +0 -0
- {oagi_core-0.10.1.dist-info → oagi_core-0.10.2.dist-info}/entry_points.txt +0 -0
- {oagi_core-0.10.1.dist-info → oagi_core-0.10.2.dist-info}/licenses/LICENSE +0 -0
oagi/server/socketio_server.py
CHANGED
|
@@ -16,7 +16,13 @@ from pydantic import ValidationError
|
|
|
16
16
|
from ..agent import AsyncDefaultAgent, create_agent
|
|
17
17
|
from ..client import AsyncClient
|
|
18
18
|
from ..exceptions import check_optional_dependency
|
|
19
|
-
from ..types.models.action import
|
|
19
|
+
from ..types.models.action import (
|
|
20
|
+
Action,
|
|
21
|
+
ActionType,
|
|
22
|
+
parse_coords,
|
|
23
|
+
parse_drag_coords,
|
|
24
|
+
parse_scroll,
|
|
25
|
+
)
|
|
20
26
|
from .agent_wrappers import SocketIOActionHandler, SocketIOImageProvider
|
|
21
27
|
from .config import ServerConfig
|
|
22
28
|
from .models import (
|
|
@@ -275,31 +281,29 @@ class SessionNamespace(socketio.AsyncNamespace):
|
|
|
275
281
|
| ActionType.LEFT_TRIPLE
|
|
276
282
|
| ActionType.RIGHT_SINGLE
|
|
277
283
|
):
|
|
278
|
-
coords = arg
|
|
279
|
-
if
|
|
280
|
-
x, y = int(coords[0]), int(coords[1])
|
|
281
|
-
else:
|
|
284
|
+
coords = parse_coords(arg)
|
|
285
|
+
if not coords:
|
|
282
286
|
logger.warning(f"Invalid action coordinates: {arg}")
|
|
283
287
|
return None
|
|
284
288
|
|
|
285
289
|
return await self.call(
|
|
286
290
|
action.type.value,
|
|
287
|
-
ClickEventData(**common, x=
|
|
291
|
+
ClickEventData(**common, x=coords[0], y=coords[1]).model_dump(),
|
|
288
292
|
to=session.socket_id,
|
|
289
293
|
timeout=self.config.socketio_timeout,
|
|
290
294
|
)
|
|
291
295
|
|
|
292
296
|
case ActionType.DRAG:
|
|
293
|
-
coords = arg
|
|
294
|
-
if
|
|
295
|
-
x1, y1, x2, y2 = (int(coords[i]) for i in range(4))
|
|
296
|
-
else:
|
|
297
|
+
coords = parse_drag_coords(arg)
|
|
298
|
+
if not coords:
|
|
297
299
|
logger.warning(f"Invalid drag coordinates: {arg}")
|
|
298
300
|
return None
|
|
299
301
|
|
|
300
302
|
return await self.call(
|
|
301
303
|
"drag",
|
|
302
|
-
DragEventData(
|
|
304
|
+
DragEventData(
|
|
305
|
+
**common, x1=coords[0], y1=coords[1], x2=coords[2], y2=coords[3]
|
|
306
|
+
).model_dump(),
|
|
303
307
|
to=session.socket_id,
|
|
304
308
|
timeout=self.config.socketio_timeout,
|
|
305
309
|
)
|
|
@@ -326,11 +330,8 @@ class SessionNamespace(socketio.AsyncNamespace):
|
|
|
326
330
|
)
|
|
327
331
|
|
|
328
332
|
case ActionType.SCROLL:
|
|
329
|
-
|
|
330
|
-
if
|
|
331
|
-
x, y = int(parts[0]), int(parts[1])
|
|
332
|
-
direction = parts[2].strip().lower()
|
|
333
|
-
else:
|
|
333
|
+
result = parse_scroll(arg)
|
|
334
|
+
if not result:
|
|
334
335
|
logger.warning(f"Invalid scroll coordinates: {arg}")
|
|
335
336
|
return None
|
|
336
337
|
|
|
@@ -340,9 +341,9 @@ class SessionNamespace(socketio.AsyncNamespace):
|
|
|
340
341
|
"scroll",
|
|
341
342
|
ScrollEventData(
|
|
342
343
|
**common,
|
|
343
|
-
x=
|
|
344
|
-
y=
|
|
345
|
-
direction=
|
|
344
|
+
x=result[0],
|
|
345
|
+
y=result[1],
|
|
346
|
+
direction=result[2],
|
|
346
347
|
count=count, # type: ignore
|
|
347
348
|
).model_dump(),
|
|
348
349
|
to=session.socket_id,
|
oagi/types/__init__.py
CHANGED
|
@@ -11,7 +11,15 @@ from .async_action_handler import AsyncActionHandler
|
|
|
11
11
|
from .async_image_provider import AsyncImageProvider
|
|
12
12
|
from .image import Image
|
|
13
13
|
from .image_provider import ImageProvider
|
|
14
|
-
from .models import
|
|
14
|
+
from .models import (
|
|
15
|
+
Action,
|
|
16
|
+
ActionType,
|
|
17
|
+
ImageConfig,
|
|
18
|
+
Step,
|
|
19
|
+
parse_coords,
|
|
20
|
+
parse_drag_coords,
|
|
21
|
+
parse_scroll,
|
|
22
|
+
)
|
|
15
23
|
from .step_observer import (
|
|
16
24
|
ActionEvent,
|
|
17
25
|
AsyncObserver,
|
|
@@ -47,4 +55,7 @@ __all__ = [
|
|
|
47
55
|
"ImageProvider",
|
|
48
56
|
"AsyncImageProvider",
|
|
49
57
|
"URL",
|
|
58
|
+
"parse_coords",
|
|
59
|
+
"parse_drag_coords",
|
|
60
|
+
"parse_scroll",
|
|
50
61
|
]
|
oagi/types/models/__init__.py
CHANGED
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
# Licensed under the MIT License.
|
|
7
7
|
# -----------------------------------------------------------------------------
|
|
8
8
|
|
|
9
|
-
from .action import
|
|
9
|
+
from .action import (
|
|
10
|
+
Action,
|
|
11
|
+
ActionType,
|
|
12
|
+
parse_coords,
|
|
13
|
+
parse_drag_coords,
|
|
14
|
+
parse_scroll,
|
|
15
|
+
)
|
|
10
16
|
from .client import (
|
|
11
17
|
ErrorDetail,
|
|
12
18
|
ErrorResponse,
|
|
@@ -29,4 +35,7 @@ __all__ = [
|
|
|
29
35
|
"Step",
|
|
30
36
|
"UploadFileResponse",
|
|
31
37
|
"Usage",
|
|
38
|
+
"parse_coords",
|
|
39
|
+
"parse_drag_coords",
|
|
40
|
+
"parse_scroll",
|
|
32
41
|
]
|
oagi/types/models/action.py
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
# Licensed under the MIT License.
|
|
7
7
|
# -----------------------------------------------------------------------------
|
|
8
8
|
|
|
9
|
+
import re
|
|
9
10
|
from enum import Enum
|
|
10
11
|
|
|
11
12
|
from pydantic import BaseModel, Field
|
|
@@ -31,3 +32,53 @@ class Action(BaseModel):
|
|
|
31
32
|
count: int | None = Field(
|
|
32
33
|
default=1, ge=1, description="Number of times to repeat the action"
|
|
33
34
|
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def parse_coords(args_str: str) -> tuple[int, int] | None:
|
|
38
|
+
"""Extract x, y coordinates from argument string.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
args_str: Argument string in format "x, y" (normalized 0-1000 range)
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
Tuple of (x, y) coordinates, or None if parsing fails
|
|
45
|
+
"""
|
|
46
|
+
match = re.match(r"(\d+),\s*(\d+)", args_str)
|
|
47
|
+
if not match:
|
|
48
|
+
return None
|
|
49
|
+
return int(match.group(1)), int(match.group(2))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def parse_drag_coords(args_str: str) -> tuple[int, int, int, int] | None:
|
|
53
|
+
"""Extract x1, y1, x2, y2 coordinates from drag argument string.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
args_str: Argument string in format "x1, y1, x2, y2" (normalized 0-1000 range)
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
Tuple of (x1, y1, x2, y2) coordinates, or None if parsing fails
|
|
60
|
+
"""
|
|
61
|
+
match = re.match(r"(\d+),\s*(\d+),\s*(\d+),\s*(\d+)", args_str)
|
|
62
|
+
if not match:
|
|
63
|
+
return None
|
|
64
|
+
return (
|
|
65
|
+
int(match.group(1)),
|
|
66
|
+
int(match.group(2)),
|
|
67
|
+
int(match.group(3)),
|
|
68
|
+
int(match.group(4)),
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def parse_scroll(args_str: str) -> tuple[int, int, str] | None:
|
|
73
|
+
"""Extract x, y, direction from scroll argument string.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
args_str: Argument string in format "x, y, direction" (normalized 0-1000 range)
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
Tuple of (x, y, direction) where direction is "up" or "down", or None if parsing fails
|
|
80
|
+
"""
|
|
81
|
+
match = re.match(r"(\d+),\s*(\d+),\s*(\w+)", args_str)
|
|
82
|
+
if not match:
|
|
83
|
+
return None
|
|
84
|
+
return int(match.group(1)), int(match.group(2)), match.group(3).lower()
|
|
@@ -2,23 +2,24 @@ oagi/__init__.py,sha256=xI--F3inDKuNQ2caI4Xx0rdFuUxO24cEeAX6WoGi170,4836
|
|
|
2
2
|
oagi/exceptions.py,sha256=Rco37GQTPYUfc2vRO3hozxPF_s8mKFDpFvBg2UKWo3Y,3066
|
|
3
3
|
oagi/logging.py,sha256=YT3KCMFj5fzO98R9xlDDgfSotUuz1xRD6OZeYM2rKoo,1760
|
|
4
4
|
oagi/agent/__init__.py,sha256=KTVLUMhbjgpTJoOWMUZkkiqwhgumvbOZV2tJ9XCLfao,901
|
|
5
|
-
oagi/agent/default.py,sha256=
|
|
6
|
-
oagi/agent/factories.py,sha256=
|
|
5
|
+
oagi/agent/default.py,sha256=JZ4N2RRl0i5W60jumVg9j22XYWi9wn3yMFL92YVdpQA,4359
|
|
6
|
+
oagi/agent/factories.py,sha256=QF-Ivey9yx2uDcVSHLXidM-gAPLj1L9jkoQ0tgGJFBw,2293
|
|
7
7
|
oagi/agent/protocol.py,sha256=IQJGiMN4yZIacrh5e9JQsoM9TyHb8wJRQR4LAk8dSA0,1615
|
|
8
8
|
oagi/agent/registry.py,sha256=7bMA2-pH3xQ9ZavrHB_mnc2fOGSMeICPbOGtHoM7It0,4851
|
|
9
9
|
oagi/agent/observer/__init__.py,sha256=YZ4qvR22pFB0mSDMX6iKKLbBA1dB-nqC7HZVvdMIVGw,909
|
|
10
10
|
oagi/agent/observer/agent_observer.py,sha256=fBs4X2_YKhYVThJocjMM-65JAHQSCLJPvzy8OXMt5pY,2864
|
|
11
11
|
oagi/agent/observer/events.py,sha256=xc3Z1UGpX69BqhO9cQiGmnRhDZbMYya1kuXm6bXtjWI,625
|
|
12
|
-
oagi/agent/observer/exporters.py,sha256=
|
|
12
|
+
oagi/agent/observer/exporters.py,sha256=uwVMIvsa5HR4VatvxJscvRErr7sUdjFtR5GOA6xms1w,11830
|
|
13
13
|
oagi/agent/observer/protocol.py,sha256=jyRXoCG4CdvaPaDASar1rSbwc7vdpkar39KkGpwf8jw,411
|
|
14
|
+
oagi/agent/observer/report_template.html,sha256=NOp280_-P2g_4TYbtqPhYxv-y_x3PwovoDUt_CajdoY,14729
|
|
14
15
|
oagi/agent/tasker/__init__.py,sha256=1iTEFe7lzcqh96TL9R0QADPpLJLrUP0shtZ4DlZSv_8,764
|
|
15
16
|
oagi/agent/tasker/memory.py,sha256=NR13l5yxRA8GUE-oupAP4W1n80ZNG0SxpUfxsNltkUY,5033
|
|
16
17
|
oagi/agent/tasker/models.py,sha256=sMQgwIMKhT1tvVF2yoc1hh8GwEiJ6i6qPMy9WoiA8JM,2137
|
|
17
18
|
oagi/agent/tasker/planner.py,sha256=1NJQ2279GlGLMTB6JUhgnJtN46iiEGy2O_czaxRQwsE,14437
|
|
18
|
-
oagi/agent/tasker/taskee_agent.py,sha256=
|
|
19
|
-
oagi/agent/tasker/tasker_agent.py,sha256=
|
|
19
|
+
oagi/agent/tasker/taskee_agent.py,sha256=X5pFcZIG3uE6p23c2FDdIUZtOnCgW0a9Sdt13NLR5-E,17040
|
|
20
|
+
oagi/agent/tasker/tasker_agent.py,sha256=YrblKaTDTjiBt0N3_jDgmJAB7smSxvCJy_2nC9-vtnk,10920
|
|
20
21
|
oagi/cli/__init__.py,sha256=aDnJViTseShpo5fdGPTj-ELysZhmdvB6Z8mEj2D-_N4,359
|
|
21
|
-
oagi/cli/agent.py,sha256=
|
|
22
|
+
oagi/cli/agent.py,sha256=fTqr50Q0QO9Gsy_P7iJcb4K7TaDeY3kUXTDQrePVlVQ,9756
|
|
22
23
|
oagi/cli/display.py,sha256=rkAxuHa40ZtKdmvwARev1rgyfsNyVvQ-J6RdjOZIPwc,1729
|
|
23
24
|
oagi/cli/main.py,sha256=faHns0HaQCGyylDn2YZLpjQESuEiMYjoQVoMkt8FsH4,2292
|
|
24
25
|
oagi/cli/server.py,sha256=Z1ic8r55yaeQBFRCsMNZStC1jRiJdnDGqe9On9LmFzQ,3031
|
|
@@ -33,7 +34,7 @@ oagi/handler/_macos.py,sha256=aHkp-xGzvWL_SBjuS690i9jf93OITFJfGHzHeYCK65I,1957
|
|
|
33
34
|
oagi/handler/async_pyautogui_action_handler.py,sha256=hQzseR1yBD0QMpgsEVNsUmuApGVAIIyGYD06BXd82Dc,1615
|
|
34
35
|
oagi/handler/async_screenshot_maker.py,sha256=8QCtUV59ozpOpvkqhUMb8QDI2qje2gsoFT1qB60tfJM,1689
|
|
35
36
|
oagi/handler/pil_image.py,sha256=yUcAoGBL-aZ0PCjSaAmQsDwtyzjldXHqXQp_OYRk6e4,4080
|
|
36
|
-
oagi/handler/pyautogui_action_handler.py,sha256=
|
|
37
|
+
oagi/handler/pyautogui_action_handler.py,sha256=AIzxLCZipWlIP8wsJ4qtwhT-bp06KW5ly4FADl_odjQ,10559
|
|
37
38
|
oagi/handler/screenshot_maker.py,sha256=j1jTW-awx3vAnb1N5_FIMBC0Z-rNVQbiBP-S6Gh5dlE,1284
|
|
38
39
|
oagi/server/__init__.py,sha256=uZx8u3vJUb87kkNzwmmVrgAgbqRu0WxyMIQCLSx56kk,452
|
|
39
40
|
oagi/server/agent_wrappers.py,sha256=j8va0A7u80bzOM82nndAplK1uaO_T3kufHWScK6kfWM,3263
|
|
@@ -41,14 +42,14 @@ oagi/server/config.py,sha256=2gJ-pDpYAxNUubwSsGKOieGcOtNX9b5YGuSqtf6g2P0,1607
|
|
|
41
42
|
oagi/server/main.py,sha256=jnTxk7Prc5CzlsUnkBNJp4MOoYN-7HN_Be_m1d3COa8,4829
|
|
42
43
|
oagi/server/models.py,sha256=7zsmjvnIZ0JUcCpE8F2A1OqX4_kGJydraRkbvPHnvn8,2593
|
|
43
44
|
oagi/server/session_store.py,sha256=922Sz00_Ao-9fA0dhA1lrzs7yd6wo7xpdYJH4hZmEaI,3634
|
|
44
|
-
oagi/server/socketio_server.py,sha256=
|
|
45
|
+
oagi/server/socketio_server.py,sha256=9FNkx6K-ZbRWylHCKv8zrW0pkiKybDN5pWBANTnouts,14211
|
|
45
46
|
oagi/task/__init__.py,sha256=g_8_7ZLDLKuCGzyrB42OzY3gSOjd_SxzkJW3_pf-PXs,662
|
|
46
47
|
oagi/task/async_.py,sha256=ev1jnuOQIYahjjMlSCFwtaeyOliePZCpEVt3ocsZXAI,3124
|
|
47
48
|
oagi/task/async_short.py,sha256=VMIBKcTQMjadWXPHiJXWlYZqr5v4MeGVYnuKOs7dS3Y,2752
|
|
48
49
|
oagi/task/base.py,sha256=D4e4N1cWoObMzaGcXyXGBPKyNbzmxABIjxbHiVrK548,5664
|
|
49
50
|
oagi/task/short.py,sha256=xSR5_9BX35UMfITXtCgKXRLU92f4vnqa06c-HSjUO0A,2561
|
|
50
51
|
oagi/task/sync.py,sha256=ciDkQYJQZkQyp8buNIKXU9Oy6kD7WIezCh2L0trLDDc,2958
|
|
51
|
-
oagi/types/__init__.py,sha256=
|
|
52
|
+
oagi/types/__init__.py,sha256=nhxQBaDssygtscetliQa3AaryvuNZhkVmBYsVcuR-qg,1332
|
|
52
53
|
oagi/types/action_handler.py,sha256=NH8E-m5qpGqWcXzTSWfF7W0Xdp8SkzJsbhCmQ0B96cg,1075
|
|
53
54
|
oagi/types/async_action_handler.py,sha256=k1AaqSkFcXlxwW8sn-w0WFHGsIqHFLbcOPrkknmSVug,1116
|
|
54
55
|
oagi/types/async_image_provider.py,sha256=UwDl7VOCA3tiSP5k1fnxK86iEa84Yr57MVaoBSa3hOE,1203
|
|
@@ -56,13 +57,13 @@ oagi/types/image.py,sha256=KgPCCTJ6D5vHIaGZdbTE7eQEa1WlT6G9tf59ZuUCV2U,537
|
|
|
56
57
|
oagi/types/image_provider.py,sha256=IhKEnwCGZ5l_rO3AvJ6xv5RZMTmTDmqsFRynI9h0R_M,1145
|
|
57
58
|
oagi/types/step_observer.py,sha256=wXuChzsof7Rh4azvDTIQ22gAwZAYjMAOVIuL8ZGtw-M,2315
|
|
58
59
|
oagi/types/url.py,sha256=Q-1jf5L_4rad4dxyLTg4MXadGgpkH3w4dcoVrVupW-A,54
|
|
59
|
-
oagi/types/models/__init__.py,sha256=
|
|
60
|
-
oagi/types/models/action.py,sha256=
|
|
60
|
+
oagi/types/models/__init__.py,sha256=gnFh4TddritHjT0Chy-4fv3KZIC6bYCUyGmWm_2IuZw,879
|
|
61
|
+
oagi/types/models/action.py,sha256=Q14xfYJrj9IsrqxDpEIzd6iWS-gLmNHfIX6Ef8k0O9E,2497
|
|
61
62
|
oagi/types/models/client.py,sha256=1xIKBgLSheHfqYbcyRKMDOLQJaKijaKQ5l-COc6e7_k,1471
|
|
62
63
|
oagi/types/models/image_config.py,sha256=tl6abVg_-IAPLwpaWprgknXu7wRWriMg-AEVyUX73v0,1567
|
|
63
64
|
oagi/types/models/step.py,sha256=RSI4H_2rrUBq_xyCoWKaq7JHdJWNobtQppaKC1l0aWU,471
|
|
64
|
-
oagi_core-0.10.
|
|
65
|
-
oagi_core-0.10.
|
|
66
|
-
oagi_core-0.10.
|
|
67
|
-
oagi_core-0.10.
|
|
68
|
-
oagi_core-0.10.
|
|
65
|
+
oagi_core-0.10.2.dist-info/METADATA,sha256=zEpy_q3jUhSphhGi6QYKkvjGvZKLnDq6QSPlOtJ8ppw,8269
|
|
66
|
+
oagi_core-0.10.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
67
|
+
oagi_core-0.10.2.dist-info/entry_points.txt,sha256=zzgsOSWX6aN3KUB0Z1it8DMxFFBJBqmZVqMVAJRjYuw,44
|
|
68
|
+
oagi_core-0.10.2.dist-info/licenses/LICENSE,sha256=sy5DLA2M29jFT4UfWsuBF9BAr3FnRkYtnAu6oDZiIf8,1075
|
|
69
|
+
oagi_core-0.10.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|