withruntime 0.12.0 → 0.14.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 +3 -3
- package/README.src.md +2 -2
- package/dist/billing-cli.js +8 -4
- package/dist/blaxel/sandbox.d.ts +1 -1
- package/dist/blaxel/sandbox.js +1 -1
- package/dist/cli.d.ts +17 -2
- package/dist/cli.js +242 -69
- package/dist/credentials.d.ts +3 -0
- package/dist/credentials.js +15 -0
- package/dist/daytona/daytona.d.ts +1 -1
- package/dist/daytona/daytona.js +1 -1
- package/dist/e2b/sandbox.d.ts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/machine.d.ts +15 -1
- package/dist/machine.js +26 -11
- package/dist/mcp.js +144 -20
- package/dist/products/api-keys.d.ts +73 -0
- package/dist/products/api-keys.js +23 -0
- package/dist/products/apps.d.ts +12 -31
- package/dist/products/apps.js +8 -113
- package/dist/products/balancers.d.ts +87 -0
- package/dist/products/balancers.js +8 -0
- package/dist/products/builds.d.ts +30 -0
- package/dist/products/builds.js +6 -0
- package/dist/products/index.d.ts +2 -0
- package/dist/products/index.js +2 -0
- package/dist/products/jobs.d.ts +2 -2
- package/dist/products/jobs.js +1 -1
- package/dist/products/observability.d.ts +7 -2
- package/dist/products/resources.d.ts +54 -0
- package/dist/products/resources.js +122 -0
- package/dist/products/secrets.d.ts +22 -0
- package/dist/products/secrets.js +8 -0
- package/dist/products/volumes.d.ts +3 -0
- package/dist/sandbox.d.ts +4 -0
- package/dist/sandbox.js +27 -2
- package/dist/transport.d.ts +4 -1
- package/dist/transport.js +25 -4
- package/dist/types.d.ts +9 -5
- package/dist/vercel/sandbox.d.ts +1 -1
- package/dist/vercel/sandbox.js +1 -1
- package/dist/wallet.d.ts +4 -1
- package/dist/wallet.js +2 -1
- package/package.json +2 -14
- package/dist/cli/logs.test.d.ts +0 -1
- package/dist/cli/logs.test.js +0 -272
- package/dist/products/logs.test.d.ts +0 -1
- package/dist/products/logs.test.js +0 -343
package/README.md
CHANGED
|
@@ -29,11 +29,11 @@ console.log(result.exitCode, result.stdout);
|
|
|
29
29
|
`await using` deletes it when the block ends (Node 24, Bun or TypeScript; on
|
|
30
30
|
Node 22 call `await sbx.delete()`), and `keep: true` stops it instead, keeping
|
|
31
31
|
its disk. With no arguments you get the
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
free usage, with no card (up to
|
|
33
|
+
four sandboxes running at once without credit), 2 vCPU, 4 GiB of
|
|
34
34
|
memory and a 4 GiB disk. The current default image includes NumPy, pandas and
|
|
35
35
|
matplotlib; see the [sandbox environment](https://withruntime.com/docs/sandbox-environment).
|
|
36
|
-
The
|
|
36
|
+
The free usage is spent first, then prepaid credit, with nothing to
|
|
37
37
|
choose; `funding` is accepted and ignored.
|
|
38
38
|
|
|
39
39
|
The sandbox object does the rest:
|
package/README.src.md
CHANGED
|
@@ -31,11 +31,11 @@ console.log(result.exitCode, result.stdout);
|
|
|
31
31
|
`await using` deletes it when the block ends (Node 24, Bun or TypeScript; on
|
|
32
32
|
Node 22 call `await sbx.delete()`), and `keep: true` stops it instead, keeping
|
|
33
33
|
its disk. With no arguments you get the
|
|
34
|
-
|
|
34
|
+
free usage, with no card (up to
|
|
35
35
|
{{trial-sandboxes}} sandboxes running at once without credit), 2 vCPU, 4 GiB of
|
|
36
36
|
memory and a 4 GiB disk. The current default image includes NumPy, pandas and
|
|
37
37
|
matplotlib; see the [sandbox environment](https://withruntime.com/docs/sandbox-environment).
|
|
38
|
-
The
|
|
38
|
+
The free usage is spent first, then prepaid credit, with nothing to
|
|
39
39
|
choose; `funding` is accepted and ignored.
|
|
40
40
|
|
|
41
41
|
The sandbox object does the rest:
|
package/dist/billing-cli.js
CHANGED
|
@@ -184,7 +184,7 @@ async function walletCommand(verb, value, acceptTerms, wait, out, sleep, wallet)
|
|
|
184
184
|
let payBy = null;
|
|
185
185
|
if (verb === "topup") {
|
|
186
186
|
if (!acceptTerms)
|
|
187
|
-
throw usage("Opening an account means agreeing to https://withruntime.com/legal/terms. Add --accept-terms
|
|
187
|
+
throw usage("Opening an account means agreeing to https://withruntime.com/legal/terms. Add --accept-terms to agree to them for whoever you act for.");
|
|
188
188
|
const opened = await wallet.open({ usd: dollarsOf(value), acceptTerms: true });
|
|
189
189
|
code = opened.claimCode;
|
|
190
190
|
payBy = opened.payBy;
|
|
@@ -224,11 +224,15 @@ async function walletCommand(verb, value, acceptTerms, wait, out, sleep, wallet)
|
|
|
224
224
|
: `The top-up ${claim.status}: nothing was credited. Open a new one with \`${me} billing topup <usd> --new-account --accept-terms\`.`);
|
|
225
225
|
return 1;
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
// A top-up that never reached Stripe has no address: waiting cannot help.
|
|
228
|
+
const noAddress = claim.topup?.status === "open" && !claim.topup.networks.length;
|
|
229
|
+
if (noAddress || !wait || Date.now() >= until) {
|
|
228
230
|
out.write(out.json
|
|
229
231
|
? JSON.stringify(claim)
|
|
230
|
-
:
|
|
231
|
-
|
|
232
|
+
: noAddress
|
|
233
|
+
? (claim.next ?? "This top-up has no address to pay to yet.")
|
|
234
|
+
: `Not paid yet (${claim.status}). Run \`${me} billing claim ${code}\` again once the transfer has gone through.`);
|
|
235
|
+
return noAddress || wait ? 1 : 0;
|
|
232
236
|
}
|
|
233
237
|
}
|
|
234
238
|
}
|
package/dist/blaxel/sandbox.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ export declare class SandboxInstance {
|
|
|
139
139
|
get expiresIn(): number | undefined;
|
|
140
140
|
/** Creates a sandbox and answers once it runs. Blaxel's defaults: the base
|
|
141
141
|
* image (Runtime's stock image) and 4096 MB, with vCPUs at one per 2048 MB.
|
|
142
|
-
* Funding is left to Runtime: the
|
|
142
|
+
* Funding is left to Runtime: the free usage first, then prepaid credit. A name another live sandbox holds is refused
|
|
143
143
|
* with a 409, as in Blaxel. */
|
|
144
144
|
static create<T extends typeof SandboxInstance>(this: T, sandbox?: SandboxCreateConfiguration | SandboxModel, options?: SandboxCreateOptions): Promise<InstanceType<T>>;
|
|
145
145
|
/** The named sandbox, or a new one when no live sandbox has the name.
|
package/dist/blaxel/sandbox.js
CHANGED
|
@@ -573,7 +573,7 @@ export class SandboxInstance {
|
|
|
573
573
|
// ---- create, get, list ---------------------------------------------------
|
|
574
574
|
/** Creates a sandbox and answers once it runs. Blaxel's defaults: the base
|
|
575
575
|
* image (Runtime's stock image) and 4096 MB, with vCPUs at one per 2048 MB.
|
|
576
|
-
* Funding is left to Runtime: the
|
|
576
|
+
* Funding is left to Runtime: the free usage first, then prepaid credit. A name another live sandbox holds is refused
|
|
577
577
|
* with a 409, as in Blaxel. */
|
|
578
578
|
static async create(sandbox, options = {}) {
|
|
579
579
|
const { createIfNotExist = false, safe = false } = options;
|
package/dist/cli.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { RuntimeError } from "./errors.js";
|
|
3
3
|
import type { OutOfMemory, Usage } from "./types.js";
|
|
4
4
|
import type { SwitchProvider } from "./products/switching.js";
|
|
5
|
-
import type { SecretRule } from "./products/secrets.js";
|
|
5
|
+
import type { SecretRule, SecretScope } from "./products/secrets.js";
|
|
6
6
|
type Out = {
|
|
7
7
|
json: boolean;
|
|
8
8
|
write: (text: string) => void;
|
|
@@ -30,7 +30,7 @@ declare const kit: {
|
|
|
30
30
|
};
|
|
31
31
|
export type CliKit = typeof kit;
|
|
32
32
|
export declare function run(argv: string[], env?: NodeJS.ProcessEnv, out?: Out): Promise<number>;
|
|
33
|
-
/** `runtime usage` for a person: the balance, the
|
|
33
|
+
/** `runtime usage` for a person: the balance, the free usage and what each kind
|
|
34
34
|
* of resource was charged, in dollars. --json keeps every figure, and each
|
|
35
35
|
* resource with its rates and CPU time. */
|
|
36
36
|
/** One row per resource, for a spreadsheet: when it ran, how big it was, how
|
|
@@ -44,12 +44,27 @@ export declare function usageCsv(u: Usage): string;
|
|
|
44
44
|
export declare function outOfMemoryLines(memory: OutOfMemory | undefined): string | undefined;
|
|
45
45
|
/** How to move a rival's code across, when one import does it. */
|
|
46
46
|
export declare function dropInLines(provider: SwitchProvider | undefined): string[];
|
|
47
|
+
/** A secret's value, from standard input only, so it never sits in shell
|
|
48
|
+
* history or a process list. Piped: everything, less one trailing newline.
|
|
49
|
+
* A terminal: one line, not shown. */
|
|
50
|
+
/** A pasted secret as the header it becomes: no line breaks (a token copied
|
|
51
|
+
* from a terminal arrives wrapped), no bracketed-paste markers, no space at
|
|
52
|
+
* either end. 13 October 2026: Marc's pasted Claude token was refused as
|
|
53
|
+
* "not visible ASCII". A header cannot hold a line break, so none is lost. */
|
|
54
|
+
export declare function cleanSecret(raw: string): string;
|
|
47
55
|
/** `--allow` values as secret rules: each is `[METHOD[,METHOD]...] PATH`, and
|
|
48
56
|
* rules naming the same methods share one rule's paths. Only the shape is read
|
|
49
57
|
* here; the API holds every rule to the same check the host makes
|
|
50
58
|
* (ARCHITECTURE.md section 10, "Per-path rules on an egress secret") and says
|
|
51
59
|
* which one it refused. */
|
|
52
60
|
export declare function parseSecretRules(values: string[]): SecretRule[];
|
|
61
|
+
/** `--only-label role=hub,tier=x --only-sandbox <id>`: a sandbox whose labels
|
|
62
|
+
* hold every pair of any one --only-label gets the secret, and so does each
|
|
63
|
+
* --only-sandbox. `--all-sandboxes`: every sandbox again. Nothing: undefined,
|
|
64
|
+
* so a replacement keeps the scope it has. */
|
|
65
|
+
export declare function parseSecretScope(labels: string[] | undefined, sandboxes: string[] | undefined, all: boolean): SecretScope | undefined;
|
|
66
|
+
/** Who gets a secret, in a few words. */
|
|
67
|
+
export declare const scopeText: (only: SecretScope | undefined) => string;
|
|
53
68
|
export declare function secretsCommand(argv: string[], env: NodeJS.ProcessEnv, out: Out,
|
|
54
69
|
/** Tests give the value here; the CLI reads standard input. */
|
|
55
70
|
read?: () => Promise<string>): Promise<number>;
|