withruntime 1.1.1 → 1.4.58

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.
Files changed (77) hide show
  1. package/README.md +5 -2
  2. package/dist/generated/agentSessions.d.ts +2 -2
  3. package/dist/generated/agentSessions.js +2 -2
  4. package/dist/generated/agents.d.ts +2 -2
  5. package/dist/generated/agents.js +1 -1
  6. package/dist/generated/apps.d.ts +8 -6
  7. package/dist/generated/apps.js +10 -6
  8. package/dist/generated/browsers.d.ts +8 -6
  9. package/dist/generated/browsers.js +10 -6
  10. package/dist/generated/builds.d.ts +8 -6
  11. package/dist/generated/builds.js +10 -6
  12. package/dist/generated/ci.d.ts +106 -6
  13. package/dist/generated/ci.js +14 -6
  14. package/dist/generated/containers.d.ts +8 -6
  15. package/dist/generated/containers.js +10 -6
  16. package/dist/generated/desktops.d.ts +8 -6
  17. package/dist/generated/desktops.js +10 -6
  18. package/dist/generated/dropins/e2b.d.ts +180 -0
  19. package/dist/generated/dropins/e2b.js +342 -0
  20. package/dist/generated/dropins/e2b_code_interpreter.d.ts +180 -0
  21. package/dist/generated/dropins/e2b_code_interpreter.js +342 -0
  22. package/dist/generated/dropins/modal.d.ts +195 -0
  23. package/dist/generated/dropins/modal.js +375 -0
  24. package/dist/generated/dropins/runtime.d.ts +74 -0
  25. package/dist/generated/dropins/runtime.js +180 -0
  26. package/dist/generated/dropins/vercel.d.ts +78 -0
  27. package/dist/generated/dropins/vercel.js +154 -0
  28. package/dist/generated/egressIps.d.ts +2 -2
  29. package/dist/generated/egressIps.js +2 -2
  30. package/dist/generated/functions.d.ts +8 -6
  31. package/dist/generated/functions.js +10 -6
  32. package/dist/generated/identities.d.ts +42 -4
  33. package/dist/generated/identities.js +60 -0
  34. package/dist/generated/images.d.ts +3 -0
  35. package/dist/generated/images.js +4 -0
  36. package/dist/generated/index.d.ts +1 -1
  37. package/dist/generated/jobs.d.ts +2 -2
  38. package/dist/generated/jobs.js +1 -1
  39. package/dist/generated/keys.d.ts +28 -0
  40. package/dist/generated/keys.js +4 -0
  41. package/dist/generated/notebooks.d.ts +8 -6
  42. package/dist/generated/notebooks.js +10 -6
  43. package/dist/generated/ports.d.ts +2 -0
  44. package/dist/generated/projects.d.ts +49 -7
  45. package/dist/generated/projects.js +72 -3
  46. package/dist/generated/roles.d.ts +43 -5
  47. package/dist/generated/roles.js +61 -0
  48. package/dist/generated/routes.js +1 -1
  49. package/dist/generated/runtime.d.ts +49 -3
  50. package/dist/generated/runtime.js +235 -26
  51. package/dist/generated/sandboxes.d.ts +33 -14
  52. package/dist/generated/sandboxes.js +10 -6
  53. package/dist/generated/sites.d.ts +8 -6
  54. package/dist/generated/sites.js +10 -6
  55. package/dist/generated/snapshots.d.ts +7 -2
  56. package/dist/generated/snapshots.js +6 -2
  57. package/dist/generated/usage.d.ts +9 -3
  58. package/dist/generated/volumes.d.ts +30 -11
  59. package/dist/generated/volumes.js +19 -6
  60. package/dist/generated/workspaces.d.ts +8 -6
  61. package/dist/generated/workspaces.js +10 -6
  62. package/dist/v2/cli.d.ts +29 -0
  63. package/dist/v2/cli.js +156 -7
  64. package/dist/v2/login.d.ts +6 -0
  65. package/dist/v2/login.js +2 -1
  66. package/dist/v2/mcp.d.ts +5 -0
  67. package/dist/v2/mcp.js +196 -35
  68. package/dist/v2/openapi.json +3053 -1772
  69. package/dist/v2/shims/base.d.ts +0 -3
  70. package/dist/v2/shims/base.js +2 -7
  71. package/dist/v2/shims/blaxel.js +2 -1
  72. package/dist/v2/shims/daytona.js +3 -2
  73. package/dist/v2/shims/morph.js +3 -1
  74. package/dist/v2/shims/vercel.js +2 -1
  75. package/package.json +3 -2
  76. package/dist/v2/shims/e2b.d.ts +0 -142
  77. package/dist/v2/shims/e2b.js +0 -238
