withruntime 0.48.0 → 0.49.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/dist/cli-update.js +2 -2
- package/dist/cli.js +8 -3
- package/dist/errors.js +3 -0
- package/dist/transport.d.ts +1 -1
- package/dist/transport.js +1 -1
- package/dist/types.d.ts +12 -1
- package/package.json +1 -1
package/dist/cli-update.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// is older. Nothing is asked on any other path, in CI, or when
|
|
7
7
|
// RUNTIME_NO_UPDATE_CHECK is set.
|
|
8
8
|
import { envFetch } from "./proxy.js";
|
|
9
|
-
import { VERSION } from "./transport.js";
|
|
9
|
+
import { timeoutSignal, VERSION } from "./transport.js";
|
|
10
10
|
export const LATEST_URL = "https://registry.npmjs.org/withruntime/latest";
|
|
11
11
|
const ASK_MS = 1_500;
|
|
12
12
|
const parts = (v) => /^(\d+)\.(\d+)\.(\d+)$/.exec(v.trim())?.slice(1).map(Number);
|
|
@@ -31,7 +31,7 @@ export async function outdatedLine(opts) {
|
|
|
31
31
|
try {
|
|
32
32
|
const response = await (opts.fetch ?? envFetch)(LATEST_URL, {
|
|
33
33
|
headers: { accept: "application/json" },
|
|
34
|
-
signal:
|
|
34
|
+
signal: timeoutSignal(opts.timeoutMs ?? ASK_MS),
|
|
35
35
|
});
|
|
36
36
|
if (!response.ok)
|
|
37
37
|
return "";
|
package/dist/cli.js
CHANGED
|
@@ -1400,8 +1400,11 @@ export async function run(argv, env = process.env, out = defaultOut(argv)) {
|
|
|
1400
1400
|
return (await import("./apps-cli.js")).containersCommand(rest, env, out, () => client(env), kit);
|
|
1401
1401
|
}
|
|
1402
1402
|
if (["browser", "browsers", "desktop", "desktops"].includes(command)) {
|
|
1403
|
-
product
|
|
1404
|
-
|
|
1403
|
+
// Its own constant: `product` is the module's, and another run in the same
|
|
1404
|
+
// process can change it while the import is awaited.
|
|
1405
|
+
const which = (command.endsWith("s") ? command : `${command}s`);
|
|
1406
|
+
product = which;
|
|
1407
|
+
return (await import("./browsers-cli.js")).machineProductCommand(which, rest, out, () => client(env), kit);
|
|
1405
1408
|
}
|
|
1406
1409
|
if (command === "agent" || command === "agents") {
|
|
1407
1410
|
product = "agents";
|
|
@@ -1576,6 +1579,8 @@ function usageSummary(u) {
|
|
|
1576
1579
|
rows.push(["expired or taken back", dollars(micros(u.expired))]);
|
|
1577
1580
|
if (u.trial)
|
|
1578
1581
|
rows.push(["free time", trialLeft(u.trial)]);
|
|
1582
|
+
if (u.freeUsageHold)
|
|
1583
|
+
rows.push(["no free time", u.freeUsageHold.message]);
|
|
1579
1584
|
if (u.allowances)
|
|
1580
1585
|
rows.push(...allowanceRows(u.allowances));
|
|
1581
1586
|
// Only a data property is an older server's answer. Do not invoke SDK
|
|
@@ -2302,7 +2307,7 @@ async function sandbox(argv, env, out) {
|
|
|
2302
2307
|
case "never-park": {
|
|
2303
2308
|
// Runtime's own operator only, so not in the help: the release path's
|
|
2304
2309
|
// sandboxes (the release signer's, the agents' hub) are never parked to
|
|
2305
|
-
// make room (
|
|
2310
|
+
// make room (28 October 2026). The API refuses it for any other
|
|
2306
2311
|
// organization, and for a key that is not an owner's, an admin's or
|
|
2307
2312
|
// account-wide (20261028190617_cloud_never_park.sql).
|
|
2308
2313
|
const args = parse(rest, [], []);
|
package/dist/errors.js
CHANGED
|
@@ -52,6 +52,9 @@ export const WAITS_FOR_ROOM = new Set([
|
|
|
52
52
|
// A volume whose last sandbox is stopping: free once the stop lets go of
|
|
53
53
|
// its disk, up to about a minute (measured 50 to 60 s, 6 October 2026).
|
|
54
54
|
"volume_releasing",
|
|
55
|
+
// A paused sandbox moving to another server: its wake goes once its pause
|
|
56
|
+
// is copied, a minute or two.
|
|
57
|
+
"sandbox_moving",
|
|
55
58
|
]);
|
|
56
59
|
export class RuntimeError extends Error {
|
|
57
60
|
code;
|
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.49.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, untrustedCertificate } from "./proxy.js";
|
|
3
3
|
import { warningText } from "./product-renames.js";
|
|
4
|
-
export const VERSION = "0.
|
|
4
|
+
export const VERSION = "0.49.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/types.d.ts
CHANGED
|
@@ -381,7 +381,9 @@ export type Usage = {
|
|
|
381
381
|
* milliseconds, or null when it has none. `totalMs` and `usedMs` count free
|
|
382
382
|
* hours given before 5 October 2026 (0 for an account given none);
|
|
383
383
|
* `availableMs` is the larger of those hours left and this month's included
|
|
384
|
-
* usage, as time at 2 vCPU and 4 GiB
|
|
384
|
+
* usage, as time at 2 vCPU and 4 GiB, after what running sandboxes hold: a
|
|
385
|
+
* create without credit is refused exactly when it is 0. The field keeps
|
|
386
|
+
* its older name. */
|
|
385
387
|
trial: {
|
|
386
388
|
totalMs: number;
|
|
387
389
|
usedMs: number;
|
|
@@ -395,6 +397,15 @@ export type Usage = {
|
|
|
395
397
|
/** When the free usage renews: the 1st of next month, 00:00 UTC. */
|
|
396
398
|
renewsAt?: string;
|
|
397
399
|
} | null;
|
|
400
|
+
/** Why the account has no free machine time, or null: `reason` is
|
|
401
|
+
* `withheld`, `hosting` (opened from a data-center or VPN network),
|
|
402
|
+
* `region` (opened outside the listed countries), `card` (opened by email,
|
|
403
|
+
* no card saved yet), `no-source` or `unknown`, and `message` says it and
|
|
404
|
+
* what starts it. Absent from an API older than 30 October 2026. */
|
|
405
|
+
freeUsageHold?: {
|
|
406
|
+
reason: string;
|
|
407
|
+
message: string;
|
|
408
|
+
} | null;
|
|
398
409
|
/** What the account uses free this calendar month (UTC), one row per
|
|
399
410
|
* product, drawn before credit and never charged
|
|
400
411
|
* (https://withruntime.com/docs/included-usage). */
|