@sandboxrouter/sdk 0.1.0 → 0.3.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 +271 -62
- package/dist/bench.js +4 -4
- package/dist/catalog.d.ts +232 -3
- package/dist/catalog.js +569 -14
- package/dist/check.d.ts +28 -0
- package/dist/check.js +185 -0
- package/dist/cli.js +149 -12
- package/dist/computers.d.ts +55 -13
- package/dist/computers.js +132 -6
- package/dist/conformance.d.ts +46 -0
- package/dist/conformance.js +65 -0
- package/dist/cost.d.ts +67 -0
- package/dist/cost.js +153 -0
- package/dist/gc.d.ts +29 -0
- package/dist/gc.js +54 -0
- package/dist/index.d.ts +34 -2
- package/dist/index.js +34 -2
- package/dist/leaderboard.d.ts +6 -0
- package/dist/leaderboard.js +5 -4
- package/dist/ledger.d.ts +38 -0
- package/dist/ledger.js +89 -0
- package/dist/providers/agent37.d.ts +40 -0
- package/dist/providers/agent37.js +224 -0
- package/dist/providers/agentcore.d.ts +71 -0
- package/dist/providers/agentcore.js +446 -0
- package/dist/providers/alibaba.d.ts +18 -0
- package/dist/providers/alibaba.js +106 -0
- package/dist/providers/azure.d.ts +43 -0
- package/dist/providers/azure.js +330 -0
- package/dist/providers/beam.d.ts +11 -0
- package/dist/providers/beam.js +179 -0
- package/dist/providers/blaxel.d.ts +3 -1
- package/dist/providers/blaxel.js +32 -22
- package/dist/providers/boat.d.ts +25 -0
- package/dist/providers/boat.js +263 -0
- package/dist/providers/cloudflare.d.ts +30 -0
- package/dist/providers/cloudflare.js +152 -0
- package/dist/providers/codesandbox.d.ts +59 -0
- package/dist/providers/codesandbox.js +287 -0
- package/dist/providers/daytona.d.ts +25 -4
- package/dist/providers/daytona.js +449 -28
- package/dist/providers/dedalus.d.ts +12 -0
- package/dist/providers/dedalus.js +244 -0
- package/dist/providers/deno.d.ts +50 -0
- package/dist/providers/deno.js +170 -0
- package/dist/providers/docker.d.ts +17 -0
- package/dist/providers/docker.js +154 -0
- package/dist/providers/e2b.d.ts +70 -3
- package/dist/providers/e2b.js +376 -8
- package/dist/providers/exedev.d.ts +23 -0
- package/dist/providers/exedev.js +290 -0
- package/dist/providers/freestyle.d.ts +49 -0
- package/dist/providers/freestyle.js +261 -0
- package/dist/providers/hopx.d.ts +15 -0
- package/dist/providers/hopx.js +177 -0
- package/dist/providers/instabox.d.ts +76 -0
- package/dist/providers/instabox.js +360 -0
- package/dist/providers/koyeb.d.ts +71 -0
- package/dist/providers/koyeb.js +379 -0
- package/dist/providers/lambda.d.ts +51 -0
- package/dist/providers/lambda.js +467 -0
- package/dist/providers/langsmith.d.ts +16 -0
- package/dist/providers/langsmith.js +149 -0
- package/dist/providers/limrun.d.ts +77 -0
- package/dist/providers/limrun.js +626 -0
- package/dist/providers/maritime.d.ts +5 -1
- package/dist/providers/maritime.js +39 -8
- package/dist/providers/mobilerun.d.ts +44 -0
- package/dist/providers/mobilerun.js +417 -0
- package/dist/providers/modal.js +12 -4
- package/dist/providers/morph.js +12 -4
- package/dist/providers/northflank.d.ts +21 -0
- package/dist/providers/northflank.js +259 -0
- package/dist/providers/novita.d.ts +12 -0
- package/dist/providers/novita.js +81 -0
- package/dist/providers/openscale.d.ts +17 -0
- package/dist/providers/openscale.js +87 -0
- package/dist/providers/orgo.d.ts +45 -0
- package/dist/providers/orgo.js +414 -0
- package/dist/providers/sail.d.ts +32 -0
- package/dist/providers/sail.js +372 -0
- package/dist/providers/superserve.d.ts +25 -0
- package/dist/providers/superserve.js +337 -0
- package/dist/providers/tensorlake.js +17 -14
- package/dist/providers/upstash.d.ts +30 -0
- package/dist/providers/upstash.js +258 -0
- package/dist/providers/vercel.js +14 -3
- package/dist/providers/workspaces.d.ts +60 -0
- package/dist/providers/workspaces.js +662 -0
- package/dist/router.d.ts +36 -5
- package/dist/router.js +174 -25
- package/dist/server.d.ts +1 -1
- package/dist/server.js +22 -3
- package/dist/types.d.ts +18 -6
- package/dist/util.d.ts +28 -1
- package/dist/util.js +56 -7
- package/package.json +106 -17
package/dist/catalog.d.ts
CHANGED
|
@@ -16,20 +16,249 @@ export interface ProviderInfo {
|
|
|
16
16
|
maxVcpu: number;
|
|
17
17
|
maxMemoryGb: number;
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* The size every sandbox gets unless a custom image (template, snapshot) is passed, whatever
|
|
21
|
+
* vcpu/memoryGb ask for. Measured inside real sandboxes (nproc, MemTotal). The router skips the
|
|
22
|
+
* provider for requests bigger than this and prices it at this size.
|
|
23
|
+
*/
|
|
24
|
+
defaultSize?: {
|
|
25
|
+
vcpu: number;
|
|
26
|
+
memoryGb: number;
|
|
27
|
+
measured: string;
|
|
28
|
+
};
|
|
29
|
+
/** Runs on your own machine (Docker). Never chosen automatically; name it to use it. */
|
|
30
|
+
local?: boolean;
|
|
19
31
|
/** Env vars the adapter reads. Any one group being fully set means "configured". */
|
|
20
32
|
credentials: string[][];
|
|
21
33
|
docs: string;
|
|
34
|
+
/**
|
|
35
|
+
* Set when you can't just sign up and get a key: "waitlist" (invite or beta only) or "closed"
|
|
36
|
+
* (not taking new accounts). Existing accounts keep working, so routing is unchanged: the router
|
|
37
|
+
* only ever uses providers you have keys for.
|
|
38
|
+
*/
|
|
39
|
+
access?: {
|
|
40
|
+
status: "waitlist" | "closed";
|
|
41
|
+
note: string;
|
|
42
|
+
checked: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* "allocated": you pay for the size you asked for while it runs. "active-cpu": CPU is charged only
|
|
46
|
+
* while it's busy, so the listed price (every core busy) is the most an hour can cost; idle agents pay less.
|
|
47
|
+
*/
|
|
48
|
+
billing: "allocated" | "active-cpu";
|
|
49
|
+
/**
|
|
50
|
+
* The cheapest monthly plan you need before you can create sandboxes through the API. Absent when a
|
|
51
|
+
* free tier or plain pay-as-you-go works. `credited`: the fee comes back as usage credit.
|
|
52
|
+
* `unclear`: the pricing page doesn't say whether a free tier can use the API.
|
|
53
|
+
*/
|
|
54
|
+
plan?: {
|
|
55
|
+
usdMonth: number;
|
|
56
|
+
credited: boolean;
|
|
57
|
+
unclear?: boolean;
|
|
58
|
+
note: string;
|
|
59
|
+
checked: string;
|
|
60
|
+
};
|
|
22
61
|
}
|
|
62
|
+
/** Short label for a gated provider's sign-up status, or null when anyone can sign up. */
|
|
63
|
+
export declare function accessLabel(id: ProviderId): string | null;
|
|
64
|
+
/** Short label for the plan a provider needs before you can use it: "none", "$20/mo (credited)", "$5/mo". */
|
|
65
|
+
export declare function planLabel(id: ProviderId): string;
|
|
23
66
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
67
|
+
* The order tables list providers in (README, CLI, website): providers anyone can sign up for that can
|
|
68
|
+
* take this size, cheapest first, ties alphabetical; then waitlisted or closed sign-ups; then providers
|
|
69
|
+
* that can't take the size; then Docker. The router uses the same price order, but only among providers
|
|
70
|
+
* you have keys for, so a gated provider only gets work if you already have an account there.
|
|
27
71
|
*/
|
|
72
|
+
export declare function listingOrder(spec?: SandboxSpec): ProviderInfo[];
|
|
28
73
|
export declare const CATALOG: ProviderInfo[];
|
|
74
|
+
/** Cloudflare only rents fixed instance types: https://developers.cloudflare.com/containers/platform/limits/ */
|
|
75
|
+
export declare const CLOUDFLARE_INSTANCES: readonly [{
|
|
76
|
+
readonly name: "lite";
|
|
77
|
+
readonly vcpu: number;
|
|
78
|
+
readonly memoryGb: 0.25;
|
|
79
|
+
}, {
|
|
80
|
+
readonly name: "basic";
|
|
81
|
+
readonly vcpu: number;
|
|
82
|
+
readonly memoryGb: 1;
|
|
83
|
+
}, {
|
|
84
|
+
readonly name: "standard-1";
|
|
85
|
+
readonly vcpu: number;
|
|
86
|
+
readonly memoryGb: 4;
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "standard-2";
|
|
89
|
+
readonly vcpu: 1;
|
|
90
|
+
readonly memoryGb: 6;
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: "standard-3";
|
|
93
|
+
readonly vcpu: 2;
|
|
94
|
+
readonly memoryGb: 8;
|
|
95
|
+
}, {
|
|
96
|
+
readonly name: "standard-4";
|
|
97
|
+
readonly vcpu: 4;
|
|
98
|
+
readonly memoryGb: 12;
|
|
99
|
+
}];
|
|
100
|
+
/** CodeSandbox VM tiers: https://docs.together.ai/docs/together-code-sandbox-legacy (Pico supports 2 vCPU / 1 GB). */
|
|
101
|
+
export declare const CODESANDBOX_TIERS: readonly [{
|
|
102
|
+
readonly name: "Pico";
|
|
103
|
+
readonly vcpu: 2;
|
|
104
|
+
readonly memoryGb: 1;
|
|
105
|
+
readonly usdHour: 0.0743;
|
|
106
|
+
}, {
|
|
107
|
+
readonly name: "Nano";
|
|
108
|
+
readonly vcpu: 2;
|
|
109
|
+
readonly memoryGb: 4;
|
|
110
|
+
readonly usdHour: 0.1486;
|
|
111
|
+
}, {
|
|
112
|
+
readonly name: "Micro";
|
|
113
|
+
readonly vcpu: 4;
|
|
114
|
+
readonly memoryGb: 8;
|
|
115
|
+
readonly usdHour: 0.2972;
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "Small";
|
|
118
|
+
readonly vcpu: 8;
|
|
119
|
+
readonly memoryGb: 16;
|
|
120
|
+
readonly usdHour: 0.5944;
|
|
121
|
+
}, {
|
|
122
|
+
readonly name: "Medium";
|
|
123
|
+
readonly vcpu: 16;
|
|
124
|
+
readonly memoryGb: 32;
|
|
125
|
+
readonly usdHour: 1.1888;
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "Large";
|
|
128
|
+
readonly vcpu: 32;
|
|
129
|
+
readonly memoryGb: 64;
|
|
130
|
+
readonly usdHour: 2.3776;
|
|
131
|
+
}, {
|
|
132
|
+
readonly name: "XLarge";
|
|
133
|
+
readonly vcpu: 64;
|
|
134
|
+
readonly memoryGb: 128;
|
|
135
|
+
readonly usdHour: 4.7552;
|
|
136
|
+
}];
|
|
137
|
+
/** Smallest tier with at least the requested vCPUs and memory (the largest if nothing fits). */
|
|
138
|
+
export declare function codesandboxTier(vcpu: number, memoryGb: number): {
|
|
139
|
+
readonly name: "Pico";
|
|
140
|
+
readonly vcpu: 2;
|
|
141
|
+
readonly memoryGb: 1;
|
|
142
|
+
readonly usdHour: 0.0743;
|
|
143
|
+
} | {
|
|
144
|
+
readonly name: "Nano";
|
|
145
|
+
readonly vcpu: 2;
|
|
146
|
+
readonly memoryGb: 4;
|
|
147
|
+
readonly usdHour: 0.1486;
|
|
148
|
+
} | {
|
|
149
|
+
readonly name: "Micro";
|
|
150
|
+
readonly vcpu: 4;
|
|
151
|
+
readonly memoryGb: 8;
|
|
152
|
+
readonly usdHour: 0.2972;
|
|
153
|
+
} | {
|
|
154
|
+
readonly name: "Small";
|
|
155
|
+
readonly vcpu: 8;
|
|
156
|
+
readonly memoryGb: 16;
|
|
157
|
+
readonly usdHour: 0.5944;
|
|
158
|
+
} | {
|
|
159
|
+
readonly name: "Medium";
|
|
160
|
+
readonly vcpu: 16;
|
|
161
|
+
readonly memoryGb: 32;
|
|
162
|
+
readonly usdHour: 1.1888;
|
|
163
|
+
} | {
|
|
164
|
+
readonly name: "Large";
|
|
165
|
+
readonly vcpu: 32;
|
|
166
|
+
readonly memoryGb: 64;
|
|
167
|
+
readonly usdHour: 2.3776;
|
|
168
|
+
} | {
|
|
169
|
+
readonly name: "XLarge";
|
|
170
|
+
readonly vcpu: 64;
|
|
171
|
+
readonly memoryGb: 128;
|
|
172
|
+
readonly usdHour: 4.7552;
|
|
173
|
+
};
|
|
174
|
+
/** Upstash Box sizes (https://upstash.com/docs/box/overall/how-it-works.md#box-size). */
|
|
175
|
+
export declare const UPSTASH_SIZES: readonly [{
|
|
176
|
+
readonly size: "small";
|
|
177
|
+
readonly vcpu: 2;
|
|
178
|
+
readonly memoryGb: 4;
|
|
179
|
+
}, {
|
|
180
|
+
readonly size: "medium";
|
|
181
|
+
readonly vcpu: 4;
|
|
182
|
+
readonly memoryGb: 8;
|
|
183
|
+
}, {
|
|
184
|
+
readonly size: "large";
|
|
185
|
+
readonly vcpu: 8;
|
|
186
|
+
readonly memoryGb: 16;
|
|
187
|
+
}];
|
|
188
|
+
export declare function upstashSize(vcpu: number, memoryGb: number): {
|
|
189
|
+
readonly size: "small";
|
|
190
|
+
readonly vcpu: 2;
|
|
191
|
+
readonly memoryGb: 4;
|
|
192
|
+
} | {
|
|
193
|
+
readonly size: "medium";
|
|
194
|
+
readonly vcpu: 4;
|
|
195
|
+
readonly memoryGb: 8;
|
|
196
|
+
} | {
|
|
197
|
+
readonly size: "large";
|
|
198
|
+
readonly vcpu: 8;
|
|
199
|
+
readonly memoryGb: 16;
|
|
200
|
+
};
|
|
201
|
+
/** Boat's fixed machine sizes and hourly prices: https://docs.boat.dev/machines.md */
|
|
202
|
+
export declare const BOAT_SIZES: readonly [{
|
|
203
|
+
readonly type: "small";
|
|
204
|
+
readonly vcpu: 2;
|
|
205
|
+
readonly memoryGb: 4;
|
|
206
|
+
readonly usdHour: 0.018;
|
|
207
|
+
}, {
|
|
208
|
+
readonly type: "default";
|
|
209
|
+
readonly vcpu: 4;
|
|
210
|
+
readonly memoryGb: 8;
|
|
211
|
+
readonly usdHour: 0.036;
|
|
212
|
+
}, {
|
|
213
|
+
readonly type: "large";
|
|
214
|
+
readonly vcpu: 8;
|
|
215
|
+
readonly memoryGb: 16;
|
|
216
|
+
readonly usdHour: 0.072;
|
|
217
|
+
}, {
|
|
218
|
+
readonly type: "xlarge";
|
|
219
|
+
readonly vcpu: 16;
|
|
220
|
+
readonly memoryGb: 32;
|
|
221
|
+
readonly usdHour: 0.2;
|
|
222
|
+
}];
|
|
223
|
+
export declare function cloudflareInstance(vcpu: number, memoryGb: number): {
|
|
224
|
+
readonly name: "lite";
|
|
225
|
+
readonly vcpu: number;
|
|
226
|
+
readonly memoryGb: 0.25;
|
|
227
|
+
} | {
|
|
228
|
+
readonly name: "basic";
|
|
229
|
+
readonly vcpu: number;
|
|
230
|
+
readonly memoryGb: 1;
|
|
231
|
+
} | {
|
|
232
|
+
readonly name: "standard-1";
|
|
233
|
+
readonly vcpu: number;
|
|
234
|
+
readonly memoryGb: 4;
|
|
235
|
+
} | {
|
|
236
|
+
readonly name: "standard-2";
|
|
237
|
+
readonly vcpu: 1;
|
|
238
|
+
readonly memoryGb: 6;
|
|
239
|
+
} | {
|
|
240
|
+
readonly name: "standard-3";
|
|
241
|
+
readonly vcpu: 2;
|
|
242
|
+
readonly memoryGb: 8;
|
|
243
|
+
} | {
|
|
244
|
+
readonly name: "standard-4";
|
|
245
|
+
readonly vcpu: 4;
|
|
246
|
+
readonly memoryGb: 12;
|
|
247
|
+
};
|
|
29
248
|
export declare function info(id: ProviderId): ProviderInfo;
|
|
30
249
|
export declare const DEFAULT_VCPU = 2;
|
|
31
250
|
export declare const DEFAULT_MEMORY_GB = 4;
|
|
32
251
|
/** Estimated USD per hour for this spec on this provider (list price, while running). */
|
|
252
|
+
/** The size the sandbox will really have when it's fixed by the default image, else null. */
|
|
253
|
+
export declare function fixedSize(id: ProviderId, spec?: SandboxSpec): {
|
|
254
|
+
vcpu: number;
|
|
255
|
+
memoryGb: number;
|
|
256
|
+
} | null;
|
|
257
|
+
/** A spec this provider can take as-is: its default size if it has one, else the router default. */
|
|
258
|
+
export declare function fittingSpec(id: ProviderId): {
|
|
259
|
+
vcpu: number;
|
|
260
|
+
memoryGb: number;
|
|
261
|
+
};
|
|
33
262
|
export declare function hourlyCost(id: ProviderId, spec?: SandboxSpec): number;
|
|
34
263
|
/** Why a provider can't take this spec, or null if it can. */
|
|
35
264
|
export declare function unfit(id: ProviderId, spec: SandboxSpec, require?: Capability[]): string | null;
|