clerk-sdk 0.5.3__tar.gz → 0.5.5__tar.gz

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.
Files changed (85) hide show
  1. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/PKG-INFO +1 -1
  2. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/__init__.py +1 -1
  3. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/client_actor/client_actor.py +26 -8
  4. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/client_actor/exception.py +16 -0
  5. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/pyproject.toml +1 -1
  6. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/setup.py +1 -1
  7. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/.github/workflows/ci.yaml +0 -0
  8. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/.github/workflows/pypi_publish.yml +0 -0
  9. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/.gitignore +0 -0
  10. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/LICENSE +0 -0
  11. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/MANIFEST.in +0 -0
  12. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/README.md +0 -0
  13. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/base.py +0 -0
  14. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/client.py +0 -0
  15. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/decorator/__init__.py +0 -0
  16. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/decorator/models.py +0 -0
  17. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/decorator/task_decorator.py +0 -0
  18. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/__init__.py +0 -0
  19. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/cli.py +0 -0
  20. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/code_runner.py +0 -0
  21. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/gui/graph_checker.py +0 -0
  22. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/gui/test_session.py +0 -0
  23. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/init_project.py +0 -0
  24. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/schema/fetch_schema.py +0 -0
  25. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/templates/exceptions.py.template +0 -0
  26. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/templates/launch.json.template +0 -0
  27. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/templates/main_basic.py.template +0 -0
  28. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/templates/main_gui.py.template +0 -0
  29. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/templates/rollbacks.py.template +0 -0
  30. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/templates/states.py.template +0 -0
  31. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/templates/tasks.json.template +0 -0
  32. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/templates/test_payload.py.template +0 -0
  33. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/development/templates/transitions.py.template +0 -0
  34. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/exceptions/__init__.py +0 -0
  35. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/exceptions/exceptions.py +0 -0
  36. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/exceptions/remote_device.py +0 -0
  37. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/__init__.py +0 -0
  38. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/action_model/__init__.py +0 -0
  39. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/action_model/model.py +0 -0
  40. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/action_model/utils.py +0 -0
  41. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/client.py +0 -0
  42. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/client_actor/__init__.py +0 -0
  43. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/client_actor/model.py +0 -0
  44. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/decorators/__init__.py +0 -0
  45. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/decorators/gui_automation.py +0 -0
  46. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/exceptions/__init__.py +0 -0
  47. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/exceptions/agent_manager.py +0 -0
  48. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/exceptions/modality/__init__.py +0 -0
  49. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/exceptions/modality/exc.py +0 -0
  50. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/exceptions/websocket.py +0 -0
  51. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/requirements.txt +0 -0
  52. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_actions/__init__.py +0 -0
  53. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_actions/actions.py +0 -0
  54. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_actions/base.py +0 -0
  55. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_actions/support.py +0 -0
  56. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_state_inspector/__init__.py +0 -0
  57. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_state_inspector/gui_vision.py +0 -0
  58. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_state_inspector/models.py +0 -0
  59. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_state_machine/Readme.md +0 -0
  60. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_state_machine/__init__.py +0 -0
  61. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_state_machine/ai_recovery.py +0 -0
  62. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_state_machine/decorators.py +0 -0
  63. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_state_machine/exceptions.py +0 -0
  64. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/gui_automation/ui_state_machine/state_machine.py +0 -0
  65. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/models/__init__.py +0 -0
  66. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/models/document.py +0 -0
  67. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/models/document_statuses.py +0 -0
  68. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/models/file.py +0 -0
  69. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/models/remote_device.py +0 -0
  70. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/models/response_model.py +0 -0
  71. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/models/ui_operator.py +0 -0
  72. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/utils/__init__.py +0 -0
  73. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/utils/logger.py +0 -0
  74. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/clerk/utils/save_artifact.py +0 -0
  75. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/requirements.txt +0 -0
  76. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/tests/conftest.py +0 -0
  77. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/tests/test_base.py +0 -0
  78. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/tests/test_client.py +0 -0
  79. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/tests/test_document_models.py +0 -0
  80. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/tests/test_exceptions.py +0 -0
  81. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/tests/test_file_models.py +0 -0
  82. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/tests/test_gui_automation.py +0 -0
  83. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/tests/test_task_decorator.py +0 -0
  84. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/tests/test_utils.py +0 -0
  85. {clerk_sdk-0.5.3 → clerk_sdk-0.5.5}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clerk-sdk
