@sandboxrouter/sdk 0.20.1 → 0.21.1

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.
@@ -189,6 +189,58 @@ class BlaxelBox {
189
189
  throw wrap(err);
190
190
  }
191
191
  }
192
+ /**
193
+ * A private preview with a token of its own: opened once with `bl_preview_token` in the URL, the
194
+ * browser then keeps it in a cookie. Blaxel stops the token at its expiry; deleting it ends it early.
195
+ */
196
+ async privateUrl(port, expiresInSeconds) {
197
+ if (info("blaxel").limits.reservedPorts?.includes(port))
198
+ throw new ProviderError("blaxel", `port ${port} is reserved`, 400);
199
+ try {
200
+ const preview = await this.sbx.previews.createIfNotExists({
201
+ metadata: { name: `sandboxrouter-${port}` },
202
+ spec: { port, public: false },
203
+ });
204
+ if (preview.spec.port !== port || preview.spec.public === true) {
205
+ throw new ProviderError("blaxel", `existing preview for port ${port} has different access or routing settings`, 409);
206
+ }
207
+ const url = new URL(preview.url);
208
+ if (url.protocol !== "https:")
209
+ throw new ProviderError("blaxel", "preview did not return an HTTPS URL");
210
+ const expiresAt = new Date(Date.now() + expiresInSeconds * 1000);
211
+ const token = await preview.tokens.create(expiresAt);
212
+ url.searchParams.set("bl_preview_token", token.value);
213
+ return {
214
+ url: url.toString(),
215
+ expiresAt,
216
+ // Seen on a real account (2026-12-04): a preview of an app bound to 127.0.0.1 times out, one bound to 0.0.0.0 answers.
217
+ reaches: "interface",
218
+ revoke: async () => {
219
+ try {
220
+ await preview.tokens.delete(token.name);
221
+ }
222
+ catch (err) {
223
+ throw wrap(err);
224
+ }
225
+ },
226
+ };
227
+ }
228
+ catch (err) {
229
+ throw wrap(err);
230
+ }
231
+ }
232
+ /** A "date" expiration policy: Blaxel deletes the sandbox at that time. It replaces the lifetime set at create. */
233
+ async endAfter(seconds) {
234
+ const endsAt = new Date(Date.now() + Math.max(1, Math.round(seconds)) * 1000);
235
+ try {
236
+ const { SandboxInstance } = await optionalImport("@blaxel/core", "blaxel");
237
+ await SandboxInstance.updateLifecycle(this.nativeId, { expirationPolicies: [{ type: "date", action: "delete", value: endsAt.toISOString() }] });
238
+ }
239
+ catch (err) {
240
+ throw wrap(err);
241
+ }
242
+ return { endsAt };
243
+ }
192
244
  async kill() {
193
245
  try {
194
246
  await this.sbx.delete();
@@ -210,10 +210,48 @@ class DaytonaBox {
210
210
  await proc.deleteSession(session).catch(() => { });
211
211
  }
212
212
  }
213
+ /** Daytona's own terminal sessions (`process.createPty`), over a WebSocket. */
214
+ async terminal(o) {
215
+ const handle = await this.sbx.process.createPty({ id: `sr-${randomUUID().slice(0, 12)}`, cols: o.cols, rows: o.rows, onData: (data) => o.onData(data) });
216
+ try {
217
+ await handle.waitForConnection();
218
+ void handle.wait().then(o.onClose, o.onClose);
219
+ // The session starts a shell, so the command is typed into it.
220
+ await handle.sendInput(` ${o.cmd}\n`);
221
+ }
222
+ catch (err) {
223
+ await handle.kill().catch(() => { });
224
+ throw new ProviderError("daytona", err instanceof Error ? err.message : String(err), errorStatus(err));
225
+ }
226
+ return {
227
+ write: (data) => handle.sendInput(data),
228
+ close: async () => {
229
+ await handle.kill().catch(() => { });
230
+ await handle.disconnect().catch(() => { });
231
+ },
232
+ };
233
+ }
213
234
  async url(port) {
214
235
  // A port-scoped signed URL works in a browser without revealing a sandbox-wide preview token.
215
236
  return (await this.sbx.getSignedPreviewUrl(port, 3600)).url;
216
237
  }
238
+ /** A signed preview URL: the token is in the host name, it expires, and expireSignedPreviewUrl ends it early. */
239
+ async privateUrl(port, expiresInSeconds) {
240
+ const signed = await this.sbx.getSignedPreviewUrl(port, expiresInSeconds);
241
+ return {
242
+ url: signed.url,
243
+ expiresAt: new Date(Date.now() + expiresInSeconds * 1000),
244
+ revoke: async () => {
245
+ await this.sbx.expireSignedPreviewUrl(port, signed.token);
246
+ },
247
+ };
248
+ }
249
+ /** Daytona's TTL: the sandbox is destroyed that many whole minutes from now, whatever state it is in. */
250
+ async endAfter(seconds) {
251
+ const minutes = Math.max(1, Math.ceil(seconds / 60));
252
+ await this.sbx.setTtl(minutes);
253
+ return { endsAt: new Date(Date.now() + minutes * 60_000) };
254
+ }
217
255
  async start(cmd, opts = {}) {
218
256
  const session = `sbr-${randomUUID()}`;
219
257
  const process = this.sbx.process;
@@ -1,4 +1,4 @@
1
- import { type ExecOptions, type ExecResult, type Provider, type ProviderId, type ProviderProcess, type ProviderSandbox, type SandboxSpec, type StartOptions } from "../types.js";
1
+ import { type ExecOptions, type ExecResult, type Provider, type ProviderId, type ProviderProcess, type ProviderSandbox, type ProviderTerminal, type ProviderTerminalOptions, type SandboxSpec, type StartOptions } from "../types.js";
2
2
  import type { ComputerOs, ComputerProvider, ComputerSpec, ProviderComputer } from "../computers.js";
3
3
  /**
4
4
  * E2B via the official `e2b` SDK. vCPU and memory come from the template, not the create call.
@@ -45,8 +45,24 @@ export interface E2BLikeSandbox {
45
45
  format: "bytes";
46
46
  }): Promise<Uint8Array>;
47
47
  };
48
+ /** The SDK's terminal module (`sandbox.pty`), where the SDK has one. */
49
+ pty?: {
50
+ create(opts: {
51
+ cols: number;
52
+ rows: number;
53
+ onData: (data: Uint8Array) => void | Promise<void>;
54
+ timeoutMs?: number;
55
+ }): Promise<{
56
+ pid: number;
57
+ wait(): Promise<unknown>;
58
+ }>;
59
+ sendInput(pid: number, data: Uint8Array): Promise<void>;
60
+ kill(pid: number): Promise<boolean>;
61
+ };
48
62
  kill(): Promise<unknown>;
49
63
  pause(): Promise<unknown>;
64
+ /** Replaces the sandbox's lifetime: it ends this many milliseconds from now. */
65
+ setTimeout?(timeoutMs: number): Promise<unknown>;
50
66
  }
51
67
  /** A background command (the SDK's CommandHandle). */
52
68
  export interface E2BCommandHandle {
@@ -66,6 +82,8 @@ export declare class E2BCompatBox implements ProviderSandbox {
66
82
  /** The provider SDK's own sandbox object, for what the router doesn't cover (RoutedSandbox.native). */
67
83
  get native(): unknown;
68
84
  readonly nativeId: string;
85
+ /** Present when the SDK has a terminal module. */
86
+ terminal?: (opts: ProviderTerminalOptions) => Promise<ProviderTerminal>;
69
87
  constructor(sbx: E2BLikeSandbox, provider?: ProviderId);
70
88
  exec(cmd: string, opts?: ExecOptions): Promise<ExecResult>;
71
89
  writeFile(path: string, content: string | Uint8Array): Promise<void>;
@@ -76,6 +94,10 @@ export declare class E2BCompatBox implements ProviderSandbox {
76
94
  export declare class E2BBox extends E2BCompatBox {
77
95
  /** Snapshot memory and disk. Sandbox.connect (router.get) resumes it. */
78
96
  pause(): Promise<void>;
97
+ /** The SDK's setTimeout: the sandbox is ended that long from now (it can shorten or extend the lifetime). */
98
+ endAfter(seconds: number): Promise<{
99
+ endsAt: Date;
100
+ }>;
79
101
  }
80
102
  /** E2B-style SDK with browser hosts and detached, killable command handles. */
81
103
  export interface E2BPreviewSandbox extends E2BLikeSandbox {
@@ -24,6 +24,8 @@ export class E2BProvider {
24
24
  timeoutMs: (spec.timeoutMinutes ?? 30) * 60_000,
25
25
  envs: spec.env,
26
26
  metadata: spec.metadata,
27
+ // Left out, the project's own default applies: public unless the project requires its traffic token.
28
+ ...(spec.publicPorts ? { network: { allowPublicTraffic: true } } : {}),
27
29
  };
28
30
  const sbx = spec.image?.e2b ? await Sandbox.create(spec.image.e2b, opts) : await Sandbox.create(opts);
29
31
  return new E2BNativeBox(sbx);
@@ -79,10 +81,28 @@ export class E2BCompatBox {
79
81
  return this.sbx;
80
82
  }
81
83
  nativeId;
84
+ /** Present when the SDK has a terminal module. */
85
+ terminal;
82
86
  constructor(sbx, provider = "e2b") {
83
87
  this.sbx = sbx;
84
88
  this.provider = provider;
85
89
  this.nativeId = sbx.sandboxId;
90
+ const pty = sbx.pty;
91
+ if (pty) {
92
+ this.terminal = async (o) => {
93
+ // No time limit: the SDK would close the terminal after a minute otherwise.
94
+ const handle = await pty.create({ cols: o.cols, rows: o.rows, onData: (data) => o.onData(data), timeoutMs: 0 });
95
+ void handle.wait().then(o.onClose, o.onClose);
96
+ // The API starts a shell, so the command is typed into it. The leading space keeps the line out of the shell's history.
97
+ await pty.sendInput(handle.pid, new TextEncoder().encode(` ${o.cmd}\n`));
98
+ return {
99
+ write: (data) => pty.sendInput(handle.pid, data),
100
+ close: async () => {
101
+ await pty.kill(handle.pid);
102
+ },
103
+ };
104
+ };
105
+ }
86
106
  }
87
107
  async exec(cmd, opts = {}) {
88
108
  const t0 = Date.now();
@@ -144,6 +164,14 @@ export class E2BBox extends E2BCompatBox {
144
164
  async pause() {
145
165
  await this.sbx.pause();
146
166
  }
167
+ /** The SDK's setTimeout: the sandbox is ended that long from now (it can shorten or extend the lifetime). */
168
+ async endAfter(seconds) {
169
+ if (typeof this.sbx.setTimeout !== "function")
170
+ throw new ProviderError(this.provider, "this SDK has no setTimeout");
171
+ const ms = Math.max(1000, Math.round(seconds * 1000));
172
+ await this.sbx.setTimeout(ms);
173
+ return { endsAt: new Date(Date.now() + ms) };
174
+ }
147
175
  }
148
176
  export class E2BNativeBox extends E2BBox {
149
177
  sandbox;
@@ -154,7 +182,7 @@ export class E2BNativeBox extends E2BBox {
154
182
  async url(port) {
155
183
  const info = await this.sandbox.getInfo?.();
156
184
  if (info?.network?.allowPublicTraffic === false) {
157
- throw new ProviderError(this.provider, "this sandbox requires authenticated preview traffic; use a provider or project with browser-accessible previews", 403);
185
+ throw new ProviderError(this.provider, "this sandbox requires authenticated preview traffic: the E2B project allows no public sandbox URLs. Create the sandbox with publicPorts: true to open its ports, or use a project with browser-accessible previews", 403);
158
186
  }
159
187
  return `https://${this.sandbox.getHost(port)}`;
160
188
  }
@@ -92,6 +92,24 @@ class ModalBox {
92
92
  throw new ProviderError("modal", message);
93
93
  }
94
94
  }
95
+ /**
96
+ * A command whose input and output stay open as binary streams (`exec` with `mode: "binary"`).
97
+ * No terminal is asked of Modal: the router's own holds it, and this carries its bytes.
98
+ */
99
+ async terminal(o) {
100
+ try {
101
+ const p = await this.sb.exec(["sh", "-c", o.cmd], { mode: "binary" });
102
+ void (async () => {
103
+ for await (const chunk of p.stdout)
104
+ o.onData(chunk);
105
+ })().then(o.onClose, o.onClose);
106
+ void p.stderr.readBytes().catch(() => { });
107
+ return { write: (data) => p.stdin.writeBytes(data), close: () => p.stdin.close().catch(() => { }) };
108
+ }
109
+ catch (err) {
110
+ throw new ProviderError("modal", err?.message ?? String(err));
111
+ }
112
+ }
95
113
  async url(port) {
96
114
  const tunnel = (await this.sb.tunnels())[port];
97
115
  if (!tunnel)
@@ -149,6 +149,17 @@ class TensorlakeBox {
149
149
  clearTimeout(timer);
150
150
  }
151
151
  }
152
+ /** Tensorlake's own terminal sessions (`createPty`), over a WebSocket. */
153
+ async terminal(o) {
154
+ try {
155
+ const pty = await this.sbx.createPty({ command: "/bin/sh", args: ["-c", o.cmd], cols: o.cols, rows: o.rows, onData: (data) => o.onData(data) });
156
+ void pty.wait().then(o.onClose, o.onClose);
157
+ return { write: (data) => pty.sendInput(data), close: () => pty.kill() };
158
+ }
159
+ catch (err) {
160
+ throw new ProviderError("tensorlake", err?.message ?? String(err));
161
+ }
162
+ }
152
163
  async writeFile(path, content) {
153
164
  try {
154
165
  await this.sbx.writeFile(path, toBytes(content));
package/dist/published.js CHANGED
@@ -2147,6 +2147,20 @@ export const PUBLISHED = {
2147
2147
  {
2148
2148
  "n": 10,
2149
2149
  "job": "start",
2150
+ "notTested": [
2151
+ {
2152
+ "provider": "lambda",
2153
+ "name": "AWS Lambda MicroVMs"
2154
+ },
2155
+ {
2156
+ "provider": "boat",
2157
+ "name": "Boat"
2158
+ },
2159
+ {
2160
+ "provider": "superserve",
2161
+ "name": "Superserve"
2162
+ }
2163
+ ],
2150
2164
  "rows": {
2151
2165
  "cloudflare": {
2152
2166
  "name": "Cloudflare Sandbox",
@@ -2342,76 +2356,46 @@ export const PUBLISHED = {
2342
2356
  "wallMs": 12345,
2343
2357
  "usdPer100": 0.01405,
2344
2358
  "measuredAt": "2026-11-17T18:33:05.397Z"
2345
- },
2346
- "lambda": {
2347
- "name": "AWS Lambda MicroVMs",
2348
- "n": 10,
2349
- "ok": 2,
2350
- "limited": 8,
2351
- "size": {
2352
- "vcpu": 2,
2353
- "memoryGb": 4
2354
- },
2355
- "p50Ms": 3077,
2356
- "p99Ms": 4545,
2357
- "wallMs": 4545,
2358
- "usdPer100": 0.028,
2359
- "measuredAt": "2026-11-17T18:33:05.397Z"
2360
- },
2361
- "boat": {
2362
- "name": "Boat",
2363
- "n": 10,
2364
- "ok": 0,
2365
- "limited": 10,
2366
- "size": {
2367
- "vcpu": 2,
2368
- "memoryGb": 4
2369
- },
2370
- "wallMs": 1694,
2371
- "measuredAt": "2026-11-17T18:33:05.397Z"
2372
- },
2373
- "superserve": {
2374
- "name": "Superserve",
2375
- "n": 10,
2376
- "ok": 0,
2377
- "limited": 10,
2378
- "size": {
2379
- "vcpu": 2,
2380
- "memoryGb": 4
2381
- },
2382
- "wallMs": 3573,
2383
- "measuredAt": "2026-11-17T18:33:05.397Z"
2384
- }
2385
- }
2386
- },
2387
- {
2388
- "n": 10,
2389
- "job": "rl",
2390
- "rows": {
2391
- "maritime": {
2392
- "name": "Maritime",
2393
- "n": 10,
2394
- "ok": 10,
2395
- "limited": 0,
2396
- "size": {
2397
- "vcpu": 2,
2398
- "memoryGb": 4
2399
- },
2400
- "createFailures": 0,
2401
- "commandFailures": 0,
2402
- "taskFailures": 0,
2403
- "cleanupFailures": 0,
2404
- "p50Ms": 2722,
2405
- "p99Ms": 3075,
2406
- "wallMs": 5792,
2407
- "usdPer100": 0.0033,
2408
- "measuredAt": "2026-11-17T23:49:19.260Z"
2409
2359
  }
2410
2360
  }
2411
2361
  },
2412
2362
  {
2413
2363
  "n": 100,
2414
2364
  "job": "start",
2365
+ "notTested": [
2366
+ {
2367
+ "provider": "agent37",
2368
+ "name": "Agent37"
2369
+ },
2370
+ {
2371
+ "provider": "lambda",
2372
+ "name": "AWS Lambda MicroVMs"
2373
+ },
2374
+ {
2375
+ "provider": "boat",
2376
+ "name": "Boat"
2377
+ },
2378
+ {
2379
+ "provider": "daytona",
2380
+ "name": "Daytona"
2381
+ },
2382
+ {
2383
+ "provider": "e2b",
2384
+ "name": "E2B"
2385
+ },
2386
+ {
2387
+ "provider": "freestyle",
2388
+ "name": "Freestyle"
2389
+ },
2390
+ {
2391
+ "provider": "maritime",
2392
+ "name": "Maritime"
2393
+ },
2394
+ {
2395
+ "provider": "vercel",
2396
+ "name": "Vercel Sandbox"
2397
+ }
2398
+ ],
2415
2399
  "rows": {
2416
2400
  "novita": {
2417
2401
  "name": "Novita AI Agent Sandbox",
@@ -2541,158 +2525,6 @@ export const PUBLISHED = {
2541
2525
  "wallMs": 19460,
2542
2526
  "usdPer100": 0.103711,
2543
2527
  "measuredAt": "2026-12-04T16:09:40.651Z"
2544
- },
2545
- "vercel": {
2546
- "name": "Vercel Sandbox",
2547
- "n": 100,
2548
- "ok": 81,
2549
- "limited": 19,
2550
- "size": {
2551
- "vcpu": 2,
2552
- "memoryGb": 4
2553
- },
2554
- "createFailures": 19,
2555
- "commandFailures": 0,
2556
- "taskFailures": 0,
2557
- "cleanupFailures": 0,
2558
- "p50Ms": 2263,
2559
- "p99Ms": 6232,
2560
- "wallMs": 6274,
2561
- "usdPer100": 0.568,
2562
- "measuredAt": "2026-12-04T16:09:40.651Z"
2563
- },
2564
- "maritime": {
2565
- "name": "Maritime",
2566
- "n": 100,
2567
- "ok": 65,
2568
- "limited": 35,
2569
- "size": {
2570
- "vcpu": 2,
2571
- "memoryGb": 4
2572
- },
2573
- "createFailures": 35,
2574
- "commandFailures": 0,
2575
- "taskFailures": 0,
2576
- "cleanupFailures": 0,
2577
- "p50Ms": 9687,
2578
- "p99Ms": 14166,
2579
- "wallMs": 14977,
2580
- "usdPer100": 0.006449,
2581
- "measuredAt": "2026-12-04T16:09:40.651Z"
2582
- },
2583
- "e2b": {
2584
- "name": "E2B",
2585
- "n": 100,
2586
- "ok": 43,
2587
- "limited": 57,
2588
- "size": {
2589
- "vcpu": 2,
2590
- "memoryGb": 0.5
2591
- },
2592
- "createFailures": 57,
2593
- "commandFailures": 0,
2594
- "taskFailures": 0,
2595
- "cleanupFailures": 0,
2596
- "p50Ms": 8799,
2597
- "p99Ms": 10042,
2598
- "wallMs": 10042,
2599
- "usdPer100": 0.026451,
2600
- "measuredAt": "2026-12-04T16:09:40.651Z"
2601
- },
2602
- "freestyle": {
2603
- "name": "Freestyle",
2604
- "n": 100,
2605
- "ok": 40,
2606
- "limited": 60,
2607
- "size": {
2608
- "vcpu": 2,
2609
- "memoryGb": 4
2610
- },
2611
- "createFailures": 60,
2612
- "commandFailures": 0,
2613
- "taskFailures": 0,
2614
- "cleanupFailures": 0,
2615
- "p50Ms": 2272,
2616
- "p99Ms": 2677,
2617
- "wallMs": 2677,
2618
- "usdPer100": 0.011135,
2619
- "measuredAt": "2026-12-04T16:09:40.651Z"
2620
- },
2621
- "agent37": {
2622
- "name": "Agent37",
2623
- "n": 100,
2624
- "ok": 40,
2625
- "limited": 60,
2626
- "size": {
2627
- "vcpu": 2,
2628
- "memoryGb": 4
2629
- },
2630
- "createFailures": 60,
2631
- "commandFailures": 0,
2632
- "taskFailures": 0,
2633
- "cleanupFailures": 0,
2634
- "p50Ms": 5038,
2635
- "p99Ms": 6614,
2636
- "wallMs": 6614,
2637
- "usdPer100": 0.010845,
2638
- "measuredAt": "2026-12-04T16:09:40.651Z"
2639
- },
2640
- "boat": {
2641
- "name": "Boat",
2642
- "n": 100,
2643
- "ok": 12,
2644
- "limited": 88,
2645
- "size": {
2646
- "vcpu": 2,
2647
- "memoryGb": 4
2648
- },
2649
- "createFailures": 88,
2650
- "commandFailures": 0,
2651
- "taskFailures": 0,
2652
- "cleanupFailures": 0,
2653
- "p50Ms": 3036,
2654
- "p99Ms": 3520,
2655
- "wallMs": 5773,
2656
- "usdPer100": 0.001833,
2657
- "measuredAt": "2026-12-04T16:09:40.651Z"
2658
- },
2659
- "daytona": {
2660
- "name": "Daytona",
2661
- "n": 100,
2662
- "ok": 10,
2663
- "limited": 90,
2664
- "size": {
2665
- "vcpu": 1,
2666
- "memoryGb": 1
2667
- },
2668
- "createFailures": 90,
2669
- "commandFailures": 0,
2670
- "taskFailures": 0,
2671
- "cleanupFailures": 0,
2672
- "p50Ms": 1794,
2673
- "p99Ms": 1900,
2674
- "wallMs": 1900,
2675
- "usdPer100": 0.0037,
2676
- "measuredAt": "2026-12-04T16:09:40.651Z"
2677
- },
2678
- "lambda": {
2679
- "name": "AWS Lambda MicroVMs",
2680
- "n": 100,
2681
- "ok": 2,
2682
- "limited": 98,
2683
- "size": {
2684
- "vcpu": 2,
2685
- "memoryGb": 4
2686
- },
2687
- "createFailures": 98,
2688
- "commandFailures": 0,
2689
- "taskFailures": 0,
2690
- "cleanupFailures": 0,
2691
- "p50Ms": 4428,
2692
- "p99Ms": 4565,
2693
- "wallMs": 4565,
2694
- "usdPer100": 0.03505,
2695
- "measuredAt": "2026-12-04T16:09:40.651Z"
2696
2528
  }
2697
2529
  }
2698
2530
  }
@@ -44,7 +44,7 @@ export interface PublishedLoadRow {
44
44
  /** How many were asked for at once, and how many started. */
45
45
  n: number;
46
46
  ok: number;
47
- /** Of those that didn't start, how many the benchmarking account's own limit refused. */
47
+ /** Always 0 in published data: a batch an account limit cut short is not published (not tested at that size). */
48
48
  limited: number;
49
49
  size?: BenchmarkSize;
50
50
  createFailures?: number;
@@ -61,6 +61,11 @@ export interface PublishedLoadRow {
61
61
  export interface PublishedLoad {
62
62
  /** Sandboxes asked for at once. */
63
63
  n: number;
64
+ /** Providers with no result at this size: an account limit stopped their batch short, so it tested nothing. */
65
+ notTested?: {
66
+ provider: string;
67
+ name: string;
68
+ }[];
64
69
  /** "start": one command each; "rl": a short Python step each; "agents": the minute-long agent loop each. */
65
70
  job: "start" | "rl" | "agents";
66
71
  rows: Record<string, PublishedLoadRow>;
@@ -113,6 +118,12 @@ export interface Recommendation {
113
118
  successRate: number;
114
119
  /** Runs behind the numbers. */
115
120
  runs: number;
121
+ /**
122
+ * True when this provider was measured at a different sandbox size than most of the others. A smaller or
123
+ * larger machine is a different product at a different price, so the row is listed after the ranked ones
124
+ * and takes no part in the medians; `size` says what it ran at.
125
+ */
126
+ otherSize?: true;
116
127
  /** Cost and time together, each against the median and divided by the success rate; 1.0 is the median, lower is better. */
117
128
  valueScore: number;
118
129
  /** The burst size the at-once numbers come from, when `count` is 10 or more and the provider started all of them. */
@@ -132,12 +143,18 @@ export interface RecommendResult {
132
143
  dataThrough: string;
133
144
  results: Recommendation[];
134
145
  }
146
+ /** The sandbox size most rows were measured at: the only size a ranking compares. Ties go to the larger size. */
147
+ export declare function comparisonSize(sizes: (BenchmarkSize | undefined)[]): BenchmarkSize | undefined;
135
148
  /**
136
149
  * Rank providers for a job from the published benchmarks. Costs and times are per successful job: each is
137
150
  * divided by the provider's success rate, so one that fails often pays for it. For `count` of 10 or more, the
138
151
  * start time is the one measured with that many asked for at once (the largest measured size not above
139
- * `count`); providers not yet measured at that size are listed after the ones that were, since the limit that
140
- * stopped them was the benchmarking account's, not theirs.
152
+ * `count`); providers not tested at that size are listed after the ones that were. A batch that an account
153
+ * limit stopped short is not in the published data at all, so it is never read as the provider failing.
154
+ *
155
+ * Only providers measured at the same sandbox size are ranked against each other: that size is the one most of
156
+ * them ran at (`comparisonSize`). A provider measured at another size is listed after them with `otherSize` and a
157
+ * note, and its numbers stay out of the medians.
141
158
  */
142
159
  export declare function recommend(data: PublishedData, opts?: RecommendOptions): RecommendResult;
143
160
  export {};