> ## Documentation Index
> Fetch the complete documentation index at: https://uom-demo.vercel.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# sandbox_tools

> [<span className="flex items-center gap-1"><Icon icon="external-link"/>View Source</span>](https://github.com/corovcam/Universal-Object-Mapping/tree/main/services/orchestrator/src/react_agent/custom_tools/sandbox_tools.py)

Provides tools for connecting to sandbox Docker containers.

#### react\_agent.custom\_tools.sandbox\_tools.execute\_in\_sandbox

```python theme={null}
@tool
async def execute_in_sandbox(
        sandbox_type: SandboxType, command: str, timeout: int,
        env_vars: dict[str, Any] | None,
        runtime: Annotated[ToolRuntime, InjectedToolArg]) -> tuple[str, int]
```

[<span className="flex items-center gap-1"><Icon icon="external-link" />View Source</span>](https://github.com/corovcam/Universal-Object-Mapping/blob/main/services/orchestrator/src/react_agent/custom_tools/sandbox_tools.py#L25)

Execute a shell command directly inside the target Daytona sandbox container asynchronously.

This tool interfaces with the Daytona process manager to run arbitrary commands (like Maven
or Dotnet CLI) within an isolated workspace. It seamlessly pipes stdout and stderr via
`runtime.stream_writer` back to the LangGraph execution environment so the user can observe
real-time compiler output via `LanggraphCustomEventKeys`.

**Arguments**:

* `sandbox_type` *SandboxType* - The target service architecture enum (e.g., DOTNET\_10\_SANDBOX).
* `command` *str* - The raw shell command or script to run.
* `timeout` *int* - The execution timeout in seconds.
* `env_vars` *dict\[str, Any] | None* - Dictionary of environment variables to inject.
* `runtime` *Annotated\[ToolRuntime, InjectedToolArg]* - Injected tool runtime context.

**Returns**:

tuple\[str, int]: A tuple of the combined output (stdout/stderr) and the exit code.

**Raises**:

* `DaytonaError` - If communicating with the Daytona daemon fails.

#### react\_agent.custom\_tools.sandbox\_tools.download\_file\_from\_sandbox

```python theme={null}
@tool
async def download_file_from_sandbox(
        sandbox_type: SandboxType, remote_path: str,
        runtime: Annotated[ToolRuntime, InjectedToolArg]) -> str
```

[<span className="flex items-center gap-1"><Icon icon="external-link" />View Source</span>](https://github.com/corovcam/Universal-Object-Mapping/blob/main/services/orchestrator/src/react_agent/custom_tools/sandbox_tools.py#L122)

Retrieve the contents of a file from a specified service container using the Daytona FS API.

Used primarily to extract the generated JSON execution results after a query validation
harness finishes running in the sandbox.

**Arguments**:

* `sandbox_type` *SandboxType* - The target service architecture enum.
* `remote_path` *str* - The absolute path to the file on the remote container's filesystem.
* `runtime` *Annotated\[ToolRuntime, InjectedToolArg]* - Injected tool runtime context.

**Returns**:

* `str` - The UTF-8 decoded string content of the requested file.

**Raises**:

* `DaytonaError` - If the file does not exist or Daytona communication fails.
