@promigence/sdk 0.1.0-beta.16 → 0.1.0-beta.17
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/cjs/client.d.ts +123 -10
- package/dist/cjs/client.js +374 -82
- package/dist/cjs/context.d.ts +2 -1
- package/dist/cjs/context.js +5 -0
- package/dist/cjs/core.d.ts +25 -2
- package/dist/cjs/core.js +25 -4
- package/dist/cjs/handles.js +2 -1
- package/dist/cjs/http2.js +5 -0
- package/dist/cjs/models.gen.d.ts +205 -23
- package/dist/cjs/proxy.js +32 -3
- package/dist/cjs/sandbox.d.ts +12 -5
- package/dist/cjs/sandbox.js +1 -1
- package/dist/client.d.ts +123 -10
- package/dist/client.js +375 -83
- package/dist/context.d.ts +2 -1
- package/dist/context.js +5 -0
- package/dist/core.d.ts +25 -2
- package/dist/core.js +23 -3
- package/dist/handles.js +2 -1
- package/dist/http2.js +5 -0
- package/dist/models.gen.d.ts +205 -23
- package/dist/proxy.js +33 -4
- package/dist/sandbox.d.ts +12 -5
- package/dist/sandbox.js +1 -1
- package/package.json +1 -1
package/dist/context.d.ts
CHANGED
|
@@ -96,7 +96,8 @@ export interface ContextOptions {
|
|
|
96
96
|
allowSecrets?: boolean;
|
|
97
97
|
/**
|
|
98
98
|
* Send these files that look like credentials, and only these: paths inside the context,
|
|
99
|
-
* `/`-separated, as `listContext` names them. Every other one is still refused
|
|
99
|
+
* `/`-separated, as `listContext` names them. Every other one is still refused, and a name that
|
|
100
|
+
* is no file of the context is refused too, so a mistyped or stale name is seen.
|
|
100
101
|
*/
|
|
101
102
|
allowSecretFiles?: readonly string[];
|
|
102
103
|
/** Called with each note: what was left out by default, or changed on the way. */
|
package/dist/context.js
CHANGED
|
@@ -582,6 +582,11 @@ export function packContext(dir, opts = {}) {
|
|
|
582
582
|
const c = collect(dir, opts);
|
|
583
583
|
for (const n of c.notes)
|
|
584
584
|
opts.onNote?.(n);
|
|
585
|
+
const files = new Set(c.entries.filter((e) => e.kind !== "dir").map((e) => e.rel));
|
|
586
|
+
const unknown = [...new Set((opts.allowSecretFiles ?? []).map(insidePath))].filter((p) => !files.has(p));
|
|
587
|
+
if (unknown.length > 0) {
|
|
588
|
+
throw new InvalidArgumentError(`allowSecretFiles ${unknown.join(", ")}: no such file in this upload`, 'Name each file as listContext names it (its path inside the context sent), e.g. { allowSecretFiles: ["certs/test.pem"] }.');
|
|
589
|
+
}
|
|
585
590
|
if (c.bytes > max) {
|
|
586
591
|
const ig = c.ignore?.file;
|
|
587
592
|
throw new InvalidArgumentError(`the build context is over ${max} bytes${ig ? ` even without what its ${ig} excludes` : ""}`, `${ig ? `Exclude more in ${ig}` : "Add a .dockerignore"}, point --context at a smaller directory, or pass a git URL pinned to a full 40-character sha.`);
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Promigence SDK — constants, error hierarchy and shared types. */
|
|
2
|
-
export declare const VERSION = "0.1.0-beta.
|
|
2
|
+
export declare const VERSION = "0.1.0-beta.17";
|
|
3
3
|
export declare const DOCS_URL = "https://promigence.ai";
|
|
4
4
|
/** The error reference; each code is an anchor on it (the API's `docs` link has the same form). */
|
|
5
5
|
export declare const ERRORS_DOCS_URL = "https://www.promigence.ai/docs/errors";
|
|
@@ -229,6 +229,20 @@ export declare class TimeoutError extends PromigenceError {
|
|
|
229
229
|
export declare class ServiceRestartError extends PromigenceError {
|
|
230
230
|
constructor(message: string, fix: string);
|
|
231
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* The connection dropped while a command was running (`sandboxes.exec`, `execStream`,
|
|
234
|
+
* `commands.run`), and the command could not be picked up again: no client came back for it in
|
|
235
|
+
* time, or the service no longer keeps it. The sandbox keeps running. `retryable` is `false`: the
|
|
236
|
+
* command may have done part of its work before it stopped, so run it again only if that is safe.
|
|
237
|
+
* exit 3
|
|
238
|
+
*/
|
|
239
|
+
export declare class ExecLostError extends PromigenceError {
|
|
240
|
+
/** The sandbox the command ran in. */
|
|
241
|
+
readonly sandboxId: string | undefined;
|
|
242
|
+
constructor(message: string, ids?: {
|
|
243
|
+
sandboxId?: string;
|
|
244
|
+
}, lost?: "gone" | "not_reattached" | "unreachable");
|
|
245
|
+
}
|
|
232
246
|
/** An API error with no more specific class (5xx, unknown code). exit from the table. */
|
|
233
247
|
export declare class ApiError extends PromigenceError {
|
|
234
248
|
}
|
|
@@ -266,6 +280,12 @@ export interface CommandResult {
|
|
|
266
280
|
truncated?: boolean;
|
|
267
281
|
/** `exec_id`, for `promigence exec output <exec_id>` / `GET /sandboxes/:id/execs/:exec_id`. */
|
|
268
282
|
execId?: string;
|
|
283
|
+
/**
|
|
284
|
+
* `true` when the command was killed at its own time bound (see `timeoutMs`), `false` for any
|
|
285
|
+
* other exit. With `throwOnExit: false` this is how a result tells a timeout from any other
|
|
286
|
+
* exit 137, such as an out-of-memory kill or a `kill -9`. Set on every result the SDK returns.
|
|
287
|
+
*/
|
|
288
|
+
timedOut?: boolean;
|
|
269
289
|
}
|
|
270
290
|
export interface CommandRunOpts {
|
|
271
291
|
cwd?: string;
|
|
@@ -277,7 +297,10 @@ export interface CommandRunOpts {
|
|
|
277
297
|
* (or the default 15 minutes).
|
|
278
298
|
*/
|
|
279
299
|
timeoutMs?: number;
|
|
280
|
-
/**
|
|
300
|
+
/**
|
|
301
|
+
* Throw `CommandExitError` on non-zero exit (default true). With `false`, a foreground command's
|
|
302
|
+
* result comes back instead, and its `timedOut` says whether it was killed at its time bound.
|
|
303
|
+
*/
|
|
281
304
|
throwOnExit?: boolean;
|
|
282
305
|
/** Inline output budget; `truncated` beyond it (default 64 KiB). */
|
|
283
306
|
maxOutputBytes?: number;
|
package/dist/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hintArg } from "./hint.js";
|
|
2
|
-
export const VERSION = "0.1.0-beta.
|
|
2
|
+
export const VERSION = "0.1.0-beta.17";
|
|
3
3
|
export const DOCS_URL = "https://promigence.ai";
|
|
4
4
|
export const ERRORS_DOCS_URL = "https://www.promigence.ai/docs/errors";
|
|
5
5
|
export function errorsDocsFor(code) {
|
|
@@ -104,9 +104,14 @@ export class PreviewsUnavailableError extends InvalidArgumentError {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
const SANDBOX_ENDED = /^sandbox (\S+) has ended \(`([a-z_]+)`\)/;
|
|
107
|
+
const SANDBOX_EXPIRED = /^sandbox (\S+) reached its timeout and ended\b/;
|
|
107
108
|
export function sandboxEndedIn(message) {
|
|
108
|
-
const
|
|
109
|
-
|
|
109
|
+
const text = message.trim();
|
|
110
|
+
const m = SANDBOX_ENDED.exec(text);
|
|
111
|
+
if (m)
|
|
112
|
+
return { sandboxId: m[1], state: m[2] };
|
|
113
|
+
const x = SANDBOX_EXPIRED.exec(text);
|
|
114
|
+
return x ? { sandboxId: x[1], state: "ended" } : undefined;
|
|
110
115
|
}
|
|
111
116
|
export const SANDBOX_ENDED_FIX = "Start a new sandbox: Sandbox.create(). This one's getInfo() says how it ended (`outcome`).";
|
|
112
117
|
export class SandboxEndedError extends InvalidArgumentError {
|
|
@@ -218,6 +223,20 @@ export class ServiceRestartError extends PromigenceError {
|
|
|
218
223
|
super({ code: "service_restart", message, fix, exitCode: 3, category: "env", retryable: false });
|
|
219
224
|
}
|
|
220
225
|
}
|
|
226
|
+
const EXEC_LOST_FIX = "The sandbox is still running; the command was stopped, maybe after part of its work: run it again if that is safe. " +
|
|
227
|
+
"Billed unless the drop was ours: then email support@promigence.ai with the sandbox id.";
|
|
228
|
+
export class ExecLostError extends PromigenceError {
|
|
229
|
+
sandboxId;
|
|
230
|
+
lost;
|
|
231
|
+
constructor(message, ids = {}, lost = "gone") {
|
|
232
|
+
super({
|
|
233
|
+
code: "exec_lost", message, fix: EXEC_LOST_FIX, docs: `${ERRORS_DOCS_URL}#exec_lost`,
|
|
234
|
+
exitCode: 3, category: "env", retryable: false,
|
|
235
|
+
});
|
|
236
|
+
this.sandboxId = ids.sandboxId;
|
|
237
|
+
this.lost = lost;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
221
240
|
export class ApiError extends PromigenceError {
|
|
222
241
|
}
|
|
223
242
|
export class NotReleasedError extends PromigenceError {
|
|
@@ -236,6 +255,7 @@ export const EXIT_BY_CODE = {
|
|
|
236
255
|
not_connected: 7,
|
|
237
256
|
service_restart: 3,
|
|
238
257
|
digest_mismatch: 4,
|
|
258
|
+
exec_lost: 3,
|
|
239
259
|
fork_failed: 3, start_timeout: 3, readiness_failed: 3, verify_too_slow: 3,
|
|
240
260
|
verify_each_failed: 3, toolchain_mismatch: 3, sandbox_unresponsive: 3, oom_within_tier: 3,
|
|
241
261
|
disk_full_within_tier: 3, sandbox_interrupted: 3, integrity_mismatch: 3, egress_unavailable: 3,
|
package/dist/handles.js
CHANGED
|
@@ -111,9 +111,10 @@ export class CommandHandle {
|
|
|
111
111
|
stderr: this.stderr,
|
|
112
112
|
truncated: Boolean(this.record.truncated),
|
|
113
113
|
execId: this.pid,
|
|
114
|
+
timedOut: exitTimedOut(this.record.exit, this.opts.timeoutMs),
|
|
114
115
|
};
|
|
115
116
|
if (result.exitCode !== 0) {
|
|
116
|
-
if (
|
|
117
|
+
if (result.timedOut)
|
|
117
118
|
throw new CommandTimeoutError(result, this.opts.timeoutMs);
|
|
118
119
|
throw new CommandExitError(result);
|
|
119
120
|
}
|
package/dist/http2.js
CHANGED
|
@@ -31,6 +31,7 @@ const FETCH_AT_LOAD = globalThis.fetch;
|
|
|
31
31
|
const PROXY_VARS = ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy", "ALL_PROXY", "all_proxy"];
|
|
32
32
|
const OFF = new Set(["0", "false", "off", "no"]);
|
|
33
33
|
const NOT_IN_H2 = new Set(["connection", "keep-alive", "proxy-connection", "transfer-encoding", "upgrade", "host", "te"]);
|
|
34
|
+
const ACCEPT_ENCODING = "br, gzip";
|
|
34
35
|
export function http2Allowed(opt, env = process.env) {
|
|
35
36
|
try {
|
|
36
37
|
const envFlag = env["PROMIGENCE_HTTP2"]?.trim().toLowerCase();
|
|
@@ -1089,6 +1090,8 @@ function exchange(pool, entry, target, init, deadline) {
|
|
|
1089
1090
|
if (!NOT_IN_H2.has(name))
|
|
1090
1091
|
headers[name] = init.headers[k];
|
|
1091
1092
|
}
|
|
1093
|
+
if (headers["accept-encoding"] === undefined)
|
|
1094
|
+
headers["accept-encoding"] = ACCEPT_ENCODING;
|
|
1092
1095
|
headers[http2.sensitiveHeaders] = ["authorization"];
|
|
1093
1096
|
const body = init.body === undefined ? undefined : Buffer.from(init.body, "utf8");
|
|
1094
1097
|
if (body !== undefined)
|
|
@@ -1652,6 +1655,8 @@ class TransportThread {
|
|
|
1652
1655
|
if (!NOT_IN_H2.has(name))
|
|
1653
1656
|
headers[name] = init.headers[k];
|
|
1654
1657
|
}
|
|
1658
|
+
if (headers["accept-encoding"] === undefined)
|
|
1659
|
+
headers["accept-encoding"] = ACCEPT_ENCODING;
|
|
1655
1660
|
if (init.body !== undefined)
|
|
1656
1661
|
headers["content-length"] = Buffer.byteLength(init.body, "utf8");
|
|
1657
1662
|
const id = this.nextId++;
|
package/dist/models.gen.d.ts
CHANGED
|
@@ -358,7 +358,9 @@ export interface BillingCredits {
|
|
|
358
358
|
*/
|
|
359
359
|
balance_usd: number;
|
|
360
360
|
/**
|
|
361
|
-
* Available credits cannot
|
|
361
|
+
* Available credits cannot pay for new work. That stops new work only where credits pay for
|
|
362
|
+
* it (`model` `credits`, or the trial); a `postpaid` organization's new work is billed after
|
|
363
|
+
* use.
|
|
362
364
|
*/
|
|
363
365
|
exhausted: boolean;
|
|
364
366
|
/**
|
|
@@ -969,6 +971,24 @@ export interface CaptureView {
|
|
|
969
971
|
*/
|
|
970
972
|
snapshot_id: string;
|
|
971
973
|
}
|
|
974
|
+
/**
|
|
975
|
+
* What applies to a failed run's sandboxes when the run does not say (`capture`).
|
|
976
|
+
*/
|
|
977
|
+
export interface CapturesEffective {
|
|
978
|
+
/**
|
|
979
|
+
* Which choice decided it: `project`, `org`, or `default` (neither chose, so the default
|
|
980
|
+
* applies).
|
|
981
|
+
*/
|
|
982
|
+
from: CapturesFrom;
|
|
983
|
+
/**
|
|
984
|
+
* Whether a failed sandbox is kept so you can reopen it where it broke.
|
|
985
|
+
*/
|
|
986
|
+
kept: boolean;
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* Which choice decides whether a failed run's sandboxes are kept, when the run does not say.
|
|
990
|
+
*/
|
|
991
|
+
export type CapturesFrom = "project" | "org" | "default";
|
|
972
992
|
/**
|
|
973
993
|
* The card on file, enough to recognise it.
|
|
974
994
|
*/
|
|
@@ -1508,6 +1528,45 @@ export interface ErrorBody {
|
|
|
1508
1528
|
* Every error code the API returns. `category` decides whether the failure is billed: `env` is ours (not billed before hand-over; after it, the time since the sandbox's last snapshot is credited back, up to 24 hours, when our side shows the cause), `task` is your command and is billed. The full table is `x-promigence-error-codes` at the document root.
|
|
1509
1529
|
*/
|
|
1510
1530
|
export type ErrorCode = "fork_failed" | "start_timeout" | "readiness_failed" | "verify_too_slow" | "verify_each_failed" | "toolchain_mismatch" | "sandbox_unresponsive" | "oom_within_tier" | "disk_full_within_tier" | "sandbox_interrupted" | "integrity_mismatch" | "egress_unavailable" | "service_timeout" | "preempted" | "verify_did_not_cover" | "grader_failed" | "nonzero_exit" | "grade_not_passed" | "task_timeout" | "oom_over_tier" | "disk_over_tier" | "shutdown_by_task" | "modified_by_task" | "cap_killed" | "cap_exceeded" | "cap_paused" | "credits_paused" | "aborted_by_client" | "stopped_by_support" | "expired" | "not_started" | "superseded" | "usage" | "internal" | "auth" | "forbidden" | "not_found" | "unreachable" | "rate_limited" | "timeout" | "not_verified" | "snapshot_incompatible" | "storage_limit_reached" | "resume_unavailable" | "sandbox_unreachable" | "capacity_busy" | "region_at_capacity" | "builder_unavailable" | "builder_busy" | "overloaded" | "tier_unavailable" | "snapshot_unavailable" | "capacity_limit" | "build_timeout" | "dockerfile_build_failed" | "image_unresolvable" | "registry_unavailable" | "enoent" | "trial_credits_exhausted" | "credits_exhausted" | "credit_unclaimed" | "setup_required" | "card_required" | "billing_unavailable" | "purchase_limit" | "card_needed" | "auto_reload_unavailable" | "purchases_blocked" | "concurrency_limit" | "egress_cap_reached" | "project_cap_reached" | "spend_limit_reached" | "billing_hold" | "tier_over_plan" | "network_host_refused" | "network_policy_unsupported" | "secrets_in_snapshot" | "secrets_unavailable" | "secret_binding_unsupported" | "idempotency_key_reused" | "idempotency_key_in_use" | "repo_credentials_not_supported" | "account_exists" | "invite_invalid" | "invite_required" | "key_expired" | "account_blocked";
|
|
1531
|
+
/**
|
|
1532
|
+
* `POST /v1/sandboxes/{id}/execs/attach`: pick up a command whose connection dropped, by the key
|
|
1533
|
+
* it was started with (the `Promigence-Exec-Key` header).
|
|
1534
|
+
*/
|
|
1535
|
+
export interface ExecAttach {
|
|
1536
|
+
/**
|
|
1537
|
+
* The key the command was started with.
|
|
1538
|
+
*/
|
|
1539
|
+
key: string;
|
|
1540
|
+
/**
|
|
1541
|
+
* A stream only: the same for standard error.
|
|
1542
|
+
*/
|
|
1543
|
+
stderr_offset?: number | null;
|
|
1544
|
+
/**
|
|
1545
|
+
* A stream only: how many bytes of standard output you already have; you are sent what
|
|
1546
|
+
* follows. Default 0.
|
|
1547
|
+
*/
|
|
1548
|
+
stdout_offset?: number | null;
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* `POST /v1/sandboxes/{id}/execs/cancel`: stop a command started with a key, now.
|
|
1552
|
+
*/
|
|
1553
|
+
export interface ExecCancel {
|
|
1554
|
+
/**
|
|
1555
|
+
* The key the command was started with.
|
|
1556
|
+
*/
|
|
1557
|
+
key: string;
|
|
1558
|
+
}
|
|
1559
|
+
/**
|
|
1560
|
+
* `POST /v1/sandboxes/{id}/execs/cancel`.
|
|
1561
|
+
*/
|
|
1562
|
+
export interface ExecCancelled {
|
|
1563
|
+
/**
|
|
1564
|
+
* True when the command was still running and is being stopped; false when it had already
|
|
1565
|
+
* ended, which is not a failure.
|
|
1566
|
+
*/
|
|
1567
|
+
cancelled: boolean;
|
|
1568
|
+
sandbox_id: string;
|
|
1569
|
+
}
|
|
1511
1570
|
/**
|
|
1512
1571
|
* `POST /v1/sandboxes/{id}/execs`, and the `exec` of `POST /v1/runs`: one command. `argv` (a
|
|
1513
1572
|
* non-empty list) or `sh` (a shell line) is required.
|
|
@@ -1614,8 +1673,9 @@ export interface ExecResult {
|
|
|
1614
1673
|
*/
|
|
1615
1674
|
oom_killed?: boolean;
|
|
1616
1675
|
/**
|
|
1617
|
-
* Why the command ended without an exit code: `timeout`, `out_of_memory` or
|
|
1618
|
-
*
|
|
1676
|
+
* Why the command ended without an exit code: `timeout`, `out_of_memory`, `signal`, or
|
|
1677
|
+
* `not_reattached` (it was started with a `Promigence-Exec-Key`, its connection dropped, and
|
|
1678
|
+
* nobody picked it up again in time, so it was stopped). Absent when it exited on its own.
|
|
1619
1679
|
*/
|
|
1620
1680
|
reason?: string | null;
|
|
1621
1681
|
sandbox_id: string;
|
|
@@ -1796,7 +1856,8 @@ export interface Failure {
|
|
|
1796
1856
|
}
|
|
1797
1857
|
export type FailureCategory = "env" | "snapshot" | "task" | "cap" | "grader" | "preempt" | "other";
|
|
1798
1858
|
/**
|
|
1799
|
-
* `POST /v1/sandboxes/{id}/files/archive`: pack a path into a `.tar.gz` inside the sandbox.
|
|
1859
|
+
* `POST /v1/sandboxes/{id}/files/archive`: pack a path into a `.tar.gz` inside the sandbox. A path
|
|
1860
|
+
* is absolute, or relative to the sandbox's working directory.
|
|
1800
1861
|
*/
|
|
1801
1862
|
export interface FileArchive {
|
|
1802
1863
|
/**
|
|
@@ -1804,13 +1865,15 @@ export interface FileArchive {
|
|
|
1804
1865
|
*/
|
|
1805
1866
|
exclude?: Array<string>;
|
|
1806
1867
|
/**
|
|
1807
|
-
* Where the archive is written
|
|
1868
|
+
* Where the archive is written: absolute, or relative to the sandbox's working directory.
|
|
1869
|
+
* Default: beside the source.
|
|
1808
1870
|
*/
|
|
1809
1871
|
out?: string | null;
|
|
1810
1872
|
path: string;
|
|
1811
1873
|
}
|
|
1812
1874
|
/**
|
|
1813
|
-
* `POST /v1/sandboxes/{id}/files/chmod`: at least one of `mode`, `uid`, `gid`.
|
|
1875
|
+
* `POST /v1/sandboxes/{id}/files/chmod`: at least one of `mode`, `uid`, `gid`. The path is absolute,
|
|
1876
|
+
* or relative to the sandbox's working directory.
|
|
1814
1877
|
*/
|
|
1815
1878
|
export interface FileChmod {
|
|
1816
1879
|
gid?: number | null;
|
|
@@ -1820,7 +1883,8 @@ export interface FileChmod {
|
|
|
1820
1883
|
uid?: number | null;
|
|
1821
1884
|
}
|
|
1822
1885
|
/**
|
|
1823
|
-
* `POST /v1/sandboxes/{id}/files/copy`.
|
|
1886
|
+
* `POST /v1/sandboxes/{id}/files/copy`. A path is absolute, or relative to the sandbox's working
|
|
1887
|
+
* directory.
|
|
1824
1888
|
*/
|
|
1825
1889
|
export interface FileCopy {
|
|
1826
1890
|
from: string;
|
|
@@ -1829,7 +1893,8 @@ export interface FileCopy {
|
|
|
1829
1893
|
to: string;
|
|
1830
1894
|
}
|
|
1831
1895
|
/**
|
|
1832
|
-
* `DELETE /v1/sandboxes/{id}/files`: a path,
|
|
1896
|
+
* `DELETE /v1/sandboxes/{id}/files`: a path (absolute, or relative to the sandbox's working
|
|
1897
|
+
* directory), and `recursive` for a directory with something in it.
|
|
1833
1898
|
*/
|
|
1834
1899
|
export interface FileDeleteRequest {
|
|
1835
1900
|
path: string;
|
|
@@ -1850,7 +1915,8 @@ export interface FileDeleted {
|
|
|
1850
1915
|
sandbox_id: string;
|
|
1851
1916
|
}
|
|
1852
1917
|
/**
|
|
1853
|
-
* `POST /v1/sandboxes/{id}/files/extract`.
|
|
1918
|
+
* `POST /v1/sandboxes/{id}/files/extract`. A path is absolute, or relative to the sandbox's
|
|
1919
|
+
* working directory.
|
|
1854
1920
|
*/
|
|
1855
1921
|
export interface FileExtract {
|
|
1856
1922
|
archive: string;
|
|
@@ -1890,7 +1956,7 @@ export interface FileListRequest {
|
|
|
1890
1956
|
*/
|
|
1891
1957
|
limit?: number | null;
|
|
1892
1958
|
/**
|
|
1893
|
-
* The directory
|
|
1959
|
+
* The directory: absolute, or relative to the sandbox's working directory. Default: `/`.
|
|
1894
1960
|
*/
|
|
1895
1961
|
path?: string | null;
|
|
1896
1962
|
/**
|
|
@@ -1914,7 +1980,8 @@ export interface FileListing {
|
|
|
1914
1980
|
truncated: boolean;
|
|
1915
1981
|
}
|
|
1916
1982
|
/**
|
|
1917
|
-
* `POST /v1/sandboxes/{id}/files/mkdir`.
|
|
1983
|
+
* `POST /v1/sandboxes/{id}/files/mkdir`. A path is absolute, or relative to the sandbox's working
|
|
1984
|
+
* directory (where its commands start).
|
|
1918
1985
|
*/
|
|
1919
1986
|
export interface FileMkdir {
|
|
1920
1987
|
mode?: FileMode | null;
|
|
@@ -1929,7 +1996,8 @@ export interface FileMkdir {
|
|
|
1929
1996
|
*/
|
|
1930
1997
|
export type FileMode = number | string;
|
|
1931
1998
|
/**
|
|
1932
|
-
* `POST /v1/sandboxes/{id}/files/move`.
|
|
1999
|
+
* `POST /v1/sandboxes/{id}/files/move`. A path is absolute, or relative to the sandbox's working
|
|
2000
|
+
* directory.
|
|
1933
2001
|
*/
|
|
1934
2002
|
export interface FileMove {
|
|
1935
2003
|
from: string;
|
|
@@ -1937,8 +2005,8 @@ export interface FileMove {
|
|
|
1937
2005
|
to: string;
|
|
1938
2006
|
}
|
|
1939
2007
|
/**
|
|
1940
|
-
* `POST /v1/sandboxes/{id}/files/read` and `POST /v1/sandboxes/{id}/files/stat`: one path
|
|
1941
|
-
*
|
|
2008
|
+
* `POST /v1/sandboxes/{id}/files/read` and `POST /v1/sandboxes/{id}/files/stat`: one path inside
|
|
2009
|
+
* the sandbox, absolute or relative to its working directory (where its commands start).
|
|
1942
2010
|
*/
|
|
1943
2011
|
export interface FilePathRequest {
|
|
1944
2012
|
path: string;
|
|
@@ -1964,7 +2032,8 @@ export interface FileSearchRequest {
|
|
|
1964
2032
|
*/
|
|
1965
2033
|
limit?: number | null;
|
|
1966
2034
|
/**
|
|
1967
|
-
* The directory to search
|
|
2035
|
+
* The directory to search: absolute, or relative to the sandbox's working directory.
|
|
2036
|
+
* Default: `/`.
|
|
1968
2037
|
*/
|
|
1969
2038
|
path?: string | null;
|
|
1970
2039
|
/**
|
|
@@ -2958,6 +3027,11 @@ export interface Me {
|
|
|
2958
3027
|
*/
|
|
2959
3028
|
spend?: number | null;
|
|
2960
3029
|
spend_detail?: SpendDetail | null;
|
|
3030
|
+
/**
|
|
3031
|
+
* What the organisation stores now, against `limits.max_storage_gb` and
|
|
3032
|
+
* `limits.max_capture_storage_gb`. Absent from a server before it.
|
|
3033
|
+
*/
|
|
3034
|
+
storage?: MeStorage | null;
|
|
2961
3035
|
/**
|
|
2962
3036
|
* The organisation's trial credit. Absent for a key that may not see the organisation's
|
|
2963
3037
|
* money: only an owner's key of the default project does.
|
|
@@ -2982,6 +3056,11 @@ export interface MeConcurrency {
|
|
|
2982
3056
|
* The limits in force for an organisation.
|
|
2983
3057
|
*/
|
|
2984
3058
|
export interface MeLimits {
|
|
3059
|
+
/**
|
|
3060
|
+
* The storage saved failures may use, in GB: when a new one would pass it, the oldest are
|
|
3061
|
+
* removed to make room; `null` for no limit.
|
|
3062
|
+
*/
|
|
3063
|
+
max_capture_storage_gb?: number | null;
|
|
2985
3064
|
/**
|
|
2986
3065
|
* Sandboxes that may be live at once.
|
|
2987
3066
|
*/
|
|
@@ -2990,6 +3069,10 @@ export interface MeLimits {
|
|
|
2990
3069
|
* Sandboxes that may be starting at once.
|
|
2991
3070
|
*/
|
|
2992
3071
|
max_inflight: number;
|
|
3072
|
+
/**
|
|
3073
|
+
* Paused sandboxes that may be kept; `null` for no limit.
|
|
3074
|
+
*/
|
|
3075
|
+
max_paused?: number | null;
|
|
2993
3076
|
/**
|
|
2994
3077
|
* The largest sandbox shape, in vCPU; `null` for no limit.
|
|
2995
3078
|
*/
|
|
@@ -2998,6 +3081,41 @@ export interface MeLimits {
|
|
|
2998
3081
|
* The longest a sandbox may live, in seconds; `null` for no limit.
|
|
2999
3082
|
*/
|
|
3000
3083
|
max_session_s?: number | null;
|
|
3084
|
+
/**
|
|
3085
|
+
* Snapshots that may be kept; `null` for no limit.
|
|
3086
|
+
*/
|
|
3087
|
+
max_snapshots?: number | null;
|
|
3088
|
+
/**
|
|
3089
|
+
* Everything stored together, in GB: snapshots, paused sandboxes and saved failures; `null`
|
|
3090
|
+
* for no limit.
|
|
3091
|
+
*/
|
|
3092
|
+
max_storage_gb?: number | null;
|
|
3093
|
+
}
|
|
3094
|
+
/**
|
|
3095
|
+
* What an organisation stores now (`GET /v1/me` `storage`).
|
|
3096
|
+
*/
|
|
3097
|
+
export interface MeStorage {
|
|
3098
|
+
/**
|
|
3099
|
+
* Saved failures kept now.
|
|
3100
|
+
*/
|
|
3101
|
+
captures: number;
|
|
3102
|
+
/**
|
|
3103
|
+
* Of that, what saved failures use, in bytes (what `limits.max_capture_storage_gb` holds).
|
|
3104
|
+
*/
|
|
3105
|
+
captures_bytes: number;
|
|
3106
|
+
/**
|
|
3107
|
+
* Paused sandboxes kept now.
|
|
3108
|
+
*/
|
|
3109
|
+
paused: number;
|
|
3110
|
+
/**
|
|
3111
|
+
* Snapshots kept now.
|
|
3112
|
+
*/
|
|
3113
|
+
snapshots: number;
|
|
3114
|
+
/**
|
|
3115
|
+
* Everything stored together, in bytes: snapshots, paused sandboxes and saved failures (what
|
|
3116
|
+
* `limits.max_storage_gb` holds; a GB there is 2^30 bytes).
|
|
3117
|
+
*/
|
|
3118
|
+
used_bytes: number;
|
|
3001
3119
|
}
|
|
3002
3120
|
/**
|
|
3003
3121
|
* `GET /v1/orgs/{org_id}/members`.
|
|
@@ -3229,8 +3347,9 @@ export interface OrgList {
|
|
|
3229
3347
|
export interface OrgPatch {
|
|
3230
3348
|
/**
|
|
3231
3349
|
* Keep a failed sandbox so it can be reopened where it broke, when a run does not say
|
|
3232
|
-
* (`capture`): `true` or `false`; `null` =
|
|
3233
|
-
*
|
|
3350
|
+
* (`capture`): `true` or `false`; `null` = not chosen, so the default applies: not kept unless
|
|
3351
|
+
* the organization or project chose to keep them. A project may choose its own. Set by an
|
|
3352
|
+
* owner, on its own (no other field in the same request).
|
|
3234
3353
|
*/
|
|
3235
3354
|
failure_captures?: boolean | null;
|
|
3236
3355
|
/**
|
|
@@ -3243,6 +3362,13 @@ export interface OrgPatch {
|
|
|
3243
3362
|
* owner.
|
|
3244
3363
|
*/
|
|
3245
3364
|
output_retention_days?: number | null;
|
|
3365
|
+
/**
|
|
3366
|
+
* The length of new preview URLs when a request does not say: `short` or `long` (a longer,
|
|
3367
|
+
* harder-to-guess URL, for apps with sensitive data); `null` = the default, `short`. A
|
|
3368
|
+
* project may name its own. Set by an owner, on its own (no other field in the same
|
|
3369
|
+
* request). Custom domains are coming soon.
|
|
3370
|
+
*/
|
|
3371
|
+
preview_link_length?: PreviewLinkLength | null;
|
|
3246
3372
|
}
|
|
3247
3373
|
/**
|
|
3248
3374
|
* One organization you belong to. Billing, members and credits belong to it.
|
|
@@ -3261,10 +3387,18 @@ export interface OrgView {
|
|
|
3261
3387
|
*/
|
|
3262
3388
|
default: boolean;
|
|
3263
3389
|
/**
|
|
3264
|
-
*
|
|
3265
|
-
* say (`capture`); `null` =
|
|
3390
|
+
* This organization's choice: whether a failed sandbox is kept so you can reopen it where it
|
|
3391
|
+
* broke, when a run does not say (`capture`); `null` = not chosen, so the default applies:
|
|
3392
|
+
* not kept unless the organization or project chose to keep them. A project may choose its
|
|
3393
|
+
* own. What applies is `failure_captures_effective`.
|
|
3266
3394
|
*/
|
|
3267
3395
|
failure_captures?: boolean | null;
|
|
3396
|
+
/**
|
|
3397
|
+
* What applies to a failed run of this organization when neither the run (`capture`) nor
|
|
3398
|
+
* its project says: kept or not, and which choice decided it. A run's own `capture` is
|
|
3399
|
+
* followed either way.
|
|
3400
|
+
*/
|
|
3401
|
+
failure_captures_effective?: CapturesEffective | null;
|
|
3268
3402
|
members: number;
|
|
3269
3403
|
name: string;
|
|
3270
3404
|
org_id: string;
|
|
@@ -3273,6 +3407,11 @@ export interface OrgView {
|
|
|
3273
3407
|
* name its own.
|
|
3274
3408
|
*/
|
|
3275
3409
|
output_retention_days?: number | null;
|
|
3410
|
+
/**
|
|
3411
|
+
* The length of new preview URLs when a request does not say (`length`): `short` or `long`;
|
|
3412
|
+
* `null` = the default, `short`. A project may name its own.
|
|
3413
|
+
*/
|
|
3414
|
+
preview_link_length?: PreviewLinkLength | null;
|
|
3276
3415
|
projects: number;
|
|
3277
3416
|
/**
|
|
3278
3417
|
* Your role in it: `owner` or `member`.
|
|
@@ -3543,6 +3682,12 @@ export interface Port {
|
|
|
3543
3682
|
* need this form.
|
|
3544
3683
|
*/
|
|
3545
3684
|
host_url_label?: string | null;
|
|
3685
|
+
/**
|
|
3686
|
+
* `short` (`https://brave-otter-48213.<domain>/`) or `long` (a longer, harder-to-guess
|
|
3687
|
+
* URL). Which one a new URL gets: the request's `length`, else its project's setting, else
|
|
3688
|
+
* its organization's, else `short`.
|
|
3689
|
+
*/
|
|
3690
|
+
length?: PreviewLinkLength | null;
|
|
3546
3691
|
/**
|
|
3547
3692
|
* The port inside the sandbox.
|
|
3548
3693
|
*/
|
|
@@ -3569,6 +3714,12 @@ export interface PortList {
|
|
|
3569
3714
|
* `POST /v1/sandboxes/{id}/ports`.
|
|
3570
3715
|
*/
|
|
3571
3716
|
export interface PortOpen {
|
|
3717
|
+
/**
|
|
3718
|
+
* `short` (`https://brave-otter-48213.<domain>/`) or `long` (a longer, harder-to-guess URL,
|
|
3719
|
+
* for apps with sensitive data). Absent: the project's setting, else the organization's,
|
|
3720
|
+
* else `short`. Custom domains are coming soon.
|
|
3721
|
+
*/
|
|
3722
|
+
length?: PreviewLinkLength | null;
|
|
3572
3723
|
/**
|
|
3573
3724
|
* 1–65535.
|
|
3574
3725
|
*/
|
|
@@ -3611,6 +3762,10 @@ export interface PortsRevoked {
|
|
|
3611
3762
|
revoked: Array<string>;
|
|
3612
3763
|
sandbox_id: string;
|
|
3613
3764
|
}
|
|
3765
|
+
/**
|
|
3766
|
+
* How long a preview URL is. Custom domains are coming soon.
|
|
3767
|
+
*/
|
|
3768
|
+
export type PreviewLinkLength = "short" | "long";
|
|
3614
3769
|
/**
|
|
3615
3770
|
* The free credit a new account gets. An account's own credit, and whether it can still claim
|
|
3616
3771
|
* it, is `GET /v1/credits/offer`.
|
|
@@ -3884,8 +4039,9 @@ export interface ProjectMoved {
|
|
|
3884
4039
|
export interface ProjectPatch {
|
|
3885
4040
|
/**
|
|
3886
4041
|
* Keep a failed sandbox so it can be reopened where it broke, when a run does not say
|
|
3887
|
-
* (`capture`): `true` or `false`; `null` = the
|
|
3888
|
-
*
|
|
4042
|
+
* (`capture`): `true` or `false`; `null` = not chosen, so the organization's choice applies,
|
|
4043
|
+
* and where neither chose, the default: not kept unless the organization or project chose to
|
|
4044
|
+
* keep them. Set by an owner, on its own (no other field in the same request).
|
|
3889
4045
|
*/
|
|
3890
4046
|
failure_captures?: boolean | null;
|
|
3891
4047
|
/**
|
|
@@ -3898,6 +4054,13 @@ export interface ProjectPatch {
|
|
|
3898
4054
|
* sandbox ends, 1–30; `null` = the organization's setting. Set by an owner.
|
|
3899
4055
|
*/
|
|
3900
4056
|
output_retention_days?: number | null;
|
|
4057
|
+
/**
|
|
4058
|
+
* The length of this project's new preview URLs when a request does not say: `short` or
|
|
4059
|
+
* `long` (a longer, harder-to-guess URL, for apps with sensitive data); `null` = the
|
|
4060
|
+
* organization's setting. Set by an owner, on its own (no other field in the same request).
|
|
4061
|
+
* Custom domains are coming soon.
|
|
4062
|
+
*/
|
|
4063
|
+
preview_link_length?: PreviewLinkLength | null;
|
|
3901
4064
|
}
|
|
3902
4065
|
/**
|
|
3903
4066
|
* One project. API keys belong to a project; a project holds any number of repositories.
|
|
@@ -3912,10 +4075,18 @@ export interface ProjectView {
|
|
|
3912
4075
|
*/
|
|
3913
4076
|
default: boolean;
|
|
3914
4077
|
/**
|
|
3915
|
-
*
|
|
3916
|
-
* (`capture`); `null` = the organization's
|
|
4078
|
+
* This project's choice: whether its failed sandboxes are kept to reopen, when a run does not
|
|
4079
|
+
* say (`capture`); `null` = not chosen, so the organization's choice applies, and where
|
|
4080
|
+
* neither chose, the default: not kept unless the organization or project chose to keep
|
|
4081
|
+
* them. Set by an owner. What applies is `failure_captures_effective`.
|
|
3917
4082
|
*/
|
|
3918
4083
|
failure_captures?: boolean | null;
|
|
4084
|
+
/**
|
|
4085
|
+
* What applies to this project's failed runs when the run does not say (`capture`): kept or
|
|
4086
|
+
* not, and which choice decided it (this project's, its organization's, or the default). A
|
|
4087
|
+
* run's own `capture` is followed either way.
|
|
4088
|
+
*/
|
|
4089
|
+
failure_captures_effective?: CapturesEffective | null;
|
|
3919
4090
|
/**
|
|
3920
4091
|
* Keys that still work.
|
|
3921
4092
|
*/
|
|
@@ -3942,6 +4113,11 @@ export interface ProjectView {
|
|
|
3942
4113
|
* organization's setting. Set by an owner.
|
|
3943
4114
|
*/
|
|
3944
4115
|
output_retention_days?: number | null;
|
|
4116
|
+
/**
|
|
4117
|
+
* The length of this project's new preview URLs when a request does not say (`length`):
|
|
4118
|
+
* `short` or `long`; `null` = the organization's setting. Set by an owner.
|
|
4119
|
+
*/
|
|
4120
|
+
preview_link_length?: PreviewLinkLength | null;
|
|
3945
4121
|
project_id: string;
|
|
3946
4122
|
}
|
|
3947
4123
|
export interface Provenance {
|
|
@@ -5559,6 +5735,12 @@ export interface SecretStored {
|
|
|
5559
5735
|
* of the `*`. Present when `hosts` is.
|
|
5560
5736
|
*/
|
|
5561
5737
|
urls?: Array<string>;
|
|
5738
|
+
/**
|
|
5739
|
+
* Things to know about the value just stored, one `code: sentence` per line; absent when
|
|
5740
|
+
* there are none. `api_key_value`: the value holds an API key of this service, which any
|
|
5741
|
+
* command in a sandbox given this secret can use.
|
|
5742
|
+
*/
|
|
5743
|
+
warnings?: Array<string>;
|
|
5562
5744
|
}
|
|
5563
5745
|
/**
|
|
5564
5746
|
* One stored secret, without its value.
|