scalebox-sdk 0.1.4__py3-none-any.whl → 0.1.25__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.
- scalebox/__init__.py +1 -1
- scalebox/api/__init__.py +128 -128
- scalebox/api/client/__init__.py +8 -8
- scalebox/api/client/api/sandboxes/get_sandboxes.py +5 -3
- scalebox/api/client/api/sandboxes/get_sandboxes_sandbox_id_metrics.py +2 -2
- scalebox/api/client/api/sandboxes/post_sandboxes.py +2 -2
- scalebox/api/client/client.py +288 -288
- scalebox/api/client/models/listed_sandbox.py +11 -9
- scalebox/api/client/models/new_sandbox.py +1 -1
- scalebox/api/client/models/sandbox.py +125 -125
- scalebox/api/client/models/sandbox_state.py +1 -0
- scalebox/api/client/types.py +46 -46
- scalebox/code_interpreter/code_interpreter_async.py +370 -369
- scalebox/code_interpreter/code_interpreter_sync.py +318 -317
- scalebox/connection_config.py +92 -92
- scalebox/csx_desktop/main.py +12 -12
- scalebox/generated/api_pb2_connect.py +17 -66
- scalebox/sandbox_async/commands/command.py +307 -307
- scalebox/sandbox_async/commands/command_handle.py +187 -187
- scalebox/sandbox_async/commands/pty.py +187 -187
- scalebox/sandbox_async/filesystem/filesystem.py +557 -557
- scalebox/sandbox_async/filesystem/watch_handle.py +61 -61
- scalebox/sandbox_async/main.py +647 -646
- scalebox/sandbox_async/sandbox_api.py +365 -365
- scalebox/sandbox_async/utils.py +7 -7
- scalebox/sandbox_sync/__init__.py +2 -2
- scalebox/sandbox_sync/commands/command.py +300 -300
- scalebox/sandbox_sync/commands/command_handle.py +150 -150
- scalebox/sandbox_sync/commands/pty.py +181 -181
- scalebox/sandbox_sync/filesystem/filesystem.py +543 -543
- scalebox/sandbox_sync/filesystem/watch_handle.py +66 -66
- scalebox/sandbox_sync/main.py +789 -790
- scalebox/sandbox_sync/sandbox_api.py +356 -356
- scalebox/test/CODE_INTERPRETER_TESTS_READY.md +256 -256
- scalebox/test/README.md +164 -164
- scalebox/test/aclient.py +72 -72
- scalebox/test/code_interpreter_centext.py +21 -21
- scalebox/test/code_interpreter_centext_sync.py +21 -21
- scalebox/test/code_interpreter_test.py +1 -1
- scalebox/test/code_interpreter_test_sync.py +1 -1
- scalebox/test/run_all_validation_tests.py +334 -334
- scalebox/test/test_basic.py +78 -78
- scalebox/test/test_code_interpreter_async_comprehensive.py +2653 -2653
- scalebox/test/{test_code_interpreter_e2bsync_comprehensive.py → test_code_interpreter_execcode.py} +328 -392
- scalebox/test/test_code_interpreter_sync_comprehensive.py +3416 -3412
- scalebox/test/test_csx_desktop_examples.py +130 -0
- scalebox/test/test_sandbox_async_comprehensive.py +736 -738
- scalebox/test/test_sandbox_stress_and_edge_cases.py +778 -778
- scalebox/test/test_sandbox_sync_comprehensive.py +779 -770
- scalebox/test/test_sandbox_usage_examples.py +987 -987
- scalebox/test/testacreate.py +24 -24
- scalebox/test/testagetinfo.py +18 -18
- scalebox/test/testcodeinterpreter_async.py +508 -508
- scalebox/test/testcodeinterpreter_sync.py +239 -239
- scalebox/test/testcomputeuse.py +2 -2
- scalebox/test/testnovnc.py +12 -12
- scalebox/test/testsandbox_api.py +15 -0
- scalebox/test/testsandbox_async.py +202 -118
- scalebox/test/testsandbox_sync.py +71 -38
- scalebox/version.py +2 -2
- {scalebox_sdk-0.1.4.dist-info → scalebox_sdk-0.1.25.dist-info}/METADATA +104 -103
- {scalebox_sdk-0.1.4.dist-info → scalebox_sdk-0.1.25.dist-info}/RECORD +66 -66
- scalebox/test/test_code_interpreter_e2basync_comprehensive.py +0 -2655
- scalebox/test/test_e2b_first.py +0 -11
- {scalebox_sdk-0.1.4.dist-info → scalebox_sdk-0.1.25.dist-info}/WHEEL +0 -0
- {scalebox_sdk-0.1.4.dist-info → scalebox_sdk-0.1.25.dist-info}/entry_points.txt +0 -0
- {scalebox_sdk-0.1.4.dist-info → scalebox_sdk-0.1.25.dist-info}/licenses/LICENSE +0 -0
- {scalebox_sdk-0.1.4.dist-info → scalebox_sdk-0.1.25.dist-info}/top_level.txt +0 -0
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
from collections.abc import Mapping
|
|
2
|
-
from typing import Any, TypeVar, Union, cast
|
|
3
|
-
|
|
4
|
-
from attrs import define as _attrs_define
|
|
5
|
-
from attrs import field as _attrs_field
|
|
6
|
-
|
|
7
|
-
from ..types import UNSET, Unset
|
|
8
|
-
|
|
9
|
-
T = TypeVar("T", bound="Sandbox")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@_attrs_define
|
|
13
|
-
class Sandbox:
|
|
14
|
-
"""
|
|
15
|
-
Attributes:
|
|
16
|
-
client_id (str): Identifier of the client
|
|
17
|
-
envd_version (str): Version of the envd running in the sandbox
|
|
18
|
-
sandbox_id (str): Identifier of the sandbox
|
|
19
|
-
template_id (str): Identifier of the template from which is the sandbox created
|
|
20
|
-
alias (Union[Unset, str]): Alias of the template
|
|
21
|
-
domain (Union[None, Unset, str]): Base domain where the sandbox traffic is accessible
|
|
22
|
-
envd_access_token (Union[Unset, str]): Access token used for envd communication
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
client_id: str
|
|
26
|
-
envd_version: str
|
|
27
|
-
sandbox_id: str
|
|
28
|
-
template_id: str
|
|
29
|
-
alias: Union[Unset, str] = UNSET
|
|
30
|
-
domain: Union[None, Unset, str] = UNSET
|
|
31
|
-
envd_access_token: Union[Unset, str] = UNSET
|
|
32
|
-
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
-
|
|
34
|
-
def to_dict(self) -> dict[str, Any]:
|
|
35
|
-
client_id = self.client_id
|
|
36
|
-
|
|
37
|
-
envd_version = self.envd_version
|
|
38
|
-
|
|
39
|
-
sandbox_id = self.sandbox_id
|
|
40
|
-
|
|
41
|
-
template_id = self.template_id
|
|
42
|
-
|
|
43
|
-
alias = self.alias
|
|
44
|
-
|
|
45
|
-
domain: Union[None, Unset, str]
|
|
46
|
-
if isinstance(self.domain, Unset):
|
|
47
|
-
domain = UNSET
|
|
48
|
-
else:
|
|
49
|
-
domain = self.domain
|
|
50
|
-
|
|
51
|
-
envd_access_token = self.envd_access_token
|
|
52
|
-
|
|
53
|
-
field_dict: dict[str, Any] = {}
|
|
54
|
-
field_dict.update(self.additional_properties)
|
|
55
|
-
field_dict.update(
|
|
56
|
-
{
|
|
57
|
-
"clientID": client_id,
|
|
58
|
-
"envdVersion": envd_version,
|
|
59
|
-
"sandboxID": sandbox_id,
|
|
60
|
-
"templateID": template_id,
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
if alias is not UNSET:
|
|
64
|
-
field_dict["alias"] = alias
|
|
65
|
-
if domain is not UNSET:
|
|
66
|
-
field_dict["domain"] = domain
|
|
67
|
-
if envd_access_token is not UNSET:
|
|
68
|
-
field_dict["envdAccessToken"] = envd_access_token
|
|
69
|
-
|
|
70
|
-
return field_dict
|
|
71
|
-
|
|
72
|
-
@classmethod
|
|
73
|
-
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
74
|
-
d = dict(src_dict)
|
|
75
|
-
dd = d.pop("data")
|
|
76
|
-
data = dict(dd) if dd else None
|
|
77
|
-
client_id = data.pop("clientID", "")
|
|
78
|
-
|
|
79
|
-
envd_version = data.pop("envdVersion", "")
|
|
80
|
-
|
|
81
|
-
sandbox_id = data.pop("sandbox_id")
|
|
82
|
-
|
|
83
|
-
template_id = data.pop("template_id")
|
|
84
|
-
|
|
85
|
-
alias = data.pop("alias", UNSET)
|
|
86
|
-
|
|
87
|
-
def _parse_domain(data: object) -> Union[None, Unset, str]:
|
|
88
|
-
if data is None:
|
|
89
|
-
return data
|
|
90
|
-
if isinstance(data, Unset):
|
|
91
|
-
return data
|
|
92
|
-
return cast(Union[None, Unset, str], data)
|
|
93
|
-
|
|
94
|
-
domain = _parse_domain(data.pop("sandbox_domain", UNSET))
|
|
95
|
-
|
|
96
|
-
envd_access_token = data.pop("envd_access_token", UNSET)
|
|
97
|
-
|
|
98
|
-
sandbox = cls(
|
|
99
|
-
client_id=client_id,
|
|
100
|
-
envd_version=envd_version,
|
|
101
|
-
sandbox_id=sandbox_id,
|
|
102
|
-
template_id=template_id,
|
|
103
|
-
alias=alias,
|
|
104
|
-
domain=domain,
|
|
105
|
-
envd_access_token=envd_access_token,
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
sandbox.additional_properties = d
|
|
109
|
-
return sandbox
|
|
110
|
-
|
|
111
|
-
@property
|
|
112
|
-
def additional_keys(self) -> list[str]:
|
|
113
|
-
return list(self.additional_properties.keys())
|
|
114
|
-
|
|
115
|
-
def __getitem__(self, key: str) -> Any:
|
|
116
|
-
return self.additional_properties[key]
|
|
117
|
-
|
|
118
|
-
def __setitem__(self, key: str, value: Any) -> None:
|
|
119
|
-
self.additional_properties[key] = value
|
|
120
|
-
|
|
121
|
-
def __delitem__(self, key: str) -> None:
|
|
122
|
-
del self.additional_properties[key]
|
|
123
|
-
|
|
124
|
-
def __contains__(self, key: str) -> bool:
|
|
125
|
-
return key in self.additional_properties
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="Sandbox")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class Sandbox:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
client_id (str): Identifier of the client
|
|
17
|
+
envd_version (str): Version of the envd running in the sandbox
|
|
18
|
+
sandbox_id (str): Identifier of the sandbox
|
|
19
|
+
template_id (str): Identifier of the template from which is the sandbox created
|
|
20
|
+
alias (Union[Unset, str]): Alias of the template
|
|
21
|
+
domain (Union[None, Unset, str]): Base domain where the sandbox traffic is accessible
|
|
22
|
+
envd_access_token (Union[Unset, str]): Access token used for envd communication
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
client_id: str
|
|
26
|
+
envd_version: str
|
|
27
|
+
sandbox_id: str
|
|
28
|
+
template_id: str
|
|
29
|
+
alias: Union[Unset, str] = UNSET
|
|
30
|
+
domain: Union[None, Unset, str] = UNSET
|
|
31
|
+
envd_access_token: Union[Unset, str] = UNSET
|
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
|
35
|
+
client_id = self.client_id
|
|
36
|
+
|
|
37
|
+
envd_version = self.envd_version
|
|
38
|
+
|
|
39
|
+
sandbox_id = self.sandbox_id
|
|
40
|
+
|
|
41
|
+
template_id = self.template_id
|
|
42
|
+
|
|
43
|
+
alias = self.alias
|
|
44
|
+
|
|
45
|
+
domain: Union[None, Unset, str]
|
|
46
|
+
if isinstance(self.domain, Unset):
|
|
47
|
+
domain = UNSET
|
|
48
|
+
else:
|
|
49
|
+
domain = self.domain
|
|
50
|
+
|
|
51
|
+
envd_access_token = self.envd_access_token
|
|
52
|
+
|
|
53
|
+
field_dict: dict[str, Any] = {}
|
|
54
|
+
field_dict.update(self.additional_properties)
|
|
55
|
+
field_dict.update(
|
|
56
|
+
{
|
|
57
|
+
"clientID": client_id,
|
|
58
|
+
"envdVersion": envd_version,
|
|
59
|
+
"sandboxID": sandbox_id,
|
|
60
|
+
"templateID": template_id,
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
if alias is not UNSET:
|
|
64
|
+
field_dict["alias"] = alias
|
|
65
|
+
if domain is not UNSET:
|
|
66
|
+
field_dict["domain"] = domain
|
|
67
|
+
if envd_access_token is not UNSET:
|
|
68
|
+
field_dict["envdAccessToken"] = envd_access_token
|
|
69
|
+
|
|
70
|
+
return field_dict
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
74
|
+
d = dict(src_dict)
|
|
75
|
+
dd = d.pop("data")
|
|
76
|
+
data = dict(dd) if dd else None
|
|
77
|
+
client_id = data.pop("clientID", "")
|
|
78
|
+
|
|
79
|
+
envd_version = data.pop("envdVersion", "")
|
|
80
|
+
|
|
81
|
+
sandbox_id = data.pop("sandbox_id")
|
|
82
|
+
|
|
83
|
+
template_id = data.pop("template_id")
|
|
84
|
+
|
|
85
|
+
alias = data.pop("alias", UNSET)
|
|
86
|
+
|
|
87
|
+
def _parse_domain(data: object) -> Union[None, Unset, str]:
|
|
88
|
+
if data is None:
|
|
89
|
+
return data
|
|
90
|
+
if isinstance(data, Unset):
|
|
91
|
+
return data
|
|
92
|
+
return cast(Union[None, Unset, str], data)
|
|
93
|
+
|
|
94
|
+
domain = _parse_domain(data.pop("sandbox_domain", UNSET))
|
|
95
|
+
|
|
96
|
+
envd_access_token = data.pop("envd_access_token", UNSET)
|
|
97
|
+
|
|
98
|
+
sandbox = cls(
|
|
99
|
+
client_id=client_id,
|
|
100
|
+
envd_version=envd_version,
|
|
101
|
+
sandbox_id=sandbox_id,
|
|
102
|
+
template_id=template_id,
|
|
103
|
+
alias=alias,
|
|
104
|
+
domain=domain,
|
|
105
|
+
envd_access_token=envd_access_token,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
sandbox.additional_properties = d
|
|
109
|
+
return sandbox
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def additional_keys(self) -> list[str]:
|
|
113
|
+
return list(self.additional_properties.keys())
|
|
114
|
+
|
|
115
|
+
def __getitem__(self, key: str) -> Any:
|
|
116
|
+
return self.additional_properties[key]
|
|
117
|
+
|
|
118
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
119
|
+
self.additional_properties[key] = value
|
|
120
|
+
|
|
121
|
+
def __delitem__(self, key: str) -> None:
|
|
122
|
+
del self.additional_properties[key]
|
|
123
|
+
|
|
124
|
+
def __contains__(self, key: str) -> bool:
|
|
125
|
+
return key in self.additional_properties
|
scalebox/api/client/types.py
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
"""Contains some shared types for properties"""
|
|
2
|
-
|
|
3
|
-
from collections.abc import MutableMapping
|
|
4
|
-
from http import HTTPStatus
|
|
5
|
-
from typing import BinaryIO, Generic, Literal, Optional, TypeVar
|
|
6
|
-
|
|
7
|
-
from attrs import define
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Unset:
|
|
11
|
-
def __bool__(self) -> Literal[False]:
|
|
12
|
-
return False
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
UNSET: Unset = Unset()
|
|
16
|
-
|
|
17
|
-
FileJsonType = tuple[Optional[str], BinaryIO, Optional[str]]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@define
|
|
21
|
-
class File:
|
|
22
|
-
"""Contains information for file uploads"""
|
|
23
|
-
|
|
24
|
-
payload: BinaryIO
|
|
25
|
-
file_name: Optional[str] = None
|
|
26
|
-
mime_type: Optional[str] = None
|
|
27
|
-
|
|
28
|
-
def to_tuple(self) -> FileJsonType:
|
|
29
|
-
"""Return a tuple representation that httpx will accept for multipart/form-data"""
|
|
30
|
-
return self.file_name, self.payload, self.mime_type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
T = TypeVar("T")
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
@define
|
|
37
|
-
class Response(Generic[T]):
|
|
38
|
-
"""A response from an endpoint"""
|
|
39
|
-
|
|
40
|
-
status_code: HTTPStatus
|
|
41
|
-
content: bytes
|
|
42
|
-
headers: MutableMapping[str, str]
|
|
43
|
-
parsed: Optional[T]
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
__all__ = ["UNSET", "File", "FileJsonType", "Response", "Unset"]
|
|
1
|
+
"""Contains some shared types for properties"""
|
|
2
|
+
|
|
3
|
+
from collections.abc import MutableMapping
|
|
4
|
+
from http import HTTPStatus
|
|
5
|
+
from typing import BinaryIO, Generic, Literal, Optional, TypeVar
|
|
6
|
+
|
|
7
|
+
from attrs import define
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Unset:
|
|
11
|
+
def __bool__(self) -> Literal[False]:
|
|
12
|
+
return False
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
UNSET: Unset = Unset()
|
|
16
|
+
|
|
17
|
+
FileJsonType = tuple[Optional[str], BinaryIO, Optional[str]]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@define
|
|
21
|
+
class File:
|
|
22
|
+
"""Contains information for file uploads"""
|
|
23
|
+
|
|
24
|
+
payload: BinaryIO
|
|
25
|
+
file_name: Optional[str] = None
|
|
26
|
+
mime_type: Optional[str] = None
|
|
27
|
+
|
|
28
|
+
def to_tuple(self) -> FileJsonType:
|
|
29
|
+
"""Return a tuple representation that httpx will accept for multipart/form-data"""
|
|
30
|
+
return self.file_name, self.payload, self.mime_type
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
T = TypeVar("T")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@define
|
|
37
|
+
class Response(Generic[T]):
|
|
38
|
+
"""A response from an endpoint"""
|
|
39
|
+
|
|
40
|
+
status_code: HTTPStatus
|
|
41
|
+
content: bytes
|
|
42
|
+
headers: MutableMapping[str, str]
|
|
43
|
+
parsed: Optional[T]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
__all__ = ["UNSET", "File", "FileJsonType", "Response", "Unset"]
|