withruntime 0.17.1 → 0.18.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/DAYTONA.md +33 -2
- package/compatibility-lock.json +15 -15
- package/dist/apps-cli.d.ts +12 -0
- package/dist/apps-cli.js +564 -0
- package/dist/billing-cli.d.ts +4 -2
- package/dist/billing-cli.js +27 -1
- package/dist/cli-words.js +10 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +33 -2
- package/dist/daytona/index.d.ts +61 -0
- package/dist/daytona/index.js +57 -0
- package/dist/daytona/sandbox.d.ts +2 -1
- package/dist/daytona/sandbox.js +2 -1
- package/dist/identity.js +18 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/products/apps.d.ts +6 -2
- package/dist/products/browser.d.ts +4 -2
- package/dist/products/browser.js +4 -2
- package/dist/products/builds.d.ts +11 -1
- package/dist/products/builds.js +7 -0
- package/dist/products/limits.d.ts +18 -0
- package/dist/products/observability.d.ts +1 -1
- package/dist/transport.d.ts +1 -1
- package/dist/transport.js +1 -1
- package/dist/vercel/errors.d.ts +1 -1
- package/dist/wallet.d.ts +12 -0
- package/dist/wallet.js +7 -0
- package/package.json +1 -1
package/dist/cli.d.ts
CHANGED
|
@@ -24,9 +24,13 @@ declare const kit: {
|
|
|
24
24
|
pairs: (args: Args, name: string) => {
|
|
25
25
|
[k: string]: string;
|
|
26
26
|
};
|
|
27
|
+
envPairs: (args: Args, from: NodeJS.ProcessEnv) => {
|
|
28
|
+
[k: string]: string;
|
|
29
|
+
};
|
|
27
30
|
need: (value: string | undefined, what: string) => string;
|
|
28
31
|
table: (rows: string[][]) => string;
|
|
29
32
|
usage: (message: string) => RuntimeError;
|
|
33
|
+
unknown: (what: string, word: string, choices: readonly string[]) => RuntimeError;
|
|
30
34
|
};
|
|
31
35
|
export type CliKit = typeof kit;
|
|
32
36
|
export declare function run(argv: string[], env?: NodeJS.ProcessEnv, out?: Out): Promise<number>;
|
package/dist/cli.js
CHANGED
|
@@ -109,6 +109,8 @@ Products
|
|
|
109
109
|
images Custom images from a Dockerfile, any public or private image, or a package list
|
|
110
110
|
volumes Persistent disks to attach to sandboxes
|
|
111
111
|
jobs A command in a fresh sandbox, once or on a cron schedule, with its logs
|
|
112
|
+
apps Your web server from an image or a build, copies started by requests (beta)
|
|
113
|
+
builds A connected repository's commits built into what an App deploys (beta)
|
|
112
114
|
domains Your own hostname for a sandbox's port, with HTTPS
|
|
113
115
|
ports A public TCP port to a sandbox: databases, game servers
|
|
114
116
|
ips A dedicated outbound address, for allow-lists
|
|
@@ -357,9 +359,11 @@ const kit = {
|
|
|
357
359
|
has,
|
|
358
360
|
integer,
|
|
359
361
|
pairs,
|
|
362
|
+
envPairs,
|
|
360
363
|
need: (value, what) => need(value, what),
|
|
361
364
|
table: (rows) => table(rows),
|
|
362
365
|
usage: (message) => usage(message),
|
|
366
|
+
unknown: (what, word, choices) => unknown(what, word, choices),
|
|
363
367
|
};
|
|
364
368
|
/** The product being run, so a mistake points at its own help. */
|
|
365
369
|
let product = "";
|
|
@@ -421,6 +425,8 @@ const COMMANDS = [
|
|
|
421
425
|
"images",
|
|
422
426
|
"volumes",
|
|
423
427
|
"jobs",
|
|
428
|
+
"apps",
|
|
429
|
+
"builds",
|
|
424
430
|
"domains",
|
|
425
431
|
"ports",
|
|
426
432
|
"ips",
|
|
@@ -439,6 +445,8 @@ const OWN_HELP = [
|
|
|
439
445
|
"images",
|
|
440
446
|
"volumes",
|
|
441
447
|
"jobs",
|
|
448
|
+
"apps",
|
|
449
|
+
"builds",
|
|
442
450
|
"keys",
|
|
443
451
|
"webhooks",
|
|
444
452
|
"webhook",
|
|
@@ -837,6 +845,7 @@ export async function run(argv, env = process.env, out = defaultOut(argv)) {
|
|
|
837
845
|
],
|
|
838
846
|
["used, last 24 hours", usd(l.daily.usedMicros)],
|
|
839
847
|
...(l.daily.remainingMicros === null ? [] : [["left", usd(l.daily.remainingMicros)]]),
|
|
848
|
+
...(l.credit ? [["credit", creditLine(l.credit, usd)]] : []),
|
|
840
849
|
...(l.trial ? [["free time", trialLeft(l.trial)]] : []),
|
|
841
850
|
...(spend?.pilot
|
|
842
851
|
? [
|
|
@@ -845,6 +854,8 @@ export async function run(argv, env = process.env, out = defaultOut(argv)) {
|
|
|
845
854
|
]
|
|
846
855
|
: []),
|
|
847
856
|
]), l);
|
|
857
|
+
if (l.credit?.addedBy === "agent" && !out.json)
|
|
858
|
+
out.write(`No person pays for this account, so add credit yourself: \`${me} billing topup <usd>\`.`);
|
|
848
859
|
return 0;
|
|
849
860
|
}
|
|
850
861
|
if (command === "secrets")
|
|
@@ -929,8 +940,8 @@ export async function run(argv, env = process.env, out = defaultOut(argv)) {
|
|
|
929
940
|
if (command === "billing") {
|
|
930
941
|
product = "billing";
|
|
931
942
|
const origins = connectionOrigins(env);
|
|
932
|
-
const { claimWalletAccount, openWalletAccount } = await import("./wallet.js");
|
|
933
|
-
return billingCommand(rest, parse(rest, ["wait", "new-account", "accept-terms"], ["below", "amount", "monthly"]), out, () => client(env), undefined, {
|
|
943
|
+
const { claimWalletAccount, openWalletAccount, rekeyWalletAccount } = await import("./wallet.js");
|
|
944
|
+
return billingCommand(rest, parse(rest, ["wait", "new-account", "accept-terms", "new-key"], ["below", "amount", "monthly"]), out, () => client(env), undefined, {
|
|
934
945
|
open: (input) => {
|
|
935
946
|
checkBrowserOrigins(origins);
|
|
936
947
|
return openWalletAccount(input, { authUrl: origins.auth });
|
|
@@ -939,6 +950,10 @@ export async function run(argv, env = process.env, out = defaultOut(argv)) {
|
|
|
939
950
|
checkBrowserOrigins(origins);
|
|
940
951
|
return claimWalletAccount(code, { authUrl: origins.auth });
|
|
941
952
|
},
|
|
953
|
+
rekey: (code) => {
|
|
954
|
+
checkBrowserOrigins(origins);
|
|
955
|
+
return rekeyWalletAccount(code, { authUrl: origins.auth });
|
|
956
|
+
},
|
|
942
957
|
save: (key, orgId) => {
|
|
943
958
|
checkBrowserOrigins(origins);
|
|
944
959
|
return connectionStore(env).save({
|
|
@@ -1088,6 +1103,14 @@ export async function run(argv, env = process.env, out = defaultOut(argv)) {
|
|
|
1088
1103
|
product = "job";
|
|
1089
1104
|
return jobCommand(rest, env, out);
|
|
1090
1105
|
}
|
|
1106
|
+
if (command === "app" || command === "apps") {
|
|
1107
|
+
product = "apps";
|
|
1108
|
+
return (await import("./apps-cli.js")).appsCommand(rest, env, out, () => client(env), kit);
|
|
1109
|
+
}
|
|
1110
|
+
if (command === "build" || command === "builds") {
|
|
1111
|
+
product = "builds";
|
|
1112
|
+
return (await import("./apps-cli.js")).buildsCommand(rest, out, () => client(env), kit);
|
|
1113
|
+
}
|
|
1091
1114
|
// WireGuard is inside networks: `runtime networks wireguard peer add`.
|
|
1092
1115
|
const wireguard = command === "networks" && rest[0] === "wireguard";
|
|
1093
1116
|
const networkProduct = wireguard ? "wireguard" : command;
|
|
@@ -1356,6 +1379,14 @@ export function outOfMemoryLines(memory) {
|
|
|
1356
1379
|
/** Dollars from integer microdollars: cents from a dollar up, four places
|
|
1357
1380
|
* below one, and every place below a hundredth of a cent, so a short trial
|
|
1358
1381
|
* test never reads as $0.0000. */
|
|
1382
|
+
function creditLine(c, usd) {
|
|
1383
|
+
if (c.state === "empty")
|
|
1384
|
+
return "none left: add credit to keep going";
|
|
1385
|
+
const days = c.runwayDays === null
|
|
1386
|
+
? "nothing is being spent"
|
|
1387
|
+
: `lasts about ${Math.max(1, Math.round(c.runwayDays))} ${Math.round(c.runwayDays) <= 1 ? "day" : "days"} at this month's pace`;
|
|
1388
|
+
return `${usd(c.availableMicros)} left, ${days}${c.state === "low" ? " (low)" : ""}`;
|
|
1389
|
+
}
|
|
1359
1390
|
function dollars(micros) {
|
|
1360
1391
|
const value = BigInt(micros);
|
|
1361
1392
|
const sign = value < 0n ? "-" : "";
|
package/dist/daytona/index.d.ts
CHANGED
|
@@ -19,6 +19,67 @@ export declare const SandboxState: {
|
|
|
19
19
|
readonly DESTROYED: "destroyed";
|
|
20
20
|
};
|
|
21
21
|
export type SandboxState = (typeof SandboxState)[keyof typeof SandboxState];
|
|
22
|
+
export declare const GpuType: {
|
|
23
|
+
readonly H100: "H100";
|
|
24
|
+
readonly H200: "H200";
|
|
25
|
+
readonly B200: "B200";
|
|
26
|
+
readonly B300: "B300";
|
|
27
|
+
readonly RTX_PRO_6000: "RTX-PRO-6000";
|
|
28
|
+
readonly RTX_4090: "RTX-4090";
|
|
29
|
+
readonly RTX_5090: "RTX-5090";
|
|
30
|
+
readonly MI355X: "MI355X";
|
|
31
|
+
readonly UNKNOWN_DEFAULT_OPEN_API: "11184809";
|
|
32
|
+
};
|
|
33
|
+
export type GpuType = (typeof GpuType)[keyof typeof GpuType];
|
|
34
|
+
export declare const SnapshotState: {
|
|
35
|
+
readonly BUILDING: "building";
|
|
36
|
+
readonly PENDING: "pending";
|
|
37
|
+
readonly PULLING: "pulling";
|
|
38
|
+
readonly SNAPSHOTTING: "snapshotting";
|
|
39
|
+
readonly ACTIVE: "active";
|
|
40
|
+
readonly INACTIVE: "inactive";
|
|
41
|
+
readonly ERROR: "error";
|
|
42
|
+
readonly BUILD_FAILED: "build_failed";
|
|
43
|
+
readonly REMOVING: "removing";
|
|
44
|
+
readonly UNKNOWN_DEFAULT_OPEN_API: "11184809";
|
|
45
|
+
};
|
|
46
|
+
export type SnapshotState = (typeof SnapshotState)[keyof typeof SnapshotState];
|
|
47
|
+
export declare const SandboxListSortField: {
|
|
48
|
+
readonly NAME: "name";
|
|
49
|
+
readonly CPU: "cpu";
|
|
50
|
+
readonly MEMORY_GIB: "memoryGib";
|
|
51
|
+
readonly DISK_GIB: "diskGib";
|
|
52
|
+
readonly LAST_ACTIVITY_AT: "lastActivityAt";
|
|
53
|
+
readonly CREATED_AT: "createdAt";
|
|
54
|
+
readonly UNKNOWN_DEFAULT_OPEN_API: "11184809";
|
|
55
|
+
};
|
|
56
|
+
export type SandboxListSortField = (typeof SandboxListSortField)[keyof typeof SandboxListSortField];
|
|
57
|
+
export declare const SandboxListSortDirection: {
|
|
58
|
+
readonly ASC: "asc";
|
|
59
|
+
readonly DESC: "desc";
|
|
60
|
+
readonly UNKNOWN_DEFAULT_OPEN_API: "11184809";
|
|
61
|
+
};
|
|
62
|
+
export type SandboxListSortDirection = (typeof SandboxListSortDirection)[keyof typeof SandboxListSortDirection];
|
|
63
|
+
export declare const SandboxClass: {
|
|
64
|
+
readonly LINUX_VM: "linux-vm";
|
|
65
|
+
readonly CONTAINER: "container";
|
|
66
|
+
readonly WINDOWS: "windows";
|
|
67
|
+
readonly UNKNOWN_DEFAULT_OPEN_API: "11184809";
|
|
68
|
+
};
|
|
69
|
+
export type SandboxClass = (typeof SandboxClass)[keyof typeof SandboxClass];
|
|
70
|
+
export declare const ListSecretsPaginatedSortEnum: {
|
|
71
|
+
readonly NAME: "name";
|
|
72
|
+
readonly CREATED_AT: "createdAt";
|
|
73
|
+
readonly UPDATED_AT: "updatedAt";
|
|
74
|
+
readonly UNKNOWN_DEFAULT_OPEN_API: "11184809";
|
|
75
|
+
};
|
|
76
|
+
export type ListSecretsPaginatedSortEnum = (typeof ListSecretsPaginatedSortEnum)[keyof typeof ListSecretsPaginatedSortEnum];
|
|
77
|
+
export declare const ListSecretsPaginatedOrderEnum: {
|
|
78
|
+
readonly ASC: "asc";
|
|
79
|
+
readonly DESC: "desc";
|
|
80
|
+
readonly UNKNOWN_DEFAULT_OPEN_API: "11184809";
|
|
81
|
+
};
|
|
82
|
+
export type ListSecretsPaginatedOrderEnum = (typeof ListSecretsPaginatedOrderEnum)[keyof typeof ListSecretsPaginatedOrderEnum];
|
|
22
83
|
export declare const LspLanguageId: {
|
|
23
84
|
(...args: unknown[]): never;
|
|
24
85
|
new (...args: unknown[]): never;
|
package/dist/daytona/index.js
CHANGED
|
@@ -26,6 +26,63 @@ export const SandboxState = {
|
|
|
26
26
|
DESTROYING: "destroying",
|
|
27
27
|
DESTROYED: "destroyed",
|
|
28
28
|
};
|
|
29
|
+
/* Daytona's other enums, re-exported by @daytona/sdk from its API client, so
|
|
30
|
+
code importing them loads. A GPU type on create is refused (Runtime runs
|
|
31
|
+
sandboxes on CPUs); the sort field and direction drive daytona.list. */
|
|
32
|
+
export const GpuType = {
|
|
33
|
+
H100: "H100",
|
|
34
|
+
H200: "H200",
|
|
35
|
+
B200: "B200",
|
|
36
|
+
B300: "B300",
|
|
37
|
+
RTX_PRO_6000: "RTX-PRO-6000",
|
|
38
|
+
RTX_4090: "RTX-4090",
|
|
39
|
+
RTX_5090: "RTX-5090",
|
|
40
|
+
MI355X: "MI355X",
|
|
41
|
+
UNKNOWN_DEFAULT_OPEN_API: "11184809",
|
|
42
|
+
};
|
|
43
|
+
export const SnapshotState = {
|
|
44
|
+
BUILDING: "building",
|
|
45
|
+
PENDING: "pending",
|
|
46
|
+
PULLING: "pulling",
|
|
47
|
+
SNAPSHOTTING: "snapshotting",
|
|
48
|
+
ACTIVE: "active",
|
|
49
|
+
INACTIVE: "inactive",
|
|
50
|
+
ERROR: "error",
|
|
51
|
+
BUILD_FAILED: "build_failed",
|
|
52
|
+
REMOVING: "removing",
|
|
53
|
+
UNKNOWN_DEFAULT_OPEN_API: "11184809",
|
|
54
|
+
};
|
|
55
|
+
export const SandboxListSortField = {
|
|
56
|
+
NAME: "name",
|
|
57
|
+
CPU: "cpu",
|
|
58
|
+
MEMORY_GIB: "memoryGib",
|
|
59
|
+
DISK_GIB: "diskGib",
|
|
60
|
+
LAST_ACTIVITY_AT: "lastActivityAt",
|
|
61
|
+
CREATED_AT: "createdAt",
|
|
62
|
+
UNKNOWN_DEFAULT_OPEN_API: "11184809",
|
|
63
|
+
};
|
|
64
|
+
export const SandboxListSortDirection = {
|
|
65
|
+
ASC: "asc",
|
|
66
|
+
DESC: "desc",
|
|
67
|
+
UNKNOWN_DEFAULT_OPEN_API: "11184809",
|
|
68
|
+
};
|
|
69
|
+
export const SandboxClass = {
|
|
70
|
+
LINUX_VM: "linux-vm",
|
|
71
|
+
CONTAINER: "container",
|
|
72
|
+
WINDOWS: "windows",
|
|
73
|
+
UNKNOWN_DEFAULT_OPEN_API: "11184809",
|
|
74
|
+
};
|
|
75
|
+
export const ListSecretsPaginatedSortEnum = {
|
|
76
|
+
NAME: "name",
|
|
77
|
+
CREATED_AT: "createdAt",
|
|
78
|
+
UPDATED_AT: "updatedAt",
|
|
79
|
+
UNKNOWN_DEFAULT_OPEN_API: "11184809",
|
|
80
|
+
};
|
|
81
|
+
export const ListSecretsPaginatedOrderEnum = {
|
|
82
|
+
ASC: "asc",
|
|
83
|
+
DESC: "desc",
|
|
84
|
+
UNKNOWN_DEFAULT_OPEN_API: "11184809",
|
|
85
|
+
};
|
|
29
86
|
/** A stand-in for a Daytona export Runtime has no counterpart for. Importing
|
|
30
87
|
* it works; using it throws NotSupportedError naming the alternative. */
|
|
31
88
|
function unsupportedExport(name, alternative) {
|
|
@@ -126,7 +126,8 @@ export declare class Sandbox {
|
|
|
126
126
|
/** Pauses the sandbox with its memory. */
|
|
127
127
|
pause(_timeout?: number): Promise<void>;
|
|
128
128
|
/** Runtime has no archive tier: a stopped sandbox stays paused, kept for
|
|
129
|
-
* its retention (
|
|
129
|
+
* its retention (while the account has credit, 7 days without, or
|
|
130
|
+
* autoDeleteInterval rounded up to whole days). */
|
|
130
131
|
archive(): Promise<void>;
|
|
131
132
|
/** Ends the sandbox for good. */
|
|
132
133
|
delete(_timeout?: number): Promise<void>;
|
package/dist/daytona/sandbox.js
CHANGED
|
@@ -270,7 +270,8 @@ export class Sandbox {
|
|
|
270
270
|
this.#pausedByPause = true;
|
|
271
271
|
}
|
|
272
272
|
/** Runtime has no archive tier: a stopped sandbox stays paused, kept for
|
|
273
|
-
* its retention (
|
|
273
|
+
* its retention (while the account has credit, 7 days without, or
|
|
274
|
+
* autoDeleteInterval rounded up to whole days). */
|
|
274
275
|
async archive() {
|
|
275
276
|
await this.stop();
|
|
276
277
|
}
|
package/dist/identity.js
CHANGED
|
@@ -5,8 +5,24 @@ async function requestCredentials() {
|
|
|
5
5
|
const token = process.env.RUNTIME_ID_TOKEN_REQUEST_TOKEN;
|
|
6
6
|
if (url && token)
|
|
7
7
|
return { url, token };
|
|
8
|
-
// A process started
|
|
9
|
-
|
|
8
|
+
// A process started without them (a server started before the guest wrote
|
|
9
|
+
// its environment, a sandbox whose guest software predates the variables)
|
|
10
|
+
// asks the host, which answers every running sandbox whatever its image or
|
|
11
|
+
// age, then the guest's file. Only inside a sandbox: elsewhere nothing is
|
|
12
|
+
// asked over the network.
|
|
13
|
+
if (!(await exists(sandboxMarker.path)))
|
|
14
|
+
return null;
|
|
15
|
+
return currentCredentials();
|
|
16
|
+
}
|
|
17
|
+
async function exists(path) {
|
|
18
|
+
try {
|
|
19
|
+
const { access } = await import("node:fs/promises");
|
|
20
|
+
await access(path);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
10
26
|
}
|
|
11
27
|
async function fileCredentials() {
|
|
12
28
|
try {
|
package/dist/index.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare class Sandbox extends SandboxClass {
|
|
|
72
72
|
}
|
|
73
73
|
export type { RuntimeOptions as ClientOptions };
|
|
74
74
|
export { identityToken, type IdentityToken } from "./identity.js";
|
|
75
|
-
export { openWalletAccount, claimWalletAccount, type OpenedWalletAccount, type WalletClaim, type WalletOptions, } from "./wallet.js";
|
|
75
|
+
export { openWalletAccount, claimWalletAccount, rekeyWalletAccount, type OpenedWalletAccount, type WalletClaim, type WalletRekey, type WalletOptions, } from "./wallet.js";
|
|
76
76
|
export type { Topup } from "./products/billing.js";
|
|
77
77
|
export type { NewKey, LimitedKey, LimitedKeyAction, MadeKey, ListedKey, KeyUsage, } from "./products/api-keys.js";
|
|
78
78
|
export type { SsoConnection, SsoStatus } from "./products/sso.js";
|
package/dist/index.js
CHANGED
|
@@ -47,4 +47,4 @@ export class Sandbox extends SandboxClass {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
export { identityToken } from "./identity.js";
|
|
50
|
-
export { openWalletAccount, claimWalletAccount, } from "./wallet.js";
|
|
50
|
+
export { openWalletAccount, claimWalletAccount, rekeyWalletAccount, } from "./wallet.js";
|
package/dist/products/apps.d.ts
CHANGED
|
@@ -82,6 +82,8 @@ export type AppDeploy = {
|
|
|
82
82
|
lastOutput: string;
|
|
83
83
|
};
|
|
84
84
|
});
|
|
85
|
+
/** `image`: an image of this account (id, name, name:tag or name@version),
|
|
86
|
+
* ready; the version records its id. */
|
|
85
87
|
export type DeployApp = ({
|
|
86
88
|
image: string;
|
|
87
89
|
build?: never;
|
|
@@ -93,8 +95,10 @@ export type DeployApp = ({
|
|
|
93
95
|
/** Carry the last deploy's environment, still sealed. With env, that
|
|
94
96
|
* environment with env's names set: change one value without sending the rest
|
|
95
97
|
* (needs a key that may reveal the App's secrets, secrets_reveal; else 403).
|
|
96
|
-
*
|
|
97
|
-
* environment came with
|
|
98
|
+
* For a build: only one a push to the production branch made, from the
|
|
99
|
+
* repository the environment came with. For an image: only from a key that
|
|
100
|
+
* may reveal the App's secrets, and only an environment named with an image
|
|
101
|
+
* deploy. Otherwise refused with keep_env_refused (409). */
|
|
98
102
|
keepEnv?: boolean;
|
|
99
103
|
port?: number;
|
|
100
104
|
healthPath?: string;
|
|
@@ -37,8 +37,10 @@ export type BrowserStartOptions = {
|
|
|
37
37
|
*
|
|
38
38
|
* Inside the sandbox the same browser is at http://127.0.0.1:9222. */
|
|
39
39
|
export declare function sandboxBrowser(t: Transport, sandbox: Sandbox): {
|
|
40
|
-
/** Starts Chromium and returns its CDP address.
|
|
41
|
-
* sandbox
|
|
40
|
+
/** Starts Chromium and returns its CDP address. A start in a new
|
|
41
|
+
* sandbox takes about 1 to 2 seconds: Chromium comes from the host. A
|
|
42
|
+
* sandbox from a custom image that is not Ubuntu 24.04 x86_64 installs it
|
|
43
|
+
* on the first start, about a minute; this waits for it (up to 10
|
|
42
44
|
* minutes, or the call's timeoutMs). Starting a running browser returns it
|
|
43
45
|
* as it is. */
|
|
44
46
|
start(input?: BrowserStartOptions, options?: RequestOptions): Promise<{
|
package/dist/products/browser.js
CHANGED
|
@@ -8,8 +8,10 @@ import { whileInstalling } from "../wait.js";
|
|
|
8
8
|
export function sandboxBrowser(t, sandbox) {
|
|
9
9
|
const base = () => `/v1/sandboxes/${encodeURIComponent(sandbox.id)}/browser`;
|
|
10
10
|
return {
|
|
11
|
-
/** Starts Chromium and returns its CDP address.
|
|
12
|
-
* sandbox
|
|
11
|
+
/** Starts Chromium and returns its CDP address. A start in a new
|
|
12
|
+
* sandbox takes about 1 to 2 seconds: Chromium comes from the host. A
|
|
13
|
+
* sandbox from a custom image that is not Ubuntu 24.04 x86_64 installs it
|
|
14
|
+
* on the first start, about a minute; this waits for it (up to 10
|
|
13
15
|
* minutes, or the call's timeoutMs). Starting a running browser returns it
|
|
14
16
|
* as it is. */
|
|
15
17
|
async start(input = {}, options) {
|
|
@@ -86,8 +86,12 @@ export type ListBuilds = {
|
|
|
86
86
|
name?: string;
|
|
87
87
|
label?: string[];
|
|
88
88
|
state?: BuildState[];
|
|
89
|
+
/** Only this connected repository's builds. */
|
|
90
|
+
repositoryId?: string;
|
|
91
|
+
/** Only builds of this commit, by its full sha. */
|
|
92
|
+
commit?: string;
|
|
89
93
|
};
|
|
90
|
-
export type ListRepositories = Omit<ListBuilds, "state"> & {
|
|
94
|
+
export type ListRepositories = Omit<ListBuilds, "state" | "repositoryId" | "commit"> & {
|
|
91
95
|
state?: Repository["state"][];
|
|
92
96
|
};
|
|
93
97
|
export type BuildLine = {
|
|
@@ -151,6 +155,12 @@ export declare function builds(t: Transport): {
|
|
|
151
155
|
list: (query?: ListRepositories, options?: RequestOptions) => Promise<Page<Repository>>;
|
|
152
156
|
update: (id: string, change: ChangeRepository, options?: RequestOptions) => Promise<Repository>;
|
|
153
157
|
disconnect: (id: string, options?: RequestOptions) => Promise<Repository>;
|
|
158
|
+
/** A link to install Runtime's GitHub App, open for 15 minutes: a
|
|
159
|
+
* private repository builds once its owner installs it. */
|
|
160
|
+
installGithub: (options?: RequestOptions) => Promise<{
|
|
161
|
+
url: string;
|
|
162
|
+
expiresAt: string;
|
|
163
|
+
}>;
|
|
154
164
|
};
|
|
155
165
|
};
|
|
156
166
|
export {};
|
package/dist/products/builds.js
CHANGED
|
@@ -222,6 +222,13 @@ export function builds(t) {
|
|
|
222
222
|
path: `/v1/repositories/${encodeURIComponent(id)}`,
|
|
223
223
|
...options,
|
|
224
224
|
}),
|
|
225
|
+
/** A link to install Runtime's GitHub App, open for 15 minutes: a
|
|
226
|
+
* private repository builds once its owner installs it. */
|
|
227
|
+
installGithub: (options) => t.json({
|
|
228
|
+
method: "POST",
|
|
229
|
+
path: "/v1/repositories/github:install",
|
|
230
|
+
...options,
|
|
231
|
+
}),
|
|
225
232
|
},
|
|
226
233
|
};
|
|
227
234
|
}
|
|
@@ -22,6 +22,24 @@ export type KeyLimits = {
|
|
|
22
22
|
* numbers a create past one is refused `quota_exceeded` by (its
|
|
23
23
|
* `details.limit` names the row). Null when they can't be read. */
|
|
24
24
|
account: AccountLimit[] | null;
|
|
25
|
+
/** The account's prepaid credit and how long it lasts. */
|
|
26
|
+
credit: {
|
|
27
|
+
/** Credit left to spend now, in microdollars. */
|
|
28
|
+
availableMicros: string;
|
|
29
|
+
/** What the account spends in a day at this month's pace, or null when
|
|
30
|
+
* nothing has been spent yet. */
|
|
31
|
+
dailyPaceMicros: string | null;
|
|
32
|
+
/** Days the credit lasts at that pace, or null when nothing is being spent. */
|
|
33
|
+
runwayDays: number | null;
|
|
34
|
+
/** `state` is "low" when the runway is under this many days. */
|
|
35
|
+
lowBelowDays: number;
|
|
36
|
+
/** ok: enough. low: under `lowBelowDays` of runway. empty: none left. */
|
|
37
|
+
state: "ok" | "low" | "empty";
|
|
38
|
+
/** owner: a person pays for this account. agent: it was opened with a
|
|
39
|
+
* wallet and no person pays, so its own agent adds credit with
|
|
40
|
+
* `runtime billing topup <usd>`. */
|
|
41
|
+
addedBy: "owner" | "agent";
|
|
42
|
+
};
|
|
25
43
|
};
|
|
26
44
|
/** One of the account's limits, as https://withruntime.com/account/limits shows it. */
|
|
27
45
|
export type AccountLimit = {
|
|
@@ -35,7 +35,7 @@ export type SandboxMetrics = {
|
|
|
35
35
|
latest: MetricPoint | null;
|
|
36
36
|
points: MetricPoint[];
|
|
37
37
|
};
|
|
38
|
-
export type WebhookEventType = "sandbox.created" | "sandbox.running" | "sandbox.paused" | "sandbox.woken" | "sandbox.stopped" | "sandbox.start_failed" | "sandbox.wake_failed" | "sandbox.host_unreachable" | "sandbox.host_reachable" | "sandbox.recovered" | "sandbox.recovery_failed" | "sandbox.files.changed" | "sandbox.out_of_memory" | "sandbox.secret_not_applied" | "snapshot.ready" | "snapshot.failed" | "snapshot.deleted" | "volume.ready" | "volume.failed" | "volume.deleted" | "volume.recovered" | "egress_secret.created" | "egress_secret.updated" | "egress_secret.deleted" | "upstream_proxy.set" | "upstream_proxy.removed";
|
|
38
|
+
export type WebhookEventType = "sandbox.created" | "sandbox.running" | "sandbox.paused" | "sandbox.woken" | "sandbox.stopped" | "sandbox.start_failed" | "sandbox.wake_failed" | "sandbox.host_unreachable" | "sandbox.host_reachable" | "sandbox.recovered" | "sandbox.recovery_failed" | "sandbox.files.changed" | "sandbox.out_of_memory" | "sandbox.secret_not_applied" | "snapshot.ready" | "snapshot.failed" | "snapshot.deleted" | "volume.ready" | "volume.failed" | "volume.deleted" | "volume.recovered" | "egress_secret.created" | "egress_secret.updated" | "egress_secret.deleted" | "upstream_proxy.set" | "upstream_proxy.removed" | "credit.low" | "credit.empty";
|
|
39
39
|
/** An event as /v1/events lists it and a webhook delivers it. */
|
|
40
40
|
export type RuntimeEvent = {
|
|
41
41
|
id: string;
|
package/dist/transport.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RuntimeError } from "./errors.js";
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.18.0";
|
|
3
3
|
export declare const DEFAULT_BASE_URL = "https://api.withruntime.com";
|
|
4
4
|
/** Runtime's API as code inside a Runtime sandbox reaches it: the sandbox's
|
|
5
5
|
* own host sends each request on to DEFAULT_BASE_URL over HTTPS. The API runs
|
package/dist/transport.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectionError, DELIBERATE, errorFor, NOTHING_RAN, RuntimeError, WAITS_FOR_ROOM, } from "./errors.js";
|
|
2
2
|
import { describeRoute, envFetch, openWebSocket } from "./proxy.js";
|
|
3
3
|
import { warningText } from "./product-renames.js";
|
|
4
|
-
export const VERSION = "0.
|
|
4
|
+
export const VERSION = "0.18.0";
|
|
5
5
|
export const DEFAULT_BASE_URL = "https://api.withruntime.com";
|
|
6
6
|
/** Runtime's API as code inside a Runtime sandbox reaches it: the sandbox's
|
|
7
7
|
* own host sends each request on to DEFAULT_BASE_URL over HTTPS. The API runs
|
package/dist/vercel/errors.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare function translate(error: unknown, sandboxName?: string): unknown
|
|
|
45
45
|
export declare function guard<T>(work: () => Promise<T>, sandboxName?: string): Promise<T>;
|
|
46
46
|
/** A node:fs-style error, as Vercel's `sandbox.fs` throws. */
|
|
47
47
|
export declare function fsError(code: "ENOENT" | "EEXIST" | "EISDIR" | "ENOTDIR" | "EACCES" | "ENOTEMPTY" | "EINVAL", syscall: string, path: string): Error & {
|
|
48
|
-
code: "ENOENT" | "
|
|
48
|
+
code: "ENOENT" | "EEXIST" | "ENOTDIR" | "EISDIR" | "EACCES" | "ENOTEMPTY" | "EINVAL";
|
|
49
49
|
errno: number;
|
|
50
50
|
syscall: string;
|
|
51
51
|
path: string;
|
package/dist/wallet.d.ts
CHANGED
|
@@ -20,6 +20,14 @@ export type WalletClaim = {
|
|
|
20
20
|
/** What to do now, such as sending the top-up again when it has no address. */
|
|
21
21
|
next?: string;
|
|
22
22
|
};
|
|
23
|
+
export type WalletRekey = {
|
|
24
|
+
status: "replaced";
|
|
25
|
+
orgId: string;
|
|
26
|
+
/** The new key, shown once. The old one no longer works. */
|
|
27
|
+
apiKey: string;
|
|
28
|
+
/** The id of the key this replaced, or null when there was none to revoke. */
|
|
29
|
+
revokedKeyId: string | null;
|
|
30
|
+
};
|
|
23
31
|
/** Opens an account and a stablecoin top-up of `usd` dollars ($10 to $500,
|
|
24
32
|
* a new account's first week).
|
|
25
33
|
* `acceptTerms` must be true: opening one means agreeing to
|
|
@@ -31,3 +39,7 @@ export declare function openWalletAccount(input: {
|
|
|
31
39
|
/** Exchanges a paid account's claim code for its API key, once. Until the
|
|
32
40
|
* payment arrives it answers the top-up's status instead; call it again. */
|
|
33
41
|
export declare function claimWalletAccount(claimCode: string, options?: WalletOptions): Promise<WalletClaim>;
|
|
42
|
+
/** Replaces a lost API key with a new one, using the account's claim code. The
|
|
43
|
+
* account's every other key stops working. Refused (409) when the first key was never claimed or
|
|
44
|
+
* a person took the account over, and (429) past 3 times in 24 hours. */
|
|
45
|
+
export declare function rekeyWalletAccount(claimCode: string, options?: WalletOptions): Promise<WalletRekey>;
|
package/dist/wallet.js
CHANGED
|
@@ -47,3 +47,10 @@ export async function claimWalletAccount(claimCode, options = {}) {
|
|
|
47
47
|
const [, claim] = await post(options, "/api/wallet/claim", { claimCode });
|
|
48
48
|
return claim;
|
|
49
49
|
}
|
|
50
|
+
/** Replaces a lost API key with a new one, using the account's claim code. The
|
|
51
|
+
* account's every other key stops working. Refused (409) when the first key was never claimed or
|
|
52
|
+
* a person took the account over, and (429) past 3 times in 24 hours. */
|
|
53
|
+
export async function rekeyWalletAccount(claimCode, options = {}) {
|
|
54
|
+
const [, rekey] = await post(options, "/api/wallet/rekey", { claimCode });
|
|
55
|
+
return rekey;
|
|
56
|
+
}
|