intuned-runtime 1.3.1__tar.gz → 1.3.3__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 (132) hide show
  1. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/PKG-INFO +4 -2
  2. intuned_runtime-1.3.3/intuned_cli/__init__.py +41 -0
  3. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/__init__.py +5 -0
  4. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/attempt_api_command.py +8 -2
  5. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/attempt_authsession_check_command.py +8 -2
  6. intuned_runtime-1.3.3/intuned_cli/commands/attempt_authsession_command.py +9 -0
  7. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/attempt_authsession_create_command.py +9 -3
  8. intuned_runtime-1.3.3/intuned_cli/commands/attempt_command.py +9 -0
  9. intuned_runtime-1.3.3/intuned_cli/commands/authsession_command.py +9 -0
  10. intuned_runtime-1.3.3/intuned_cli/commands/authsession_record_command.py +52 -0
  11. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/command.py +6 -7
  12. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/deploy_command.py +2 -3
  13. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/init_command.py +2 -3
  14. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/run_api_command.py +9 -3
  15. intuned_runtime-1.3.3/intuned_cli/commands/run_authsession_command.py +9 -0
  16. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/run_authsession_create_command.py +32 -5
  17. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/run_authsession_update_command.py +31 -5
  18. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/run_authsession_validate_command.py +30 -4
  19. intuned_runtime-1.3.3/intuned_cli/commands/run_command.py +9 -0
  20. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/commands/save_command.py +2 -3
  21. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/controller/__test__/test_api.py +159 -18
  22. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/controller/__test__/test_authsession.py +497 -6
  23. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/controller/api.py +40 -39
  24. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/controller/authsession.py +213 -110
  25. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/controller/deploy.py +3 -5
  26. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/controller/save.py +47 -66
  27. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/types.py +14 -0
  28. intuned_runtime-1.3.3/intuned_cli/utils/__test__/test_browser.py +132 -0
  29. intuned_runtime-1.3.3/intuned_cli/utils/__test__/test_traces.py +27 -0
  30. intuned_runtime-1.3.3/intuned_cli/utils/api_helpers.py +81 -0
  31. intuned_runtime-1.3.3/intuned_cli/utils/auth_session_helpers.py +92 -0
  32. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/utils/backend.py +4 -1
  33. intuned_runtime-1.3.3/intuned_cli/utils/browser.py +63 -0
  34. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/utils/error.py +14 -0
  35. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/utils/exclusions.py +1 -0
  36. intuned_runtime-1.3.3/intuned_cli/utils/help.py +9 -0
  37. intuned_runtime-1.3.3/intuned_cli/utils/traces.py +31 -0
  38. intuned_runtime-1.3.3/intuned_cli/utils/wrapper.py +68 -0
  39. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/__init__.py +7 -0
  40. intuned_runtime-1.3.3/intuned_internal_cli/commands/__init__.py +19 -0
  41. intuned_runtime-1.3.3/intuned_internal_cli/commands/browser/__init__.py +3 -0
  42. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/commands/browser/save_state.py +2 -3
  43. intuned_runtime-1.3.3/intuned_internal_cli/commands/project/__init__.py +18 -0
  44. intuned_runtime-1.3.3/intuned_internal_cli/commands/project/auth_session/__init__.py +5 -0
  45. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/commands/project/auth_session/check.py +2 -2
  46. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/commands/project/auth_session/create.py +2 -3
  47. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/commands/project/auth_session/load.py +2 -3
  48. intuned_runtime-1.3.3/intuned_internal_cli/commands/project/project.py +10 -0
  49. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/commands/project/run.py +2 -2
  50. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/commands/project/run_interface.py +75 -8
  51. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/commands/project/type_check.py +5 -5
  52. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/commands/root.py +2 -1
  53. intuned_runtime-1.3.3/intuned_internal_cli/utils/wrapper.py +15 -0
  54. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/pyproject.toml +42 -43
  55. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/browser/launch_browser.py +15 -0
  56. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/browser/launch_chromium.py +14 -1
  57. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/run/types.py +0 -5
  58. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/types/settings_types.py +13 -4
  59. intuned_runtime-1.3.3/runtime/utils/anyio.py +26 -0
  60. intuned_runtime-1.3.1/intuned_cli/__init__.py +0 -50
  61. intuned_runtime-1.3.1/intuned_cli/commands/attempt_authsession_command.py +0 -12
  62. intuned_runtime-1.3.1/intuned_cli/commands/attempt_command.py +0 -12
  63. intuned_runtime-1.3.1/intuned_cli/commands/run_authsession_command.py +0 -12
  64. intuned_runtime-1.3.1/intuned_cli/commands/run_command.py +0 -12
  65. intuned_runtime-1.3.1/intuned_cli/utils/api_helpers.py +0 -32
  66. intuned_runtime-1.3.1/intuned_cli/utils/auth_session_helpers.py +0 -57
  67. intuned_runtime-1.3.1/intuned_internal_cli/commands/__init__.py +0 -27
  68. intuned_runtime-1.3.1/intuned_internal_cli/commands/ai_source/__init__.py +0 -4
  69. intuned_runtime-1.3.1/intuned_internal_cli/commands/ai_source/ai_source.py +0 -10
  70. intuned_runtime-1.3.1/intuned_internal_cli/commands/ai_source/deploy.py +0 -64
  71. intuned_runtime-1.3.1/intuned_internal_cli/commands/browser/__init__.py +0 -3
  72. intuned_runtime-1.3.1/intuned_internal_cli/commands/init.py +0 -127
  73. intuned_runtime-1.3.1/intuned_internal_cli/commands/project/__init__.py +0 -20
  74. intuned_runtime-1.3.1/intuned_internal_cli/commands/project/auth_session/__init__.py +0 -5
  75. intuned_runtime-1.3.1/intuned_internal_cli/commands/project/project.py +0 -10
  76. intuned_runtime-1.3.1/intuned_internal_cli/commands/project/upgrade.py +0 -92
  77. intuned_runtime-1.3.1/intuned_internal_cli/commands/publish_packages.py +0 -264
  78. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/LICENSE +0 -0
  79. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/README.md +0 -0
  80. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/controller/__test__/__init__.py +0 -0
  81. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/utils/confirmation.py +0 -0
  82. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/utils/console.py +0 -0
  83. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/utils/get_auth_parameters.py +0 -0
  84. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/utils/import_function.py +0 -0
  85. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_cli/utils/timeout.py +0 -0
  86. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/logger.py +0 -0
  87. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/utils/ai_source_project.py +0 -0
  88. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/utils/code_tree.py +0 -0
  89. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/utils/run_apis.py +0 -0
  90. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/utils/setup_ide_functions_token.py +0 -0
  91. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_internal_cli/utils/unix_socket.py +0 -0
  92. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/intuned_runtime/__init__.py +0 -0
  93. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/__init__.py +0 -0
  94. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/backend_functions/__init__.py +0 -0
  95. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/backend_functions/_call_backend_function.py +0 -0
  96. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/backend_functions/get_auth_session_parameters.py +0 -0
  97. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/browser/__init__.py +0 -0
  98. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/browser/extensions/__init__.py +0 -0
  99. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/browser/extensions/helpers.py +0 -0
  100. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/browser/extensions/intuned_extension.py +0 -0
  101. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/browser/helpers.py +0 -0
  102. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/browser/launch_camoufox.py +0 -0
  103. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/browser/storage_state.py +0 -0
  104. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/constants.py +0 -0
  105. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/context/__init__.py +0 -0
  106. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/context/context.py +0 -0
  107. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/env.py +0 -0
  108. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/errors/__init__.py +0 -0
  109. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/errors/auth_session_errors.py +0 -0
  110. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/errors/run_api_errors.py +0 -0
  111. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/errors/trace_errors.py +0 -0
  112. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/helpers/__init__.py +0 -0
  113. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/helpers/attempt_store.py +0 -0
  114. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/helpers/extend_payload.py +0 -0
  115. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/helpers/extend_timeout.py +0 -0
  116. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/helpers/get_auth_session_parameters.py +0 -0
  117. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/py.typed +0 -0
  118. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/run/__init__.py +0 -0
  119. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/run/intuned_settings.py +0 -0
  120. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/run/playwright_context.py +0 -0
  121. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/run/playwright_tracing.py +0 -0
  122. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/run/pydantic_encoder.py +0 -0
  123. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/run/run_api.py +0 -0
  124. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/run/setup_context_hook.py +0 -0
  125. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/run/traces.py +0 -0
  126. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/types/__init__.py +0 -0
  127. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/types/payload.py +0 -0
  128. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/types/run_types.py +0 -0
  129. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/utils/__init__.py +0 -0
  130. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime/utils/config_loader.py +0 -0
  131. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime_helpers/__init__.py +0 -0
  132. {intuned_runtime-1.3.1 → intuned_runtime-1.3.3}/runtime_helpers/py.typed +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: intuned-runtime
