exxec 0.3.2__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.2 → exxec-0.3.3}/PKG-INFO +1 -1
  2. {exxec-0.3.2 → exxec-0.3.3}/pyproject.toml +1 -1
  3. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/__init__.py +2 -1
  4. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/acp_provider/provider.py +8 -2
  5. {exxec-0.3.2 → exxec-0.3.3}/src/exxec_config/configs.py +77 -14
  6. {exxec-0.3.2 → exxec-0.3.3}/LICENSE +0 -0
  7. {exxec-0.3.2 → exxec-0.3.3}/README.md +0 -0
  8. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/acp_provider/__init__.py +0 -0
  9. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/acp_provider/process_manager.py +0 -0
  10. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/base.py +0 -0
  11. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/beam_provider/__init__.py +0 -0
  12. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/beam_provider/helpers.py +0 -0
  13. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/beam_provider/process_manager.py +0 -0
  14. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/beam_provider/provider.py +0 -0
  15. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/daytona_provider/__init__.py +0 -0
  16. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/daytona_provider/helpers.py +0 -0
  17. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/daytona_provider/process_manager.py +0 -0
  18. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/daytona_provider/provider.py +0 -0
  19. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/daytona_provider/pty_manager.py +0 -0
  20. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/docker_provider/__init__.py +0 -0
  21. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/docker_provider/provider.py +0 -0
  22. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/docker_provider/pty_manager.py +0 -0
  23. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/e2b_provider/__init__.py +0 -0
  24. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/e2b_provider/process_manager.py +0 -0
  25. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/e2b_provider/provider.py +0 -0
  26. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/e2b_provider/pty_manager.py +0 -0
  27. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/events.py +0 -0
  28. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/local_provider/__init__.py +0 -0
  29. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/local_provider/provider.py +0 -0
  30. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/local_provider/pty_manager.py +0 -0
  31. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/local_provider/utils.py +0 -0
  32. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/log.py +0 -0
  33. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/microsandbox_provider/__init__.py +0 -0
  34. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/microsandbox_provider/provider.py +0 -0
  35. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/mock_provider/__init__.py +0 -0
  36. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/mock_provider/process_manager.py +0 -0
  37. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/mock_provider/provider.py +0 -0
  38. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/mock_provider/pty_manager.py +0 -0
  39. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/modal_provider/__init__.py +0 -0
  40. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/modal_provider/provider.py +0 -0
  41. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/modal_provider/pty_manager.py +0 -0
  42. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/models.py +0 -0
  43. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/parse_output.py +0 -0
  44. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/pep723.py +0 -0
  45. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/process_manager.py +0 -0
  46. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/pty_manager.py +0 -0
  47. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/py.typed +0 -0
  48. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/pyodide_provider/__init__.py +0 -0
  49. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/pyodide_provider/filesystem.py +0 -0
  50. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/pyodide_provider/provider.py +0 -0
  51. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/pyodide_provider/pyodide_server.ts +0 -0
  52. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/remote_callable.py +0 -0
  53. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/srt_provider/__init__.py +0 -0
  54. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/srt_provider/config.py +0 -0
  55. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/srt_provider/provider.py +0 -0
  56. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/ssh_provider/__init__.py +0 -0
  57. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/ssh_provider/provider.py +0 -0
  58. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/ssh_provider/pty_manager.py +0 -0
  59. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/vercel_provider/__init__.py +0 -0
  60. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/vercel_provider/process_manager.py +0 -0
  61. {exxec-0.3.2 → exxec-0.3.3}/src/exxec/vercel_provider/provider.py +0 -0
  62. {exxec-0.3.2 → exxec-0.3.3}/src/exxec_config/__init__.py +0 -0
  63. {exxec-0.3.2 → exxec-0.3.3}/src/exxec_config/py.typed +0 -0
  64. {exxec-0.3.2 → 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.2
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.2"
5
+ version = "0.3.3"
6
6
  description = "Execution environments"
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.13"
@@ -31,11 +31,12 @@ from exxec.models import ExecutionResult, ServerInfo
31
31
  from exxec.remote_callable import create_remote_callable, infer_package_dependencies
32
32
 
33
33
  # from exxec.server import fastapi_tool_server
34
- from exxec_config import ExecutionEnvironmentConfig, ExecutionEnvironmentStr
34
+ from exxec_config import ExecutionEnvironmentConfig
35
35
  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
@@ -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:
@@ -63,13 +63,13 @@ class BaseExecutionEnvironmentConfig(Schema):
63
63
  )
64
64
  """List of packages to install (pip for Python, npm for JS/TS)."""
65
65
 
