rlpsdk
v0.3.2
Published
Native rl-platform SDK (Daytona-compatible interface).
Maintainers
Readme
rlpsdk (TypeScript)
Native rl-platform SDK with a Daytona-compatible interface (v0.190.x-shaped)
so existing Daytona code is near drop-in. Drives rl-platform's native API
(/vms, /daytona/snapshots) and the toolbox proxy directly.
- npm package:
rlpsdk - Ships: ESM + CJS builds with TypeScript declarations
- Requires: Node >= 18
Install
npm install rlpsdk # or: pnpm add rlpsdk / yarn add rlpsdkQuickstart
import { Daytona } from 'rlpsdk'
const daytona = new Daytona({
apiUrl: 'http://<api-host>:8088', // native API root
apiKey: 'rlp_...', // rlp-api mint-key <name>
toolboxUrl: 'http://<proxy-host>:9000/toolbox',
})
// Cache a registry image as a snapshot (image alias).
const snap = await daytona.snapshot.create(
{ name: 'py312', image: 'python:3.12-slim', resources: { cpu: 1, memory: 1, disk: 1 } },
{ onLogs: console.log },
)
// Create a sandbox from it and run a command.
const sandbox = await daytona.create({ snapshot: 'py312' })
const r = await sandbox.process.executeCommand('echo hello')
console.log(r.exitCode, r.result)
await daytona.delete(sandbox)Configuration
| Field / env | Purpose |
|-------------|---------|
| apiUrl / RLP_API_URL / DAYTONA_API_URL | Native control-plane API root |
| apiKey / RLP_API_KEY / DAYTONA_API_KEY | Bearer API key (rlp_...) |
| toolboxUrl / 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.
daytona.stop()/sandbox.stop()/sandbox.archive()throwDaytonaNotSupportedError(HTTP 501 semantics).start()tolerates an already-running sandbox but cannot revive a stopped/failed one — recreate. - Create is async.
create()pollsGET /vms/:iduntilstarted. - Extras on create:
mode(burstable|dedicated), fractionalcpu,ports,dockerDataMib. sandbox.createSnapshot(name, kind)— native VM-state capture (disk/full), distinct from Daytona image-alias snapshots.sandbox.accessToken— per-VM toolbox credential returned once on create.
Build
npm run build # ESM + CJS to dist/
npm run typecheck
npm testSurface (v1)
Daytona (create/get/list/start/delete + snapshot), Sandbox
(fs/git/process, createSnapshot, lifecycle), SnapshotService
(create/get/list/delete/activate), toolbox Process/FileSystem/Git, and the
full Daytona error hierarchy. PTY/LSP/ComputerUse/Volumes are deferred.