3
- Version: 1.3.1
4
- Summary: Runtime commands for Intuned platform Python scrapers
3
+ Version: 1.3.3
4
+ Summary: Runtime SDK that powers browser automation projects running on Intuned
5
5
  License: Elastic-2.0
6
6
  License-File: LICENSE
7
7
  Keywords: runtime,intuned
@@ -23,12 +23,14 @@ Requires-Dist: browserforge[all]
23
23
  Requires-Dist: camoufox[geoip] (>=0.4.11,<0.5.0)
24
24
  Requires-Dist: gitpython (>=3.1.43,<4.0.0)
25
25
  Requires-Dist: httpx (>=0.23.0,<1)
26
+ Requires-Dist: jsonc-parser (>=1.1.5,<2.0.0)
26
27
  Requires-Dist: more-termcolor (>=1.1.3,<2.0.0)
27
28
  Requires-Dist: pathspec (>=0.12.1,<0.13.0)
28
29
  Requires-Dist: pydantic (>=2.10.6,<3.0.0)
29
30
  Requires-Dist: pyright (>=1.1.387,<2.0.0)
30
31
  Requires-Dist: python-dotenv (==1.0.1)
31
32
  Requires-Dist: pytimeparse (>=1.1.8,<2.0.0)
33
+ Requires-Dist: pyyaml (>=6.0.3,<7.0.0)
32
34
  Requires-Dist: requests (>=2.32.3,<3.0.0)
33
35
  Requires-Dist: rich (>=14.1.0,<15.0.0)
34
36
  Requires-Dist: ruff (>=0.7.2,<0.8.0)
@@ -0,0 +1,41 @@
1
+ import logging
2
+ import os
3
+ import sys
4
+
5
+ import arguably
6
+ from dotenv import find_dotenv
7
+ from dotenv import load_dotenv
8
+
9
+ import intuned_cli.commands # pyright: ignore[reportUnusedImport] # noqa: F401
10
+ from intuned_cli.utils.error import CLIExit
11
+ from runtime.context.context import IntunedContext
12
+
13
+ logging.basicConfig(level=logging.WARNING, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
14
+
15
+ logging.getLogger("runtime").setLevel(logging.INFO)
16
+ logging.getLogger("intuned_runtime").setLevel(logging.INFO)
17
+ logging.getLogger("intuned_browser").setLevel(logging.INFO)
18
+
19
+
20
+ def run():
21
+ dotenv = find_dotenv(usecwd=True)
22
+ if dotenv:
23
+ load_dotenv(dotenv, override=True)
24
+ from runtime.env import cli_env_var_key
25
+
26
+ os.environ[cli_env_var_key] = "true"
27
+ os.environ["RUN_ENVIRONMENT"] = "AUTHORING"
28
+
29
+ if not os.environ.get("FUNCTIONS_DOMAIN"):
30
+ from intuned_cli.utils.backend import get_base_url
31
+
32
+ os.environ["FUNCTIONS_DOMAIN"] = get_base_url().replace("/$", "")
33
+ try:
34
+ with IntunedContext():
35
+ arguably.run(name="intuned", output=sys.stderr)
36
+ return 0
37
+ except CLIExit as e:
38
+ return e.code
39
+
40
+
41
+ __all__ = ["run"]
@@ -7,13 +7,18 @@ from .attempt_authsession_create_command import (
7
7
  attempt__authsession__create as attempt__authsession__create, # type: ignore
8
8
  )
9
9
  from .attempt_command import attempt as attempt # type: ignore
10
+ from .authsession_command import authsession as authsession # type: ignore
11
+ from .authsession_record_command import authsession__record as authsession__record # type: ignore
10
12
  from .command import __root__ as __root__ # type: ignore
11
13
  from .deploy_command import deploy as deploy # type: ignore
12
14
  from .init_command import init as init # type: ignore
13
15
  from .run_api_command import run__api as run__api # type: ignore
14
16
  from .run_authsession_command import run__authsession as run__authsession # type: ignore
17
+ from .run_authsession_create_command import authsession__create as authsession__create # type: ignore
15
18
  from .run_authsession_create_command import run__authsession__create as run__authsession__create # type: ignore
19
+ from .run_authsession_update_command import authsession__update as authsession__update # type: ignore
16
20
  from .run_authsession_update_command import run__authsession__update as run__authsession__update # type: ignore
21
+ from .run_authsession_validate_command import authsession__validate as authsession__validate # type: ignore
17
22
  from .run_authsession_validate_command import run__authsession__validate as run__authsession__validate # type: ignore
18
23
  from .run_command import run as run # type: ignore
19
24
  from .save_command import save as save # type: ignore
@@ -1,12 +1,12 @@
1
- import arguably
2
1
  import pytimeparse # type: ignore
3
2
 
4
3
  from intuned_cli.controller.api import execute_attempt_api_cli
5
4
  from intuned_cli.utils.auth_session_helpers import assert_auth_consistent
6
5
  from intuned_cli.utils.auth_session_helpers import load_parameters
6
+ from intuned_cli.utils.wrapper import cli_command
7
7
 
8
8
 
9
- @arguably.command # type: ignore
9
+ @cli_command
10
10
  async def attempt__api(
11
11
  api_name: str,
12
12
  parameters: str,
@@ -17,6 +17,8 @@ async def attempt__api(
17
17
  timeout: str = "10 min",
18
18
  headless: bool = False,
19
19
  output_file: str | None = None,
20
+ trace: bool = False,
21
+ keep_browser_open: bool = False,
20
22
  ):
21
23
  """Executes an Intuned API attempt with parameters
22
24
 
@@ -28,6 +30,8 @@ async def attempt__api(
28
30
  timeout (str, optional): [--timeout]. Timeout - seconds or pytimeparse-formatted string. Defaults to "10 min".
29
31
  headless (bool, optional): [--headless]. Run the API in headless mode (default: False). This will not open a browser window.
30
32
  output_file (str | None, optional): [-o/--output-file]. Output file path. Defaults to None.
33
+ trace (bool, optional): [--trace]. Capture a trace of each attempt, useful for debugging. Defaults to False.
34
+ keep_browser_open (bool, optional): [--keep-browser-open]. Keep the last browser open after execution for debugging. Defaults to False.
31
35
  """
32
36
 
33
37
  await assert_auth_consistent(auth_session)
@@ -48,4 +52,6 @@ async def attempt__api(
48
52
  timeout=timeout_value,
49
53
  headless=headless,
50
54
  output_file=output_file,
55
+ trace=trace,
56
+ keep_browser_open=keep_browser_open,
51
57
  )
@@ -1,11 +1,11 @@
1
- import arguably
2
1
  import pytimeparse # type: ignore
3
2
 
4
3
  from intuned_cli.controller.authsession import execute_attempt_check_auth_session_cli
5
4
  from intuned_cli.utils.auth_session_helpers import assert_auth_enabled
5
+ from intuned_cli.utils.wrapper import cli_command
6
6
 
7
7
 
8
- @arguably.command # type: ignore
8
+ @cli_command
9
9
  async def attempt__authsession__check(
10
10
  id: str,
11
11
  /,
@@ -13,6 +13,8 @@ async def attempt__authsession__check(
13
13
  proxy: str | None = None,
14
14
  timeout: str = "10 min",
15
15
  headless: bool = False,
16
+ trace: bool = False,
17
+ keep_browser_open: bool = False,
16
18
  ):
17
19
  """Check an existing auth session
18
20
 
@@ -21,6 +23,8 @@ async def attempt__authsession__check(
21
23
  proxy (str | None, optional): [--proxy]. Proxy URL to use for the auth session command. Defaults to None.
22
24
  timeout (str, optional): [--timeout]. Timeout for the auth session command - seconds or pytimeparse-formatted string. Defaults to "10 min".
23
25
  headless (bool, optional): [--headless]. Run the API in headless mode (default: False). This will not open a browser window.
26
+ trace (bool, optional): [--trace]. Capture a trace of each attempt, useful for debugging. Defaults to False.
27
+ keep_browser_open (bool, optional): [--keep-browser-open]. Keep the last browser open after execution for debugging. Defaults to False.
24
28
  """
25
29
  await assert_auth_enabled()
26
30
 
@@ -35,4 +39,6 @@ async def attempt__authsession__check(
35
39
  headless=headless,
36
40
  timeout=timeout_value,
37
41
  proxy=proxy,
42
+ trace=trace,
43
+ keep_browser_open=keep_browser_open,
38
44
  )
@@ -0,0 +1,9 @@
1
+ from intuned_cli.utils.help import print_help_and_exit
2
+ from intuned_cli.utils.wrapper import cli_command
3
+
4
+
5
+ @cli_command
6
+ async def attempt__authsession():
7
+ """Execute san Intuned authsession attempt"""
8
+
9
+ print_help_and_exit()
@@ -1,12 +1,12 @@
1
- import arguably
2
1
  import pytimeparse # type: ignore
3
2
 
4
3
  from intuned_cli.controller.authsession import execute_attempt_create_auth_session_cli
5
4
  from intuned_cli.utils.auth_session_helpers import assert_auth_enabled
6
5
  from intuned_cli.utils.auth_session_helpers import load_parameters
6
+ from intuned_cli.utils.wrapper import cli_command
7
7
 
8
8
 
9
- @arguably.command # type: ignore
9
+ @cli_command
10
10
  async def attempt__authsession__create(
11
11
  parameters: str,
12
12
  /,
@@ -15,6 +15,8 @@ async def attempt__authsession__create(
15
15
  proxy: str | None = None,
16
16
  timeout: str = "10 min",
17
17
  headless: bool = False,
18
+ trace: bool = False,
19
+ keep_browser_open: bool = False,
18
20
  ):
19
21
  """Create a new auth session
20
22
 
@@ -24,8 +26,10 @@ async def attempt__authsession__create(
24
26
  proxy (str | None, optional): [--proxy]. Proxy URL to use for the auth session command. Defaults to None.
25
27
  timeout (str, optional): [--timeout]. Timeout for the auth session command - seconds or pytimeparse-formatted string. Defaults to "10 min".
26
28
  headless (bool, optional): [--headless]. Run the API in headless mode (default: False). This will not open a browser window.
29
+ trace (bool, optional): [--trace]. Capture a trace of each attempt, useful for debugging. Defaults to False.
30
+ keep_browser_open (bool, optional): [--keep-browser-open]. Keep the last browser open after execution for debugging. Defaults to False.
27
31
  """
28
- await assert_auth_enabled()
32
+ await assert_auth_enabled(auth_type="API")
29
33
 
30
34
  auth_session_input = await load_parameters(parameters) or {}
31
35
 
@@ -41,4 +45,6 @@ async def attempt__authsession__create(
41
45
  headless=headless,
42
46
  timeout=timeout_value,
43
47
  proxy=proxy,
48
+ trace=trace,
49
+ keep_browser_open=keep_browser_open,
44
50
  )
@@ -0,0 +1,9 @@
1
+ from intuned_cli.utils.help import print_help_and_exit
2
+ from intuned_cli.utils.wrapper import cli_command
3
+
4
+
5
+ @cli_command
6
+ async def attempt():
7
+ """Executes an Intuned attempt."""
8
+
9
+ print_help_and_exit()
@@ -0,0 +1,9 @@
1
+ from intuned_cli.utils.help import print_help_and_exit
2
+ from intuned_cli.utils.wrapper import cli_command
3
+
4
+
5
+ @cli_command
6
+ async def authsession():
7
+ """Manage Auth Sessions"""
8
+
9
+ print_help_and_exit()
@@ -0,0 +1,52 @@
1
+ import pytimeparse # type: ignore
2
+
3
+ from intuned_cli.controller.authsession import execute_record_auth_session_cli
4
+ from intuned_cli.utils.auth_session_helpers import assert_auth_enabled
5
+ from intuned_cli.utils.auth_session_helpers import get_auth_session_recorder_parameters
6
+ from intuned_cli.utils.wrapper import cli_command
7
+
8
+
9
+ @cli_command
10
+ async def authsession__record(
11
+ *,
12
+ id: str | None = None,
13
+ check_attempts: int = 1,
14
+ proxy: str | None = None,
15
+ timeout: str = "10 min",
16
+ headless: bool = False,
17
+ trace: bool = False,
18
+ keep_browser_open: bool = False,
19
+ ):
20
+ """Record a recorder-based auth session and then execute an AuthSession:Validate run to validate it
21
+
22
+ Args:
23
+ id (str | None, optional): ID of the auth session to record. If not provided, a new ID will be generated.
24
+ check_attempts (int, optional): [--check-attempts]. Number of attempts to check the auth session validity after it is created. Defaults to 1.
25
+ proxy (str | None, optional): [--proxy]. Proxy URL to use for recorder session and validation. Defaults to None.
26
+ timeout (str, optional): [--timeout]. Timeout for the auth session command - seconds or pytimeparse-formatted string. Defaults to "10 min".
27
+ headless (bool, optional): [--headless]. Run the auth session validation in headless mode (default: False). This will not open a browser window. The recorder will always be non-headless.
28
+ trace (bool, optional): [--trace]. Capture a trace of each attempt, useful for debugging. Defaults to False.
29
+ keep_browser_open (bool, optional): [--keep-browser-open]. Keep the last browser open after execution for debugging. Defaults to False.
30
+ """
31
+
32
+ await assert_auth_enabled(auth_type="MANUAL")
33
+
34
+ timeout_value = pytimeparse.parse(timeout) # type: ignore
35
+ if timeout_value is None:
36
+ raise ValueError(
37
+ f"Invalid timeout format: {timeout}. Please use a valid time format like '10 min' or '600 seconds'."
38
+ )
39
+
40
+ start_url, finish_url = await get_auth_session_recorder_parameters()
41
+
42
+ await execute_record_auth_session_cli(
43
+ start_url=start_url,
44
+ finish_url=finish_url,
45
+ id=id,
46
+ check_retries=check_attempts,
47
+ headless=headless,
48
+ proxy=proxy,
49
+ timeout=timeout_value,
50
+ trace=trace,
51
+ keep_browser_open=keep_browser_open,
52
+ )
@@ -1,9 +1,10 @@
1
- import arguably
2
-
3
1
  from intuned_cli.utils.console import console
2
+ from intuned_cli.utils.error import CLIExit
3
+ from intuned_cli.utils.help import print_help_and_exit
4
+ from intuned_cli.utils.wrapper import cli_command
4
5
 
5
6
 
6
- @arguably.command # type: ignore
7
+ @cli_command
7
8
  async def __root__(
8
9
  *,
9
10
  version: bool = False,
@@ -19,8 +20,6 @@ async def __root__(
19
20
 
20
21
  if version:
21
22
  console.print("1.0.0") # todo: better version handling
22
- exit(0)
23
+ raise CLIExit(0)
23
24
 
24
- if arguably.is_target() and not version:
25
- console.print(" (-h/--help) for usage")
26
- exit(1)
25
+ print_help_and_exit()
@@ -1,13 +1,12 @@
1
- import arguably
2
-
3
1
  from intuned_cli.controller.deploy import deploy_project
4
2
  from intuned_cli.controller.save import validate_intuned_project
5
3
  from intuned_cli.controller.save import validate_project_name
6
4
  from intuned_cli.utils.backend import get_intuned_api_auth_credentials
7
5
  from intuned_cli.utils.error import CLIError
6
+ from intuned_cli.utils.wrapper import cli_command
8
7
 
9
8
 
10
- @arguably.command # type: ignore
9
+ @cli_command
11
10
  async def deploy(
12
11
  project_name: str | None = None,
13
12
  /,
@@ -1,11 +1,10 @@
1
1
  from typing import Any
2
2
 
3
- import arguably
4
-
5
3
  from intuned_cli.utils.error import CLIError
4
+ from intuned_cli.utils.wrapper import cli_command
6
5
 
7
6
 
8
- @arguably.command # type: ignore
7
+ @cli_command
9
8
  async def init(
10
9
  *args: Any,
11
10
  ):
@@ -1,13 +1,13 @@
1
- import arguably
2
1
  import pytimeparse # type: ignore
3
2
 
4
3
  from intuned_cli.controller.api import AuthSessionInput
5
4
  from intuned_cli.controller.api import execute_run_api_cli
6
5
  from intuned_cli.utils.auth_session_helpers import assert_auth_consistent
7
6
  from intuned_cli.utils.auth_session_helpers import load_parameters
7
+ from intuned_cli.utils.wrapper import cli_command
8
8
 
9
9
 
10
- @arguably.command # type: ignore
10
+ @cli_command
11
11
  async def run__api(
12
12
  api_name: str,
13
13
  parameters: str,
@@ -22,8 +22,10 @@ async def run__api(
22
22
  timeout: str = "10 min",
23
23
  headless: bool = False,
24
24
  output_file: str | None = None,
25
+ trace: bool = False,
26
+ keep_browser_open: bool = False,
25
27
  ):
26
- """Execute san Intuned API run with parameters
28
+ """Execute an API run with parameters
27
29
 
28
30
  Args:
29
31
  api_name (str): Name of the API to run.
@@ -37,6 +39,8 @@ async def run__api(
37
39
  timeout (str, optional): [--timeout]. Timeout - seconds or pytimeparse-formatted string. Defaults to "10 min".
38
40
  headless (bool, optional): [--headless]. Run the API in headless mode (default: False). This will not open a browser window.
39
41
  output_file (str | None, optional): [-o/--output-file]. Output file path. Defaults to None.
42
+ trace (bool, optional): [--trace]. Capture a trace of each attempt, useful for debugging. Defaults to False.
43
+ keep_browser_open (bool, optional): [--keep-browser-open]. Keep the last browser open after execution for debugging. Defaults to False.
40
44
  """
41
45
  auth_session_auto_recreate = not no_auth_session_auto_recreate
42
46
 
@@ -66,4 +70,6 @@ async def run__api(
66
70
  timeout=timeout_value,
67
71
  headless=headless,
68
72
  output_file=output_file,
73
+ trace=trace,
74
+ keep_browser_open=keep_browser_open,
69
75
  )
@@ -0,0 +1,9 @@
1
+ from intuned_cli.utils.help import print_help_and_exit
2
+ from intuned_cli.utils.wrapper import cli_command
3
+
4
+
5
+ @cli_command
6
+ async def run__authsession():
7
+ """Executes an Intuned authsession run"""
8
+
9
+ print_help_and_exit()
@@ -1,13 +1,15 @@
1
- import arguably
1
+ from functools import WRAPPER_ASSIGNMENTS
2
+ from functools import wraps
3
+
2
4
  import pytimeparse # type: ignore
3
5
 
4
6
  from intuned_cli.controller.authsession import execute_run_create_auth_session_cli
5
7
  from intuned_cli.utils.auth_session_helpers import assert_auth_enabled
6
8
  from intuned_cli.utils.auth_session_helpers import load_parameters
9
+ from intuned_cli.utils.wrapper import cli_command
7
10
 
8
11
 
9
- @arguably.command # type: ignore
10
- async def run__authsession__create(
12
+ async def _run_auth_session_create_impl(
11
13
  parameters: str,
12
14
  /,
13
15
  *,
@@ -17,8 +19,10 @@ async def run__authsession__create(
17
19
  proxy: str | None = None,
18
20
  timeout: str = "10 min",
19
21
  headless: bool = False,
22
+ trace: bool = False,
23
+ keep_browser_open: bool = False,
20
24
  ):
21
- """Create a new auth session
25
+ """Execute an AuthSession:Create run to create an auth session
22
26
 
23
27
  Args:
24
28
  parameters (str): Parameters for the auth session command
@@ -28,8 +32,11 @@ async def run__authsession__create(
28
32
  proxy (str | None, optional): [--proxy]. Proxy URL to use for the auth session command. Defaults to None.
29
33
  timeout (str, optional): [--timeout]. Timeout for the auth session command - seconds or pytimeparse-formatted string. Defaults to "10 min".
30
34
  headless (bool, optional): [--headless]. Run the API in headless mode (default: False). This will not open a browser window.
35
+ trace (bool, optional): [--trace]. Capture a trace of each attempt, useful for debugging. Defaults to False.
36
+ keep_browser_open (bool, optional): [--keep-browser-open]. Keep the last browser open after execution for debugging. Defaults to False.
31
37
  """
32
- await assert_auth_enabled()
38
+
39
+ await assert_auth_enabled(auth_type="API")
33
40
 
34
41
  auth_session_input = await load_parameters(parameters) or {}
35
42
 
@@ -47,4 +54,24 @@ async def run__authsession__create(
47
54
  headless=headless,
48
55
  proxy=proxy,
49
56
  timeout=timeout_value,
57
+ trace=trace,
58
+ keep_browser_open=keep_browser_open,
50
59
  )
60
+
61
+
62
+ @cli_command
63
+ @wraps(_run_auth_session_create_impl, (a for a in WRAPPER_ASSIGNMENTS if a != "__name__"))
64
+ async def run__authsession__create(
65
+ *args, # type: ignore
66
+ **kwargs, # type: ignore
67
+ ):
68
+ return await _run_auth_session_create_impl(*args, **kwargs) # type: ignore
69
+
70
+
71
+ @cli_command
72
+ @wraps(_run_auth_session_create_impl, (a for a in WRAPPER_ASSIGNMENTS if a != "__name__"))
73
+ async def authsession__create(
74
+ *args, # type: ignore
75
+ **kwargs, # type: ignore
76
+ ):
77
+ return await _run_auth_session_create_impl(*args, **kwargs) # type: ignore
@@ -1,13 +1,15 @@
1
- import arguably
1
+ from functools import WRAPPER_ASSIGNMENTS
2
+ from functools import wraps
3
+
2
4
  import pytimeparse # type: ignore
3
5
 
4
6
  from intuned_cli.controller.authsession import execute_run_update_auth_session_cli
5
7
  from intuned_cli.utils.auth_session_helpers import assert_auth_enabled
6
8
  from intuned_cli.utils.auth_session_helpers import load_parameters
9
+ from intuned_cli.utils.wrapper import cli_command
7
10
 
8
11
 
9
- @arguably.command # type: ignore
10
- async def run__authsession__update(
12
+ async def _run_update_authsession_impl(
11
13
  id: str,
12
14
  /,
13
15
  *,
@@ -17,8 +19,10 @@ async def run__authsession__update(
17
19
  proxy: str | None = None,
18
20
  timeout: str = "10 min",
19
21
  headless: bool = False,
22
+ trace: bool = False,
23
+ keep_browser_open: bool = False,
20
24
  ):
21
- """Update an existing auth session
25
+ """Execute an AuthSession:Update run to update an existing auth session
22
26
 
23
27
  Args:
24
28
  id (str): ID of the auth session to update
@@ -28,8 +32,10 @@ async def run__authsession__update(
28
32
  proxy (str | None, optional): [--proxy]. Proxy URL to use for the auth session command. Defaults to None.
29
33
  timeout (str, optional): [--timeout]. Timeout for the auth session command - seconds or pytimeparse-formatted string. Defaults to "10 min".
30
34
  headless (bool, optional): [--headless]. Run the API in headless mode (default: False). This will not open a browser window.
35
+ trace (bool, optional): [--trace]. Capture a trace of each attempt, useful for debugging. Defaults to False.
36
+ keep_browser_open (bool, optional): [--keep-browser-open]. Keep the last browser open after execution for debugging. Defaults to False.
31
37
  """
32
- await assert_auth_enabled()
38
+ await assert_auth_enabled(auth_type="API")
33
39
 
34
40
  auth_session_input = None
35
41
  if parameters:
@@ -49,4 +55,24 @@ async def run__authsession__update(
49
55
  headless=headless,
50
56
  proxy=proxy,
51
57
  timeout=timeout_value,
58
+ trace=trace,
59
+ keep_browser_open=keep_browser_open,
52
60
  )
61
+
62
+
63
+ @cli_command
64
+ @wraps(_run_update_authsession_impl, (a for a in WRAPPER_ASSIGNMENTS if a != "__name__"))
65
+ async def run__authsession__update(
66
+ *args, # type: ignore
67
+ **kwargs, # type: ignore
68
+ ):
69
+ return await _run_update_authsession_impl(*args, **kwargs) # type: ignore
70
+
71
+
72
+ @cli_command
73
+ @wraps(_run_update_authsession_impl, (a for a in WRAPPER_ASSIGNMENTS if a != "__name__"))
74
+ async def authsession__update(
75
+ *args, # type: ignore
76
+ **kwargs, # type: ignore
77
+ ):
78
+ return await _run_update_authsession_impl(*args, **kwargs) # type: ignore
@@ -1,12 +1,14 @@
1
- import arguably
1
+ from functools import WRAPPER_ASSIGNMENTS
2
+ from functools import wraps
3
+
2
4
  import pytimeparse # type: ignore
3
5
 
4
6
  from intuned_cli.controller.authsession import execute_run_validate_auth_session_cli
5
7
  from intuned_cli.utils.auth_session_helpers import assert_auth_enabled
8
+ from intuned_cli.utils.wrapper import cli_command
6
9
 
7
10
 
8
- @arguably.command # type: ignore
9
- async def run__authsession__validate(
11
+ async def _run_validate_authsession_impl(
10
12
  id: str,
11
13
  /,
12
14
  *,
@@ -16,8 +18,10 @@ async def run__authsession__validate(
16
18
  timeout: str = "10 min",
17
19
  no_auto_recreate: bool = False,
18
20
  headless: bool = False,
21
+ trace: bool = False,
22
+ keep_browser_open: bool = False,
19
23
  ):
20
- """Validate an existing auth session
24
+ """Execute an AuthSession:Validate run to validate an auth session
21
25
 
22
26
  Args:
23
27
  id (str): ID of the auth session to validate
@@ -27,6 +31,8 @@ async def run__authsession__validate(
27
31
  timeout (str, optional): [--timeout]. Timeout for the auth session command - seconds or pytimeparse-formatted string. Defaults to "10 min".
28
32
  no_auto_recreate (bool, optional): [--no-auto-recreate]. Disable auto recreation of the auth session if it is invalid. Defaults to False.
29
33
  headless (bool, optional): [--headless]. Run the API in headless mode (default: False). This will not open a browser window.
34
+ trace (bool, optional): [--trace]. Capture a trace of each attempt, useful for debugging. Defaults to False.
35
+ keep_browser_open (bool, optional): [--keep-browser-open]. Keep the last browser open after execution for debugging. Defaults to False.
30
36
  """
31
37
  await assert_auth_enabled()
32
38
 
@@ -46,4 +52,24 @@ async def run__authsession__validate(
46
52
  headless=headless,
47
53
  proxy=proxy,
48
54
  timeout=timeout_value,
55
+ trace=trace,
56
+ keep_browser_open=keep_browser_open,
49
57
  )
58
+
59
+
60
+ @cli_command
61
+ @wraps(_run_validate_authsession_impl, (a for a in WRAPPER_ASSIGNMENTS if a != "__name__"))
62
+ async def run__authsession__validate(
63
+ *args, # type: ignore
64
+ **kwargs, # type: ignore
65
+ ):
66
+ return await _run_validate_authsession_impl(*args, **kwargs) # type: ignore
67
+
68
+
69
+ @cli_command
70
+ @wraps(_run_validate_authsession_impl, (a for a in WRAPPER_ASSIGNMENTS if a != "__name__"))
71
+ async def authsession__validate(
72
+ *args, # type: ignore
73
+ **kwargs, # type: ignore
74
+ ):
75
+ return await _run_validate_authsession_impl(*args, **kwargs) # type: ignore
@@ -0,0 +1,9 @@
1
+ from intuned_cli.utils.help import print_help_and_exit
2
+ from intuned_cli.utils.wrapper import cli_command
3
+
4
+
5
+ @cli_command
6
+ async def run():
7
+ """Executes an Intuned run."""
8
+
9
+ print_help_and_exit()
@@ -1,13 +1,12 @@
1
- import arguably
2
-
3
1
  from intuned_cli.controller.save import save_project
4
2
  from intuned_cli.controller.save import validate_intuned_project
5
3
  from intuned_cli.controller.save import validate_project_name
6
4
  from intuned_cli.utils.backend import get_intuned_api_auth_credentials
7
5
  from intuned_cli.utils.error import CLIError
6
+ from intuned_cli.utils.wrapper import cli_command
8
7
 
9
8
 
10
- @arguably.command # type: ignore
9
+ @cli_command
11
10
  async def save(
12
11
  project_name: str | None = None,
13
12
  /,