66
- timeout: float = Field(
67
- default=60.0,
66
+ default_command_timeout: float | None = Field(
67
+ default=None,
68
68
  gt=0.0,
69
- title="Execution Timeout",
70
- examples=[120.0, 300.0],
69
+ title="Default Command Timeout",
70
+ examples=[30.0, 60.0, 120.0],
71
71
  )
72
- """Execution timeout in seconds."""
72
+ """Default timeout for individual command execution in seconds. None means no timeout."""
73
73
 
74
74
  cwd: str | None = Field(
75
75
  default=None,
@@ -135,7 +135,7 @@ class LocalExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
135
135
  return LocalExecutionEnvironment(
136
136
  lifespan_handler=lifespan_handler,
137
137
  dependencies=self.dependencies,
138
- default_command_timeout=self.timeout,
138
+ default_command_timeout=self.default_command_timeout,
139
139
  isolated=self.isolated,
140
140
  executable=self.executable,
141
141
  language=self.language,
@@ -180,7 +180,7 @@ class DockerExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
180
180
  lifespan_handler=lifespan_handler,
181
181
  dependencies=self.dependencies,
182
182
  image=self.image,
183
- default_command_timeout=self.timeout,
183
+ default_command_timeout=self.default_command_timeout,
184
184
  language=self.language,
185
185
  cwd=self.cwd,
186
186
  env_vars=self.env_vars,
@@ -203,6 +203,14 @@ class E2bExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
203
203
  )
204
204
  """E2B template to use."""
205
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
+
206
214
  keep_alive: bool = Field(default=False, title="Keep Alive")
207
215
  """Keep sandbox running after execution."""
208
216
 
@@ -223,7 +231,8 @@ class E2bExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
223
231
  lifespan_handler=lifespan_handler,
224
232
  dependencies=self.dependencies,
225
233
  template=self.template,
226
- timeout=self.timeout,
234
+ timeout=self.sandbox_timeout,
235
+ default_command_timeout=self.default_command_timeout,
227
236
  keep_alive=self.keep_alive,
228
237
  language=self.language,
229
238
  cwd=self.cwd,
@@ -257,6 +266,14 @@ class BeamExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
257
266
  keep_warm_seconds: int = Field(default=600, title="Keep Warm Duration", examples=[300, 600, -1])
258
267
  """Seconds to keep sandbox alive, -1 for no timeout."""
259
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
+
260
277
  language: Language = Field(
261
278
  default="python",
262
279
  title="Programming Language",
@@ -276,7 +293,8 @@ class BeamExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
276
293
  cpu=self.cpu,
277
294
  memory=self.memory,
278
295
  keep_warm_seconds=self.keep_warm_seconds,
279
- timeout=self.timeout,
296
+ timeout=self.sandbox_timeout,
297
+ default_command_timeout=self.default_command_timeout,
280
298
  language=self.language,
281
299
  cwd=self.cwd,
282
300
  env_vars=self.env_vars,
@@ -319,6 +337,14 @@ class DaytonaExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
319
337
  keep_alive: bool = Field(default=False, title="Keep Alive")
320
338
  """Keep sandbox running after execution."""
321
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
+
322
348
  def get_provider(
323
349
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
324
350
  ) -> DaytonaExecutionEnvironment:
@@ -333,7 +359,8 @@ class DaytonaExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
333
359
  api_key=api_key_str,
334
360
  target=self.target,
335
361
  image=self.image,
336
- timeout=self.timeout,
362
+ timeout=self.sandbox_timeout,
363
+ default_command_timeout=self.default_command_timeout,
337
364
  keep_alive=self.keep_alive,
338
365
  cwd=self.cwd,
339
366
  env_vars=self.env_vars,
@@ -369,6 +396,14 @@ class SRTExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
369
396
  sandbox: SandboxConfig = Field(default_factory=SandboxConfig)
370
397
  """Sandbox restrictions configuration."""
371
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
+
372
407
  def get_provider(
373
408
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
374
409
  ) -> SRTExecutionEnvironment:
@@ -379,7 +414,8 @@ class SRTExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
379
414
  sandbox_config=self.sandbox,
380
415
  lifespan_handler=lifespan_handler,
381
416
  dependencies=self.dependencies,
382
- timeout=self.timeout,
417
+ timeout=self.sandbox_timeout,
418
+ default_command_timeout=self.default_command_timeout,
383
419
  executable=self.executable,
384
420
  language=self.language,
385
421
  cwd=self.cwd,
@@ -433,6 +469,14 @@ class MicrosandboxExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
433
469
  )
434
470
  """Custom Docker image (uses default for language if None)."""
435
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
+
436
480
  def get_provider(
437
481
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
438
482
  ) -> MicrosandboxExecutionEnvironment:
@@ -448,7 +492,8 @@ class MicrosandboxExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
448
492
  api_key=api_key_str,
449
493
  memory=self.memory,
450
494
  cpus=self.cpus,
451
- timeout=self.timeout,
495
+ timeout=self.sandbox_timeout,
496
+ default_command_timeout=self.default_command_timeout,
452
497
  language=self.language,
453
498
  image=self.image,
454
499
  cwd=self.cwd,
@@ -555,6 +600,14 @@ class SshExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
555
600
  )
556
601
  """Programming language to use."""
557
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
+
558
611
  def get_provider(
559
612
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
560
613
  ) -> SshExecutionEnvironment:
@@ -570,7 +623,8 @@ class SshExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
570
623
  password=password_str,
571
624
  private_key_path=self.private_key_path,
572
625
  port=self.port,
573
- timeout=self.timeout,
626
+ timeout=self.sandbox_timeout,
627
+ default_command_timeout=self.default_command_timeout,
574
628
  language=self.language,
575
629
  cwd=self.cwd,
576
630
  env_vars=self.env_vars,
@@ -759,6 +813,14 @@ class PyodideExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
759
813
  )
760
814
  """Path to deno executable (auto-detected if None)."""
761
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
+
762
824
  def get_provider(
763
825
  self, lifespan_handler: AbstractAsyncContextManager[ServerInfo] | None = None
764
826
  ) -> PyodideExecutionEnvironment:
@@ -768,7 +830,8 @@ class PyodideExecutionEnvironmentConfig(BaseExecutionEnvironmentConfig):
768
830
  return PyodideExecutionEnvironment(
769
831
  lifespan_handler=lifespan_handler,
770
832
  dependencies=self.dependencies,
771
- timeout=self.timeout,
833
+ timeout=self.sandbox_timeout,
834
+ default_command_timeout=self.default_command_timeout,
772
835
  startup_timeout=self.startup_timeout,
773
836
  allow_net=self.allow_net,
774
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