intuned-runtime 1.0.0__py3-none-any.whl → 1.1.0__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.
- intuned_cli/__init__.py +40 -0
- intuned_cli/commands/__init__.py +18 -0
- intuned_cli/commands/attempt_api_command.py +51 -0
- intuned_cli/commands/attempt_authsession_check_command.py +38 -0
- intuned_cli/commands/attempt_authsession_command.py +12 -0
- intuned_cli/commands/attempt_authsession_create_command.py +44 -0
- intuned_cli/commands/attempt_command.py +12 -0
- intuned_cli/commands/command.py +26 -0
- intuned_cli/commands/deploy_command.py +47 -0
- intuned_cli/commands/init_command.py +21 -0
- intuned_cli/commands/run_api_command.py +69 -0
- intuned_cli/commands/run_authsession_command.py +12 -0
- intuned_cli/commands/run_authsession_create_command.py +50 -0
- intuned_cli/commands/run_authsession_update_command.py +52 -0
- intuned_cli/commands/run_authsession_validate_command.py +49 -0
- intuned_cli/commands/run_command.py +12 -0
- intuned_cli/constants/__init__.py +1 -0
- intuned_cli/constants/readme.py +134 -0
- intuned_cli/controller/__test__/__init__.py +0 -0
- intuned_cli/controller/__test__/test_api.py +529 -0
- intuned_cli/controller/__test__/test_authsession.py +907 -0
- intuned_cli/controller/api.py +212 -0
- intuned_cli/controller/authsession.py +458 -0
- intuned_cli/controller/deploy.py +352 -0
- intuned_cli/controller/init.py +97 -0
- intuned_cli/types.py +33 -0
- intuned_cli/utils/api_helpers.py +32 -0
- intuned_cli/utils/auth_session_helpers.py +57 -0
- intuned_cli/utils/backend.py +5 -0
- intuned_cli/utils/confirmation.py +0 -0
- intuned_cli/utils/console.py +6 -0
- intuned_cli/utils/error.py +27 -0
- intuned_cli/utils/exclusions.py +40 -0
- intuned_cli/utils/get_auth_parameters.py +18 -0
- intuned_cli/utils/import_function.py +15 -0
- intuned_cli/utils/timeout.py +25 -0
- {cli → intuned_internal_cli}/__init__.py +1 -1
- {cli → intuned_internal_cli}/commands/__init__.py +2 -0
- {cli → intuned_internal_cli}/commands/ai_source/deploy.py +1 -1
- {cli → intuned_internal_cli}/commands/project/type_check.py +39 -32
- intuned_internal_cli/commands/root.py +15 -0
- {intuned_runtime-1.0.0.dist-info → intuned_runtime-1.1.0.dist-info}/METADATA +3 -1
- intuned_runtime-1.1.0.dist-info/RECORD +96 -0
- intuned_runtime-1.1.0.dist-info/entry_points.txt +4 -0
- runtime/__init__.py +2 -1
- runtime/backend_functions/_call_backend_function.py +0 -5
- runtime/browser/__init__.py +2 -1
- runtime/browser/launch_chromium.py +68 -49
- runtime/browser/storage_state.py +11 -12
- runtime/errors/run_api_errors.py +14 -10
- runtime/run/playwright_constructs.py +4 -2
- runtime/run/pydantic_encoder.py +15 -0
- runtime/run/run_api.py +5 -4
- runtime/types/run_types.py +16 -0
- intuned_runtime-1.0.0.dist-info/RECORD +0 -58
- intuned_runtime-1.0.0.dist-info/entry_points.txt +0 -3
- {cli → intuned_internal_cli}/commands/ai_source/__init__.py +0 -0
- {cli → intuned_internal_cli}/commands/ai_source/ai_source.py +0 -0
- {cli → intuned_internal_cli}/commands/browser/__init__.py +0 -0
- {cli → intuned_internal_cli}/commands/browser/save_state.py +0 -0
- {cli → intuned_internal_cli}/commands/init.py +0 -0
- {cli → intuned_internal_cli}/commands/project/__init__.py +0 -0
- {cli → intuned_internal_cli}/commands/project/auth_session/__init__.py +0 -0
- {cli → intuned_internal_cli}/commands/project/auth_session/check.py +0 -0
- {cli → intuned_internal_cli}/commands/project/auth_session/create.py +0 -0
- {cli → intuned_internal_cli}/commands/project/auth_session/load.py +0 -0
- {cli → intuned_internal_cli}/commands/project/project.py +0 -0
- {cli → intuned_internal_cli}/commands/project/run.py +0 -0
- {cli → intuned_internal_cli}/commands/project/run_interface.py +0 -0
- {cli → intuned_internal_cli}/commands/project/upgrade.py +0 -0
- {cli → intuned_internal_cli}/commands/publish_packages.py +0 -0
- {cli → intuned_internal_cli}/logger.py +0 -0
- {cli → intuned_internal_cli}/utils/ai_source_project.py +0 -0
- {cli → intuned_internal_cli}/utils/code_tree.py +0 -0
- {cli → intuned_internal_cli}/utils/run_apis.py +0 -0
- {cli → intuned_internal_cli}/utils/unix_socket.py +0 -0
- {intuned_runtime-1.0.0.dist-info → intuned_runtime-1.1.0.dist-info}/LICENSE +0 -0
- {intuned_runtime-1.0.0.dist-info → intuned_runtime-1.1.0.dist-info}/WHEEL +0 -0
@@ -1,13 +1,15 @@
|
|
1
1
|
from contextlib import asynccontextmanager
|
2
|
+
from typing import TYPE_CHECKING
|
2
3
|
|
3
|
-
|
4
|
+
if TYPE_CHECKING:
|
5
|
+
from playwright.async_api import ProxySettings
|
4
6
|
|
5
7
|
from ..browser import launch_chromium
|
6
8
|
|
7
9
|
|
8
10
|
@asynccontextmanager
|
9
11
|
async def get_production_playwright_constructs(
|
10
|
-
proxy: ProxySettings | None = None,
|
12
|
+
proxy: "ProxySettings | None" = None,
|
11
13
|
headless: bool = False,
|
12
14
|
*,
|
13
15
|
cdp_address: str | None = None,
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import json
|
2
|
+
from typing import Any
|
3
|
+
from typing import override
|
4
|
+
|
5
|
+
from pydantic import BaseModel
|
6
|
+
|
7
|
+
|
8
|
+
class PydanticEncoder(json.JSONEncoder):
|
9
|
+
@override
|
10
|
+
def default(self, o: Any):
|
11
|
+
if isinstance(o, BaseModel):
|
12
|
+
return o.model_dump(
|
13
|
+
by_alias=True,
|
14
|
+
)
|
15
|
+
return super().default(o)
|
runtime/run/run_api.py
CHANGED
@@ -31,7 +31,7 @@ from ..errors import AutomationError
|
|
31
31
|
from ..errors import AutomationNotCoroutineError
|
32
32
|
from ..errors import NoAutomationInApiError
|
33
33
|
from .playwright_constructs import get_production_playwright_constructs
|
34
|
-
from .
|
34
|
+
from .pydantic_encoder import PydanticEncoder
|
35
35
|
|
36
36
|
|
37
37
|
def import_function_from_api_dir(
|
@@ -111,7 +111,9 @@ async def run_api(
|
|
111
111
|
parameters: RunApiParameters,
|
112
112
|
*,
|
113
113
|
import_function: ImportFunction | None = None,
|
114
|
-
):
|
114
|
+
) -> RunAutomationSuccessResult:
|
115
|
+
from playwright.async_api import ProxySettings
|
116
|
+
|
115
117
|
trace_started: bool = False
|
116
118
|
|
117
119
|
headless = False
|
@@ -145,7 +147,6 @@ async def run_api(
|
|
145
147
|
context=context,
|
146
148
|
state=state,
|
147
149
|
)
|
148
|
-
|
149
150
|
import_function = import_function or (
|
150
151
|
lambda file_path, name=None: import_function_from_api_dir(
|
151
152
|
file_path=file_path, automation_function_name=name
|
@@ -181,7 +182,7 @@ async def run_api(
|
|
181
182
|
else:
|
182
183
|
automation_result = await automation_coroutine_with_page(parameters.automation_function.params)
|
183
184
|
try:
|
184
|
-
json.dumps(automation_result)
|
185
|
+
json.dumps(automation_result, cls=PydanticEncoder)
|
185
186
|
except TypeError as e:
|
186
187
|
raise AutomationError(TypeError("Result is not JSON serializable")) from e
|
187
188
|
|
runtime/types/run_types.py
CHANGED
@@ -5,6 +5,7 @@ from typing import List
|
|
5
5
|
from typing import Literal
|
6
6
|
from typing import Optional
|
7
7
|
from typing import Union
|
8
|
+
from urllib.parse import urlparse
|
8
9
|
|
9
10
|
from pydantic import BaseModel
|
10
11
|
from pydantic import ConfigDict
|
@@ -24,6 +25,21 @@ class ProxyConfig(CamelBaseModel):
|
|
24
25
|
username: str
|
25
26
|
password: str
|
26
27
|
|
28
|
+
@classmethod
|
29
|
+
def parse_from_str(cls, proxy_str: str) -> "ProxyConfig":
|
30
|
+
parts = urlparse(proxy_str)
|
31
|
+
username = parts.username or ""
|
32
|
+
password = parts.password or ""
|
33
|
+
hostname = parts.hostname or ""
|
34
|
+
port = f":{parts.port}" if parts.port else ""
|
35
|
+
domain = f"{parts.scheme}://{hostname}{port}"
|
36
|
+
|
37
|
+
return ProxyConfig(
|
38
|
+
server=domain,
|
39
|
+
username=username,
|
40
|
+
password=password,
|
41
|
+
)
|
42
|
+
|
27
43
|
|
28
44
|
class SameSite(str, Enum):
|
29
45
|
STRICT = "Strict"
|
@@ -1,58 +0,0 @@
|
|
1
|
-
cli/__init__.py,sha256=QvTM82L3VLVOFGpu_bziWupgwjsAgv07u6o_gUwO3z0,1314
|
2
|
-
cli/commands/__init__.py,sha256=QF-zy-iOZXY-9m-1O-JjWnugjulgJtsODtnkhvlNKq8,944
|
3
|
-
cli/commands/ai_source/__init__.py,sha256=lg7owgcK8owNn2a4VBUP9RKxzFsLruhtnnQV0F_z6pc,149
|
4
|
-
cli/commands/ai_source/ai_source.py,sha256=2woQtCmhxKvLfEz832eUoCT9gMsuSvEE6rMnHSYXC7w,138
|
5
|
-
cli/commands/ai_source/deploy.py,sha256=XVN_alilwIaoVniuSpE8RkAveuaB3MaUtsRjIcpQTXo,2440
|
6
|
-
cli/commands/browser/__init__.py,sha256=AuVbvh7aSBTFKYvewXZyPoIvfBTe2uHiPcnaAkzapas,95
|
7
|
-
cli/commands/browser/save_state.py,sha256=eHKfvBfeFR_U9VQbsjOnIZjWepyDjNn9NL3naDYWP2s,841
|
8
|
-
cli/commands/init.py,sha256=8rWBenWZfwNtLxOBqhEMbOATyQNEnmDUmrFJ1xBGyxI,4384
|
9
|
-
cli/commands/project/__init__.py,sha256=t97wvhSenerYRdbSeCKXqHASA6EWA3lc1hnRhF9baOE,734
|
10
|
-
cli/commands/project/auth_session/__init__.py,sha256=gt7mlaW6xmqAc_4-pfF_FiecsR51C6fqCaq_NFbcbwA,300
|
11
|
-
cli/commands/project/auth_session/check.py,sha256=AFILp7m34nAO_RD3IfRpuJm5Zh0wnCRtBXqIrerdbwo,4565
|
12
|
-
cli/commands/project/auth_session/create.py,sha256=r-eYu3uLUo2mzF836CbVgu4oBzcIIDekzzFwwekxmg0,3374
|
13
|
-
cli/commands/project/auth_session/load.py,sha256=UUvg9Vyj15xiR44XlJzojLoFm5esv-o4E3qA3JqnBsE,1201
|
14
|
-
cli/commands/project/project.py,sha256=_MSh6Xor2Cbh-ItifwgOPq_BP8UDuKB7S6w796FULKQ,137
|
15
|
-
cli/commands/project/run.py,sha256=FDYYkU24aURYbljyYLFo8wLF-nvb86EVr9gMEjAfeE0,12274
|
16
|
-
cli/commands/project/run_interface.py,sha256=4RyR8WZriIF7Va4z1wt-q6zZDQOI31n62Ho2dyimzUY,8717
|
17
|
-
cli/commands/project/type_check.py,sha256=3BKMqTzJ73_J-RYrjba7Yv2mM_VzHR0gnXQEg_Us7JA,3384
|
18
|
-
cli/commands/project/upgrade.py,sha256=XmkZLflM4O-mwvhwcswlZpazRotwi3xesLgE0Zz8fTI,3061
|
19
|
-
cli/commands/publish_packages.py,sha256=sijkaG7_s0I1EWgLekGy1qm8Aqi_gYY8poXbMX0B6Yw,10505
|
20
|
-
cli/logger.py,sha256=bZK3q-KUdGxk_qzDb6pn-n0LOhKJvi6a9p8oSwZtq3s,594
|
21
|
-
cli/utils/ai_source_project.py,sha256=xUCM6p3i1XN4bJbuQz8LCzeI4BwqAdSvCl_vwDAEi0k,831
|
22
|
-
cli/utils/code_tree.py,sha256=1wfxZoQ5kRCfqs2SEPAicbAIPTiD6P1LxSuwYu_eeaI,2790
|
23
|
-
cli/utils/run_apis.py,sha256=Zee4zkgt9R8XY1XCGzj2Nc4zJ3jlRz1xnO493wotuWw,4690
|
24
|
-
cli/utils/unix_socket.py,sha256=UISmkJMHrir5iBLUm6vxC3uzTGIFyOk_wa0C9LUw4Cc,1889
|
25
|
-
runtime/__init__.py,sha256=wgS7k3f10LBbjSYJdjKeKUptizNw6OrBgNx-ECT5Ox8,124
|
26
|
-
runtime/backend_functions/__init__.py,sha256=j2EaK4FK8bmdFtqc5FxtFwx1KhIn_7qKPChrrAhJI3s,119
|
27
|
-
runtime/backend_functions/_call_backend_function.py,sha256=sER0op3vE9EVEB5-ZNwpGraxrqkFh5ZgOIV2B5fgmg4,3028
|
28
|
-
runtime/backend_functions/get_auth_session_parameters.py,sha256=pOvB7XiWpphEuBpazdKALw9EWgBU1PeY3gkzBfVLpkc,869
|
29
|
-
runtime/browser/__init__.py,sha256=9Nqf-80l1F7KGjy2pYBC5S5SeEXJ4YJ4Dl71hi_GWdI,132
|
30
|
-
runtime/browser/launch_chromium.py,sha256=sML_XpjmlMf5QpuqMGeaS42D43pAXWKswm2q-3a2jAM,7459
|
31
|
-
runtime/browser/storage_state.py,sha256=AmiHMfWbFVr7XUEYXoaWWZH4pXGdPv4wTNPXunm19rA,3591
|
32
|
-
runtime/context/__init__.py,sha256=hg8ejm4bJy4tNkwmZ9lKgYJx6bU7OgOdBS684Uv5XGg,73
|
33
|
-
runtime/context/context.py,sha256=pl_0x77_d5CiAznz1qGSk6o9cW-msNvlCt-2eFoMKlA,1739
|
34
|
-
runtime/env.py,sha256=h4BJI-XVSZKgtTxjkzj2HsyN3DlY5Ml9GZqeH4CKDE8,238
|
35
|
-
runtime/errors/__init__.py,sha256=oqiBSvT_yFLQ3hG0AbCUA3WYFaxkTDVkDMSy59xvBCo,688
|
36
|
-
runtime/errors/auth_session_errors.py,sha256=6b4XTI8UCDHDPX4jEA8_HyrNUp4VZ1TrEA8DRh6Z3rM,228
|
37
|
-
runtime/errors/run_api_errors.py,sha256=etqS18ZxDzr30qUezG6D8gcH0Yc1XNtQ8GMkUZx3Rmw,3400
|
38
|
-
runtime/errors/trace_errors.py,sha256=Lzfo0sH3zGaWz1kn5DHcAXQMn3aR2y2bnauj6xP1LYE,110
|
39
|
-
runtime/helpers/__init__.py,sha256=jozYPKHgZJ7Na5U1Wjt83egzjPATMZ_OMInEI6swSbY,234
|
40
|
-
runtime/helpers/extend_payload.py,sha256=towZF08WTpTTDBL4AV1bUU3XpKAQHEB66kGUfTICDe0,246
|
41
|
-
runtime/helpers/extend_timeout.py,sha256=KjfSLEUrqoz7v00rhnPAKq2OmUzEzcv-eQ3M8c2U46s,348
|
42
|
-
runtime/helpers/get_auth_session_parameters.py,sha256=7bopGhJ7vjKAn_UxnHSAah-k2rVOPbq0zi9FQOOCFds,472
|
43
|
-
runtime/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
|
-
runtime/run/__init__.py,sha256=zxMYVb7hn147YTrhMLsrcX6-KTd71HLrYHstJOWeWXQ,52
|
45
|
-
runtime/run/intuned_settings.py,sha256=vy2-ktEzUfUp5Z90dp3l7jPKHNjgB-8GSMDgAY-rYaU,1074
|
46
|
-
runtime/run/playwright_constructs.py,sha256=kOa95d4m4DTcIDKq_QajBs-9FkPz5yZFcsafLtx5288,519
|
47
|
-
runtime/run/run_api.py,sha256=88u91YS5-m_aGwQnNfeN7Mszm1MRfOmciCpzuAXjdoI,8853
|
48
|
-
runtime/run/traces.py,sha256=fKzh11LqV47ujgq_9I2tdp-dgld566wffWaHwU_4gis,1123
|
49
|
-
runtime/types/__init__.py,sha256=IJkDfqsau8F8R_j8TO6j-JwW4ElQr6aU6LNaWRehg5U,401
|
50
|
-
runtime/types/payload.py,sha256=sty8HgDEn3nJbZrwEOMCXyuG7_ICGDwlBIIWSON5ABY,124
|
51
|
-
runtime/types/run_types.py,sha256=_ZoW0rv4VnjqVwVxJBWsdh0S5toppNL3AfL456rn5yM,4076
|
52
|
-
runtime_helpers/__init__.py,sha256=XBrEiE9yNC8Lgn8NgIkqNXbI6e4ap237E83Zj_nlhCQ,249
|
53
|
-
runtime_helpers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
54
|
-
intuned_runtime-1.0.0.dist-info/LICENSE,sha256=9LIjQdgyU_ptzNIfItNCR7VmEHqYnrY1f1XwOreKFI0,3714
|
55
|
-
intuned_runtime-1.0.0.dist-info/METADATA,sha256=i6-dbJpG78FttN_tw7HgA3qd_fE99cHW7bkASh2z16o,5134
|
56
|
-
intuned_runtime-1.0.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
57
|
-
intuned_runtime-1.0.0.dist-info/entry_points.txt,sha256=4VXmTtVfaolAgt2owC9QF1bQpzCVv6Qh_cqW6ZGpftw,35
|
58
|
-
intuned_runtime-1.0.0.dist-info/RECORD,,
|
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
|
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
|