3
- Version: 0.5.3
3
+ Version: 0.5.5
4
4
  Summary: Library for interacting with Clerk
5
5
  Project-URL: Homepage, https://github.com/F-ONE-Group/clerk_pypi
6
6
  Author-email: F-One <contact@f-one.group>
@@ -1,4 +1,4 @@
1
1
  from .client import Clerk
2
2
 
3
3
 
4
- __version__ = "0.5.3"
4
+ __version__ = "0.5.5"
@@ -19,7 +19,12 @@ from .model import (
19
19
  )
20
20
 
21
21
  from .model import PerformActionResponse, ActionStates
22
- from .exception import PerformActionException, GetScreenError
22
+ from .exception import (
23
+ PerformActionException,
24
+ GetScreenError,
25
+ AckTimeoutError,
26
+ ActionTimeoutError,
27
+ )
23
28
 
24
29
 
25
30
  async def before_retry(details: Any):
@@ -35,6 +40,13 @@ async def before_retry(details: Any):
35
40
  max_tries=5,
36
41
  on_backoff=before_retry,
37
42
  )
43
+ @backoff.on_exception(
44
+ backoff.constant,
45
+ (ActionTimeoutError, AckTimeoutError),
46
+ interval=10,
47
+ max_tries=2,
48
+ on_backoff=before_retry,
49
+ )
38
50
  async def _perform_action_ws(payload: Dict[str, Any]) -> PerformActionResponse:
39
51
  """Perform an action over a WebSocket connection.
40
52
 
@@ -57,15 +69,21 @@ async def _perform_action_ws(payload: Dict[str, Any]) -> PerformActionResponse:
57
69
  # 2. wait for ack message
58
70
  try:
59
71
  ack = await asyncio.wait_for(global_ws.recv(), 10)
60
- if ack == "OK":
61
- action_info = await asyncio.wait_for(global_ws.recv(), 10)
62
- return PerformActionResponse(**json.loads(action_info))
63
- else:
64
- raise RuntimeError("Received ACK != OK")
72
+ except asyncio.TimeoutError:
73
+ raise AckTimeoutError("Timeout waiting for ACK message")
65
74
  except WebSocketException as e:
66
75
  raise e
67
- except asyncio.TimeoutError:
68
- raise RuntimeError("The ack message did not arrive.")
76
+
77
+ if ack == "OK":
78
+ try:
79
+ action_info = await asyncio.wait_for(global_ws.recv(), 60)
80
+ except asyncio.TimeoutError:
81
+ raise ActionTimeoutError("Timeout waiting for action response")
82
+ except WebSocketException as e:
83
+ raise e
84
+ return PerformActionResponse(**json.loads(action_info))
85
+ else:
86
+ raise RuntimeError("Received ACK != OK")
69
87
  else:
70
88
  raise RuntimeError("The Websocket has not been initiated.")
71
89
 
@@ -20,3 +20,19 @@ class WebSocketConnectionFailed(Exception):
20
20
  """
21
21
 
22
22
  pass
23
+
24
+
25
+ class AckTimeoutError(Exception):
26
+ """
27
+ Timeout waiting for ACK message from WebSocket.
28
+ """
29
+
30
+ pass
31
+
32
+
33
+ class ActionTimeoutError(Exception):
34
+ """
35
+ Timeout waiting for action response from WebSocket.
36
+ """
37
+
38
+ pass
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "clerk-sdk"
7
- version = "0.5.3"
7
+ version = "0.5.5"
8
8
  description = "Library for interacting with Clerk"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -13,7 +13,7 @@ gui_requirements = get_requirements("./clerk/gui_automation")
13
13
 
14
14
  setup(
15
15
  name="clerk-sdk",
16
- version="0.5.3",
16
+ version="0.5.5",
17
17
  description="Library for interacting with Clerk",
18
18
  long_description=open("README.md").read(),
19
19
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes