Metadata-Version: 2.4
Name: rlp-sdk
Version: 0.1.0
Summary: Native rl-platform SDK (Daytona-compatible interface).
Project-URL: Homepage, https://github.com/vedranjukic/rl-platform
Project-URL: Repository, https://github.com/vedranjukic/rl-platform
Project-URL: Issues, https://github.com/vedranjukic/rl-platform/issues
Author-email: Vedran Jukic <vedran.jukic@gmail.com>
License: Apache-2.0
Keywords: agents,daytona,rl-platform,sandbox,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx>=0.24
Provides-Extra: dev
Requires-Dist: mypy>=1.8; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: respx>=0.20; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# rlp-sdk (Python)

Native rl-platform SDK with a **Daytona-compatible interface** (v0.190.x-shaped)
so existing Daytona code is near drop-in. It drives rl-platform's native API
(`/vms`, `/daytona/snapshots`) and the toolbox proxy directly.

## Install

```bash
pip install rlp-sdk        # or: uv pip install rlp-sdk
```

## Quickstart

```python
from rlp import Daytona, DaytonaConfig, CreateSandboxFromSnapshotParams

daytona = Daytona(DaytonaConfig(
    api_url="http://<api-host>:8088",       # native API root
    api_key="rlp_...",                       # rlp-api mint-key <name>
    toolbox_url="http://<proxy-host>:9000/toolbox",
))

# Cache a registry image as a snapshot (image alias).
from rlp import CreateSnapshotParams, Resources
snap = daytona.snapshot.create(
    CreateSnapshotParams(name="py312", image="python:3.12-slim",
                         resources=Resources(cpu=1, memory=1, disk=1)),
    on_logs=print,
)

# Create a sandbox from it and run a command.
sandbox = daytona.create(CreateSandboxFromSnapshotParams(snapshot="py312"))
r = sandbox.process.exec("echo hello")
print(r.exit_code, r.result)

daytona.delete(sandbox)
```

## Configuration

| Field / env | Purpose |
|-------------|---------|
| `api_url` / `RLP_API_URL` / `DAYTONA_API_URL` | Native control-plane API root |
| `api_key` / `RLP_API_KEY` / `DAYTONA_API_KEY` | Bearer API key (`rlp_...`) |
| `toolbox_url` / `RLP_TOOLBOX_URL` | Toolbox proxy base (`.../toolbox`); required for `fs`/`git`/`process` |
| `target` / `RLP_TARGET` | Optional region/target label |

## rl-platform specifics vs Daytona

- **No warm stop/start.** `stop()`/`archive()` raise `DaytonaNotSupportedError`
  (HTTP 501 semantics). `start()` tolerates an already-running sandbox but
  cannot revive a stopped/failed one — recreate instead.
- **Create is async.** `create()` polls `GET /vms/:id` until `started`.
- **Extras on create:** `mode` (`burstable`|`dedicated`), fractional `cpu`,
  `ports`, `docker_data_mib`.
- **`sandbox.create_snapshot(name, kind)`** — native VM-state capture
  (`disk`/`full`), distinct from Daytona image-alias snapshots.
- **`sandbox.access_token`** — per-VM toolbox credential returned once on create.

## Surface (v1)

`Daytona` (create/get/list/start/delete + `snapshot` service), `Sandbox`
(`fs`/`git`/`process`, `create_snapshot`, lifecycle), `SnapshotService`
(create/get/list/delete/activate), toolbox `Process`/`FileSystem`/`Git`, and the
full Daytona error hierarchy. PTY/LSP/ComputerUse/Volumes and async are deferred.
