blaxel 0.2.4__py3-none-any.whl → 0.2.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.
- blaxel/core/sandbox/__init__.py +2 -0
- blaxel/core/sandbox/process.py +10 -4
- blaxel/core/sandbox/types.py +15 -3
- {blaxel-0.2.4.dist-info → blaxel-0.2.5.dist-info}/METADATA +1 -1
- {blaxel-0.2.4.dist-info → blaxel-0.2.5.dist-info}/RECORD +7 -7
- {blaxel-0.2.4.dist-info → blaxel-0.2.5.dist-info}/WHEEL +0 -0
- {blaxel-0.2.4.dist-info → blaxel-0.2.5.dist-info}/licenses/LICENSE +0 -0
blaxel/core/sandbox/__init__.py
CHANGED
@@ -7,6 +7,7 @@ from .sandbox import (
|
|
7
7
|
)
|
8
8
|
from .types import (
|
9
9
|
CopyResponse,
|
10
|
+
ProcessRequestWithLog,
|
10
11
|
SandboxConfiguration,
|
11
12
|
SandboxCreateConfiguration,
|
12
13
|
SandboxFilesystemFile,
|
@@ -28,4 +29,5 @@ __all__ = [
|
|
28
29
|
"SandboxFileSystem",
|
29
30
|
"SandboxPreviews",
|
30
31
|
"SandboxProcess",
|
32
|
+
"ProcessRequestWithLog",
|
31
33
|
]
|
blaxel/core/sandbox/process.py
CHANGED
@@ -7,7 +7,7 @@ from ..common.settings import settings
|
|
7
7
|
from .action import SandboxAction
|
8
8
|
from .client.models import ProcessResponse, SuccessResponse
|
9
9
|
from .client.models.process_request import ProcessRequest
|
10
|
-
from .types import SandboxConfiguration
|
10
|
+
from .types import ProcessRequestWithLog, SandboxConfiguration
|
11
11
|
|
12
12
|
|
13
13
|
class SandboxProcess(SandboxAction):
|
@@ -76,11 +76,17 @@ class SandboxProcess(SandboxAction):
|
|
76
76
|
return {"close": close}
|
77
77
|
|
78
78
|
async def exec(
|
79
|
-
self,
|
80
|
-
process: Union[ProcessRequest, Dict[str, Any]],
|
81
|
-
on_log: Optional[Callable[[str], None]] = None,
|
79
|
+
self, process: Union[ProcessRequest, ProcessRequestWithLog, Dict[str, Any]]
|
82
80
|
) -> ProcessResponse:
|
81
|
+
on_log = None
|
82
|
+
if isinstance(process, ProcessRequestWithLog):
|
83
|
+
on_log = process.on_log
|
84
|
+
process = process.to_dict()
|
85
|
+
|
83
86
|
if isinstance(process, dict):
|
87
|
+
if "on_log" in process:
|
88
|
+
on_log = process["on_log"]
|
89
|
+
del process["on_log"]
|
84
90
|
process = ProcessRequest.from_dict(process)
|
85
91
|
|
86
92
|
# Store original wait_for_completion setting
|
blaxel/core/sandbox/types.py
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
from datetime import datetime
|
2
|
-
from typing import Any, Dict, List, Optional, Union
|
2
|
+
from typing import Any, Callable, Dict, List, Optional, Union
|
3
|
+
|
4
|
+
from attrs import define as _attrs_define
|
3
5
|
|
4
6
|
from ..client.models import Port, Sandbox
|
5
7
|
from ..client.types import UNSET
|
8
|
+
from .client.models.process_request import ProcessRequest
|
6
9
|
|
7
10
|
|
8
11
|
class SessionCreateOptions:
|
@@ -164,9 +167,18 @@ class SandboxCreateConfiguration:
|
|
164
167
|
if isinstance(env, dict):
|
165
168
|
# Validate that the dict has the required keys
|
166
169
|
if "name" not in env or "value" not in env:
|
167
|
-
raise ValueError(
|
170
|
+
raise ValueError(
|
171
|
+
f"Environment variable dict must have 'name' and 'value' keys: {env}"
|
172
|
+
)
|
168
173
|
env_objects.append({"name": env["name"], "value": env["value"]})
|
169
174
|
else:
|
170
|
-
raise ValueError(
|
175
|
+
raise ValueError(
|
176
|
+
f"Invalid env type: {type(env)}. Expected dict with 'name' and 'value' keys."
|
177
|
+
)
|
171
178
|
|
172
179
|
return env_objects
|
180
|
+
|
181
|
+
|
182
|
+
@_attrs_define
|
183
|
+
class ProcessRequestWithLog(ProcessRequest):
|
184
|
+
on_log: Callable[[str], None] = None
|
@@ -304,15 +304,15 @@ blaxel/core/mcp/__init__.py,sha256=5VjkiQFb1QWW5QKRgwPHARlxZJ9Xqaz0diJTpM8LLF0,1
|
|
304
304
|
blaxel/core/mcp/client.py,sha256=aK3wSnsO8DmT1BZqw4eiCMF71Jwvni6Qga0DhPP806Y,5437
|
305
305
|
blaxel/core/mcp/server.py,sha256=tXySGZKgK3IllYOzYOecp58BixKBkmAIvQp_4nSM_Ww,5919
|
306
306
|
blaxel/core/models/__init__.py,sha256=HbRDsMnUFHkPC-MMkzPXh4mUqkVjqO6p3j7m00N_XSo,1722
|
307
|
-
blaxel/core/sandbox/__init__.py,sha256=
|
307
|
+
blaxel/core/sandbox/__init__.py,sha256=fyxxdPhVIkI1FwSI4tHG1DH0W4sYuNaWvVxO7_due2U,673
|
308
308
|
blaxel/core/sandbox/action.py,sha256=9Zjkco7YkLzBThD3N2Hr5SpeEiqU_-Ktk8HlKpkpiAg,2802
|
309
309
|
blaxel/core/sandbox/filesystem.py,sha256=dyIvDdlPZO0ijD6mXXX8Yl0t75VijQ6_uMz_9rJd-_4,11317
|
310
310
|
blaxel/core/sandbox/network.py,sha256=P5jLd4AAg1zgyIK4qGWvZaDZ5BzIcxRx2ffz_JLsLMI,357
|
311
311
|
blaxel/core/sandbox/preview.py,sha256=g0uVbMsIi8gRXmmyOfSyqm1qO4Cv6rsq92fs_k884dY,6120
|
312
|
-
blaxel/core/sandbox/process.py,sha256=
|
312
|
+
blaxel/core/sandbox/process.py,sha256=g13yig8pvIwHtABFXwxWKSd5K4KYhEQQcGumME9I-GA,8609
|
313
313
|
blaxel/core/sandbox/sandbox.py,sha256=y6mV2-i6TsSZGQsvBBGptR514OfgvhV0hXBMEsOBcsY,8648
|
314
314
|
blaxel/core/sandbox/session.py,sha256=3PfoekfdVzLYttsmKeK3MePhuprjqv_FDyVQTQME0OE,5277
|
315
|
-
blaxel/core/sandbox/types.py,sha256=
|
315
|
+
blaxel/core/sandbox/types.py,sha256=E-IjEetAMhFDz-mDizFlifCrXoIeJnkbxolQS3p8TKQ,5936
|
316
316
|
blaxel/core/sandbox/client/__init__.py,sha256=N26bD5o1jsTb48oExow6Rgivd8ylaU9jaWZfZsVilP8,128
|
317
317
|
blaxel/core/sandbox/client/client.py,sha256=tcP8cJ4Q3dV9aB3yQ01dDXO-ekfsa3WGGFz4DQAEf8I,7079
|
318
318
|
blaxel/core/sandbox/client/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
|
@@ -402,7 +402,7 @@ blaxel/telemetry/instrumentation/map.py,sha256=PCzZJj39yiYVYJrxLBNP-NW-tjjYyTijw
|
|
402
402
|
blaxel/telemetry/instrumentation/utils.py,sha256=KInMYZH-mu9_wvetmf0EmgrfN3Sw8IWk2Y95v2u90_U,1901
|
403
403
|
blaxel/telemetry/log/log.py,sha256=RvQByRjZMoP_dRaAZu8oK6DTegsHs-xV4W-UIqis6CA,2461
|
404
404
|
blaxel/telemetry/log/logger.py,sha256=NPAS3g82ryROjvc_DEZaTIfrcehoLEZoP-JkLxADxc0,4113
|
405
|
-
blaxel-0.2.
|
406
|
-
blaxel-0.2.
|
407
|
-
blaxel-0.2.
|
408
|
-
blaxel-0.2.
|
405
|
+
blaxel-0.2.5.dist-info/METADATA,sha256=t_ALDJA5oFDqRr8BtWRKJ5Q94y1AfBo3oMEKy7QXb-w,9875
|
406
|
+
blaxel-0.2.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
407
|
+
blaxel-0.2.5.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
|
408
|
+
blaxel-0.2.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|