exxec 0.3.4__tar.gz → 0.3.6__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.
- {exxec-0.3.4 → exxec-0.3.6}/PKG-INFO +1 -2
- {exxec-0.3.4 → exxec-0.3.6}/pyproject.toml +2 -3
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/daytona_provider/helpers.py +1 -1
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/daytona_provider/process_manager.py +7 -4
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/daytona_provider/provider.py +3 -3
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/daytona_provider/pty_manager.py +32 -80
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/docker_provider/provider.py +1 -1
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/local_provider/provider.py +1 -1
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/vercel_provider/process_manager.py +4 -4
- {exxec-0.3.4 → exxec-0.3.6}/LICENSE +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/README.md +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/acp_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/acp_provider/process_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/acp_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/base.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/beam_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/beam_provider/helpers.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/beam_provider/process_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/beam_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/daytona_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/docker_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/docker_provider/pty_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/e2b_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/e2b_provider/process_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/e2b_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/e2b_provider/pty_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/events.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/local_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/local_provider/pty_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/local_provider/utils.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/log.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/microsandbox_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/microsandbox_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/mock_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/mock_provider/process_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/mock_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/mock_provider/pty_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/modal_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/modal_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/modal_provider/pty_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/models.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/parse_output.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/pep723.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/process_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/pty_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/py.typed +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/pyodide_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/pyodide_provider/filesystem.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/pyodide_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/pyodide_provider/pyodide_server.ts +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/remote_callable.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/srt_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/srt_provider/config.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/srt_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/ssh_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/ssh_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/ssh_provider/pty_manager.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/vercel_provider/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec/vercel_provider/provider.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec_config/__init__.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec_config/configs.py +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec_config/py.typed +0 -0
- {exxec-0.3.4 → exxec-0.3.6}/src/exxec_config/srt_sandbox_config.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: exxec
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.6
|
|
4
4
|
Summary: Execution environments
|
|
5
5
|
Keywords:
|
|
6
6
|
Author: Philipp Temminghoff
|
|
@@ -29,7 +29,6 @@ Requires-Dist: upathtools>=1.9.0
|
|
|
29
29
|
Requires-Dist: beam-client>=0.2.187 ; extra == 'beam'
|
|
30
30
|
Requires-Dist: daytona ; python_full_version < '3.14' and extra == 'daytona'
|
|
31
31
|
Requires-Dist: testcontainers ; extra == 'docker'
|
|
32
|
-
Requires-Dist: morefs ; extra == 'docker'
|
|
33
32
|
Requires-Dist: e2b-code-interpreter ; extra == 'e2b'
|
|
34
33
|
Requires-Dist: fastmcp ; extra == 'mcp'
|
|
35
34
|
Requires-Dist: mcp-run-python ; extra == 'mcp'
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[project]
|
|
4
4
|
name = "exxec"
|
|
5
|
-
version = "0.3.
|
|
5
|
+
version = "0.3.6"
|
|
6
6
|
description = "Execution environments"
|
|
7
7
|
readme = "README.md"
|
|
8
8
|
requires-python = ">=3.13"
|
|
@@ -47,7 +47,7 @@ Source = "https://github.com/phil65/exxec"
|
|
|
47
47
|
[project.optional-dependencies]
|
|
48
48
|
beam = ["beam-client>=0.2.187"]
|
|
49
49
|
daytona = ["daytona; python_version < '3.14'"]
|
|
50
|
-
docker = ["testcontainers"
|
|
50
|
+
docker = ["testcontainers"]
|
|
51
51
|
e2b = ["e2b-code-interpreter"]
|
|
52
52
|
mcp = ["fastmcp", "mcp-run-python"]
|
|
53
53
|
microsandbox = ["microsandbox"]
|
|
@@ -289,7 +289,6 @@ python-platform = "all"
|
|
|
289
289
|
|
|
290
290
|
[tool.uv]
|
|
291
291
|
default-groups = ["dev", "lint", "docs"]
|
|
292
|
-
|
|
293
292
|
# Override to resolve beam-client (<14) vs daytona (>=15) websockets conflict
|
|
294
293
|
override-dependencies = ["websockets>=15.0.0"]
|
|
295
294
|
|
|
@@ -18,7 +18,7 @@ from exxec.log import get_logger
|
|
|
18
18
|
if TYPE_CHECKING:
|
|
19
19
|
from pathlib import Path
|
|
20
20
|
|
|
21
|
-
from daytona._async.sandbox import AsyncSandbox
|
|
21
|
+
from daytona._async.sandbox import AsyncSandbox
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
logger = get_logger(__name__)
|
|
@@ -81,7 +81,7 @@ class DaytonaTerminalManager(ProcessManagerProtocol):
|
|
|
81
81
|
|
|
82
82
|
try:
|
|
83
83
|
await self.sandbox.process.create_session(session_id)
|
|
84
|
-
from daytona.common.process import SessionExecuteRequest
|
|
84
|
+
from daytona.common.process import SessionExecuteRequest
|
|
85
85
|
|
|
86
86
|
request = SessionExecuteRequest(command=full_command, runAsync=True) # ty: ignore[unknown-argument]
|
|
87
87
|
response = await self.sandbox.process.execute_session_command(session_id, request)
|
|
@@ -108,11 +108,14 @@ class DaytonaTerminalManager(ProcessManagerProtocol):
|
|
|
108
108
|
return
|
|
109
109
|
try:
|
|
110
110
|
|
|
111
|
-
def
|
|
111
|
+
def on_stdout(chunk: str) -> None:
|
|
112
|
+
terminal.add_output(chunk)
|
|
113
|
+
|
|
114
|
+
def on_stderr(chunk: str) -> None:
|
|
112
115
|
terminal.add_output(chunk)
|
|
113
116
|
|
|
114
117
|
await self.sandbox.process.get_session_command_logs_async(
|
|
115
|
-
terminal.session_id, terminal.command_id,
|
|
118
|
+
terminal.session_id, terminal.command_id, on_stdout, on_stderr
|
|
116
119
|
)
|
|
117
120
|
command_info = await self.sandbox.process.get_session_command(
|
|
118
121
|
terminal.session_id, terminal.command_id
|
|
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
|
|
|
18
18
|
from contextlib import AbstractAsyncContextManager
|
|
19
19
|
from types import TracebackType
|
|
20
20
|
|
|
21
|
-
from daytona._async.sandbox import AsyncSandbox
|
|
21
|
+
from daytona._async.sandbox import AsyncSandbox
|
|
22
22
|
from upathtools.filesystems import DaytonaFS
|
|
23
23
|
|
|
24
24
|
from exxec.daytona_provider.pty_manager import DaytonaPtyManager
|
|
@@ -62,7 +62,7 @@ class DaytonaExecutionEnvironment(ExecutionEnvironment):
|
|
|
62
62
|
inherit_env: If True, inherit environment variables from os.environ
|
|
63
63
|
default_command_timeout: Default timeout for command execution in seconds
|
|
64
64
|
"""
|
|
65
|
-
from daytona import AsyncDaytona, DaytonaConfig
|
|
65
|
+
from daytona import AsyncDaytona, DaytonaConfig
|
|
66
66
|
|
|
67
67
|
super().__init__(
|
|
68
68
|
lifespan_handler=lifespan_handler,
|
|
@@ -93,7 +93,7 @@ class DaytonaExecutionEnvironment(ExecutionEnvironment):
|
|
|
93
93
|
async def __aenter__(self) -> Self:
|
|
94
94
|
"""Setup Daytona client and create sandbox."""
|
|
95
95
|
await super().__aenter__()
|
|
96
|
-
from daytona.common.daytona import (
|
|
96
|
+
from daytona.common.daytona import (
|
|
97
97
|
CreateSandboxFromImageParams,
|
|
98
98
|
)
|
|
99
99
|
|
|
@@ -17,7 +17,8 @@ from exxec.pty_manager import BasePtyManager, PtyInfo, PtySize
|
|
|
17
17
|
if TYPE_CHECKING:
|
|
18
18
|
from collections.abc import AsyncIterator
|
|
19
19
|
|
|
20
|
-
from daytona._async.sandbox import AsyncSandbox
|
|
20
|
+
from daytona._async.sandbox import AsyncSandbox
|
|
21
|
+
from daytona.handle.async_pty_handle import AsyncPtyHandle
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
@dataclass
|
|
@@ -25,11 +26,10 @@ class DaytonaPtySession:
|
|
|
25
26
|
"""Tracks a Daytona PTY session."""
|
|
26
27
|
|
|
27
28
|
info: PtyInfo
|
|
28
|
-
handle:
|
|
29
|
+
handle: AsyncPtyHandle
|
|
29
30
|
sandbox: AsyncSandbox
|
|
30
31
|
_output_buffer: list[bytes] = field(default_factory=list)
|
|
31
32
|
_output_event: asyncio.Event = field(default_factory=asyncio.Event)
|
|
32
|
-
_reader_task: asyncio.Task[None] | None = None
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
class DaytonaPtyManager(BasePtyManager):
|
|
@@ -38,13 +38,8 @@ class DaytonaPtyManager(BasePtyManager):
|
|
|
38
38
|
Uses Daytona's process.create_pty_session API for interactive
|
|
39
39
|
terminal sessions with full resize support.
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- handle.send_input(data)
|
|
44
|
-
- handle.resize(PtySize)
|
|
45
|
-
- handle.kill()
|
|
46
|
-
- handle.wait()
|
|
47
|
-
- Iteration over handle for output streaming
|
|
41
|
+
The on_data callback is used for streaming output, eliminating
|
|
42
|
+
the need for background reader tasks.
|
|
48
43
|
"""
|
|
49
44
|
|
|
50
45
|
def __init__(self, sandbox: AsyncSandbox) -> None:
|
|
@@ -69,16 +64,15 @@ class DaytonaPtyManager(BasePtyManager):
|
|
|
69
64
|
|
|
70
65
|
Args:
|
|
71
66
|
size: Initial terminal size (defaults to 24x80)
|
|
72
|
-
command:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
env: Not directly supported - set via export commands
|
|
67
|
+
command: Command to run after shell starts (sent via stdin)
|
|
68
|
+
args: Arguments for the command
|
|
69
|
+
cwd: Working directory for the PTY session
|
|
70
|
+
env: Environment variables for the PTY session
|
|
77
71
|
|
|
78
72
|
Returns:
|
|
79
73
|
PtyInfo with session details
|
|
80
74
|
"""
|
|
81
|
-
from daytona.common.pty import PtySize as DaytonaPtySize
|
|
75
|
+
from daytona.common.pty import PtySize as DaytonaPtySize
|
|
82
76
|
|
|
83
77
|
size = size or PtySize()
|
|
84
78
|
command = command or "/bin/bash"
|
|
@@ -90,12 +84,6 @@ class DaytonaPtyManager(BasePtyManager):
|
|
|
90
84
|
# Create Daytona PtySize object
|
|
91
85
|
daytona_size = DaytonaPtySize(cols=size.cols, rows=size.rows)
|
|
92
86
|
|
|
93
|
-
# Create PTY session using Daytona API
|
|
94
|
-
handle = await self._sandbox.process.create_pty_session( # pyright: ignore[reportAttributeAccessIssue]
|
|
95
|
-
id=pty_id,
|
|
96
|
-
pty_size=daytona_size,
|
|
97
|
-
)
|
|
98
|
-
|
|
99
87
|
# Daytona doesn't expose PID directly
|
|
100
88
|
info = PtyInfo(
|
|
101
89
|
id=pty_id,
|
|
@@ -110,6 +98,20 @@ class DaytonaPtyManager(BasePtyManager):
|
|
|
110
98
|
output_buffer: list[bytes] = []
|
|
111
99
|
output_event = asyncio.Event()
|
|
112
100
|
|
|
101
|
+
# Callback to handle PTY output - called by Daytona when data arrives
|
|
102
|
+
def on_data(data: bytes) -> None:
|
|
103
|
+
output_buffer.append(data)
|
|
104
|
+
output_event.set()
|
|
105
|
+
|
|
106
|
+
# Create PTY session using Daytona API with callback
|
|
107
|
+
handle = await self._sandbox.process.create_pty_session(
|
|
108
|
+
id=pty_id,
|
|
109
|
+
on_data=on_data,
|
|
110
|
+
cwd=cwd,
|
|
111
|
+
envs=env,
|
|
112
|
+
pty_size=daytona_size,
|
|
113
|
+
)
|
|
114
|
+
|
|
113
115
|
session = DaytonaPtySession(
|
|
114
116
|
info=info,
|
|
115
117
|
handle=handle,
|
|
@@ -120,13 +122,6 @@ class DaytonaPtyManager(BasePtyManager):
|
|
|
120
122
|
self._sessions[pty_id] = info
|
|
121
123
|
self._daytona_sessions[pty_id] = session
|
|
122
124
|
|
|
123
|
-
# Start background reader task
|
|
124
|
-
session._reader_task = asyncio.create_task(self._read_output(session))
|
|
125
|
-
|
|
126
|
-
# If cwd specified, send cd command
|
|
127
|
-
if cwd:
|
|
128
|
-
await self.write(pty_id, f"cd {cwd}\n".encode())
|
|
129
|
-
|
|
130
125
|
# If command specified (not default shell), send it
|
|
131
126
|
if command and command != "/bin/bash":
|
|
132
127
|
full_cmd = f"{command} {' '.join(args)}\n" if args else f"{command}\n"
|
|
@@ -134,42 +129,6 @@ class DaytonaPtyManager(BasePtyManager):
|
|
|
134
129
|
|
|
135
130
|
return info
|
|
136
131
|
|
|
137
|
-
async def _read_output(self, session: DaytonaPtySession) -> None:
|
|
138
|
-
"""Background task to read from Daytona PTY handle."""
|
|
139
|
-
loop = asyncio.get_event_loop()
|
|
140
|
-
|
|
141
|
-
try:
|
|
142
|
-
# Daytona handle supports iteration for output
|
|
143
|
-
# Run in executor since it may block
|
|
144
|
-
def read_sync() -> bytes | None:
|
|
145
|
-
try:
|
|
146
|
-
for data in session.handle: # type: ignore[attr-defined]
|
|
147
|
-
return data # type: ignore[no-any-return]
|
|
148
|
-
except StopIteration:
|
|
149
|
-
return None
|
|
150
|
-
except Exception: # noqa: BLE001
|
|
151
|
-
return None
|
|
152
|
-
return None
|
|
153
|
-
|
|
154
|
-
while session.info.status == "running":
|
|
155
|
-
data = await loop.run_in_executor(None, read_sync)
|
|
156
|
-
if data:
|
|
157
|
-
session._output_buffer.append(data)
|
|
158
|
-
session._output_event.set()
|
|
159
|
-
else:
|
|
160
|
-
# End of stream
|
|
161
|
-
break
|
|
162
|
-
except Exception: # noqa: BLE001
|
|
163
|
-
pass
|
|
164
|
-
finally:
|
|
165
|
-
session.info.status = "exited"
|
|
166
|
-
# Try to get exit code
|
|
167
|
-
try:
|
|
168
|
-
result = await loop.run_in_executor(None, session.handle.wait) # type: ignore[attr-defined]
|
|
169
|
-
session.info.exit_code = result.exit_code
|
|
170
|
-
except Exception: # noqa: BLE001
|
|
171
|
-
pass
|
|
172
|
-
|
|
173
132
|
async def resize(self, pty_id: str, size: PtySize) -> None:
|
|
174
133
|
"""Resize a PTY session.
|
|
175
134
|
|
|
@@ -187,10 +146,8 @@ class DaytonaPtyManager(BasePtyManager):
|
|
|
187
146
|
msg = f"PTY session {pty_id} not found"
|
|
188
147
|
raise KeyError(msg)
|
|
189
148
|
|
|
190
|
-
# Resize using Daytona API
|
|
191
|
-
loop = asyncio.get_event_loop()
|
|
192
149
|
daytona_size = DaytonaPtySize(cols=size.cols, rows=size.rows)
|
|
193
|
-
await
|
|
150
|
+
await session.handle.resize(daytona_size)
|
|
194
151
|
session.info.size = size
|
|
195
152
|
|
|
196
153
|
async def write(self, pty_id: str, data: bytes) -> None:
|
|
@@ -210,8 +167,7 @@ class DaytonaPtyManager(BasePtyManager):
|
|
|
210
167
|
|
|
211
168
|
# Daytona send_input expects string
|
|
212
169
|
text = data.decode() if isinstance(data, bytes) else data
|
|
213
|
-
|
|
214
|
-
await loop.run_in_executor(None, session.handle.send_input, text) # type: ignore[attr-defined]
|
|
170
|
+
await session.handle.send_input(text)
|
|
215
171
|
|
|
216
172
|
async def read(self, pty_id: str, size: int = 4096) -> bytes:
|
|
217
173
|
"""Read data from a PTY's output buffer.
|
|
@@ -292,17 +248,13 @@ class DaytonaPtyManager(BasePtyManager):
|
|
|
292
248
|
return False
|
|
293
249
|
|
|
294
250
|
try:
|
|
295
|
-
|
|
296
|
-
if session._reader_task:
|
|
297
|
-
session._reader_task.cancel()
|
|
298
|
-
with contextlib.suppress(asyncio.CancelledError):
|
|
299
|
-
await session._reader_task
|
|
300
|
-
|
|
301
|
-
# Kill using Daytona API
|
|
302
|
-
loop = asyncio.get_event_loop()
|
|
303
|
-
await loop.run_in_executor(None, session.handle.kill) # type: ignore[attr-defined]
|
|
304
|
-
|
|
251
|
+
await session.handle.kill()
|
|
305
252
|
session.info.status = "exited"
|
|
253
|
+
|
|
254
|
+
# Try to get exit code
|
|
255
|
+
with contextlib.suppress(Exception):
|
|
256
|
+
result = await session.handle.wait()
|
|
257
|
+
session.info.exit_code = result.exit_code
|
|
306
258
|
except Exception: # noqa: BLE001
|
|
307
259
|
pass
|
|
308
260
|
|
|
@@ -126,7 +126,7 @@ class DockerExecutionEnvironment(ExecutionEnvironment):
|
|
|
126
126
|
def get_fs(self) -> DirFileSystem:
|
|
127
127
|
"""Return a DirFileSystem instance for the shared host directory."""
|
|
128
128
|
from fsspec.implementations.dirfs import DirFileSystem
|
|
129
|
-
from
|
|
129
|
+
from upathtools.filesystems import AsyncLocalFileSystem
|
|
130
130
|
|
|
131
131
|
if not self.host_workdir:
|
|
132
132
|
msg = "Docker environment not started"
|
|
@@ -127,7 +127,7 @@ class LocalExecutionEnvironment(ExecutionEnvironment):
|
|
|
127
127
|
def get_fs(self) -> AsyncFileSystem:
|
|
128
128
|
"""Return an AsyncLocalFileSystem for the current working directory."""
|
|
129
129
|
from fsspec.implementations.dirfs import DirFileSystem # type: ignore[import-untyped]
|
|
130
|
-
from
|
|
130
|
+
from upathtools.filesystems import AsyncLocalFileSystem
|
|
131
131
|
|
|
132
132
|
fs = AsyncLocalFileSystem()
|
|
133
133
|
if self.root_path:
|
|
@@ -129,13 +129,13 @@ class VercelTerminalManager(ProcessManagerProtocol):
|
|
|
129
129
|
# Check if command has finished by trying to get it again
|
|
130
130
|
assert terminal.command_id
|
|
131
131
|
updated_command = await self.sandbox.get_command(terminal.command_id)
|
|
132
|
-
if updated_command.cmd.
|
|
132
|
+
if updated_command.cmd.exit_code is not None:
|
|
133
133
|
# Command finished, collect final output
|
|
134
134
|
if await updated_command.stdout():
|
|
135
135
|
terminal.add_output(await updated_command.stdout())
|
|
136
136
|
if await updated_command.stderr():
|
|
137
137
|
terminal.add_output(f"STDERR: {await updated_command.stderr()}")
|
|
138
|
-
terminal.set_exit_code(updated_command.cmd.
|
|
138
|
+
terminal.set_exit_code(updated_command.cmd.exit_code)
|
|
139
139
|
except Exception: # noqa: BLE001
|
|
140
140
|
pass # Best effort
|
|
141
141
|
|
|
@@ -159,8 +159,8 @@ class VercelTerminalManager(ProcessManagerProtocol):
|
|
|
159
159
|
if terminal.command_id:
|
|
160
160
|
try:
|
|
161
161
|
updated_command = await self.sandbox.get_command(terminal.command_id)
|
|
162
|
-
if updated_command.cmd.
|
|
163
|
-
terminal.set_exit_code(updated_command.cmd.
|
|
162
|
+
if updated_command.cmd.exit_code is not None:
|
|
163
|
+
terminal.set_exit_code(updated_command.cmd.exit_code)
|
|
164
164
|
break
|
|
165
165
|
except Exception: # noqa: BLE001
|
|
166
166
|
continue
|
|
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
|
|
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
|
|
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
|