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.
@@ -0,0 +1,822 @@
1
+ /**
2
+ * Types for every documented request/response shape.
3
+ *
4
+ * Field names stay snake_case on both sides of the wire (`max_budget_usd`,
5
+ * `success_rate`, `ci95`), so examples translate between the docs tabs one
6
+ * field at a time.
7
+ */
8
+ /** `auto(ci=0.95, moe=0.03)` sizes n for a target margin of error (Wilson). */
9
+ type AutoEpisodesSpec = `auto(${string})`;
10
+ /** A positive episode count, or an `auto(ci=..., moe=...)` sizing spec. */
11
+ type EpisodesSpec = number | AutoEpisodesSpec;
12
+ type Priority = "burst" | "standard" | "soak";
13
+ type Interventions = "none" | "on_stall" | "scripted";
14
+ type RunKind = "run" | "eval" | "verify" | "matrix" | "threshold" | "compare" | "transfer";
15
+ type RunStatus = "queued" | "scheduling" | "running" | "completed" | "failed" | "stopped";
16
+ type ExportFormat = "lerobot" | "rlds" | "mcap-bundle";
17
+ /** A container image we run in-facility, GPU-adjacent. */
18
+ interface ContainerPolicy {
19
+ type: "container";
20
+ image: string;
21
+ action_space: string;
22
+ observation_contract: string;
23
+ }
24
+ /** A checkpoint on a known runtime (`openpi`, `lerobot`). */
25
+ interface CheckpointPolicy {
26
+ type: "checkpoint";
27
+ hf: string;
28
+ runtime: "openpi" | "lerobot" | (string & {});
29
+ /** Inference/decoding parameters, pinned and recorded. */
30
+ inference?: {
31
+ action_horizon?: number;
32
+ chunk_size?: number;
33
+ temp?: number;
34
+ };
35
+ action_space?: string;
36
+ observation_contract?: string;
37
+ }
38
+ /** Customer-hosted inference; measured RTT is logged per step. */
39
+ interface EndpointPolicy {
40
+ type: "endpoint";
41
+ url: string;
42
+ latency_budget_ms?: number;
43
+ fallback?: "halt" | "teleop";
44
+ }
45
+ type Policy$1 = ContainerPolicy | CheckpointPolicy | EndpointPolicy;
46
+ /** Accepts SDK-built and hand-written (including `as const`) policy objects. */
47
+ type PolicyInput = Policy$1 | (Readonly<ContainerPolicy> & {
48
+ readonly type: "container";
49
+ }) | (Readonly<CheckpointPolicy> & {
50
+ readonly type: "checkpoint";
51
+ }) | (Readonly<EndpointPolicy> & {
52
+ readonly type: "endpoint";
53
+ });
54
+ /** For `threshold`: a webhook that receives checkpoint pushes. */
55
+ interface PolicyStream {
56
+ webhook: string;
57
+ }
58
+ /** Seeded, versioned, replayable perturbation schedule. */
59
+ interface Perturbation {
60
+ layout_jitter_mm?: number;
61
+ lighting?: readonly string[];
62
+ distractors?: string;
63
+ seed?: number;
64
+ }
65
+ /** Customer IP posture, explicit per run. */
66
+ interface DataPosture {
67
+ retention?: string;
68
+ train_on_failures?: boolean;
69
+ }
70
+ interface RunCreateBase {
71
+ priority?: Priority;
72
+ max_budget_usd?: number;
73
+ perturbation?: Perturbation;
74
+ data?: DataPosture;
75
+ interventions?: Interventions;
76
+ /** Test-mode pacing control (e.g. `{ speed: 100 }`); ignored outside sandbox. */
77
+ sandbox?: {
78
+ speed?: number;
79
+ };
80
+ }
81
+ /** `kind: "run"` (the default): one policy, one robot, one task. */
82
+ interface CreateRunParams extends RunCreateBase {
83
+ kind?: "run";
84
+ robot: string;
85
+ environment: string;
86
+ task: string;
87
+ policy?: PolicyInput;
88
+ episodes?: EpisodesSpec;
89
+ }
90
+ /** `kind: "eval"`: a frozen, versioned suite with a citable attestation. */
91
+ interface CreateEvalParams extends RunCreateBase {
92
+ kind: "eval";
93
+ policy: PolicyInput;
94
+ suite: string;
95
+ robots: readonly string[];
96
+ publish?: "private" | "leaderboard";
97
+ }
98
+ /** `kind: "verify"`: physically verify sim-flagged scenarios. */
99
+ interface CreateVerifyParams extends RunCreateBase {
100
+ kind: "verify";
101
+ policy: PolicyInput;
102
+ scenarios: unknown;
103
+ robots: readonly string[];
104
+ task?: string;
105
+ audit_sample?: number;
106
+ return_ground_truth?: boolean;
107
+ }
108
+ /** `kind: "matrix"`: the embodiment × environment sweep. */
109
+ interface CreateMatrixParams extends RunCreateBase {
110
+ kind: "matrix";
111
+ policy: PolicyInput;
112
+ robots: readonly string[];
113
+ environments: readonly string[];
114
+ task: string;
115
+ episodes_per_cell?: EpisodesSpec;
116
+ }
117
+ /** `kind: "threshold"`: an outcome contract — push checkpoints, get verdicts. */
118
+ interface CreateThresholdParams extends RunCreateBase {
119
+ kind: "threshold";
120
+ policy_stream: PolicyStream;
121
+ target: {
122
+ success_rate: number;
123
+ ci: number;
124
+ task: string;
125
+ };
126
+ iterate_on: string;
127
+ escalate_to: string;
128
+ monthly_cap_usd?: number;
129
+ on_verified?: {
130
+ webhook: string;
131
+ };
132
+ }
133
+ /** `kind: "compare"`: paired A/B on the same initial conditions. */
134
+ interface CreateCompareParams extends RunCreateBase {
135
+ kind: "compare";
136
+ policies: Record<string, PolicyInput>;
137
+ paired?: boolean;
138
+ robot: string;
139
+ task: string;
140
+ }
141
+ /** `kind: "transfer"`: quantify the embodiment transfer gap. */
142
+ interface CreateTransferParams extends RunCreateBase {
143
+ kind: "transfer";
144
+ policy: PolicyInput;
145
+ source: string;
146
+ target: string;
147
+ task: string;
148
+ }
149
+ type RunCreateParams = CreateRunParams | CreateEvalParams | CreateVerifyParams | CreateMatrixParams | CreateThresholdParams | CreateCompareParams | CreateTransferParams;
150
+ interface StageRate {
151
+ stage: string;
152
+ n: number;
153
+ success_rate: number;
154
+ ci95: [number, number];
155
+ }
156
+ interface InstructionRate {
157
+ instruction: string;
158
+ held_out: boolean;
159
+ n: number;
160
+ success_rate: number;
161
+ ci95: [number, number];
162
+ }
163
+ /** Every result carries `n` and a Wilson confidence interval, by construction. */
164
+ interface Result {
165
+ n: number;
166
+ success_rate: number;
167
+ ci95: [number, number];
168
+ interval_method?: "wilson";
169
+ failure_clusters?: Record<string, number>;
170
+ robot_hours?: number;
171
+ environment_hours?: number;
172
+ cost_usd?: number;
173
+ artifacts?: {
174
+ mcap?: string;
175
+ video?: string;
176
+ ground_truth?: string;
177
+ report_pdf?: string;
178
+ };
179
+ stage_rates?: StageRate[];
180
+ instruction_breakdown?: InstructionRate[];
181
+ interventions?: {
182
+ declared?: Interventions;
183
+ count?: number;
184
+ timestamps?: string[];
185
+ };
186
+ }
187
+ /** The wire form of a run object (`GET /v1/runs/{id}`), plus kind extras. */
188
+ interface RunData {
189
+ id: string;
190
+ object: "run";
191
+ kind: RunKind;
192
+ status: RunStatus;
193
+ created?: string;
194
+ completed?: string;
195
+ robot?: string;
196
+ robots?: string[];
197
+ environment?: string;
198
+ environments?: string[];
199
+ task?: string;
200
+ suite?: string;
201
+ policy?: Policy$1;
202
+ policies?: Record<string, Policy$1>;
203
+ episodes?: EpisodesSpec;
204
+ episodes_per_cell?: EpisodesSpec;
205
+ priority?: Priority;
206
+ perturbation?: Perturbation;
207
+ data?: DataPosture;
208
+ max_budget_usd?: number;
209
+ resolved_pins?: Record<string, string>;
210
+ result?: Result;
211
+ [extra: string]: unknown;
212
+ }
213
+ interface Episode {
214
+ id: string;
215
+ object?: "episode";
216
+ index: number;
217
+ outcome: "success" | "failure" | "estop";
218
+ cluster?: string;
219
+ duration_s?: number;
220
+ video_url?: string;
221
+ mcap_url?: string;
222
+ replay_spec?: Record<string, unknown>;
223
+ }
224
+ /** The deployment verification report — conformance evidence, citable. */
225
+ interface Report {
226
+ object?: "report";
227
+ run_id: string;
228
+ kind?: "verification";
229
+ result?: Result;
230
+ resolved_pins?: Record<string, string>;
231
+ citation?: string;
232
+ pdf_url?: string;
233
+ /** Alias of `pdf_url` — the downloadable report. */
234
+ url?: string;
235
+ }
236
+ interface Export {
237
+ object?: "export";
238
+ id: string;
239
+ run_id?: string;
240
+ format?: ExportFormat | string;
241
+ status: "preparing" | "ready" | "expired";
242
+ download_url?: string | null;
243
+ }
244
+ /** A live run event: episode ticker or status transition. */
245
+ interface WatchEvent {
246
+ status: string;
247
+ episode?: number;
248
+ of?: number;
249
+ outcome?: string;
250
+ duration_s?: number;
251
+ cell?: string;
252
+ webrtc?: string;
253
+ }
254
+ interface Robot {
255
+ id: string;
256
+ class?: string;
257
+ dof?: number;
258
+ hands?: string;
259
+ firmwares?: string[];
260
+ cells?: number;
261
+ duty_cycle_pct?: number;
262
+ tier?: "soak" | "verify";
263
+ }
264
+ interface Environment {
265
+ id: string;
266
+ rev?: string;
267
+ class?: string;
268
+ instrumentation?: string[];
269
+ objects?: number;
270
+ reset?: "scripted" | "teleop-assisted";
271
+ adder_tier?: "bare" | "standard" | "replica" | "instrumented-replica";
272
+ }
273
+ interface Suite {
274
+ id: string;
275
+ rev?: string;
276
+ frozen?: string;
277
+ scoring?: string;
278
+ episodes_per_task?: number;
279
+ tasks?: string[];
280
+ environments?: string[];
281
+ [extra: string]: unknown;
282
+ }
283
+ interface QuoteParams {
284
+ robot: string;
285
+ environment: string;
286
+ episodes: EpisodesSpec;
287
+ priority?: Priority;
288
+ }
289
+ interface Quote {
290
+ object?: "quote";
291
+ robot?: string;
292
+ environment?: string;
293
+ episodes?: EpisodesSpec;
294
+ priority?: string;
295
+ robot_hours: number;
296
+ env_hours: number;
297
+ usd: number;
298
+ queue_eta: string;
299
+ breakdown?: {
300
+ minutes_per_episode_est?: number;
301
+ robot_usd_per_hour?: number;
302
+ env_usd_per_hour?: number;
303
+ robot_usd?: number;
304
+ env_usd?: number;
305
+ };
306
+ expires?: string;
307
+ }
308
+ interface GateCreateParams {
309
+ on: string;
310
+ suite: string;
311
+ robots: readonly string[];
312
+ fail_if: {
313
+ success_rate_drop_pts?: number;
314
+ new_collision?: boolean;
315
+ };
316
+ }
317
+ interface Gate extends GateCreateParams {
318
+ object?: "gate";
319
+ id: string;
320
+ status: "active" | "paused";
321
+ robots: string[];
322
+ }
323
+ interface Stream {
324
+ object?: "stream";
325
+ cell: string;
326
+ run?: string;
327
+ episode?: number;
328
+ of?: number;
329
+ webrtc?: string;
330
+ mjpeg?: string;
331
+ viewer_token?: string;
332
+ expires?: string;
333
+ }
334
+ interface Budget {
335
+ monthly_usd: number;
336
+ hard?: boolean;
337
+ remaining_usd?: number;
338
+ }
339
+ interface Usage {
340
+ object?: "usage";
341
+ period: string;
342
+ robot_hours: Record<string, number>;
343
+ env_hours: Record<string, number>;
344
+ usd_total?: number;
345
+ budget?: Budget;
346
+ }
347
+ type KeyScope = "runs:read" | "runs:write" | "streams:read" | "data:purge" | "keys:admin" | "calibration:export";
348
+ interface Key {
349
+ object?: "key";
350
+ id: string;
351
+ scope: KeyScope[];
352
+ /** `rbr_live_` prefix; shown once at creation, never again. */
353
+ secret?: string;
354
+ created?: string;
355
+ }
356
+ interface PurgeReceipt {
357
+ object?: "purge_receipt";
358
+ id: string;
359
+ run_id: string;
360
+ status: "completed";
361
+ purged_at?: string;
362
+ }
363
+ interface CalibrationExportParams {
364
+ embodiment: string;
365
+ scenes: readonly string[];
366
+ channels: readonly ("gt/object_poses" | "commanded_vs_executed" | "contact_events")[];
367
+ /** Scoped: validation use, no policy training. */
368
+ license: "sim-calibration-v1";
369
+ }
370
+ interface TaskCreateParams {
371
+ name: string;
372
+ visibility?: "private" | "published";
373
+ initial_conditions: Record<string, unknown>;
374
+ success_predicates: readonly Record<string, string>[];
375
+ instructions?: {
376
+ sampled_per_episode?: readonly string[];
377
+ held_out?: readonly string[];
378
+ };
379
+ stages?: readonly Record<string, string>[];
380
+ envelope?: Record<string, unknown>;
381
+ baseline?: {
382
+ internal_trials?: number;
383
+ internal_rate?: number;
384
+ };
385
+ }
386
+ interface TaskData {
387
+ id: string;
388
+ object?: "task";
389
+ name: string;
390
+ rev: string | null;
391
+ status: "draft" | "piloting" | "frozen";
392
+ visibility: "private" | "published";
393
+ created?: string;
394
+ frozen?: string | null;
395
+ signatures?: string[];
396
+ initial_conditions?: Record<string, unknown>;
397
+ success_predicates?: Record<string, string>[];
398
+ instructions?: Record<string, unknown>;
399
+ stages?: Record<string, string>[];
400
+ envelope?: Record<string, unknown>;
401
+ pilot?: Record<string, unknown> | null;
402
+ [extra: string]: unknown;
403
+ }
404
+ interface Pilot {
405
+ run_id: string;
406
+ robot?: string;
407
+ episodes?: number;
408
+ /** Live WebRTC stream — watch the calibration session. */
409
+ stream_url: string;
410
+ }
411
+ interface KitCreateParams {
412
+ name: string;
413
+ items: readonly {
414
+ desc: string;
415
+ qty: number;
416
+ }[];
417
+ }
418
+ interface KitData {
419
+ id: string;
420
+ object?: "kit";
421
+ name: string;
422
+ /** `registered → received → tracked → available` (as `kit/<name>`). */
423
+ status: "registered" | "received" | "tracked" | "available";
424
+ status_history?: {
425
+ status: string;
426
+ at: string;
427
+ }[];
428
+ items?: {
429
+ desc: string;
430
+ qty: number;
431
+ }[];
432
+ tracking?: {
433
+ mocap_markers?: number;
434
+ mass_g?: number;
435
+ mesh_scan?: boolean;
436
+ } | null;
437
+ environment_ref?: string | null;
438
+ shipping_label_url?: string;
439
+ }
440
+ interface TransferSide {
441
+ robot: string;
442
+ n: number;
443
+ success_rate: number;
444
+ ci95: [number, number];
445
+ }
446
+ interface TransferReport {
447
+ object?: "transfer";
448
+ task: string;
449
+ interval_method?: "wilson";
450
+ source: TransferSide;
451
+ target: TransferSide;
452
+ delta_pts: number;
453
+ new_failure_clusters: string[];
454
+ }
455
+ interface MatrixCell {
456
+ robot: string;
457
+ environment: string;
458
+ n: number;
459
+ success_rate: number;
460
+ ci95: [number, number];
461
+ status: "pass" | "fail";
462
+ }
463
+ /** Embodiment × environment grid of rate ± CI per cell. */
464
+ type Heatmap = Record<string, Record<string, {
465
+ n: number;
466
+ success_rate: number;
467
+ ci95: [number, number];
468
+ status: string;
469
+ }>>;
470
+ interface MatrixRegression {
471
+ robot: string;
472
+ environment: string;
473
+ delta_pts: number;
474
+ note?: string;
475
+ }
476
+ /** A matrix result: overall stats plus the grid and per-stage breakdowns. */
477
+ interface MatrixResult extends Result {
478
+ heatmap: Heatmap;
479
+ cells: MatrixCell[];
480
+ }
481
+ /** The documented error envelope (`{"error": {code, message, ...}}`). */
482
+ type ErrorCode = "invalid_api_key" | "insufficient_scope" | "not_found" | "contract_validation_failed" | "firmware_pin_unavailable" | "environment_unavailable" | "task_unknown" | "scenario_format_invalid" | "episodes_invalid" | "budget_exceeded" | "monthly_budget_exceeded" | "quote_expired" | "queue_timeout" | "policy_endpoint_timeout" | "estop_triggered" | "retention_expired" | "publish_forbidden" | "rate_limited" | (string & {});
483
+ interface ErrorEnvelope {
484
+ error: {
485
+ code: ErrorCode;
486
+ message: string;
487
+ run_id?: string;
488
+ doc_url?: string;
489
+ partial_result?: Result;
490
+ };
491
+ }
492
+ /** Options for the client constructor. */
493
+ interface RoboramaOptions {
494
+ /** Overrides `ROBORAMA_API_KEY`. Keys carry the `rbr_live_` prefix. */
495
+ apiKey?: string;
496
+ /** Overrides `ROBORAMA_BASE_URL` / the documented default. */
497
+ baseUrl?: string;
498
+ /** Force mock mode on/off; default follows `ROBORAMA_MOCK`. */
499
+ mock?: boolean;
500
+ /** Custom fetch implementation (defaults to `globalThis.fetch`). */
501
+ fetch?: typeof globalThis.fetch;
502
+ }
503
+
504
+ /**
505
+ * The Roborama client: bearer auth, idempotency keys, typed errors, and a
506
+ * deterministic mock mode.
507
+ *
508
+ * `new Roborama()` reads `ROBORAMA_API_KEY` from the environment; every
509
+ * method returns a promise; field names stay snake_case on both sides of
510
+ * the wire. Set `ROBORAMA_MOCK=1` (or `new Roborama({ mock: true })`) to
511
+ * integrate offline against fixture-shaped results while hosted execution
512
+ * is in private preview.
513
+ */
514
+
515
+ declare const DEFAULT_BASE_URL = "https://api.roborama.com";
516
+ type Json = Record<string, any>;
517
+ declare class Transport {
518
+ private mockOpt?;
519
+ private mockBackend?;
520
+ private apiKey?;
521
+ readonly baseUrl: string;
522
+ private fetchImpl?;
523
+ constructor(opts?: RoboramaOptions);
524
+ get mock(): boolean;
525
+ private engine;
526
+ private key;
527
+ request(method: string, path: string, opts?: {
528
+ body?: Json;
529
+ params?: Json;
530
+ }): Promise<any>;
531
+ events(runId: string): AsyncGenerator<WatchEvent>;
532
+ }
533
+ /** Three constructors, each with a declared contract, validated before any motor moves. */
534
+ declare const Policy: {
535
+ /** A container image we run in-facility, GPU-adjacent. */
536
+ readonly container: (opts: Omit<ContainerPolicy, "type">) => ContainerPolicy;
537
+ /** A checkpoint on a known runtime (`openpi`, `lerobot`). */
538
+ readonly checkpoint: (opts: Omit<CheckpointPolicy, "type">) => CheckpointPolicy;
539
+ /** Customer-hosted inference; measured RTT is logged per step. */
540
+ readonly endpoint: (opts: Omit<EndpointPolicy, "type">) => EndpointPolicy;
541
+ };
542
+ declare class BaseRunHandle {
543
+ protected transport: Transport;
544
+ protected data: RunData;
545
+ constructor(transport: Transport, data: RunData);
546
+ get id(): string;
547
+ get kind(): RunKind;
548
+ get status(): RunStatus;
549
+ get resolved_pins(): Record<string, string>;
550
+ /** The full wire payload, for forward compatibility. */
551
+ get raw(): RunData;
552
+ refresh(): Promise<this>;
553
+ protected raiseIfStopped(): void;
554
+ }
555
+ /** A created or fetched run. `result()` resolves once the run completes. */
556
+ declare class RunHandle extends BaseRunHandle {
557
+ /** `n`, `success_rate`, `ci95`, clusters, both meters, `cost_usd`. */
558
+ result(): Promise<Result>;
559
+ /** Per-episode artifacts: `video_url`, `mcap_url`, `replay_spec`. */
560
+ episodes(): Promise<Episode[]>;
561
+ /** Live events: episode ticker plus WebRTC stream URLs. No polling. */
562
+ watch(): AsyncGenerator<WatchEvent>;
563
+ /** Dataset export: `lerobot`, `rlds`, or `mcap-bundle`. */
564
+ export(opts: {
565
+ format: ExportFormat;
566
+ }): Promise<Export>;
567
+ /** The deployment verification report, citable. */
568
+ report(opts?: {
569
+ format?: "json" | "pdf";
570
+ }): Promise<Report>;
571
+ }
572
+ /** A versioned suite evaluation (`kind: "eval"`) with a citable attestation. */
573
+ declare class EvalRunHandle extends RunHandle {
574
+ get citation(): string | undefined;
575
+ get attestation(): string | undefined;
576
+ get attestation_url(): string | undefined;
577
+ get per_task(): Json[];
578
+ }
579
+ /** A paired A/B comparison (`kind: "compare"`). */
580
+ declare class CompareRunHandle extends RunHandle {
581
+ get winner(): string | undefined;
582
+ get p_value(): number | undefined;
583
+ get effect_pts(): number | undefined;
584
+ get results(): Record<string, Result>;
585
+ }
586
+ /** Physical verification of sim-flagged scenarios (`kind: "verify"`). */
587
+ declare class VerifyRunHandle extends RunHandle {
588
+ /** Where reality matched sim predictions. */
589
+ get sim_agreement(): number | undefined;
590
+ /** Scenario ids where reality diverged. */
591
+ get disagreements(): string[];
592
+ get ground_truth_url(): string | undefined;
593
+ }
594
+ /** An outcome contract (`kind: "threshold"`). The hardware calls you. */
595
+ declare class ThresholdContractHandle extends RunHandle {
596
+ /** Register the webhook fired after verification-tier confirmation. */
597
+ onVerified(opts: {
598
+ webhook: string;
599
+ }): Promise<this>;
600
+ }
601
+ /** A transfer-gap measurement (`kind: "transfer"`). */
602
+ declare class TransferRunHandle extends BaseRunHandle {
603
+ /** Source vs. target statistics and the failure clusters transfer opened. */
604
+ report(): Promise<TransferReport>;
605
+ }
606
+ /** An embodiment × environment sweep (`kind: "matrix"`). */
607
+ declare class MatrixRunHandle extends RunHandle {
608
+ get cells(): MatrixCell[];
609
+ /** Embodiment × environment grid of rate ± CI per cell. */
610
+ heatmap(): Promise<Heatmap>;
611
+ /** Cells that degraded vs. a prior release run. */
612
+ regressions(opts: {
613
+ vs: string;
614
+ }): Promise<MatrixRegression[]>;
615
+ /** The release-gate deliverable (PDF). */
616
+ verificationReport(opts?: {
617
+ format?: "json" | "pdf";
618
+ }): Promise<Report>;
619
+ /** Overall stats plus the grid and per-stage/per-instruction breakdowns. */
620
+ result(): Promise<MatrixResult>;
621
+ }
622
+ /**
623
+ * A Task Spec: declarative, versioned, instrument-bound.
624
+ * Lifecycle: `draft` → `pilot()` → `amend()` → `freeze()` → immutable `name@vN`.
625
+ */
626
+ declare class TaskHandle {
627
+ private transport;
628
+ private data;
629
+ constructor(transport: Transport, data: TaskData);
630
+ get id(): string;
631
+ get name(): string;
632
+ get status(): "draft" | "piloting" | "frozen";
633
+ /** Frozen revision id (`espresso@v1`); null until frozen. */
634
+ get rev(): string | null;
635
+ get visibility(): "private" | "published";
636
+ get raw(): TaskData;
637
+ /** Run the calibration session; the returned `stream_url` is live. */
638
+ pilot(opts: {
639
+ robot: string;
640
+ episodes?: number;
641
+ }): Promise<Pilot>;
642
+ /** Iterate on the method while piloting. Omitted fields are unchanged. */
643
+ amend(fields: Partial<TaskCreateParams>): Promise<this>;
644
+ /** Freeze to an immutable, co-signed revision (`name@vN`). */
645
+ freeze(): Promise<this>;
646
+ }
647
+ /** A kit of customer hardware, with live follow-ups. */
648
+ declare class KitHandle {
649
+ private transport;
650
+ private data;
651
+ constructor(transport: Transport, data: KitData);
652
+ get id(): string;
653
+ get name(): string;
654
+ /** `registered → received → tracked → available` (as `kit/<name>`). */
655
+ get status(): KitData["status"];
656
+ get environment_ref(): string | null | undefined;
657
+ get raw(): KitData;
658
+ /** The inbound shipping label to the facility (URL). */
659
+ shippingLabel(): Promise<string>;
660
+ }
661
+ /**
662
+ * The Roborama client. Reads `ROBORAMA_API_KEY` from the environment;
663
+ * mirrors the Python surface method for method.
664
+ */
665
+ declare class Roborama {
666
+ /** Policy constructors: `Roborama.Policy.checkpoint({...})`, etc. */
667
+ static readonly Policy: {
668
+ /** A container image we run in-facility, GPU-adjacent. */
669
+ readonly container: (opts: Omit<ContainerPolicy, "type">) => ContainerPolicy;
670
+ /** A checkpoint on a known runtime (`openpi`, `lerobot`). */
671
+ readonly checkpoint: (opts: Omit<CheckpointPolicy, "type">) => CheckpointPolicy;
672
+ /** Customer-hosted inference; measured RTT is logged per step. */
673
+ readonly endpoint: (opts: Omit<EndpointPolicy, "type">) => EndpointPolicy;
674
+ };
675
+ private transport;
676
+ readonly runs: {
677
+ /** `POST /v1/runs`; `kind` selects the primitive (default `run`). */
678
+ create(params: CreateRunParams): Promise<RunHandle>;
679
+ create(params: CreateEvalParams): Promise<EvalRunHandle>;
680
+ create(params: CreateVerifyParams): Promise<VerifyRunHandle>;
681
+ create(params: CreateMatrixParams): Promise<MatrixRunHandle>;
682
+ create(params: CreateThresholdParams): Promise<ThresholdContractHandle>;
683
+ create(params: CreateCompareParams): Promise<CompareRunHandle>;
684
+ create(params: CreateTransferParams): Promise<TransferRunHandle>;
685
+ create(params: RunCreateParams): Promise<RunHandle>;
686
+ get(runId: string): Promise<RunHandle>;
687
+ list(params?: {
688
+ kind?: RunKind;
689
+ status?: RunStatus;
690
+ limit?: number;
691
+ }): Promise<RunHandle[]>;
692
+ };
693
+ /** Physical verification of sim-flagged scenarios (`runs.create` with `kind: "verify"`). */
694
+ readonly verifications: {
695
+ create(params: Omit<CreateVerifyParams, "kind">): Promise<VerifyRunHandle>;
696
+ };
697
+ /** Embodiment × environment sweeps (`runs.create` with `kind: "matrix"`). */
698
+ readonly matrices: {
699
+ create(params: Omit<CreateMatrixParams, "kind">): Promise<MatrixRunHandle>;
700
+ };
701
+ readonly robots: {
702
+ list(): Promise<Robot[]>;
703
+ };
704
+ readonly environments: {
705
+ list(params?: {
706
+ cls?: string;
707
+ }): Promise<Environment[]>;
708
+ };
709
+ readonly suites: {
710
+ list(): Promise<Suite[]>;
711
+ };
712
+ readonly gates: {
713
+ create(params: GateCreateParams): Promise<Gate>;
714
+ };
715
+ readonly streams: {
716
+ get(cell: string): Promise<Stream>;
717
+ };
718
+ readonly keys: {
719
+ create(params: {
720
+ scope: readonly KeyScope[];
721
+ }): Promise<Key>;
722
+ list(): Promise<Key[]>;
723
+ };
724
+ readonly budgets: {
725
+ set(params: {
726
+ monthly_usd: number;
727
+ hard?: boolean;
728
+ }): Promise<Budget>;
729
+ };
730
+ readonly data: {
731
+ purge(runId: string): Promise<PurgeReceipt>;
732
+ };
733
+ readonly calibration: {
734
+ export(params: CalibrationExportParams): Promise<Export>;
735
+ };
736
+ readonly tasks: {
737
+ create(params: TaskCreateParams): Promise<TaskHandle>;
738
+ get(taskId: string): Promise<TaskHandle>;
739
+ list(): Promise<TaskHandle[]>;
740
+ };
741
+ readonly kits: {
742
+ register(params: KitCreateParams): Promise<KitHandle>;
743
+ get(kitId: string): Promise<KitHandle>;
744
+ };
745
+ readonly scenarios: {
746
+ /** Load PolaRiS / Isaac / world-model exports or layout-replay specs. */
747
+ fromFile(path: string): Promise<Record<string, unknown>>;
748
+ };
749
+ constructor(options?: RoboramaOptions);
750
+ /** Whether this client is in mock mode. */
751
+ get mock(): boolean;
752
+ get baseUrl(): string;
753
+ /** Both meters, dollars, and a queue ETA — before you commit. */
754
+ quote(params: QuoteParams): Promise<Quote>;
755
+ /** Metered usage for a period (`YYYY-MM`): hours by tier, dollars, budget. */
756
+ usage(params?: {
757
+ period?: string;
758
+ }): Promise<Usage>;
759
+ }
760
+
761
+ /**
762
+ * One error class, `RoboramaError`, with a `.code` matching the fixed set at
763
+ * https://roborama.com/docs/errors/. Switch on the code, not the message —
764
+ * messages are for humans and may improve without notice.
765
+ */
766
+
767
+ declare class RoboramaError extends Error {
768
+ /** Machine-readable code from the documented fixed set. */
769
+ readonly code: ErrorCode;
770
+ /** HTTP status, when the error came off the wire. */
771
+ readonly status?: number;
772
+ /** Present when the error concerns a specific run. */
773
+ readonly run_id?: string;
774
+ /** Link to the matching entry in the error reference. */
775
+ readonly doc_url?: string;
776
+ /**
777
+ * For `budget_exceeded`: honest statistics for the episodes that ran
778
+ * before the hard stop (`n`, `success_rate`, `ci95`).
779
+ */
780
+ readonly partial_result?: Result;
781
+ constructor(message: string, opts: {
782
+ code: ErrorCode;
783
+ status?: number;
784
+ run_id?: string;
785
+ doc_url?: string;
786
+ partial_result?: Result;
787
+ });
788
+ }
789
+
790
+ declare function zForCi(ci: number): number;
791
+ /** Wilson score interval, rounded to 3 decimals (the API's display precision). */
792
+ declare function wilsonCi(successes: number, n: number, ci?: number): [number, number];
793
+ /** Parse `auto(ci=0.95, moe=0.03)` → `{ci, moe}`; null when not auto-form. */
794
+ declare function parseAuto(spec: string): {
795
+ ci: number;
796
+ moe: number;
797
+ } | null;
798
+ /** Conservative pre-run sizing (p=0.5) for a target margin of error. */
799
+ declare function planningN(ci: number, moe: number): number;
800
+
801
+ /**
802
+ * roborama — real robots as an API.
803
+ *
804
+ * ```ts
805
+ * import Roborama from "roborama"; // reads ROBORAMA_API_KEY
806
+ *
807
+ * const roborama = new Roborama();
808
+ * const run = await roborama.runs.create({
809
+ * robot: "g1-edu-pro@fw2.3",
810
+ * environment: "kitchen-std@v1.2",
811
+ * task: "pick_place@v1",
812
+ * episodes: "auto(ci=0.95, moe=0.03)",
813
+ * });
814
+ * console.log(await run.result()); // n=612 rate=0.874 ci95=(0.846, 0.898)
815
+ * ```
816
+ *
817
+ * Hosted execution is in private preview. Set `ROBORAMA_MOCK=1` (or
818
+ * `new Roborama({ mock: true })`) to integrate today against a
819
+ * deterministic, fixture-shaped mock backend.
820
+ */
821
+
822
+ export { type AutoEpisodesSpec, type Budget, type CalibrationExportParams, type CheckpointPolicy, CompareRunHandle, type ContainerPolicy, type CreateCompareParams, type CreateEvalParams, type CreateMatrixParams, type CreateRunParams, type CreateThresholdParams, type CreateTransferParams, type CreateVerifyParams, DEFAULT_BASE_URL, type DataPosture, type EndpointPolicy, type Environment, type Episode, type EpisodesSpec, type ErrorCode, type ErrorEnvelope, EvalRunHandle, type Export, type ExportFormat, type Gate, type GateCreateParams, type Heatmap, type InstructionRate, type Interventions, type Key, type KeyScope, type KitCreateParams, type KitData, KitHandle, type MatrixCell, type MatrixRegression, type MatrixResult, MatrixRunHandle, type Perturbation, type Pilot, Policy, type PolicyInput, type PolicyStream, type Priority, type PurgeReceipt, type Quote, type QuoteParams, type Report, type Result, Roborama, RoboramaError, type RoboramaOptions, type Robot, type RunCreateParams, type RunData, RunHandle, type RunKind, type RunStatus, type StageRate, type Stream, type Suite, type TaskCreateParams, type TaskData, TaskHandle, ThresholdContractHandle, type TransferReport, TransferRunHandle, type TransferSide, type Usage, VerifyRunHandle, type WatchEvent, Roborama as default, parseAuto, planningN, wilsonCi, zForCi };