@@ -46,7 +46,7 @@ export class SandboxFiles {
46
46
  writeFolderUpload(upload, data, query = {}, options) {
47
47
  return this.#c.writeFolderUpload(this.#id, upload, data, query, options);
48
48
  }
49
- /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
49
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
50
50
  commitFolderUpload(upload, options) {
51
51
  return this.#c.commitFolderUpload(this.#id, upload, options);
52
52
  }
@@ -62,7 +62,7 @@ export class SandboxFiles {
62
62
  rename(input, options) {
63
63
  return this.#c.rename(this.#id, input, options);
64
64
  }
65
- /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its sandbox. A paused sandbox is woken for it unless wake is false. */
65
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its sandbox. A paused sandbox is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
66
66
  link(path, input = {}, options) {
67
67
  return this.#c.link(this.#id, { ...input, path: path }, options);
68
68
  }
@@ -151,7 +151,7 @@ export class Sandbox {
151
151
  get id() {
152
152
  return this.info.id;
153
153
  }
154
- /** Its vCPUs; its product's default when omitted. At least 1. */
154
+ /** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
155
155
  get vcpu() {
156
156
  return this.info.vcpu;
157
157
  }
@@ -167,7 +167,7 @@ export class Sandbox {
167
167
  get image() {
168
168
  return this.info.image;
169
169
  }
170
- /** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. Fixed for its life: a fork or a copy of a snapshot keeps it. At most 64 items. */
170
+ /** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
171
171
  get secrets() {
172
172
  return this.info.secrets;
173
173
  }
@@ -235,6 +235,10 @@ export class Sandbox {
235
235
  get ready() {
236
236
  return this.info.ready;
237
237
  }
238
+ /** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
239
+ get url() {
240
+ return this.info.url;
241
+ }
238
242
  /** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
239
243
  get deleteAt() {
240
244
  return this.info.deleteAt;
@@ -407,7 +411,7 @@ export class Sandboxes {
407
411
  writeFolderUpload(id, upload, data, query = {}, options) {
408
412
  return this.transport.request("PUT", `/v2/sandboxes/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}`, { data: toBytes(data), query: { ...query }, options, idempotent: true });
409
413
  }
410
- /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
414
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
411
415
  commitFolderUpload(id, upload, options) {
412
416
  return this.transport.request("POST", `/v2/sandboxes/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}:commit`, { options, idempotent: true });
413
417
  }
@@ -423,7 +427,7 @@ export class Sandboxes {
423
427
  rename(id, input, options) {
424
428
  return this.transport.request("POST", `/v2/sandboxes/${encodeURIComponent(id)}/files:rename`, { body: input, options });
425
429
  }
426
- /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its sandbox. A paused sandbox is woken for it unless wake is false. */
430
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its sandbox. A paused sandbox is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
427
431
  link(id, input, options) {
428
432
  return this.transport.request("POST", `/v2/sandboxes/${encodeURIComponent(id)}/files:link`, { body: input, options });
429
433
  }
@@ -164,7 +164,7 @@ export declare class SiteFiles {
164
164
  beginFolderUpload(path: string, input?: Omit<FolderUploadBegin, "path">, options?: RequestOptions): Promise<FolderUpload>;
165
165
  /** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
166
166
  writeFolderUpload(upload: string, data: Uint8Array | string, query?: SiteWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
167
- /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
167
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
168
168
  commitFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
169
169
  /** Stops a folder upload's tar; what it unpacked so far stays. */
170
170
  abortFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
@@ -172,7 +172,7 @@ export declare class SiteFiles {
172
172
  mkdir(path: string, input?: Omit<FileMkdir, "path">, options?: RequestOptions): Promise<FileMade>;
173
173
  /** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
174
174
  rename(input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
175
- /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its site. A paused site is woken for it unless wake is false. */
175
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its site. A paused site is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
176
176
  link(path: string, input?: Omit<FileLinkCreate, "path">, options?: RequestOptions): Promise<FileLink>;
177
177
  /** Ends every file link made for a site so far; links made after work. */
178
178
  revokeLinks(options?: RequestOptions): Promise<FileLinksRevoked>;
@@ -212,7 +212,7 @@ export declare class Site {
212
212
  constructor(client: Sites, info: SandboxInfo);
213
213
  /** Its id. */
214
214
  get id(): string;
215
- /** Its vCPUs; its product's default when omitted. At least 1. */
215
+ /** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
216
216
  get vcpu(): number | undefined;
217
217
  /** Its memory in GB (1 GB is 1,024 MiB); a fraction is taken to the MiB (`1.5`). Its product's default when omitted. At least 1. */
218
218
  get memoryGB(): number | undefined;
@@ -220,7 +220,7 @@ export declare class Site {
220
220
  get diskGB(): number | undefined;
221
221
  /** The image it boots, by name (its newest version), `name:version` or ID; Runtime's default image when omitted. */
222
222
  get image(): string | undefined;
223
- /** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. Fixed for its life: a fork or a copy of a snapshot keeps it. At most 64 items. */
223
+ /** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
224
224
  get secrets(): string[] | undefined;
225
225
  /** The command it starts at every fresh boot and keeps running, as a service: a web server, a runner, a desktop. A wake with its memory kept does not start it again. Its image's when omitted. */
226
226
  get start(): MachineStart | undefined;
@@ -254,6 +254,8 @@ export declare class Site {
254
254
  get pausedAt(): string | undefined;
255
255
  /** A create's answer alone, for a start with a ready check: how its wait went. */
256
256
  get ready(): MachineReady | undefined;
257
+ /** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
258
+ get url(): string | undefined;
257
259
  /** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
258
260
  get deleteAt(): string | undefined;
259
261
  /** Whether its delete is refused (409 `delete_protected`) until an update turns this off. */
@@ -335,7 +337,7 @@ export declare class Sites {
335
337
  beginFolderUpload(id: string, input: FolderUploadBegin, options?: RequestOptions): Promise<FolderUpload>;
336
338
  /** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
337
339
  writeFolderUpload(id: string, upload: string, data: Uint8Array | string, query?: SiteWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
338
- /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
340
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
339
341
  commitFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
340
342
  /** Stops a folder upload's tar; what it unpacked so far stays. */
341
343
  abortFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
@@ -343,7 +345,7 @@ export declare class Sites {
343
345
  mkdir(id: string, input: FileMkdir, options?: RequestOptions): Promise<FileMade>;
344
346
  /** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
345
347
  rename(id: string, input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
346
- /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its site. A paused site is woken for it unless wake is false. */
348
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its site. A paused site is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
347
349
  link(id: string, input: FileLinkCreate, options?: RequestOptions): Promise<FileLink>;
348
350
  /** Ends every file link made for a site so far; links made after work. */
349
351
  revokeLinks(id: string, options?: RequestOptions): Promise<FileLinksRevoked>;
@@ -45,7 +45,7 @@ export class SiteFiles {
45
45
  writeFolderUpload(upload, data, query = {}, options) {
46
46
  return this.#c.writeFolderUpload(this.#id, upload, data, query, options);
47
47
  }
48
- /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
48
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
49
49
  commitFolderUpload(upload, options) {
50
50
  return this.#c.commitFolderUpload(this.#id, upload, options);
51
51
  }
@@ -61,7 +61,7 @@ export class SiteFiles {
61
61
  rename(input, options) {
62
62
  return this.#c.rename(this.#id, input, options);
63
63
  }
64
- /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its site. A paused site is woken for it unless wake is false. */
64
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its site. A paused site is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
65
65
  link(path, input = {}, options) {
66
66
  return this.#c.link(this.#id, { ...input, path: path }, options);
67
67
  }
@@ -135,7 +135,7 @@ export class Site {
135
135
  get id() {
136
136
  return this.info.id;
137
137
  }
138
- /** Its vCPUs; its product's default when omitted. At least 1. */
138
+ /** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
139
139
  get vcpu() {
140
140
  return this.info.vcpu;
141
141
  }
@@ -151,7 +151,7 @@ export class Site {
151
151
  get image() {
152
152
  return this.info.image;
153
153
  }
154
- /** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. Fixed for its life: a fork or a copy of a snapshot keeps it. At most 64 items. */
154
+ /** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
155
155
  get secrets() {
156
156
  return this.info.secrets;
157
157
  }
@@ -219,6 +219,10 @@ export class Site {
219
219
  get ready() {
220
220
  return this.info.ready;
221
221
  }
222
+ /** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
223
+ get url() {
224
+ return this.info.url;
225
+ }
222
226
  /** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
223
227
  get deleteAt() {
224
228
  return this.info.deleteAt;
@@ -382,7 +386,7 @@ export class Sites {
382
386
  writeFolderUpload(id, upload, data, query = {}, options) {
383
387
  return this.transport.request("PUT", `/v2/sites/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}`, { data: toBytes(data), query: { ...query }, options, idempotent: true });
384
388
  }
385
- /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
389
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
386
390
  commitFolderUpload(id, upload, options) {
387
391
  return this.transport.request("POST", `/v2/sites/${encodeURIComponent(id)}/files/archive/uploads/${encodeURIComponent(upload)}:commit`, { options, idempotent: true });
388
392
  }
@@ -398,7 +402,7 @@ export class Sites {
398
402
  rename(id, input, options) {
399
403
  return this.transport.request("POST", `/v2/sites/${encodeURIComponent(id)}/files:rename`, { body: input, options });
400
404
  }
401
- /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its site. A paused site is woken for it unless wake is false. */
405
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its site. A paused site is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
402
406
  link(id, input, options) {
403
407
  return this.transport.request("POST", `/v2/sites/${encodeURIComponent(id)}/files:link`, { body: input, options });
404
408
  }
@@ -1,5 +1,6 @@
1
1
  import type { RequestOptions, Transport } from "./runtime.js";
2
2
  import { Paginated } from "./runtime.js";
3
+ import type { SnapshotSchedule } from "./sandboxes.js";
3
4
  import type { Stored } from "./sandboxes.js";
4
5
  /** A change to a snapshot, an image version or a volume: each field left out stays as it is. */
5
6
  export interface StoredUpdate {
@@ -18,6 +19,8 @@ export type SnapshotListQuery = {
18
19
  label?: string[];
19
20
  /** Only those taken of this machine, by its ID; a deleted one's snapshots too. */
20
21
  sandbox?: string;
22
+ /** Only those taken of this volume, by its ID; a deleted one's snapshots too. */
23
+ volume?: string;
21
24
  /** The most items the page holds. At least 1. At most 200. Default: 50. */
22
25
  limit?: number;
23
26
  };
@@ -28,7 +31,7 @@ export type SnapshotGetQuery = {
28
31
  /** The state the caller last read, which `wait` waits for it to leave. */
29
32
  ifState?: string;
30
33
  };
31
- /** One of snapshots: A machine's memory and disk as they were, kept to start new machines from. */
34
+ /** One of snapshots: A machine's memory and disk as they were, kept to start new machines from; or a volume's disk as it was, kept to restore as a new volume. */
32
35
  export declare class Snapshot {
33
36
  #private;
34
37
  /** What it was when last read. */
@@ -68,6 +71,8 @@ export declare class Snapshot {
68
71
  get deleteWaitsFor(): string | undefined;
69
72
  /** Whether its delete is refused (409 `delete_protected`) until an update turns this off. */
70
73
  get deleteProtection(): boolean | undefined;
74
+ /** A volume's snapshot schedule; none: off. */
75
+ get snapshotSchedule(): SnapshotSchedule | undefined;
71
76
  /** Returns a snapshot. */
72
77
  refresh(query?: SnapshotGetQuery & RequestOptions, options?: RequestOptions): Promise<this>;
73
78
  /** Deletes a snapshot, its memory and its disk. */
@@ -77,7 +82,7 @@ export declare class Snapshot {
77
82
  /** Deletes it when the `await using` block that holds it ends. */
78
83
  [Symbol.asyncDispose](): Promise<void>;
79
84
  }
80
- /** A machine's memory and disk as they were, kept to start new machines from. */
85
+ /** A machine's memory and disk as they were, kept to start new machines from; or a volume's disk as it was, kept to restore as a new volume. */
81
86
  export declare class Snapshots {
82
87
  readonly transport: Transport;
83
88
  constructor(transport: Transport);
@@ -1,7 +1,7 @@
1
1
  // Generated by spec-gen from engines/front/crates/spec. Do not edit:
2
2
  // change the spec and run `cargo run -p runtime-front-spec-gen -- write`.
3
3
  import { Paginated } from "./runtime.js";
4
- /** One of snapshots: A machine's memory and disk as they were, kept to start new machines from. */
4
+ /** One of snapshots: A machine's memory and disk as they were, kept to start new machines from; or a volume's disk as it was, kept to restore as a new volume. */
5
5
  export class Snapshot {
6
6
  #c;
7
7
  /** What it was when last read. */
@@ -78,6 +78,10 @@ export class Snapshot {
78
78
  get deleteProtection() {
79
79
  return this.info.deleteProtection;
80
80
  }
81
+ /** A volume's snapshot schedule; none: off. */
82
+ get snapshotSchedule() {
83
+ return this.info.snapshotSchedule;
84
+ }
81
85
  /** Returns a snapshot. */
82
86
  async refresh(query = {}, options) {
83
87
  this.info = (await this.#c.get(this.id, query, options)).info;
@@ -97,7 +101,7 @@ export class Snapshot {
97
101
  await this.delete();
98
102
  }
99
103
  }
100
- /** A machine's memory and disk as they were, kept to start new machines from. */
104
+ /** A machine's memory and disk as they were, kept to start new machines from; or a volume's disk as it was, kept to restore as a new volume. */
101
105
  export class Snapshots {
102
106
  transport;
103
107
  constructor(transport) {
@@ -55,10 +55,12 @@ export interface KeySpendCap {
55
55
  export interface UsageHour {
56
56
  /** The hour's first moment (UTC). */
57
57
  at: string;
58
- /** What it was used by: the machine's kind (`sandbox`, `app`, `function`, `ci`, ...), what is kept on disk (`disk`, `volume`, `snapshot`, `image`), or `traffic`, what was sent out; `machine` or `storage` when what used it was deleted too long ago to name. */
58
+ /** What it was used by: the machine's kind (`sandbox`, `app`, `function`, `ci`, ...), what is kept on disk (`disk`, `volume`, `snapshot`, `image`), or `traffic`, what was sent out; `machine` or `storage` when what used it was deleted too long ago to name. With `meter`, never `traffic`: what sent it out. */
59
59
  product: string;
60
60
  /** What it costs on the price card, before any credit, in US dollars. */
61
61
  charged: string;
62
+ /** With `meter`: what it used of that meter in the hour, in the meter's base unit, as an integer in text. */
63
+ quantity?: string;
62
64
  }
63
65
  /** One meter's part of one product's month: a quantity at the card's rate. */
64
66
  export interface ProductLine {
@@ -120,9 +122,9 @@ export interface Usage {
120
122
  key?: KeyUsage;
121
123
  /** The spend cap this key's creates are held to: the tightest of its own, those of the keys it was made with, and its holder's grants'. Omitted when none holds it. */
122
124
  keySpendCap?: KeySpendCap;
123
- /** With `by=hour`: what each product used each hour, since the month began or 7 days ago, whichever is earlier, oldest first. Only hours that cost something. */
125
+ /** With `by=hour`: what each product used each hour, since the month began or 7 days ago, whichever is earlier (or since `since`, if later), oldest first. Only hours that cost something; with `meter`, only hours that used it. */
124
126
  hours?: UsageHour[];
125
- /** With `by=hour`: what each product's month is made of, a line for each meter it used, its quantity at the card's rate. A product's lines sum to its hours since the month began. */
127
+ /** With `by=hour`: what each product's month is made of, a line for each meter it used, its quantity at the card's rate. A product's lines sum to its hours since the month began (or since `since`, if later). */
126
128
  lines?: ProductLine[];
127
129
  /** With `by=key`: what each key's machines and storage used this month, most first. A key the caller may not see is counted under `others`. */
128
130
  keys?: KeySpend[];
@@ -179,6 +181,10 @@ export type UsageGetQuery = {
179
181
  key?: string;
180
182
  /** Splits too (repeat it for both): `hour`, what each product used each hour (`hours`); `key`, what each key used this month (`keys`). */
181
183
  by?: string[];
184
+ /** With `by=hour`, only this meter's use (`traffic-out`, `cpu`, ...): each hour by what used it, with its `quantity`. */
185
+ meter?: string;
186
+ /** With `by=hour`, only the hours from this one on (UTC, RFC 3339), never before the month began or 7 days ago, whichever is earlier. */
187
+ since?: string;
182
188
  };
183
189
  /** What export takes in its query. */
184
190
  export type UsageExportQuery = {
@@ -1,20 +1,33 @@
1
1
  import type { RequestOptions, ClientOptions } from "./runtime.js";
2
2
  import { Paginated, Transport } from "./runtime.js";
3
+ import type { SnapshotSchedule } from "./sandboxes.js";
3
4
  import type { Stored } from "./sandboxes.js";
4
5
  import type { StoredUpdate } from "./snapshots.js";
6
+ /** A volume's settings. */
7
+ export interface VolumeSettings {
8
+ /** Its snapshots on a timer; off when omitted. */
9
+ snapshotSchedule?: SnapshotSchedule;
10
+ }
5
11
  /** A volume to create: an empty disk, formatted ext4 at its first mount. */
6
- export interface VolumeCreate {
12
+ export interface VolumeCreate extends VolumeSettings {
7
13
  /** Its name, unique in its project among volumes. */
8
14
  name?: string;
9
15
  /** Labels to find it by. */
10
16
  labels?: Record<string, string>;
11
- /** Its size in MiB, 64 to 409600 (400 GiB). */
12
- sizeMiB: number;
17
+ /** Its size in MiB, 64 to 409600 (400 GiB). Not with `from`, whose snapshot's size it takes. */
18
+ sizeMiB?: number;
19
+ /** A snapshot of a volume, by its ID (`ready`), to restore: the new volume holds what that volume held when the snapshot was taken, at its size. A restore is always a new volume, never an overwrite. */
20
+ from?: string;
13
21
  /** Seconds until Runtime deletes it and what it holds, as its delete does: final, and it can't be undone; one attached to a machine is deleted once that machine ends. 0 or omitted: kept until deleted. At least 0. At most 315360000. */
14
22
  deleteAfterSeconds?: number;
15
23
  /** Whether its delete is refused (409 `delete_protected`) until an update turns this off; false when omitted. Not with `deleteAfterSeconds`. */
16
24
  deleteProtection?: boolean;
17
25
  }
26
+ /** A change to a volume: each field left out stays as it is. */
27
+ export interface VolumeUpdate extends StoredUpdate {
28
+ /** Its snapshot schedule, in place of the one it has; `everySeconds` 0 turns it off. */
29
+ snapshotSchedule?: SnapshotSchedule;
30
+ }
18
31
  /** What list takes in its query. */
19
32
  export type VolumeListQuery = {
20
33
  /** Only those of this name. */
@@ -73,14 +86,18 @@ export declare class Volume {
73
86
  get deleteWaitsFor(): string | undefined;
74
87
  /** Whether its delete is refused (409 `delete_protected`) until an update turns this off. */
75
88
  get deleteProtection(): boolean | undefined;
89
+ /** A volume's snapshot schedule; none: off. */
90
+ get snapshotSchedule(): SnapshotSchedule | undefined;
76
91
  /** Makes one and returns it, as `new Runtime().volumes.create()` does, with a client of its own: `RUNTIME_API_KEY`, or the key `options` names. */
77
- static create(input: VolumeCreate, options?: ClientOptions & RequestOptions): Promise<Volume>;
92
+ static create(input?: VolumeCreate, options?: ClientOptions & RequestOptions): Promise<Volume>;
78
93
  /** Returns a volume. */
79
94
  refresh(query?: VolumeGetQuery & RequestOptions, options?: RequestOptions): Promise<this>;
80
- /** Deletes a volume and what it holds. One attached to a machine is refused: delete the machine first. */
95
+ /** Deletes a volume and what it holds. One attached to a machine is refused: delete the machine first. Its snapshots are kept until each is deleted. */
81
96
  delete(options?: RequestOptions): Promise<Stored>;
82
- /** Changes its lifetime (`deleteAfterSeconds`) or delete protection (`deleteProtection`). A lifetime sent again before its end moves the end to that many seconds from now; 0 takes it off. At its end Runtime deletes it as its delete does: final, and it can't be undone. A lifetime and protection are never set together (409 `delete_protected`). Each field left out stays as it is. */
83
- update(input?: StoredUpdate, options?: RequestOptions): Promise<this>;
97
+ /** Keeps the volume's disk as it is now, a snapshot to restore as a new volume (`from`); one attached to a running machine is taken as it runs, consistent as after a power cut. It returns the snapshot at once, `making` until its copy is off-site, then `ready`. One never attached holds nothing to keep (409). Asked again with the same Idempotency-Key, it returns the same snapshot. */
98
+ snapshot(options?: RequestOptions): Promise<this>;
99
+ /** Changes its lifetime (`deleteAfterSeconds`), delete protection (`deleteProtection`) or snapshot schedule (`snapshotSchedule`). A lifetime sent again before its end moves the end to that many seconds from now; 0 takes it off. At its end Runtime deletes it as its delete does: final, and it can't be undone. A lifetime and protection are never set together (409 `delete_protected`). A schedule sent replaces the one it has, its first snapshot `everySeconds` from now; `everySeconds` 0 turns it off, and the snapshots it made are kept. Each field left out stays as it is. */
100
+ update(input?: VolumeUpdate, options?: RequestOptions): Promise<this>;
84
101
  /** Deletes it when the `await using` block that holds it ends. */
85
102
  [Symbol.asyncDispose](): Promise<void>;
86
103
  }
@@ -89,13 +106,15 @@ export declare class Volumes {
89
106
  readonly transport: Transport;
90
107
  constructor(transport: Transport);
91
108
  /** Creates an empty volume. Asked again with the same Idempotency-Key, it returns the same one. */
92
- create(input: VolumeCreate, options?: RequestOptions): Promise<Volume>;
109
+ create(input?: VolumeCreate, options?: RequestOptions): Promise<Volume>;
93
110
  /** Lists the project's volumes, newest first. */
94
111
  list(query?: VolumeListQuery & RequestOptions, options?: RequestOptions): Paginated<Stored>;
95
112
  /** Returns a volume. */
96
113
  get(id: string, query?: VolumeGetQuery & RequestOptions, options?: RequestOptions): Promise<Volume>;
97
- /** Deletes a volume and what it holds. One attached to a machine is refused: delete the machine first. */
114
+ /** Deletes a volume and what it holds. One attached to a machine is refused: delete the machine first. Its snapshots are kept until each is deleted. */
98
115
  delete(id: string, options?: RequestOptions): Promise<Stored>;
99
- /** Changes its lifetime (`deleteAfterSeconds`) or delete protection (`deleteProtection`). A lifetime sent again before its end moves the end to that many seconds from now; 0 takes it off. At its end Runtime deletes it as its delete does: final, and it can't be undone. A lifetime and protection are never set together (409 `delete_protected`). Each field left out stays as it is. */
100
- update(id: string, input?: StoredUpdate, options?: RequestOptions): Promise<Stored>;
116
+ /** Keeps the volume's disk as it is now, a snapshot to restore as a new volume (`from`); one attached to a running machine is taken as it runs, consistent as after a power cut. It returns the snapshot at once, `making` until its copy is off-site, then `ready`. One never attached holds nothing to keep (409). Asked again with the same Idempotency-Key, it returns the same snapshot. */
117
+ snapshot(id: string, options?: RequestOptions): Promise<Stored>;
118
+ /** Changes its lifetime (`deleteAfterSeconds`), delete protection (`deleteProtection`) or snapshot schedule (`snapshotSchedule`). A lifetime sent again before its end moves the end to that many seconds from now; 0 takes it off. At its end Runtime deletes it as its delete does: final, and it can't be undone. A lifetime and protection are never set together (409 `delete_protected`). A schedule sent replaces the one it has, its first snapshot `everySeconds` from now; `everySeconds` 0 turns it off, and the snapshots it made are kept. Each field left out stays as it is. */
119
+ update(id: string, input?: VolumeUpdate, options?: RequestOptions): Promise<Stored>;
101
120
  }
@@ -78,8 +78,12 @@ export class Volume {
78
78
  get deleteProtection() {
79
79
  return this.info.deleteProtection;
80
80
  }
81
+ /** A volume's snapshot schedule; none: off. */
82
+ get snapshotSchedule() {
83
+ return this.info.snapshotSchedule;
84
+ }
81
85
  /** Makes one and returns it, as `new Runtime().volumes.create()` does, with a client of its own: `RUNTIME_API_KEY`, or the key `options` names. */
82
- static async create(input, options = {}) {
86
+ static async create(input = {}, options = {}) {
83
87
  return new Volumes(new Transport(options)).create(input, options);
84
88
  }
85
89
  /** Returns a volume. */
@@ -87,11 +91,16 @@ export class Volume {
87
91
  this.info = (await this.#c.get(this.id, query, options)).info;
88
92
  return this;
89
93
  }
90
- /** Deletes a volume and what it holds. One attached to a machine is refused: delete the machine first. */
94
+ /** Deletes a volume and what it holds. One attached to a machine is refused: delete the machine first. Its snapshots are kept until each is deleted. */
91
95
  delete(options) {
92
96
  return this.#c.delete(this.id, options);
93
97
  }
94
- /** Changes its lifetime (`deleteAfterSeconds`) or delete protection (`deleteProtection`). A lifetime sent again before its end moves the end to that many seconds from now; 0 takes it off. At its end Runtime deletes it as its delete does: final, and it can't be undone. A lifetime and protection are never set together (409 `delete_protected`). Each field left out stays as it is. */
98
+ /** Keeps the volume's disk as it is now, a snapshot to restore as a new volume (`from`); one attached to a running machine is taken as it runs, consistent as after a power cut. It returns the snapshot at once, `making` until its copy is off-site, then `ready`. One never attached holds nothing to keep (409). Asked again with the same Idempotency-Key, it returns the same snapshot. */
99
+ async snapshot(options) {
100
+ this.info = await this.#c.snapshot(this.id, options);
101
+ return this;
102
+ }
103
+ /** Changes its lifetime (`deleteAfterSeconds`), delete protection (`deleteProtection`) or snapshot schedule (`snapshotSchedule`). A lifetime sent again before its end moves the end to that many seconds from now; 0 takes it off. At its end Runtime deletes it as its delete does: final, and it can't be undone. A lifetime and protection are never set together (409 `delete_protected`). A schedule sent replaces the one it has, its first snapshot `everySeconds` from now; `everySeconds` 0 turns it off, and the snapshots it made are kept. Each field left out stays as it is. */
95
104
  async update(input = {}, options) {
96
105
  this.info = await this.#c.update(this.id, input, options);
97
106
  return this;
@@ -108,7 +117,7 @@ export class Volumes {
108
117
  this.transport = transport;
109
118
  }
110
119
  /** Creates an empty volume. Asked again with the same Idempotency-Key, it returns the same one. */
111
- async create(input, options) {
120
+ async create(input = {}, options) {
112
121
  return new Volume(this, await this.transport.request("POST", `/v2/volumes`, { body: input, options, idempotent: true }));
113
122
  }
114
123
  /** Lists the project's volumes, newest first. */
@@ -119,11 +128,15 @@ export class Volumes {
119
128
  async get(id, query = {}, options) {
120
129
  return new Volume(this, await this.transport.request("GET", `/v2/volumes/${encodeURIComponent(id)}`, { query: { ...query }, options, idempotent: true }));
121
130
  }
122
- /** Deletes a volume and what it holds. One attached to a machine is refused: delete the machine first. */
131
+ /** Deletes a volume and what it holds. One attached to a machine is refused: delete the machine first. Its snapshots are kept until each is deleted. */
123
132
  delete(id, options) {
124
133
  return this.transport.request("DELETE", `/v2/volumes/${encodeURIComponent(id)}`, { options });
125
134
  }
126
- /** Changes its lifetime (`deleteAfterSeconds`) or delete protection (`deleteProtection`). A lifetime sent again before its end moves the end to that many seconds from now; 0 takes it off. At its end Runtime deletes it as its delete does: final, and it can't be undone. A lifetime and protection are never set together (409 `delete_protected`). Each field left out stays as it is. */
135
+ /** Keeps the volume's disk as it is now, a snapshot to restore as a new volume (`from`); one attached to a running machine is taken as it runs, consistent as after a power cut. It returns the snapshot at once, `making` until its copy is off-site, then `ready`. One never attached holds nothing to keep (409). Asked again with the same Idempotency-Key, it returns the same snapshot. */
136
+ snapshot(id, options) {
137
+ return this.transport.request("POST", `/v2/volumes/${encodeURIComponent(id)}:snapshot`, { options, idempotent: true });
138
+ }
139
+ /** Changes its lifetime (`deleteAfterSeconds`), delete protection (`deleteProtection`) or snapshot schedule (`snapshotSchedule`). A lifetime sent again before its end moves the end to that many seconds from now; 0 takes it off. At its end Runtime deletes it as its delete does: final, and it can't be undone. A lifetime and protection are never set together (409 `delete_protected`). A schedule sent replaces the one it has, its first snapshot `everySeconds` from now; `everySeconds` 0 turns it off, and the snapshots it made are kept. Each field left out stays as it is. */
127
140
  update(id, input = {}, options) {
128
141
  return this.transport.request("POST", `/v2/volumes/${encodeURIComponent(id)}:update`, { body: input, options, idempotent: true });
129
142
  }
@@ -164,7 +164,7 @@ export declare class WorkspaceFiles {
164
164
  beginFolderUpload(path: string, input?: Omit<FolderUploadBegin, "path">, options?: RequestOptions): Promise<FolderUpload>;
165
165
  /** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
166
166
  writeFolderUpload(upload: string, data: Uint8Array | string, query?: WorkspaceWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
167
- /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
167
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
168
168
  commitFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
169
169
  /** Stops a folder upload's tar; what it unpacked so far stays. */
170
170
  abortFolderUpload(upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
@@ -172,7 +172,7 @@ export declare class WorkspaceFiles {
172
172
  mkdir(path: string, input?: Omit<FileMkdir, "path">, options?: RequestOptions): Promise<FileMade>;
173
173
  /** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
174
174
  rename(input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
175
- /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its workspace. A paused workspace is woken for it unless wake is false. */
175
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its workspace. A paused workspace is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
176
176
  link(path: string, input?: Omit<FileLinkCreate, "path">, options?: RequestOptions): Promise<FileLink>;
177
177
  /** Ends every file link made for a workspace so far; links made after work. */
178
178
  revokeLinks(options?: RequestOptions): Promise<FileLinksRevoked>;
@@ -212,7 +212,7 @@ export declare class Workspace {
212
212
  constructor(client: Workspaces, info: SandboxInfo);
213
213
  /** Its id. */
214
214
  get id(): string;
215
- /** Its vCPUs; its product's default when omitted. At least 1. */
215
+ /** Its vCPUs, at least every plan's least (a smaller number is taken as it); its product's default when omitted. At least 2. */
216
216
  get vcpu(): number | undefined;
217
217
  /** Its memory in GB (1 GB is 1,024 MiB); a fraction is taken to the MiB (`1.5`). Its product's default when omitted. At least 1. */
218
218
  get memoryGB(): number | undefined;
@@ -220,7 +220,7 @@ export declare class Workspace {
220
220
  get diskGB(): number | undefined;
221
221
  /** The image it boots, by name (its newest version), `name:version` or ID; Runtime's default image when omitted. */
222
222
  get image(): string | undefined;
223
- /** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. Fixed for its life: a fork or a copy of a snapshot keeps it. At most 64 items. */
223
+ /** The secrets it may get, by name, at most 64: only those of them whose scope admits it; [] none; every one whose scope admits it when omitted. A name with no secret yet takes effect once that secret is created. An update changes it; a fork or a copy of a snapshot keeps it. At most 64 items. */
224
224
  get secrets(): string[] | undefined;
225
225
  /** The command it starts at every fresh boot and keeps running, as a service: a web server, a runner, a desktop. A wake with its memory kept does not start it again. Its image's when omitted. */
226
226
  get start(): MachineStart | undefined;
@@ -254,6 +254,8 @@ export declare class Workspace {
254
254
  get pausedAt(): string | undefined;
255
255
  /** A create's answer alone, for a start with a ready check: how its wait went. */
256
256
  get ready(): MachineReady | undefined;
257
+ /** For a machine that serves a port of its own (an app, a site or a function on 8080, a container on its image's, a notebook on 8888, a workspace on 8080, a desktop on 6080, a browser's DevTools on 9222): a link that opens it, answered by its create, get and update, none for a key that may not share its ports. It works for 10 minutes; a browser that opens it is given a cookie for that address for a day and sent on to the address without it, so no history keeps a link that still opens it. Another port is shared with previews.create. */
258
+ get url(): string | undefined;
257
259
  /** When Runtime deletes it (`deleteAfterSeconds`), finally: it can't be undone, as its delete can't; none: kept until deleted. */
258
260
  get deleteAt(): string | undefined;
259
261
  /** Whether its delete is refused (409 `delete_protected`) until an update turns this off. */
@@ -335,7 +337,7 @@ export declare class Workspaces {
335
337
  beginFolderUpload(id: string, input: FolderUploadBegin, options?: RequestOptions): Promise<FolderUpload>;
336
338
  /** Sends the request's bytes, a part of the archive at its offset, into tar's input as they arrive, of any size, and returns the bytes received in all once tar took them. A part past them is refused 409 `upload_incomplete`, naming them: send the parts in order. */
337
339
  writeFolderUpload(id: string, upload: string, data: Uint8Array | string, query?: WorkspaceWriteFolderUploadQuery & RequestOptions, options?: RequestOptions): Promise<FolderUploadReceived>;
338
- /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. A front that restarts meanwhile returns 503 `run_goes_on`; sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
340
+ /** Ends a folder upload's input and returns once tar has ended, as an exec returns once its command has: the folder, or 400 `invalid_archive` with what tar said. Sent again, it returns how tar ended. An upload no call has named for 10 minutes since its last part or commit is ended. */
339
341
  commitFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUnpacked>;
340
342
  /** Stops a folder upload's tar; what it unpacked so far stays. */
341
343
  abortFolderUpload(id: string, upload: string, options?: RequestOptions): Promise<FolderUploadAborted>;
@@ -343,7 +345,7 @@ export declare class Workspaces {
343
345
  mkdir(id: string, input: FileMkdir, options?: RequestOptions): Promise<FileMade>;
344
346
  /** Moves a file, a link or a directory; refused 409 when something is at its new path, unless overwrite. With sha256 or size, a file written in parts is put in place once whole: its writes ended, then only a file of that size with every byte written and whose bytes hash to it moves; refused 409 `upload_incomplete` or `checksum_mismatch`, nothing moved. With sha256, it is safe to send again: once moved, it returns the same answer while `from` is gone and `to` holds those bytes. */
345
347
  rename(id: string, input: FileRename, options?: RequestOptions): Promise<FileRenamed>;
346
- /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its workspace. A paused workspace is woken for it unless wake is false. */
348
+ /** Makes an expiring address for one file that anyone may open with no API key, from a browser, curl or another service: GET downloads it (Range works, so videos play and downloads resume; archive: true downloads a folder as .tar.gz), PUT with the raw body uploads it (up to maxBytes, written whole; Content-Length required). The link acts as the key that made it: an upload link needs write, and the link ends with its key, with revokeLinks or with its workspace. A paused workspace is woken for it unless wake is false. A port it serves is shared by a preview (previews.create), not a link. */
347
349
  link(id: string, input: FileLinkCreate, options?: RequestOptions): Promise<FileLink>;
348
350
  /** Ends every file link made for a workspace so far; links made after work. */
349
351
  revokeLinks(id: string, options?: RequestOptions): Promise<FileLinksRevoked>;