@sandboxrouter/sdk 0.14.0 → 0.15.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/README.md +7 -5
- package/dist/catalog.d.ts +48 -3
- package/dist/catalog.js +78 -3
- package/dist/cli.js +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/leaderboard.js +5 -4
- package/dist/price-index.js +6 -3
- package/dist/providers/beam.js +5 -4
- package/dist/providers/digitalocean.d.ts +16 -0
- package/dist/providers/digitalocean.js +174 -0
- package/dist/providers/google.d.ts +23 -0
- package/dist/providers/google.js +206 -0
- package/dist/providers/morph.js +3 -2
- package/dist/providers/northflank.js +20 -3
- package/dist/providers/shell-files.d.ts +12 -0
- package/dist/providers/shell-files.js +52 -0
- package/dist/published.js +823 -162
- package/dist/recommend.d.ts +11 -4
- package/dist/recommend.js +3 -2
- package/dist/router.js +10 -1
- package/dist/types.d.ts +2 -2
- package/dist/verified.js +4 -0
- package/package.json +5 -1
package/dist/recommend.d.ts
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
export type RecJob = "start" | "short" | "long" | "python" | "download" | "agent" | "repo";
|
|
3
3
|
/** What to rank by: lowest cost, shortest time, or both together ("value"). */
|
|
4
4
|
export type RecPriority = "cost" | "speed" | "value";
|
|
5
|
+
type BenchmarkSize = {
|
|
6
|
+
vcpu: number;
|
|
7
|
+
memoryGb: number;
|
|
8
|
+
};
|
|
5
9
|
export interface PublishedStart {
|
|
6
10
|
name: string;
|
|
11
|
+
size?: BenchmarkSize;
|
|
7
12
|
medianCreateMs: number;
|
|
8
13
|
medianReadyMs?: number;
|
|
9
14
|
successRate: number;
|
|
@@ -13,6 +18,7 @@ export interface PublishedStart {
|
|
|
13
18
|
}
|
|
14
19
|
export interface PublishedJob {
|
|
15
20
|
name: string;
|
|
21
|
+
size?: BenchmarkSize;
|
|
16
22
|
/** Time to a usable sandbox when it ran this job. */
|
|
17
23
|
createMs: number;
|
|
18
24
|
/** The job itself, once the sandbox was up. */
|
|
@@ -38,10 +44,7 @@ export interface PublishedLoadRow {
|
|
|
38
44
|
ok: number;
|
|
39
45
|
/** Of those that didn't start, how many the benchmarking account's own limit refused. */
|
|
40
46
|
limited: number;
|
|
41
|
-
size?:
|
|
42
|
-
vcpu: number;
|
|
43
|
-
memoryGb: number;
|
|
44
|
-
};
|
|
47
|
+
size?: BenchmarkSize;
|
|
45
48
|
createFailures?: number;
|
|
46
49
|
commandFailures?: number;
|
|
47
50
|
taskFailures?: number;
|
|
@@ -73,6 +76,7 @@ export interface PublishedData {
|
|
|
73
76
|
minUsd: number;
|
|
74
77
|
maxUsd: number;
|
|
75
78
|
source: string;
|
|
79
|
+
when?: string;
|
|
76
80
|
}>;
|
|
77
81
|
}
|
|
78
82
|
export interface RecommendOptions {
|
|
@@ -93,6 +97,8 @@ export interface Recommendation {
|
|
|
93
97
|
rank: number;
|
|
94
98
|
provider: string;
|
|
95
99
|
name: string;
|
|
100
|
+
/** Nominal sandbox size used for the single-run measurement. */
|
|
101
|
+
size?: BenchmarkSize;
|
|
96
102
|
/** Seconds for one job, start included unless reusing. */
|
|
97
103
|
secondsEach: number;
|
|
98
104
|
/** Cost of one job; for "start", undefined (see hourlyUsd). */
|
|
@@ -132,3 +138,4 @@ export interface RecommendResult {
|
|
|
132
138
|
* stopped them was the benchmarking account's, not theirs.
|
|
133
139
|
*/
|
|
134
140
|
export declare function recommend(data: PublishedData, opts?: RecommendOptions): RecommendResult;
|
|
141
|
+
export {};
|
package/dist/recommend.js
CHANGED
|
@@ -36,7 +36,7 @@ export function recommend(data, opts = {}) {
|
|
|
36
36
|
const paired = startRows.length > 0 && startRows.every(([, s]) => s.medianReadyMs !== undefined);
|
|
37
37
|
if (job === "start") {
|
|
38
38
|
for (const [id, s] of startRows) {
|
|
39
|
-
raw.push({ provider: id, name: s.name, secondsEach: (paired ? s.medianReadyMs : s.medianCreateMs) / 1000, hourlyUsd: s.hourlyUsd, successRate: s.successRate, runs: s.runs, notes: [], measuredAt: s.measuredAt, usdKey: s.hourlyUsd });
|
|
39
|
+
raw.push({ provider: id, name: s.name, ...(s.size ? { size: s.size } : {}), secondsEach: (paired ? s.medianReadyMs : s.medianCreateMs) / 1000, hourlyUsd: s.hourlyUsd, successRate: s.successRate, runs: s.runs, notes: [], measuredAt: s.measuredAt, usdKey: s.hourlyUsd });
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
@@ -54,6 +54,7 @@ export function recommend(data, opts = {}) {
|
|
|
54
54
|
raw.push({
|
|
55
55
|
provider: id,
|
|
56
56
|
name: j.name,
|
|
57
|
+
...(j.size ? { size: j.size } : {}),
|
|
57
58
|
secondsEach: (j.taskMs + (reuse ? 0 : j.createMs)) / 1000,
|
|
58
59
|
usdEach: usd,
|
|
59
60
|
usdTotal: usd * count,
|
|
@@ -69,7 +70,7 @@ export function recommend(data, opts = {}) {
|
|
|
69
70
|
for (const r of raw) {
|
|
70
71
|
const fee = data.conditionalStartFees?.[r.provider];
|
|
71
72
|
if (!reuse && fee)
|
|
72
|
-
r.notes.push(`excludes
|
|
73
|
+
r.notes.push(`excludes ${fee.minUsd === fee.maxUsd ? `$${fee.minUsd}` : `$${fee.minUsd}–$${fee.maxUsd}`} per start ${fee.when ?? "above allowance"}`);
|
|
73
74
|
if (r.runs < mostRuns / 2)
|
|
74
75
|
r.notes.push(`only ${r.runs} runs`);
|
|
75
76
|
if (r.successRate < 1)
|
package/dist/router.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { accessLabel, billedCpuShare, billingRules, CATALOG, cpuHourlyAtFull, DEFAULT_MEMORY_GB, DEFAULT_VCPU, fixedSize, hourlyCost, info, unfit, vercelSandboxSize } from "./catalog.js";
|
|
2
|
+
import { accessLabel, billedCpuShare, billingRules, CATALOG, cpuHourlyAtFull, DEFAULT_MEMORY_GB, DEFAULT_VCPU, digitalOceanSize, fixedSize, hourlyCost, info, unfit, vercelSandboxSize } from "./catalog.js";
|
|
3
3
|
import { RoutedComputer, createComputer, planComputer, } from "./computers.js";
|
|
4
4
|
import { loadBench, median } from "./bench-store.js";
|
|
5
5
|
import { PUBLISHED } from "./published.js";
|
|
@@ -25,6 +25,8 @@ import { NorthflankProvider } from "./providers/northflank.js";
|
|
|
25
25
|
import { BoatProvider } from "./providers/boat.js";
|
|
26
26
|
import { ExeDevProvider } from "./providers/exedev.js";
|
|
27
27
|
import { AgentCoreProvider } from "./providers/agentcore.js";
|
|
28
|
+
import { DigitalOceanProvider } from "./providers/digitalocean.js";
|
|
29
|
+
import { GoogleAgentPlatformProvider } from "./providers/google.js";
|
|
28
30
|
import { AzureSessionsProvider } from "./providers/azure.js";
|
|
29
31
|
import { LambdaMicrovmProvider } from "./providers/lambda.js";
|
|
30
32
|
import { AlibabaProvider } from "./providers/alibaba.js";
|
|
@@ -80,6 +82,8 @@ export function defaultProviders() {
|
|
|
80
82
|
new ExeDevProvider(),
|
|
81
83
|
new AgentCoreProvider(),
|
|
82
84
|
new AzureSessionsProvider(),
|
|
85
|
+
new DigitalOceanProvider(),
|
|
86
|
+
new GoogleAgentPlatformProvider(),
|
|
83
87
|
new LambdaMicrovmProvider(),
|
|
84
88
|
new Agent37Provider(),
|
|
85
89
|
new AlibabaProvider(),
|
|
@@ -649,5 +653,10 @@ export const EXEC_GRACE_S = 30;
|
|
|
649
653
|
export function sizeOf(id, spec = {}) {
|
|
650
654
|
if (id === "vercel")
|
|
651
655
|
return vercelSandboxSize(spec);
|
|
656
|
+
if (id === "digitalocean") {
|
|
657
|
+
const shape = digitalOceanSize(spec.vcpu ?? DEFAULT_VCPU, spec.memoryGb ?? DEFAULT_MEMORY_GB);
|
|
658
|
+
if (shape)
|
|
659
|
+
return { vcpu: shape.vcpu, memoryGb: shape.memoryGb };
|
|
660
|
+
}
|
|
652
661
|
return fixedSize(id, spec) ?? { vcpu: spec.vcpu ?? DEFAULT_VCPU, memoryGb: spec.memoryGb ?? DEFAULT_MEMORY_GB };
|
|
653
662
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ProviderId = "maritime" | "e2b" | "daytona" | "modal" | "vercel" | "morph" | "sprites" | "blaxel" | "tensorlake" | "runloop" | "hopx" | "cloudflare" | "northflank" | "boat" | "exedev" | "docker" | "novita" | "langsmith" | "alibaba" | "upstash" | "koyeb" | "freestyle" | "deno" | "beam" | "codesandbox" | "azure" | "agentcore" | "lambda" | "dedalus" | "agent37" | "superserve" | "instabox" | "openscale" | "sail";
|
|
1
|
+
export type ProviderId = "maritime" | "e2b" | "daytona" | "modal" | "vercel" | "morph" | "sprites" | "blaxel" | "tensorlake" | "runloop" | "hopx" | "cloudflare" | "northflank" | "boat" | "exedev" | "docker" | "novita" | "langsmith" | "alibaba" | "upstash" | "koyeb" | "freestyle" | "deno" | "beam" | "codesandbox" | "azure" | "agentcore" | "lambda" | "dedalus" | "agent37" | "superserve" | "instabox" | "openscale" | "sail" | "digitalocean" | "google";
|
|
2
2
|
/** Things a caller can require of a provider. The router skips providers that lack one. */
|
|
3
3
|
export type Capability = "gpu" | "pause" | "ports" | "background" | "custom-image";
|
|
4
4
|
/** What the caller wants. Every field is optional; providers map it to their own knobs. */
|
|
@@ -30,7 +30,7 @@ export interface SandboxSpec {
|
|
|
30
30
|
expectedSeconds?: number;
|
|
31
31
|
/**
|
|
32
32
|
* How busy the CPU will be, 0 to 1 (default 1). Only a pricing hint: providers that bill CPU only
|
|
33
|
-
* while it's busy (Vercel, Cloudflare, Tensorlake, AgentCore, Sail, Sprites, Deno, Upstash) are priced
|
|
33
|
+
* while it's busy (Vercel, Cloudflare, Tensorlake, AgentCore, DigitalOcean, Sail, Sprites, Deno, Upstash) are priced
|
|
34
34
|
* at this share of their CPU plus their full memory, never below a provider's CPU floor. An agent that
|
|
35
35
|
* mostly waits on model calls uses about 0.1; a build or test run is close to 1.
|
|
36
36
|
*/
|
package/dist/verified.js
CHANGED
|
@@ -2,6 +2,7 @@ export const VERIFIED = {
|
|
|
2
2
|
agent37: "2026-11-13",
|
|
3
3
|
agentcore: "2026-11-13",
|
|
4
4
|
lambda: "2026-11-13",
|
|
5
|
+
beam: "2026-11-18",
|
|
5
6
|
blaxel: "2026-11-13",
|
|
6
7
|
boat: "2026-11-14",
|
|
7
8
|
cloudflare: "2026-11-13",
|
|
@@ -9,8 +10,11 @@ export const VERIFIED = {
|
|
|
9
10
|
e2b: "2026-11-13",
|
|
10
11
|
sprites: "2026-11-13",
|
|
11
12
|
freestyle: "2026-11-13",
|
|
13
|
+
google: "2026-11-18",
|
|
12
14
|
maritime: "2026-11-13",
|
|
13
15
|
modal: "2026-11-13",
|
|
16
|
+
morph: "2026-11-18",
|
|
17
|
+
northflank: "2026-11-18",
|
|
14
18
|
novita: "2026-11-13",
|
|
15
19
|
openscale: "2026-11-13",
|
|
16
20
|
sail: "2026-11-14",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sandboxrouter/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "One API for every sandbox provider: route AI agents' code by price, speed or capability, with automatic fallback. Free and open source.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"e2b": ">=2",
|
|
89
89
|
"modal": ">=0.11",
|
|
90
90
|
"morphcloud": ">=0.0.20",
|
|
91
|
+
"google-auth-library": "^10.0.0",
|
|
91
92
|
"@mobilerun/sdk": ">=6",
|
|
92
93
|
"@limrun/api": ">=0.69",
|
|
93
94
|
"@aws-sdk/client-appstream": ">=3",
|
|
@@ -116,6 +117,9 @@
|
|
|
116
117
|
"morphcloud": {
|
|
117
118
|
"optional": true
|
|
118
119
|
},
|
|
120
|
+
"google-auth-library": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
119
123
|
"@fly/sprites": {
|
|
120
124
|
"optional": true
|
|
121
125
|
},
|