clerk-sdk 0.4.4__py3-none-any.whl → 0.4.5__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.
- clerk/gui_automation/client_actor/model.py +13 -16
- clerk/gui_automation/ui_actions/actions.py +24 -24
- clerk/gui_automation/ui_actions/base.py +2 -2
- {clerk_sdk-0.4.4.dist-info → clerk_sdk-0.4.5.dist-info}/METADATA +1 -1
- {clerk_sdk-0.4.4.dist-info → clerk_sdk-0.4.5.dist-info}/RECORD +8 -8
- {clerk_sdk-0.4.4.dist-info → clerk_sdk-0.4.5.dist-info}/WHEEL +0 -0
- {clerk_sdk-0.4.4.dist-info → clerk_sdk-0.4.5.dist-info}/licenses/LICENSE +0 -0
- {clerk_sdk-0.4.4.dist-info → clerk_sdk-0.4.5.dist-info}/top_level.txt +0 -0
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
from typing import Any, List, Literal, Optional,
|
|
1
|
+
from typing import Any, List, Literal, Optional, Union
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
3
|
from enum import Enum
|
|
4
4
|
|
|
5
|
-
from clerk.gui_automation.ui_actions.base import ActionTypes
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# ]
|
|
6
|
+
ActionTypes = Literal[
|
|
7
|
+
"left_click",
|
|
8
|
+
"right_click",
|
|
9
|
+
"middle_click",
|
|
10
|
+
"double_click",
|
|
11
|
+
"send_keys",
|
|
12
|
+
"press_keys",
|
|
13
|
+
"hot_keys",
|
|
14
|
+
"paste_text",
|
|
15
|
+
"get_text",
|
|
16
|
+
"scroll",
|
|
17
|
+
]
|
|
20
18
|
|
|
21
19
|
|
|
22
20
|
class ActionStates(Enum):
|
|
@@ -79,7 +77,6 @@ class WindowExecutePayload(BaseModel):
|
|
|
79
77
|
"close_window",
|
|
80
78
|
"activate_window",
|
|
81
79
|
]
|
|
82
|
-
|
|
83
80
|
window_name: str
|
|
84
81
|
timeout: int = Field(default=10)
|
|
85
82
|
|
|
@@ -45,7 +45,7 @@ class File(BaseModel):
|
|
|
45
45
|
|
|
46
46
|
@field_validator("content", mode="before")
|
|
47
47
|
@classmethod
|
|
48
|
-
def convert_to_bytes(cls, v
|
|
48
|
+
def convert_to_bytes(cls, v) -> bytes:
|
|
49
49
|
if isinstance(v, str):
|
|
50
50
|
from base64 import b64decode
|
|
51
51
|
|
|
@@ -75,7 +75,7 @@ class LeftClick(BaseAction):
|
|
|
75
75
|
LeftClick(target="Suche").above("Kalender").do()
|
|
76
76
|
"""
|
|
77
77
|
|
|
78
|
-
action_type = "left_click"
|
|
78
|
+
action_type: Literal["left_click"] = "left_click"
|
|
79
79
|
|
|
80
80
|
@backoff.on_exception(
|
|
81
81
|
backoff.expo,
|
|
@@ -100,7 +100,7 @@ class LeftClick(BaseAction):
|
|
|
100
100
|
|
|
101
101
|
@property
|
|
102
102
|
def actionable_string(self):
|
|
103
|
-
return f"LeftClick(action_type='{self.action_type}', target='{self.target}', anchor='{self.
|
|
103
|
+
return f"LeftClick(action_type='{self.action_type}', target='{self.target}', anchor='{self.anchor}', relation='{self.relation}').do()"
|
|
104
104
|
|
|
105
105
|
|
|
106
106
|
class RightClick(BaseAction):
|
|
@@ -118,7 +118,7 @@ class RightClick(BaseAction):
|
|
|
118
118
|
RightClick(target="Suche").above("Kalender").do()
|
|
119
119
|
"""
|
|
120
120
|
|
|
121
|
-
action_type = "right_click"
|
|
121
|
+
action_type: Literal["right_click"] = "right_click"
|
|
122
122
|
|
|
123
123
|
@backoff.on_exception(
|
|
124
124
|
backoff.expo,
|
|
@@ -143,7 +143,7 @@ class RightClick(BaseAction):
|
|
|
143
143
|
|
|
144
144
|
@property
|
|
145
145
|
def actionable_string(self):
|
|
146
|
-
return f"RightClick(action_type='{self.action_type}', target='{self.target}', anchor='{self.
|
|
146
|
+
return f"RightClick(action_type='{self.action_type}', target='{self.target}', anchor='{self.anchor}', relation='{self.relation}').do()"
|
|
147
147
|
|
|
148
148
|
|
|
149
149
|
class MiddleClickAction(BaseAction):
|
|
@@ -161,7 +161,7 @@ class MiddleClickAction(BaseAction):
|
|
|
161
161
|
MiddleClickAction(target="Suche").above("Kalender").do()
|
|
162
162
|
"""
|
|
163
163
|
|
|
164
|
-
action_type = "middle_click"
|
|
164
|
+
action_type: Literal["middle_click"] = "middle_click"
|
|
165
165
|
|
|
166
166
|
@backoff.on_exception(
|
|
167
167
|
backoff.expo,
|
|
@@ -186,7 +186,7 @@ class MiddleClickAction(BaseAction):
|
|
|
186
186
|
|
|
187
187
|
@property
|
|
188
188
|
def actionable_string(self):
|
|
189
|
-
return f"MiddleClickAction(action_type='{self.action_type}', target='{self.target}', anchor='{self.
|
|
189
|
+
return f"MiddleClickAction(action_type='{self.action_type}', target='{self.target}', anchor='{self.anchor}', relation='{self.relation}').do()"
|
|
190
190
|
|
|
191
191
|
|
|
192
192
|
class DoubleClick(BaseAction):
|
|
@@ -204,7 +204,7 @@ class DoubleClick(BaseAction):
|
|
|
204
204
|
DoubleClick(target="Suche").above("Kalender").do()
|
|
205
205
|
"""
|
|
206
206
|
|
|
207
|
-
action_type = "double_click"
|
|
207
|
+
action_type: Literal["double_click"] = "double_click"
|
|
208
208
|
|
|
209
209
|
@backoff.on_exception(
|
|
210
210
|
backoff.expo,
|
|
@@ -229,7 +229,7 @@ class DoubleClick(BaseAction):
|
|
|
229
229
|
|
|
230
230
|
@property
|
|
231
231
|
def actionable_string(self):
|
|
232
|
-
return f"DoubleClick(action_type='{self.action_type}', target='{self.target}', anchor='{self.
|
|
232
|
+
return f"DoubleClick(action_type='{self.action_type}', target='{self.target}', anchor='{self.anchor}', relation='{self.relation}').do()"
|
|
233
233
|
|
|
234
234
|
|
|
235
235
|
class Scroll(BaseAction):
|
|
@@ -249,7 +249,7 @@ class Scroll(BaseAction):
|
|
|
249
249
|
DoubleClick(target="Suche").above("Kalender").do()
|
|
250
250
|
"""
|
|
251
251
|
|
|
252
|
-
action_type = "scroll"
|
|
252
|
+
action_type: Literal["scroll"] = "scroll"
|
|
253
253
|
clicks: int
|
|
254
254
|
click_coords: List[int] = Field(default=[])
|
|
255
255
|
|
|
@@ -333,7 +333,7 @@ class SendKeys(BaseAction):
|
|
|
333
333
|
|
|
334
334
|
@property
|
|
335
335
|
def actionable_string(self):
|
|
336
|
-
return f"SendKeys(action_type='{self.action_type}', target='{self.target}', anchor='{self.
|
|
336
|
+
return f"SendKeys(action_type='{self.action_type}', target='{self.target}', anchor='{self.anchor}', relation='{self.relation}', keys='{self.keys}').do()"
|
|
337
337
|
|
|
338
338
|
|
|
339
339
|
class PressKeys(BaseAction):
|
|
@@ -353,7 +353,7 @@ class PressKeys(BaseAction):
|
|
|
353
353
|
PressKeys(keys='ctrl+shift+esc').do()
|
|
354
354
|
"""
|
|
355
355
|
|
|
356
|
-
action_type = "press_keys"
|
|
356
|
+
action_type: ActionTypes = "press_keys"
|
|
357
357
|
keys: str
|
|
358
358
|
|
|
359
359
|
def do(self):
|
|
@@ -366,7 +366,7 @@ class PressKeys(BaseAction):
|
|
|
366
366
|
|
|
367
367
|
@property
|
|
368
368
|
def actionable_string(self):
|
|
369
|
-
return f"PressKeys(action_type='{self.action_type}', target='{self.target}', anchor='{self.
|
|
369
|
+
return f"PressKeys(action_type='{self.action_type}', target='{self.target}', anchor='{self.anchor}', relation='{self.relation}', keys='{self.keys}').do()"
|
|
370
370
|
|
|
371
371
|
|
|
372
372
|
class WaitFor(BaseAction):
|
|
@@ -385,7 +385,7 @@ class WaitFor(BaseAction):
|
|
|
385
385
|
WaitFor("element").do(timeout=60)
|
|
386
386
|
"""
|
|
387
387
|
|
|
388
|
-
action_type = "wait_for"
|
|
388
|
+
action_type: Literal["wait_for"] = "wait_for"
|
|
389
389
|
retry_timeout: float = 0.5
|
|
390
390
|
is_awaited: bool = True
|
|
391
391
|
|
|
@@ -450,7 +450,7 @@ class OpenApplication(BaseAction):
|
|
|
450
450
|
OpenApplication(app_path="/path/to/application.exe", app_window_name="Application Window").do()
|
|
451
451
|
"""
|
|
452
452
|
|
|
453
|
-
action_type = "open_app"
|
|
453
|
+
action_type: Literal["open_app"] = "open_app"
|
|
454
454
|
app_path: str = Field(description="Absolute path of the application")
|
|
455
455
|
app_window_name: str = Field(
|
|
456
456
|
description="Name of the application window once open. Wildcard logic enabled."
|
|
@@ -479,7 +479,7 @@ class ForceCloseApplication(BaseAction):
|
|
|
479
479
|
Executes the action to force close the application by creating and performing an ApplicationExecutePayload with the specified process name.
|
|
480
480
|
"""
|
|
481
481
|
|
|
482
|
-
action_type = "force_close_app"
|
|
482
|
+
action_type: Literal["force_close_app"] = "force_close_app"
|
|
483
483
|
process_name: str = Field(
|
|
484
484
|
description="Process name from task manager. Example: process.exe"
|
|
485
485
|
)
|
|
@@ -509,7 +509,7 @@ class SaveFiles(BaseAction):
|
|
|
509
509
|
SaveFiles(save_location="/path/to/", files=["/path/to/file_1", "/path/to/file_2"]).do()
|
|
510
510
|
"""
|
|
511
511
|
|
|
512
|
-
action_type = "save_files"
|
|
512
|
+
action_type: ActionTypes = "save_files"
|
|
513
513
|
save_location: str
|
|
514
514
|
files: Union[List[str], List[FileDetails]]
|
|
515
515
|
|
|
@@ -580,7 +580,7 @@ class GetFile(BaseAction):
|
|
|
580
580
|
GetFile(file_location="/path/to/file_1").do()
|
|
581
581
|
"""
|
|
582
582
|
|
|
583
|
-
action_type = "get_file"
|
|
583
|
+
action_type: Literal["get_file"] = "get_file"
|
|
584
584
|
file_location: str
|
|
585
585
|
|
|
586
586
|
def do(self) -> File:
|
|
@@ -605,7 +605,7 @@ class MaximizeWindow(BaseAction):
|
|
|
605
605
|
MaximizeWindow(window_name="MyWindow").do()
|
|
606
606
|
"""
|
|
607
607
|
|
|
608
|
-
action_type = "maximize_window"
|
|
608
|
+
action_type: Literal["maximize_window"] = "maximize_window"
|
|
609
609
|
window_name: str
|
|
610
610
|
|
|
611
611
|
def do(self, timeout: int = 10):
|
|
@@ -630,7 +630,7 @@ class MinimizeWindow(BaseAction):
|
|
|
630
630
|
MinimizeWindow(window_name="MyWindow").do()
|
|
631
631
|
"""
|
|
632
632
|
|
|
633
|
-
action_type = "minimize_window"
|
|
633
|
+
action_type: Literal["minimize_window"] = "minimize_window"
|
|
634
634
|
window_name: str
|
|
635
635
|
|
|
636
636
|
def do(self, timeout: int = 10):
|
|
@@ -655,7 +655,7 @@ class CloseWindow(BaseAction):
|
|
|
655
655
|
CloseWindow(window_name="MyWindow").do()
|
|
656
656
|
"""
|
|
657
657
|
|
|
658
|
-
action_type = "close_window"
|
|
658
|
+
action_type: Literal["close_window"] = "close_window"
|
|
659
659
|
window_name: str
|
|
660
660
|
|
|
661
661
|
def do(self, timeout: int = 10):
|
|
@@ -680,7 +680,7 @@ class ActivateWindow(BaseAction):
|
|
|
680
680
|
ActivateWindow(window_name="MyWindow").do()
|
|
681
681
|
"""
|
|
682
682
|
|
|
683
|
-
action_type = "activate_window"
|
|
683
|
+
action_type: Literal["activate_window"] = "activate_window"
|
|
684
684
|
window_name: str
|
|
685
685
|
|
|
686
686
|
def do(self, timeout: int = 10):
|
|
@@ -709,7 +709,7 @@ class GetText(BaseAction):
|
|
|
709
709
|
|
|
710
710
|
"""
|
|
711
711
|
|
|
712
|
-
action_type = "get_text"
|
|
712
|
+
action_type: Literal["get_text"] = "get_text"
|
|
713
713
|
|
|
714
714
|
@backoff.on_exception(
|
|
715
715
|
backoff.expo,
|
|
@@ -752,7 +752,7 @@ class PasteText(BaseAction):
|
|
|
752
752
|
|
|
753
753
|
"""
|
|
754
754
|
|
|
755
|
-
action_type = "paste_text"
|
|
755
|
+
action_type: Literal["paste_text"] = "paste_text"
|
|
756
756
|
keys: Union[str, List[str]]
|
|
757
757
|
followed_by: Optional[str] = Field(default=None)
|
|
758
758
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Literal, Self,
|
|
1
|
+
from typing import Literal, Self, Union, List, Optional
|
|
2
2
|
from pydantic import BaseModel, Field, model_validator
|
|
3
3
|
from ..client_actor import get_screen
|
|
4
4
|
from ..exceptions.modality.exc import TargetModalityError
|
|
@@ -24,7 +24,7 @@ def to_full_img_path(img: Union[str, ImageB64]) -> str:
|
|
|
24
24
|
return os.path.join(TARGET_IMAGES_PATH, img)
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
ActionTypes
|
|
27
|
+
ActionTypes = Literal[
|
|
28
28
|
"left_click",
|
|
29
29
|
"right_click",
|
|
30
30
|
"middle_click",
|
|
@@ -15,7 +15,7 @@ clerk/gui_automation/action_model/utils.py,sha256=xzFxgN-bTK6HKGS7J-esQZ-ePj_yG7
|
|
|
15
15
|
clerk/gui_automation/client_actor/__init__.py,sha256=SVuL6-oo1Xc0oJkjMKrO6mJwpPGjrCLKhDV6r2Abtf8,66
|
|
16
16
|
clerk/gui_automation/client_actor/client_actor.py,sha256=RT5WnvrM37pLpoDd_WZg8sSjBuugqMW_eDLTEkL7kWc,5117
|
|
17
17
|
clerk/gui_automation/client_actor/exception.py,sha256=zdnImHZ88yf52Xq3aMHivEU3aJg-r2c-r8x8XZnI3ic,407
|
|
18
|
-
clerk/gui_automation/client_actor/model.py,sha256=
|
|
18
|
+
clerk/gui_automation/client_actor/model.py,sha256=wVpFCi1w2kh4kAV8oNx489vf_SLUQnqhc02rFD5NIJA,6335
|
|
19
19
|
clerk/gui_automation/decorators/__init__.py,sha256=OCgXStEumscgT-RyVy5OKS7ml1w9y-lEnjCVnxuRnQs,43
|
|
20
20
|
clerk/gui_automation/decorators/gui_automation.py,sha256=jqzN_iqIq2KvjUU-JoYnUSOf-mst31EKCk8zdMFzGQM,5357
|
|
21
21
|
clerk/gui_automation/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -24,8 +24,8 @@ clerk/gui_automation/exceptions/websocket.py,sha256=-MdwSwlf1hbnu55aDgk3L1znkTZ6
|
|
|
24
24
|
clerk/gui_automation/exceptions/modality/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
clerk/gui_automation/exceptions/modality/exc.py,sha256=P-dMuCTyVZYD3pbGpCf_1SYEgaETn13c51pmfbsXr5k,1436
|
|
26
26
|
clerk/gui_automation/ui_actions/__init__.py,sha256=-EDQ5375HXrvG3sfFY7zOPC405YcBL6xXRACm2p-YyI,23
|
|
27
|
-
clerk/gui_automation/ui_actions/actions.py,sha256=
|
|
28
|
-
clerk/gui_automation/ui_actions/base.py,sha256=
|
|
27
|
+
clerk/gui_automation/ui_actions/actions.py,sha256=hhxl5VMDNSXdqm2L0tZqs6IhJHVXtlSVSdwsiz2BbDI,27449
|
|
28
|
+
clerk/gui_automation/ui_actions/base.py,sha256=oaUI3vIOoDwP_HdLu2GIG46-aMv0_Zv-PljMgSFeNmk,7329
|
|
29
29
|
clerk/gui_automation/ui_actions/support.py,sha256=Ulb8DBfwnrBMaYoMLDgldEy9V--NDUSdhIYXpuODZoU,5772
|
|
30
30
|
clerk/gui_automation/ui_state_inspector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
31
|
clerk/gui_automation/ui_state_inspector/gui_vision.py,sha256=Pk5nuFZnp_zNbqSOtndSmgqb6PLeADJfnC-eRIJMDZk,7736
|
|
@@ -46,8 +46,8 @@ clerk/models/ui_operator.py,sha256=mKTJUFZgv7PeEt5oys28HVZxHOJsofmRQOcRpqj0dbU,2
|
|
|
46
46
|
clerk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
47
|
clerk/utils/logger.py,sha256=vHbp-lUK3W3c5fhyPsp05p9LGyDHj95v8XM_XQ_FlLc,3691
|
|
48
48
|
clerk/utils/save_artifact.py,sha256=94aYkYNVGcSUaSWZmdjiY6Oc-3yCKb2XWCZ56IAXQqk,1158
|
|
49
|
-
clerk_sdk-0.4.
|
|
50
|
-
clerk_sdk-0.4.
|
|
51
|
-
clerk_sdk-0.4.
|
|
52
|
-
clerk_sdk-0.4.
|
|
53
|
-
clerk_sdk-0.4.
|
|
49
|
+
clerk_sdk-0.4.5.dist-info/licenses/LICENSE,sha256=GTVQl3vH6ht70wJXKC0yMT8CmXKHxv_YyO_utAgm7EA,1065
|
|
50
|
+
clerk_sdk-0.4.5.dist-info/METADATA,sha256=KmIcyeV5XxdLTtq4m3gAtB9S-zYp2yI4l5ZP4EcrBlY,3508
|
|
51
|
+
clerk_sdk-0.4.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
52
|
+
clerk_sdk-0.4.5.dist-info/top_level.txt,sha256=99eQiU6d05_-f41tmSFanfI_SIJeAdh7u9m3LNSfcv4,6
|
|
53
|
+
clerk_sdk-0.4.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|