exxec 0.3.1__tar.gz → 0.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 (64) hide show
  1. {exxec-0.3.1 → exxec-0.3.3}/PKG-INFO +1 -1
  2. {exxec-0.3.1 → exxec-0.3.3}/pyproject.toml +1 -1
  3. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/__init__.py +2 -13
  4. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/acp_provider/provider.py +8 -2
  5. {exxec-0.3.1 → exxec-0.3.3}/src/exxec_config/__init__.py +2 -0
  6. {exxec-0.3.1 → exxec-0.3.3}/src/exxec_config/configs.py +92 -14
  7. {exxec-0.3.1 → exxec-0.3.3}/LICENSE +0 -0
  8. {exxec-0.3.1 → exxec-0.3.3}/README.md +0 -0
  9. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/acp_provider/__init__.py +0 -0
  10. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/acp_provider/process_manager.py +0 -0
  11. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/base.py +0 -0
  12. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/beam_provider/__init__.py +0 -0
  13. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/beam_provider/helpers.py +0 -0
  14. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/beam_provider/process_manager.py +0 -0
  15. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/beam_provider/provider.py +0 -0
  16. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/daytona_provider/__init__.py +0 -0
  17. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/daytona_provider/helpers.py +0 -0
  18. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/daytona_provider/process_manager.py +0 -0
  19. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/daytona_provider/provider.py +0 -0
  20. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/daytona_provider/pty_manager.py +0 -0
  21. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/docker_provider/__init__.py +0 -0
  22. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/docker_provider/provider.py +0 -0
  23. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/docker_provider/pty_manager.py +0 -0
  24. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/e2b_provider/__init__.py +0 -0
  25. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/e2b_provider/process_manager.py +0 -0
  26. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/e2b_provider/provider.py +0 -0
  27. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/e2b_provider/pty_manager.py +0 -0
  28. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/events.py +0 -0
  29. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/local_provider/__init__.py +0 -0
  30. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/local_provider/provider.py +0 -0
  31. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/local_provider/pty_manager.py +0 -0
  32. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/local_provider/utils.py +0 -0
  33. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/log.py +0 -0
  34. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/microsandbox_provider/__init__.py +0 -0
  35. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/microsandbox_provider/provider.py +0 -0
  36. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/mock_provider/__init__.py +0 -0
  37. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/mock_provider/process_manager.py +0 -0
  38. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/mock_provider/provider.py +0 -0
  39. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/mock_provider/pty_manager.py +0 -0
  40. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/modal_provider/__init__.py +0 -0
  41. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/modal_provider/provider.py +0 -0
  42. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/modal_provider/pty_manager.py +0 -0
  43. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/models.py +0 -0
  44. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/parse_output.py +0 -0
  45. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/pep723.py +0 -0
  46. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/process_manager.py +0 -0
  47. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/pty_manager.py +0 -0
  48. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/py.typed +0 -0
  49. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/pyodide_provider/__init__.py +0 -0
  50. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/pyodide_provider/filesystem.py +0 -0
  51. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/pyodide_provider/provider.py +0 -0
  52. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/pyodide_provider/pyodide_server.ts +0 -0
  53. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/remote_callable.py +0 -0
  54. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/srt_provider/__init__.py +0 -0
  55. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/srt_provider/config.py +0 -0
  56. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/srt_provider/provider.py +0 -0
  57. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/ssh_provider/__init__.py +0 -0
  58. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/ssh_provider/provider.py +0 -0
  59. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/ssh_provider/pty_manager.py +0 -0
  60. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/vercel_provider/__init__.py +0 -0
  61. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/vercel_provider/process_manager.py +0 -0
  62. {exxec-0.3.1 → exxec-0.3.3}/src/exxec/vercel_provider/provider.py +0 -0
  63. {exxec-0.3.1 → exxec-0.3.3}/src/exxec_config/py.typed +0 -0
  64. {exxec-0.3.1 → exxec-0.3.3}/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.1
3
+ Version: 0.3.3
4
4
  Summary: Execution environments
5
5
  Keywords:
6
6
  Author: Philipp Temminghoff
@@ -2,7 +2,7 @@
2
2
 
3
3
  [project]
4
4
  name = "exxec"
