Skip to main content

Crate byob_exec

Crate byob_exec 

Source
Expand description

Tools that run code: RunCommand (run_command, a shell command), RunPython (run_python, Python code or a script) and InstallPythonPackages (install_python_packages, into byob’s managed venv with uv).

Everything runs through byob_sandbox: read the system, read+write the workspace and a private temp folder, no network unless the call asks (and the user approves), a minimal environment without inherited secrets, wall-clock timeout, bounded output, and the whole process tree is killed on timeout or Stop. Where the OS can’t sandbox (no Landlock), commands still run, with a warning in the log and in the tool output; BYOB_SANDBOX=off turns the sandbox off explicitly (Mode::Unsandboxed).

Re-exports§

pub use python::Python;

Modules§

python
Which Python runs model code, and the managed environment for data-analysis packages.

Structs§

Exec
Shared by the tools.
InstallPythonPackages
install_python_packages: add packages to byob’s managed venv (created on first use) with uv. Wheels only (--only-binary :all:), so installing never runs package code.
RunCommand
run_command: a shell command in the workspace.
RunPython
run_python: Python code (or a workspace script) in the workspace.

Enums§

Mode
How commands run.

Constants§

DEFAULT_TIMEOUT_S
MAX_OUTPUT
Bytes kept per stream (head and tail halves) for the model.
MAX_TIMEOUT_S

Functions§

install
Create the managed venv if needed and install packages into it. Usable by the app directly (e.g. a “set up Python for data analysis” button). Runs in the sandbox with network on, writing only under <data>/python.
register
Register run_command, run_python, and — when uv is installed and there’s a data folder — install_python_packages.