roborama 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/dist/index.cjs +1375 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +822 -0
- package/dist/index.d.ts +822 -0
- package/dist/index.js +1342 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Roborama
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# roborama
|
|
2
|
+
|
|
3
|
+
Official TypeScript/JavaScript SDK for [Roborama](https://roborama.com) — real robots as an API. Statistically defensible evaluation of robot policies on physical hardware: every result carries `n` and a 95% confidence interval, everything is versioned (robots pin firmware, environments and suites pin revisions), and both meters (robot-hours × environment-hours) are visible in every quote.
|
|
4
|
+
|
|
5
|
+
> **Status.** The API surface is a **stable draft** of [openapi.json](https://roborama.com/openapi.json); hosted execution is in **private preview**. This SDK ships a deterministic **mock mode** so you (and your agents) can integrate today — set `ROBORAMA_MOCK=1` and every call returns fixture-shaped results with honest statistics, no hardware and no API key required.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i roborama
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## First call
|
|
12
|
+
|
|
13
|
+
`new Roborama()` reads `ROBORAMA_API_KEY` (keys carry the `rbr_live_` prefix) from the environment; every method returns a promise; full type definitions ship for every request and result shape.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import Roborama from "roborama"; // reads ROBORAMA_API_KEY
|
|
17
|
+
|
|
18
|
+
const roborama = new Roborama();
|
|
19
|
+
|
|
20
|
+
const run = await roborama.runs.create({
|
|
21
|
+
robot: "g1-edu-pro@fw2.3", // embodiment @ pinned firmware
|
|
22
|
+
environment: "kitchen-std@v1.2", // versioned catalogue scene
|
|
23
|
+
policy: {
|
|
24
|
+
type: "checkpoint", // openpi / lerobot checkpoints,
|
|
25
|
+
hf: "acme/skill-v4", // containers, or hosted endpoints
|
|
26
|
+
runtime: "openpi",
|
|
27
|
+
},
|
|
28
|
+
task: "load_dishwasher@v2",
|
|
29
|
+
episodes: "auto(ci=0.95, moe=0.03)", // size n for ±3% at 95% — or an int
|
|
30
|
+
max_budget_usd: 4000, // hard stop, metered live
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const result = await run.result();
|
|
34
|
+
console.log(result);
|
|
35
|
+
// { n: 612, success_rate: 0.874, ci95: [0.846, 0.898], cost_usd: 3812, ... }
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Mock mode — runnable today
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
ROBORAMA_MOCK=1 node your-script.mjs # or: new Roborama({ mock: true })
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Mock mode is deterministic and fixture-shaped: quote math follows the [public rate card](https://roborama.com/pricing), run results are shaped like the canonical runs, `max_budget_usd` hard stops throw a `RoboramaError` with `code === "budget_exceeded"` and an honest `partial_result`, and Wilson intervals are computed exactly as documented. The same code runs unchanged against the hosted API once you have a key.
|
|
45
|
+
|
|
46
|
+
## The shape of the SDK
|
|
47
|
+
|
|
48
|
+
`roborama.runs.create()` is the workhorse: its `kind` field selects the primitive — `run` (the default), `eval`, `verify`, `matrix`, `threshold`, `compare`, or `transfer` — mirroring `POST /v1/runs` exactly, with the return type narrowed per kind (a `compare` run has `.winner`; a `matrix` run has `.heatmap()`; a `threshold` contract has `.onVerified()`).
|
|
49
|
+
|
|
50
|
+
- **Resources**: `roborama.robots.list()`, `roborama.environments.list({ cls })`, `roborama.suites`, `roborama.tasks` (create → `pilot()` → `amend()` → `freeze()`), `roborama.kits` (register → `shippingLabel()`), `roborama.streams.get(cell)`, `roborama.keys`, `roborama.budgets`, `roborama.data.purge()`, `roborama.calibration.export()`, `roborama.gates.create()`, plus `roborama.quote()` and `roborama.usage()` at the top level.
|
|
51
|
+
- **Policies**: `Roborama.Policy.container({...})`, `.checkpoint({...})`, `.endpoint({...})` — or write the plain object; declared contracts are validated before any motor moves.
|
|
52
|
+
- **Results**: `await run.result()` (n, rate, ci95, clusters, both meters), `await run.episodes()` (video, MCAP, replay spec), `for await (const e of run.watch())` (live SSE), `run.export({ format: "lerobot" })`, `run.report({ format: "pdf" })`.
|
|
53
|
+
- **Errors**: one class, `RoboramaError`, with a `.code` from [the documented fixed set](https://roborama.com/docs/errors/) — switch on the code, not the message. `budget_exceeded` carries `err.partial_result`.
|
|
54
|
+
|
|
55
|
+
Docs: [quickstart](https://roborama.com/docs/quickstart/) · [primitives](https://roborama.com/docs/primitives/run/) · [errors](https://roborama.com/docs/errors/) · [OpenAPI](https://roborama.com/openapi.json)
|
|
56
|
+
|
|
57
|
+
## Requirements
|
|
58
|
+
|
|
59
|
+
Node ≥ 18.17 (or any runtime with `fetch`). Zero runtime dependencies. Dual ESM + CJS build with full `.d.ts` types.
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|