5
- version = "0.3.1"
5
+ version = "0.3.3"
6
6
  description = "Execution environments"
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.13"
@@ -36,24 +36,13 @@ from exxec.ssh_provider import SshExecutionEnvironment, SshPtyManager
36
36
  from exxec.pty_manager import BasePtyManager, PtyInfo, PtyManagerProtocol, PtySize
37
37
 
38
38
  if TYPE_CHECKING:
39
+ from exxec_config import ExecutionEnvironmentStr
39
40
  from contextlib import AbstractAsyncContextManager
40
41
 
41
42
  from exxec.models import Language
42
43
 
43
44
 
44
- ExecutionEnvironmentStr = Literal[
45
- "local",
46
- "docker",
47
- "ssh",
48
- "daytona",
49
- "e2b",
50
- "beam",
51
- "vercel",
52
- "microsandbox",
53
- "modal",
54
- "srt",
55
- "pyodide",
56
- ]
45
+ # ExecutionEnvironmentStr is now imported from exxec_config
57
46
 
58
47
 
59
48
  @overload
@@ -211,7 +211,10 @@ class ACPExecutionEnvironment(ExecutionEnvironment):
211
211
  effective_timeout = timeout if timeout is not None else self.default_command_timeout
212
212
  # Wrap command with shell timeout if specified
213
213
  if effective_timeout is not None:
214
- command = f"timeout {effective_timeout} {command}"
214
+ # Use sh -c to ensure the entire command runs in a shell
215
+ # (timeout expects an executable, not shell builtins like cd)
216
+ quoted = shlex.quote(command)
217
+ command = f"timeout {effective_timeout} sh -c {quoted}"
215
218
  start_time = time.perf_counter()
216
219
  try:
217
220
  # Pass command directly without splitting - ACP clients run it through
@@ -266,7 +269,10 @@ class ACPExecutionEnvironment(ExecutionEnvironment):
266
269
  effective_timeout = timeout if timeout is not None else self.default_command_timeout
267
270
  # Wrap command with shell timeout if specified
268
271
  if effective_timeout is not None:
269
- command = f"timeout {effective_timeout} {command}"
272
+ # Use sh -c to ensure the entire command runs in a shell
273
+ # (timeout expects an executable, not shell builtins like cd)
274
+ quoted = shlex.quote(command)
275
+ command = f"timeout {effective_timeout} sh -c {quoted}"
270
276
  start_time = time.perf_counter()
271
277
  terminal_id: str | None = None
272
278
  try:
@@ -13,6 +13,7 @@ from exxec_config.configs import (
13
13
  DockerExecutionEnvironmentConfig,
14
14
  E2bExecutionEnvironmentConfig,
15
15
  ExecutionEnvironmentConfig,
16
+ ExecutionEnvironmentStr,
16
17
  LocalExecutionEnvironmentConfig,
17
18
  MicrosandboxExecutionEnvironmentConfig,
18
19
  MockExecutionEnvironmentConfig,
@@ -32,6 +33,7 @@ __all__ = [
32
33
  "DockerExecutionEnvironmentConfig",
33
34
  "E2bExecutionEnvironmentConfig",
34
35
  "ExecutionEnvironmentConfig",
36
+ "ExecutionEnvironmentStr",
35
37
  "LocalExecutionEnvironmentConfig",
36
38
  "MicrosandboxExecutionEnvironmentConfig",
37
39
  "MockExecutionEnvironmentConfig",
@@ -10,6 +10,21 @@ from schemez import Schema
10
10
  from exxec_config.srt_sandbox_config import SandboxConfig
11
11
 
12
12
 
13
+ ExecutionEnvironmentStr = Literal[
14
+ "local",
15
+ "docker",
16
+ "ssh",
17
+ "daytona",
18
+ "e2b",
19
+ "beam",
20
+ "vercel",
21
+ "microsandbox",
22
+ "modal",
23
+ "srt",
24
+ "pyodide",
25
+ ]
26
+
27
+
13
28
  if TYPE_CHECKING:
14
29
  from contextlib import AbstractAsyncContextManager
15
30
 
@@ -48,13 +63,13 @@ class BaseExecutionEnvironmentConfig(Schema):
48
63
  )
49
64
  """List of packages to install (pip for Python, npm for JS/TS)."""
50
65
 
51
- timeout: float = Field(
52
- default=60.0,
66
+ default_command_timeout: float | None = Field(
67
+ default=None,
53
68
  gt=0.0,
54
- title="Execution Timeout",
55
- examples=[120.0, 300.0],
69
+ title="Default Command Timeout",
70
+ examples=[30.0, 60.0, 120.0],
56
71
  )
57
- """Execution timeout in seconds."""
72
+ """Default timeout for individual command execution in seconds. None means no timeout."""
58
73
 
59
74
  cwd: str | None = Field(
60
75
  default=None,
@@ -120,7 +135,7 @@ class LocalExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
120
135
  return LocalExecutionEnvironment(
121
136
  lifespan_handler=lifespan_handler,
122
137
  dependencies=self.dependencies,
123
- default_command_timeout=self.timeout,
138
+ default_command_timeout=self.default_command_timeout,
124
139
  isolated=self.isolated,
125
140
  executable=self.executable,
126
141
  language=self.language,
@@ -165,7 +180,7 @@ class DockerExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
165
180
  lifespan_handler=lifespan_handler,
166
181
  dependencies=self.dependencies,
167
182
  image=self.image,
168
- default_command_timeout=self.timeout,
183
+ default_command_timeout=self.default_command_timeout,
169
184
  language=self.language,
170
185
  cwd=self.cwd,
171
186
  env_vars=self.env_vars,
@@ -188,6 +203,14 @@ class E2bExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
188
203
  )
189
204
  """E2B template to use."""
190
205
 
206
+ sandbox_timeout: float = Field(
207
+ default=300.0,
208
+ gt=0.0,
209
+ title="Sandbox Lifetime",
210
+ examples=[300.0, 600.0, 3600.0],
211
+ )
212
+ """How long the sandbox stays alive in seconds."""
213
+
191
214
  keep_alive: bool = Field(default=False, title="Keep Alive")
192
215
  """Keep sandbox running after execution."""
193
216
 
@@ -208,7 +231,8 @@ class E2bExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
208
231
  lifespan_handler=lifespan_handler,
209
232
  dependencies=self.dependencies,
210
233
  template=self.template,
211
- timeout=self.timeout,
234
+ timeout=self.sandbox_timeout,
235
+ default_command_timeout=self.default_command_timeout,
212
236
  keep_alive=self.keep_alive,
213
237
  language=self.language,
214
238
  cwd=self.cwd,
@@ -242,6 +266,14 @@ class BeamExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
242
266
  keep_warm_seconds: int = Field(default=600, title="Keep Warm Duration", examples=[300, 600, -1])
243
267
  """Seconds to keep sandbox alive, -1 for no timeout."""
244
268
 
269
+ sandbox_timeout: float = Field(
270
+ default=300.0,
271
+ gt=0.0,
272
+ title="Sandbox Lifetime",
273
+ examples=[300.0, 600.0, 3600.0],
274
+ )
275
+ """How long the sandbox stays alive in seconds."""
276
+
245
277
  language: Language = Field(
246
278
  default="python",
247
279
  title="Programming Language",
@@ -261,7 +293,8 @@ class BeamExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
261
293
  cpu=self.cpu,
262
294
  memory=self.memory,
263
295
  keep_warm_seconds=self.keep_warm_seconds,
264
- timeout=self.timeout,
296
+ timeout=self.sandbox_timeout,
297
+ default_command_timeout=self.default_command_timeout,
265
298
  language=self.language,
266
299
  cwd=self.cwd,
267
300
  env_vars=self.env_vars,
@@ -304,6 +337,14 @@ class DaytonaExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
304
337
  keep_alive: bool = Field(default=False, title="Keep Alive")
305
338
  """Keep sandbox running after execution."""
306
339
 
340
+ sandbox_timeout: float = Field(
341
+ default=300.0,
342
+ gt=0.0,
343
+ title="Sandbox Lifetime",
344
+ examples=[300.0, 600.0, 3600.0],
345
+ )
346
+ """How long the sandbox stays alive in seconds."""
347
+
307
348
  def get_provider(
308
349
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
309
350
  ) -> DaytonaExecutionEnvironment:
@@ -318,7 +359,8 @@ class DaytonaExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
318
359
  api_key=api_key_str,
319
360
  target=self.target,
320
361
  image=self.image,
321
- timeout=self.timeout,
362
+ timeout=self.sandbox_timeout,
363
+ default_command_timeout=self.default_command_timeout,
322
364
  keep_alive=self.keep_alive,
323
365
  cwd=self.cwd,
324
366
  env_vars=self.env_vars,
@@ -354,6 +396,14 @@ class SRTExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
354
396
  sandbox: SandboxConfig = Field(default_factory=SandboxConfig)
355
397
  """Sandbox restrictions configuration."""
356
398
 
399
+ sandbox_timeout: float = Field(
400
+ default=300.0,
401
+ gt=0.0,
402
+ title="Sandbox Lifetime",
403
+ examples=[300.0, 600.0, 3600.0],
404
+ )
405
+ """How long the sandbox stays alive in seconds."""
406
+
357
407
  def get_provider(
358
408
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
359
409
  ) -> SRTExecutionEnvironment:
@@ -364,7 +414,8 @@ class SRTExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
364
414
  sandbox_config=self.sandbox,
365
415
  lifespan_handler=lifespan_handler,
366
416
  dependencies=self.dependencies,
367
- timeout=self.timeout,
417
+ timeout=self.sandbox_timeout,
418
+ default_command_timeout=self.default_command_timeout,
368
419
  executable=self.executable,
369
420
  language=self.language,
370
421
  cwd=self.cwd,
@@ -418,6 +469,14 @@ class MicrosandboxExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
418
469
  )
419
470
  """Custom Docker image (uses default for language if None)."""
420
471
 
472
+ sandbox_timeout: float = Field(
473
+ default=300.0,
474
+ gt=0.0,
475
+ title="Sandbox Lifetime",
476
+ examples=[300.0, 600.0, 3600.0],
477
+ )
478
+ """How long the sandbox stays alive in seconds."""
479
+
421
480
  def get_provider(
422
481
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
423
482
  ) -> MicrosandboxExecutionEnvironment:
@@ -433,7 +492,8 @@ class MicrosandboxExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
433
492
  api_key=api_key_str,
434
493
  memory=self.memory,
435
494
  cpus=self.cpus,
436
- timeout=self.timeout,
495
+ timeout=self.sandbox_timeout,
496
+ default_command_timeout=self.default_command_timeout,
437
497
  language=self.language,
438
498
  image=self.image,
439
499
  cwd=self.cwd,
@@ -540,6 +600,14 @@ class SshExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
540
600
  )
541
601
  """Programming language to use."""
542
602
 
603
+ sandbox_timeout: float = Field(
604
+ default=300.0,
605
+ gt=0.0,
606
+ title="Connection Timeout",
607
+ examples=[300.0, 600.0, 3600.0],
608
+ )
609
+ """SSH connection timeout in seconds."""
610
+
543
611
  def get_provider(
544
612
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
545
613
  ) -> SshExecutionEnvironment:
@@ -555,7 +623,8 @@ class SshExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
555
623
  password=password_str,
556
624
  private_key_path=self.private_key_path,
557
625
  port=self.port,
558
- timeout=self.timeout,
626
+ timeout=self.sandbox_timeout,
627
+ default_command_timeout=self.default_command_timeout,
559
628
  language=self.language,
560
629
  cwd=self.cwd,
561
630
  env_vars=self.env_vars,
@@ -744,6 +813,14 @@ class PyodideExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
744
813
  )
745
814
  """Path to deno executable (auto-detected if None)."""
746
815
 
816
+ sandbox_timeout: float = Field(
817
+ default=300.0,
818
+ gt=0.0,
819
+ title="Sandbox Lifetime",
820
+ examples=[300.0, 600.0, 3600.0],
821
+ )
822
+ """How long the sandbox stays alive in seconds."""
823
+
747
824
  def get_provider(
748
825
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
749
826
  ) -> PyodideExecutionEnvironment:
@@ -753,7 +830,8 @@ class PyodideExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
753
830
  return PyodideExecutionEnvironment(
754
831
  lifespan_handler=lifespan_handler,
755
832
  dependencies=self.dependencies,
756
- timeout=self.timeout,
833
+ timeout=self.sandbox_timeout,
834
+ default_command_timeout=self.default_command_timeout,
757
835
  startup_timeout=self.startup_timeout,
758
836
  allow_net=self.allow_net,
759
837
  allow_read=self.allow_read,
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