disk 1.17.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/{archil-DiHA0VsS.d.mts → archil-BxdRlEP8.d.cts} +17 -2
- package/dist/{archil-Dte6VwUg.d.cts → archil-DiKN8QjJ.d.mts} +17 -2
- package/dist/archil-cli.mjs +4 -4
- package/dist/cli.mjs +2 -2
- package/dist/{disk-command-DznI8UDC.mjs → disk-command-B2bvvH9D.mjs} +2 -2
- package/dist/index.cjs +66 -25
- package/dist/index.d.cts +4 -14
- package/dist/index.d.mts +4 -14
- package/dist/index.mjs +2 -2
- package/dist/internal/tools.d.cts +1 -1
- package/dist/internal/tools.d.mts +1 -1
- package/dist/node/index.cjs +66 -25
- package/dist/node/index.mjs +18 -19
- package/dist/node/webhooks.cjs +9 -0
- package/dist/node/webhooks.mjs +2 -0
- package/dist/sandbox-cli.mjs +3 -3
- package/dist/{sandbox-command-DcDUy3G5.mjs → sandbox-command-CGh24ty9.mjs} +1 -1
- package/dist/{sandbox-options-BVDMHQFQ.mjs → sandbox-options-LF4zG3Gd.mjs} +1 -1
- package/dist/{src-DsTIOHFL.mjs → src-D6Zm2pS3.mjs} +18 -19
- package/dist/tunnel.d.cts +1 -1
- package/dist/tunnel.d.mts +1 -1
- package/dist/webhooks.cjs +9 -0
- package/dist/webhooks.d.cts +1 -0
- package/dist/webhooks.d.mts +1 -0
- package/dist/webhooks.mjs +2 -0
- package/package.json +16 -3
package/README.md
CHANGED
|
@@ -51,6 +51,23 @@ console.log(run.stdout);
|
|
|
51
51
|
await sandbox.delete();
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
## Git hosting
|
|
55
|
+
|
|
56
|
+
`archil.git` is git hosting where every repo is a disk in your own account: repos, commits
|
|
57
|
+
without git, instant forks, scoped tokens for `git`, push webhooks (`disk/webhooks`) and a
|
|
58
|
+
read API. It is a preview. Enable it in the [Archil console](https://console.archil.com)
|
|
59
|
+
(Git hosting) and pass the endpoint it shows:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { Archil } from "disk";
|
|
63
|
+
|
|
64
|
+
const archil = new Archil({ region: "aws-us-west-2", git: { endpoint: process.env.ARCHIL_GIT_URL } });
|
|
65
|
+
const repo = await archil.git.repos.create({ name: "my-app" });
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
See the [archil.git guide](https://github.com/archil-data/archil-sdk/tree/main/packages/git#readme)
|
|
69
|
+
and [examples/git](./examples/git).
|
|
70
|
+
|
|
54
71
|
## CLI
|
|
55
72
|
|
|
56
73
|
The `archil` command manages disks and sandboxes. Run it with `npx archil`, or install it
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ClientFrame, ClientFrameSchema, SandboxSchema, ServerFrameSchema } from "@archildata/api-types/process";
|
|
1
|
+
import { ArchilGit } from "@archildata/git";
|
|
3
2
|
import { ConnectionOptions } from "node:tls";
|
|
4
3
|
import { components, paths } from "@archildata/api-types";
|
|
4
|
+
import { MessageInitShape, fromBinary } from "@bufbuild/protobuf";
|
|
5
|
+
import { ClientFrame, ClientFrameSchema, SandboxSchema, ServerFrameSchema } from "@archildata/api-types/process";
|
|
5
6
|
|
|
6
7
|
//#region src/api-fetch.d.ts
|
|
7
8
|
type HttpMethod = "get" | "put" | "post" | "delete" | "patch";
|
|
@@ -1844,6 +1845,14 @@ interface ArchilOptions {
|
|
|
1844
1845
|
s3BaseUrl?: string;
|
|
1845
1846
|
/** Per-client TLS trust for control-plane and S3 requests (Node.js only). */
|
|
1846
1847
|
tls?: ArchilTlsOptions;
|
|
1848
|
+
/** Options for `archil.git`, which uses this client's API key. */
|
|
1849
|
+
git?: {
|
|
1850
|
+
/**
|
|
1851
|
+
* The account's git hosting endpoint, shown on the Archil console's Git hosting page. Falls back to
|
|
1852
|
+
* ARCHIL_GIT_URL. Without one, `archil.git` calls throw `ArchilGitError` with code `not_configured`.
|
|
1853
|
+
*/
|
|
1854
|
+
endpoint?: string;
|
|
1855
|
+
};
|
|
1847
1856
|
/**
|
|
1848
1857
|
* Seconds sandbox create, start, resume, and fork keep retrying while the
|
|
1849
1858
|
* region has no capacity, logging a warning, before throwing the 503. Falls
|
|
@@ -1923,6 +1932,7 @@ interface ExecStreamOptions extends Omit<ExecOptions, "stream">, Omit<SandboxPro
|
|
|
1923
1932
|
stream: true;
|
|
1924
1933
|
}
|
|
1925
1934
|
declare class Archil {
|
|
1935
|
+
#private;
|
|
1926
1936
|
readonly disks: Disks;
|
|
1927
1937
|
readonly images: Images;
|
|
1928
1938
|
readonly sandboxes: Sandboxes;
|
|
@@ -1934,6 +1944,11 @@ declare class Archil {
|
|
|
1934
1944
|
/** @internal Created on the first streamed exec. */
|
|
1935
1945
|
private _execConnection?;
|
|
1936
1946
|
constructor(opts?: ArchilOptions);
|
|
1947
|
+
/**
|
|
1948
|
+
* Git hosting in this account, created on first use: `archil.git.repos.create(...)`. Enable it in the
|
|
1949
|
+
* Archil console and pass the endpoint it shows as `git: { endpoint }` (or set ARCHIL_GIT_URL).
|
|
1950
|
+
*/
|
|
1951
|
+
get git(): ArchilGit;
|
|
1937
1952
|
/**
|
|
1938
1953
|
* Run a command in a container with multiple disks mounted simultaneously,
|
|
1939
1954
|
* each at its own relative path under `/mnt/archil`. Blocks until the
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { components, paths } from "@archildata/api-types";
|
|
1
|
+
import { ArchilGit } from "@archildata/git";
|
|
3
2
|
import { MessageInitShape, fromBinary } from "@bufbuild/protobuf";
|
|
4
3
|
import { ClientFrame, ClientFrameSchema, SandboxSchema, ServerFrameSchema } from "@archildata/api-types/process";
|
|
4
|
+
import { ConnectionOptions } from "node:tls";
|
|
5
|
+
import { components, paths } from "@archildata/api-types";
|
|
5
6
|
|
|
6
7
|
//#region src/api-fetch.d.ts
|
|
7
8
|
type HttpMethod = "get" | "put" | "post" | "delete" | "patch";
|
|
@@ -1844,6 +1845,14 @@ interface ArchilOptions {
|
|
|
1844
1845
|
s3BaseUrl?: string;
|
|
1845
1846
|
/** Per-client TLS trust for control-plane and S3 requests (Node.js only). */
|
|
1846
1847
|
tls?: ArchilTlsOptions;
|
|
1848
|
+
/** Options for `archil.git`, which uses this client's API key. */
|
|
1849
|
+
git?: {
|
|
1850
|
+
/**
|
|
1851
|
+
* The account's git hosting endpoint, shown on the Archil console's Git hosting page. Falls back to
|
|
1852
|
+
* ARCHIL_GIT_URL. Without one, `archil.git` calls throw `ArchilGitError` with code `not_configured`.
|
|
1853
|
+
*/
|
|
1854
|
+
endpoint?: string;
|
|
1855
|
+
};
|
|
1847
1856
|
/**
|
|
1848
1857
|
* Seconds sandbox create, start, resume, and fork keep retrying while the
|
|
1849
1858
|
* region has no capacity, logging a warning, before throwing the 503. Falls
|
|
@@ -1923,6 +1932,7 @@ interface ExecStreamOptions extends Omit<ExecOptions, "stream">, Omit<SandboxPro
|
|
|
1923
1932
|
stream: true;
|
|
1924
1933
|
}
|
|
1925
1934
|
declare class Archil {
|
|
1935
|
+
#private;
|
|
1926
1936
|
readonly disks: Disks;
|
|
1927
1937
|
readonly images: Images;
|
|
1928
1938
|
readonly sandboxes: Sandboxes;
|
|
@@ -1934,6 +1944,11 @@ declare class Archil {
|
|
|
1934
1944
|
/** @internal Created on the first streamed exec. */
|
|
1935
1945
|
private _execConnection?;
|
|
1936
1946
|
constructor(opts?: ArchilOptions);
|
|
1947
|
+
/**
|
|
1948
|
+
* Git hosting in this account, created on first use: `archil.git.repos.create(...)`. Enable it in the
|
|
1949
|
+
* Archil console and pass the endpoint it shows as `git: { endpoint }` (or set ARCHIL_GIT_URL).
|
|
1950
|
+
*/
|
|
1951
|
+
get git(): ArchilGit;
|
|
1937
1952
|
/**
|
|
1938
1953
|
* Run a command in a container with multiple disks mounted simultaneously,
|
|
1939
1954
|
* each at its own relative path under `/mnt/archil`. Blocks until the
|
package/dist/archil-cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { C as printError, _ as writeProfileCredential, a as addGlobalOptions, d as saveProfiles, g as resolveCliCredentials, l as deleteProfile, m as deleteProfileCredential, o as addProfileCommands, p as validateCredentialAndResolveRegion, u as loadProfiles, v as diskConfigDir, x as createUi, y as Command } from "./sandbox-options-
|
|
4
|
-
import { n as rewriteDiskExecSugar, t as addDiskCommands } from "./disk-command-
|
|
5
|
-
import { r as openInBrowser, t as addSandboxCommands } from "./sandbox-command-
|
|
2
|
+
import { b as Archil } from "./src-D6Zm2pS3.mjs";
|
|
3
|
+
import { C as printError, _ as writeProfileCredential, a as addGlobalOptions, d as saveProfiles, g as resolveCliCredentials, l as deleteProfile, m as deleteProfileCredential, o as addProfileCommands, p as validateCredentialAndResolveRegion, u as loadProfiles, v as diskConfigDir, x as createUi, y as Command } from "./sandbox-options-LF4zG3Gd.mjs";
|
|
4
|
+
import { n as rewriteDiskExecSugar, t as addDiskCommands } from "./disk-command-B2bvvH9D.mjs";
|
|
5
|
+
import { r as openInBrowser, t as addSandboxCommands } from "./sandbox-command-CGh24ty9.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
8
8
|
import { delimiter, join } from "node:path";
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as printError, a as addGlobalOptions, o as addProfileCommands, y as Command } from "./sandbox-options-
|
|
3
|
-
import { n as rewriteDiskExecSugar, t as addDiskCommands } from "./disk-command-
|
|
2
|
+
import { C as printError, a as addGlobalOptions, o as addProfileCommands, y as Command } from "./sandbox-options-LF4zG3Gd.mjs";
|
|
3
|
+
import { n as rewriteDiskExecSugar, t as addDiskCommands } from "./disk-command-B2bvvH9D.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
//#region bin/cli.ts
|
|
6
6
|
const pkg = createRequire(import.meta.url)("../package.json");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { C as printError, c as resolveProgramCredentials, f as renderTable, s as isProfileCommand, t as optionalInteger, x as createUi } from "./sandbox-options-
|
|
1
|
+
import { a as configure, f as getDisk, g as listDisks, h as listApiKeys, j as ArchilApiError, o as createApiKey, s as createDisk, u as deleteApiKey } from "./src-D6Zm2pS3.mjs";
|
|
2
|
+
import { C as printError, c as resolveProgramCredentials, f as renderTable, s as isProfileCommand, t as optionalInteger, x as createUi } from "./sandbox-options-LF4zG3Gd.mjs";
|
|
3
3
|
//#region src/cli/disk-command.ts
|
|
4
4
|
const DISK_COMMANDS = [
|
|
5
5
|
"list",
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_sandbox_desktop = require("./sandbox-desktop-DBs8jhKW.cjs");
|
|
3
3
|
const require_paths = require("./paths-1c4QqbOB.cjs");
|
|
4
|
+
let _archildata_git = require("@archildata/git");
|
|
4
5
|
let _bufbuild_protobuf = require("@bufbuild/protobuf");
|
|
5
6
|
let _archildata_api_types_process = require("@archildata/api-types/process");
|
|
7
|
+
let _archildata_core = require("@archildata/core");
|
|
6
8
|
//#region src/generated/http-spec.ts
|
|
7
9
|
const RETRY_CAP_MS = 2e3;
|
|
8
10
|
const TRANSIENT_STATUSES = [
|
|
@@ -122,7 +124,7 @@ function deriveS3BaseUrl(controlBaseUrl) {
|
|
|
122
124
|
}
|
|
123
125
|
//#endregion
|
|
124
126
|
//#region src/version.ts
|
|
125
|
-
const VERSION = "1.
|
|
127
|
+
const VERSION = "1.18.0";
|
|
126
128
|
const USER_AGENT = `archil-js/${VERSION}`;
|
|
127
129
|
//#endregion
|
|
128
130
|
//#region src/client.ts
|
|
@@ -1583,31 +1585,14 @@ function parseXml(xml) {
|
|
|
1583
1585
|
}
|
|
1584
1586
|
//#endregion
|
|
1585
1587
|
//#region src/errors.ts
|
|
1586
|
-
/**
|
|
1587
|
-
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
1588
|
-
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
1589
|
-
* code and `code` a machine-readable error code when the server provided one.
|
|
1590
|
-
*/
|
|
1591
|
-
var ArchilError = class extends Error {
|
|
1592
|
-
/** HTTP status code associated with the failure. */
|
|
1593
|
-
status;
|
|
1594
|
-
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
1595
|
-
code;
|
|
1596
|
-
constructor(message, status, code) {
|
|
1597
|
-
super(message);
|
|
1598
|
-
this.name = "ArchilError";
|
|
1599
|
-
this.status = status;
|
|
1600
|
-
this.code = code;
|
|
1601
|
-
}
|
|
1602
|
-
};
|
|
1603
1588
|
/** Error from the control-plane REST API. */
|
|
1604
|
-
var ArchilApiError = class extends ArchilError {
|
|
1589
|
+
var ArchilApiError = class extends _archildata_core.ArchilError {
|
|
1605
1590
|
constructor(message, status, code) {
|
|
1606
1591
|
super(message, status, code);
|
|
1607
1592
|
this.name = "ArchilApiError";
|
|
1608
1593
|
}
|
|
1609
1594
|
};
|
|
1610
|
-
var SandboxPauseError = class extends ArchilError {
|
|
1595
|
+
var SandboxPauseError = class extends _archildata_core.ArchilError {
|
|
1611
1596
|
latest;
|
|
1612
1597
|
constructor(latest) {
|
|
1613
1598
|
super(`Sandbox entered ${latest.status} before it paused${latest.exitReason ? `: ${latest.exitReason}` : ""}`, 409, "SANDBOX_PAUSE_FAILED");
|
|
@@ -1615,7 +1600,7 @@ var SandboxPauseError = class extends ArchilError {
|
|
|
1615
1600
|
this.name = "SandboxPauseError";
|
|
1616
1601
|
}
|
|
1617
1602
|
};
|
|
1618
|
-
var ImageBuildError = class extends ArchilError {
|
|
1603
|
+
var ImageBuildError = class extends _archildata_core.ArchilError {
|
|
1619
1604
|
latest;
|
|
1620
1605
|
reason;
|
|
1621
1606
|
constructor(latest) {
|
|
@@ -1625,7 +1610,7 @@ var ImageBuildError = class extends ArchilError {
|
|
|
1625
1610
|
this.reason = latest.failureReason;
|
|
1626
1611
|
}
|
|
1627
1612
|
};
|
|
1628
|
-
var SandboxFileTransferError = class extends ArchilError {
|
|
1613
|
+
var SandboxFileTransferError = class extends _archildata_core.ArchilError {
|
|
1629
1614
|
operation;
|
|
1630
1615
|
path;
|
|
1631
1616
|
constructor(operation, path, cause) {
|
|
@@ -1642,7 +1627,7 @@ var SandboxFileTransferError = class extends ArchilError {
|
|
|
1642
1627
|
* this surfaces its parts as structured fields (`status`, `code`, `requestId`)
|
|
1643
1628
|
* rather than a raw blob, while keeping the full body on `raw` for debugging.
|
|
1644
1629
|
*/
|
|
1645
|
-
var ArchilS3Error = class extends ArchilError {
|
|
1630
|
+
var ArchilS3Error = class extends _archildata_core.ArchilError {
|
|
1646
1631
|
/** S3 request id, if the gateway returned one. */
|
|
1647
1632
|
requestId;
|
|
1648
1633
|
/** Raw response body (the XML document), for debugging. */
|
|
@@ -2949,7 +2934,7 @@ var Images = class {
|
|
|
2949
2934
|
lastRequest = Date.now();
|
|
2950
2935
|
continue;
|
|
2951
2936
|
}
|
|
2952
|
-
if (Date.now() >= deadline) throw new ArchilError(`Image ${image.imageId} was not ready after ${timeoutSeconds} seconds`, 408, "IMAGE_BUILD_TIMEOUT");
|
|
2937
|
+
if (Date.now() >= deadline) throw new _archildata_core.ArchilError(`Image ${image.imageId} was not ready after ${timeoutSeconds} seconds`, 408, "IMAGE_BUILD_TIMEOUT");
|
|
2953
2938
|
await new Promise((resolve) => setTimeout(resolve, pollMs));
|
|
2954
2939
|
pollMs = Math.min(pollMs * 2, MAX_POLL_MS);
|
|
2955
2940
|
image = await this.get(image.imageId);
|
|
@@ -4003,6 +3988,8 @@ var Archil = class {
|
|
|
4003
3988
|
tokens;
|
|
4004
3989
|
/** @internal */
|
|
4005
3990
|
_client;
|
|
3991
|
+
#gitOptions;
|
|
3992
|
+
#git;
|
|
4006
3993
|
/** @internal Opens control-plane WebSockets for streamed execs. */
|
|
4007
3994
|
_execSocket;
|
|
4008
3995
|
/** @internal Created on the first streamed exec. */
|
|
@@ -4024,6 +4011,10 @@ var Archil = class {
|
|
|
4024
4011
|
});
|
|
4025
4012
|
const s3BaseUrl = opts.s3BaseUrl ?? envVar("ARCHIL_S3_BASE_URL") ?? deriveS3BaseUrl(controlBaseUrl);
|
|
4026
4013
|
this._client = client;
|
|
4014
|
+
this.#gitOptions = {
|
|
4015
|
+
apiKey,
|
|
4016
|
+
endpoint: opts.git?.endpoint
|
|
4017
|
+
};
|
|
4027
4018
|
const authorization = apiKeyAuthorization(apiKey);
|
|
4028
4019
|
this._execSocket = () => controlPlaneSocket({
|
|
4029
4020
|
baseUrl: controlBaseUrl,
|
|
@@ -4037,6 +4028,14 @@ var Archil = class {
|
|
|
4037
4028
|
this.sandboxes = new Sandboxes(client);
|
|
4038
4029
|
this.tokens = new Tokens(client);
|
|
4039
4030
|
}
|
|
4031
|
+
/**
|
|
4032
|
+
* Git hosting in this account, created on first use: `archil.git.repos.create(...)`. Enable it in the
|
|
4033
|
+
* Archil console and pass the endpoint it shows as `git: { endpoint }` (or set ARCHIL_GIT_URL).
|
|
4034
|
+
*/
|
|
4035
|
+
get git() {
|
|
4036
|
+
this.#git ??= new _archildata_git.ArchilGit(this.#gitOptions);
|
|
4037
|
+
return this.#git;
|
|
4038
|
+
}
|
|
4040
4039
|
async exec(opts) {
|
|
4041
4040
|
if (opts.stream) return this._execStream(opts);
|
|
4042
4041
|
const disks = {};
|
|
@@ -4181,7 +4180,13 @@ function workspace(mounts) {
|
|
|
4181
4180
|
//#endregion
|
|
4182
4181
|
exports.Archil = Archil;
|
|
4183
4182
|
exports.ArchilApiError = ArchilApiError;
|
|
4184
|
-
exports.ArchilError = ArchilError;
|
|
4183
|
+
exports.ArchilError = _archildata_core.ArchilError;
|
|
4184
|
+
Object.defineProperty(exports, "ArchilGitError", {
|
|
4185
|
+
enumerable: true,
|
|
4186
|
+
get: function() {
|
|
4187
|
+
return _archildata_git.ArchilGitError;
|
|
4188
|
+
}
|
|
4189
|
+
});
|
|
4185
4190
|
exports.ArchilS3Error = ArchilS3Error;
|
|
4186
4191
|
exports.DESKTOP_IMAGE = require_sandbox_desktop.DESKTOP_IMAGE;
|
|
4187
4192
|
exports.DESKTOP_MAX_TTL_SECONDS = require_sandbox_desktop.DESKTOP_MAX_TTL_SECONDS;
|
|
@@ -4194,6 +4199,12 @@ exports.DiskMultipart = DiskMultipart;
|
|
|
4194
4199
|
exports.Disks = Disks;
|
|
4195
4200
|
exports.ImageBuildError = ImageBuildError;
|
|
4196
4201
|
exports.Images = Images;
|
|
4202
|
+
Object.defineProperty(exports, "Repo", {
|
|
4203
|
+
enumerable: true,
|
|
4204
|
+
get: function() {
|
|
4205
|
+
return _archildata_git.Repo;
|
|
4206
|
+
}
|
|
4207
|
+
});
|
|
4197
4208
|
exports.Sandbox = Sandbox;
|
|
4198
4209
|
exports.SandboxDesktop = require_sandbox_desktop.SandboxDesktop;
|
|
4199
4210
|
exports.SandboxFileTransferError = SandboxFileTransferError;
|
|
@@ -4202,21 +4213,51 @@ exports.SandboxPauseError = SandboxPauseError;
|
|
|
4202
4213
|
exports.SandboxProcess = SandboxProcess;
|
|
4203
4214
|
exports.SandboxProcesses = SandboxProcesses;
|
|
4204
4215
|
exports.Sandboxes = Sandboxes;
|
|
4216
|
+
Object.defineProperty(exports, "TOKEN_ENV", {
|
|
4217
|
+
enumerable: true,
|
|
4218
|
+
get: function() {
|
|
4219
|
+
return _archildata_git.TOKEN_ENV;
|
|
4220
|
+
}
|
|
4221
|
+
});
|
|
4205
4222
|
exports.Tokens = Tokens;
|
|
4206
4223
|
exports.USER_AGENT = USER_AGENT;
|
|
4207
4224
|
exports.VERSION = VERSION;
|
|
4208
4225
|
exports.Workspace = Workspace;
|
|
4226
|
+
Object.defineProperty(exports, "authenticatedRemoteUrl", {
|
|
4227
|
+
enumerable: true,
|
|
4228
|
+
get: function() {
|
|
4229
|
+
return _archildata_git.authenticatedRemoteUrl;
|
|
4230
|
+
}
|
|
4231
|
+
});
|
|
4209
4232
|
exports.configure = configure;
|
|
4210
4233
|
exports.createApiKey = createApiKey;
|
|
4211
4234
|
exports.createDisk = createDisk;
|
|
4212
4235
|
exports.createSandbox = createSandbox;
|
|
4236
|
+
Object.defineProperty(exports, "credentialHelper", {
|
|
4237
|
+
enumerable: true,
|
|
4238
|
+
get: function() {
|
|
4239
|
+
return _archildata_git.credentialHelper;
|
|
4240
|
+
}
|
|
4241
|
+
});
|
|
4213
4242
|
exports.deleteApiKey = deleteApiKey;
|
|
4214
4243
|
exports.desktopViewerPath = require_sandbox_desktop.desktopViewerPath;
|
|
4215
4244
|
exports.effectiveUploadPartSize = effectiveUploadPartSize;
|
|
4216
4245
|
exports.exec = exec;
|
|
4217
4246
|
exports.getDisk = getDisk;
|
|
4218
4247
|
exports.getSandbox = getSandbox;
|
|
4248
|
+
Object.defineProperty(exports, "gitEnv", {
|
|
4249
|
+
enumerable: true,
|
|
4250
|
+
get: function() {
|
|
4251
|
+
return _archildata_git.gitEnv;
|
|
4252
|
+
}
|
|
4253
|
+
});
|
|
4219
4254
|
exports.listApiKeys = listApiKeys;
|
|
4220
4255
|
exports.listDisks = listDisks;
|
|
4221
4256
|
exports.listSandboxes = listSandboxes;
|
|
4257
|
+
Object.defineProperty(exports, "repoMount", {
|
|
4258
|
+
enumerable: true,
|
|
4259
|
+
get: function() {
|
|
4260
|
+
return _archildata_git.repoMount;
|
|
4261
|
+
}
|
|
4262
|
+
});
|
|
4222
4263
|
exports.workspace = workspace;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import { $ as effectiveUploadPartSize, $t as SandboxNetwork, A as Disk, At as ExecNetwork, B as MultipartUpload, Bt as SandboxProcesses, C as ListDisksOptions, Cn as ArchilTlsOptions, Ct as R2Mount, D as DeleteObjectsError, Dt as S3User, E as CreateBranchOptions, Et as S3Mount, F as ListMultipartUploadsOptions, Ft as SandboxProcessOutputHandler, G as PartListing, Gt as Sandbox, H as MultipartUploadSummary, Ht as CreateSandboxPortTokenOptions, I as ListObjectsOptions, It as SandboxProcessResult, J as PutObjectResult, Jt as SandboxEgressTransform, K as PosixCreateAttrs, Kt as SandboxEgressPolicy, L as ListObjectsResult, Lt as SandboxProcessStartOptions, M as ExecResult, Mt as SandboxProcess, N as GrepOptions, Nt as SandboxProcessConnectOptions, O as DeleteObjectsOptions, Ot as TokenUser, P as GrepResult, Pt as SandboxProcessOutput, Q as UploadPart, Qt as SandboxMountSpec, R as ListPartsOptions, Rt as SandboxProcessStatus, S as Disks, Sn as desktopViewerPath, St as MountResponse, T as CompletedMultipartUpload, Tt as S3CompatibleMount, U as ObjectMetadata, Ut as CreatedSandboxPortToken, V as MultipartUploadListing, Vt as SandboxTerminalOptions, W as PartInfo, Wt as ListSandboxPortTokensOptions, X as ShareUrlOptions, Xt as SandboxForkOptions, Y as S3Object, Yt as SandboxEndpoint, Z as ShareUrlResult, Zt as SandboxMount, _ as ImageStatus, _n as DESKTOP_VCPUS, _t as GrepGroupLine, a as ExecOptions, an as SandboxStatus, at as ConnectedClient, b as CreateDiskResult, bn as DesktopScrollDirection, bt as MountConfig, c as ListTokensOptions, cn as SandboxWaitOptions, ct as Delegation, d as ListSandboxesOptions, dn as SandboxFileWriter, dt as DiskStatus, en as SandboxNetworkAction, et as ApiTokenResponse, f as Sandboxes, fn as SandboxFiles, ft as DiskUser, g as ImageFailureReason, gn as DESKTOP_PORT, gt as GrepGroup, h as Image, hn as DESKTOP_MEMORY_MIB, ht as GCSMount, i as ExecMountSpec, in as SandboxStartOptions, it as Branch, j as DiskMultipart, jt as ExecVmOptions, k as DeleteObjectsResult, kt as FileSystem, l as Tokens, ln as SandboxFileSource, lt as DiskMetrics, m as BuildImageRequest, mn as DESKTOP_MAX_TTL_SECONDS, mt as ExecRequest, n as ArchilOptions, nn as SandboxPortTokenPage, nt as AwsStsUser, o as ExecStreamOptions, on as SandboxTimeoutAction, ot as CreateApiTokenRequest, p as BuildImageOptions, pn as DESKTOP_IMAGE, pt as ExecDiskResult, q as PutObjectOptions, qt as SandboxEgressRule, r as ExecMount, rn as SandboxResponse, rt as AzureBlobMount, s as Workspace, sn as SandboxTimeoutOptions, st as CreateDiskRequest, t as Archil, tn as SandboxPortToken, tt as AuthorizedUser, u as CreateSandboxRequest, un as SandboxFileUploadOptions, ut as DiskResponse, v as Images, vn as DesktopMouseButton, vt as GrepMatch, w as AppendObjectOptions, wt as RootAttrs, x as DiskListPage, xn as SandboxDesktop, xt as MountConfigResponse, y as RegistryAuth, yn as DesktopNotInstalledError, yt as GrepStoppedReason, z as MountOptions, zt as SandboxProcessStream } from "./archil-
|
|
1
|
+
import { $ as effectiveUploadPartSize, $t as SandboxNetwork, A as Disk, At as ExecNetwork, B as MultipartUpload, Bt as SandboxProcesses, C as ListDisksOptions, Cn as ArchilTlsOptions, Ct as R2Mount, D as DeleteObjectsError, Dt as S3User, E as CreateBranchOptions, Et as S3Mount, F as ListMultipartUploadsOptions, Ft as SandboxProcessOutputHandler, G as PartListing, Gt as Sandbox, H as MultipartUploadSummary, Ht as CreateSandboxPortTokenOptions, I as ListObjectsOptions, It as SandboxProcessResult, J as PutObjectResult, Jt as SandboxEgressTransform, K as PosixCreateAttrs, Kt as SandboxEgressPolicy, L as ListObjectsResult, Lt as SandboxProcessStartOptions, M as ExecResult, Mt as SandboxProcess, N as GrepOptions, Nt as SandboxProcessConnectOptions, O as DeleteObjectsOptions, Ot as TokenUser, P as GrepResult, Pt as SandboxProcessOutput, Q as UploadPart, Qt as SandboxMountSpec, R as ListPartsOptions, Rt as SandboxProcessStatus, S as Disks, Sn as desktopViewerPath, St as MountResponse, T as CompletedMultipartUpload, Tt as S3CompatibleMount, U as ObjectMetadata, Ut as CreatedSandboxPortToken, V as MultipartUploadListing, Vt as SandboxTerminalOptions, W as PartInfo, Wt as ListSandboxPortTokensOptions, X as ShareUrlOptions, Xt as SandboxForkOptions, Y as S3Object, Yt as SandboxEndpoint, Z as ShareUrlResult, Zt as SandboxMount, _ as ImageStatus, _n as DESKTOP_VCPUS, _t as GrepGroupLine, a as ExecOptions, an as SandboxStatus, at as ConnectedClient, b as CreateDiskResult, bn as DesktopScrollDirection, bt as MountConfig, c as ListTokensOptions, cn as SandboxWaitOptions, ct as Delegation, d as ListSandboxesOptions, dn as SandboxFileWriter, dt as DiskStatus, en as SandboxNetworkAction, et as ApiTokenResponse, f as Sandboxes, fn as SandboxFiles, ft as DiskUser, g as ImageFailureReason, gn as DESKTOP_PORT, gt as GrepGroup, h as Image, hn as DESKTOP_MEMORY_MIB, ht as GCSMount, i as ExecMountSpec, in as SandboxStartOptions, it as Branch, j as DiskMultipart, jt as ExecVmOptions, k as DeleteObjectsResult, kt as FileSystem, l as Tokens, ln as SandboxFileSource, lt as DiskMetrics, m as BuildImageRequest, mn as DESKTOP_MAX_TTL_SECONDS, mt as ExecRequest, n as ArchilOptions, nn as SandboxPortTokenPage, nt as AwsStsUser, o as ExecStreamOptions, on as SandboxTimeoutAction, ot as CreateApiTokenRequest, p as BuildImageOptions, pn as DESKTOP_IMAGE, pt as ExecDiskResult, q as PutObjectOptions, qt as SandboxEgressRule, r as ExecMount, rn as SandboxResponse, rt as AzureBlobMount, s as Workspace, sn as SandboxTimeoutOptions, st as CreateDiskRequest, t as Archil, tn as SandboxPortToken, tt as AuthorizedUser, u as CreateSandboxRequest, un as SandboxFileUploadOptions, ut as DiskResponse, v as Images, vn as DesktopMouseButton, vt as GrepMatch, w as AppendObjectOptions, wt as RootAttrs, x as DiskListPage, xn as SandboxDesktop, xt as MountConfigResponse, y as RegistryAuth, yn as DesktopNotInstalledError, yt as GrepStoppedReason, z as MountOptions, zt as SandboxProcessStream } from "./archil-BxdRlEP8.cjs";
|
|
2
|
+
import { ArchilGit, ArchilGitError, BlobOptions, ChangedFile, Commit, CommitFile, CommitIdentity, CommitParams, CommitResult, Comparison, DeleteOptions, FileMode, ForkParams, ForkRef, GitCredentials, ListReposOptions, LogOptions, LogPage, MintOptions, MintedToken, Ref, Refs, Repo, RepoData, RepoMountSpec, RepoPage, Scope, Signature, TOKEN_ENV, Tree, TreeEntry, authenticatedRemoteUrl, credentialHelper, gitEnv, repoMount } from "@archildata/git";
|
|
3
|
+
import { ArchilError } from "@archildata/core";
|
|
2
4
|
|
|
3
5
|
//#region src/errors.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
6
|
-
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
7
|
-
* code and `code` a machine-readable error code when the server provided one.
|
|
8
|
-
*/
|
|
9
|
-
declare class ArchilError extends Error {
|
|
10
|
-
/** HTTP status code associated with the failure. */
|
|
11
|
-
readonly status: number;
|
|
12
|
-
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
13
|
-
readonly code?: string;
|
|
14
|
-
constructor(message: string, status: number, code?: string);
|
|
15
|
-
}
|
|
16
6
|
/** Error from the control-plane REST API. */
|
|
17
7
|
declare class ArchilApiError extends ArchilError {
|
|
18
8
|
constructor(message: string, status: number, code?: string);
|
|
@@ -83,4 +73,4 @@ declare function exec(opts: ExecStreamOptions): Promise<SandboxProcess>;
|
|
|
83
73
|
*/
|
|
84
74
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
85
75
|
//#endregion
|
|
86
|
-
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type ArchilTlsOptions, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type Branch, type BuildImageOptions, type BuildImageRequest, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateBranchOptions, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxPortTokenOptions, type CreateSandboxRequest, type CreatedSandboxPortToken, DESKTOP_IMAGE, DESKTOP_MAX_TTL_SECONDS, DESKTOP_MEMORY_MIB, DESKTOP_PORT, DESKTOP_VCPUS, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, type DesktopMouseButton, DesktopNotInstalledError, type DesktopScrollDirection, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecNetwork, type ExecOptions, type ExecRequest, type ExecResult, type ExecStreamOptions, type ExecVmOptions, type FileSystem, type GCSMount, type GrepGroup, type GrepGroupLine, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type Image, ImageBuildError, type ImageFailureReason, type ImageStatus, Images, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxPortTokensOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RegistryAuth, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, type S3User, Sandbox, SandboxDesktop, type SandboxEgressPolicy, type SandboxEgressRule, type SandboxEgressTransform, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxMount, type SandboxMountSpec, type SandboxNetwork, type SandboxNetworkAction, SandboxPauseError, type SandboxPortToken, type SandboxPortTokenPage, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStartOptions, type SandboxStatus, type SandboxTerminalOptions, type SandboxTimeoutAction, type SandboxTimeoutOptions, type SandboxWaitOptions, Sandboxes, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, desktopViewerPath, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
|
76
|
+
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilGit, ArchilGitError, type ArchilOptions, ArchilS3Error, type ArchilTlsOptions, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type BlobOptions, type Branch, type BuildImageOptions, type BuildImageRequest, type ChangedFile, type Commit, type CommitFile, type CommitIdentity, type CommitParams, type CommitResult, type Comparison, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateBranchOptions, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxPortTokenOptions, type CreateSandboxRequest, type CreatedSandboxPortToken, DESKTOP_IMAGE, DESKTOP_MAX_TTL_SECONDS, DESKTOP_MEMORY_MIB, DESKTOP_PORT, DESKTOP_VCPUS, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, type DeleteOptions, type DesktopMouseButton, DesktopNotInstalledError, type DesktopScrollDirection, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecNetwork, type ExecOptions, type ExecRequest, type ExecResult, type ExecStreamOptions, type ExecVmOptions, type FileMode, type FileSystem, type ForkParams, type ForkRef, type GCSMount, type GitCredentials, type GrepGroup, type GrepGroupLine, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type Image, ImageBuildError, type ImageFailureReason, type ImageStatus, Images, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListReposOptions, type ListSandboxPortTokensOptions, type ListSandboxesOptions, type ListTokensOptions, type LogOptions, type LogPage, type MintOptions, type MintedToken, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type Ref, type Refs, type RegistryAuth, Repo, type RepoData, type RepoMountSpec, type RepoPage, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, type S3User, Sandbox, SandboxDesktop, type SandboxEgressPolicy, type SandboxEgressRule, type SandboxEgressTransform, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxMount, type SandboxMountSpec, type SandboxNetwork, type SandboxNetworkAction, SandboxPauseError, type SandboxPortToken, type SandboxPortTokenPage, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStartOptions, type SandboxStatus, type SandboxTerminalOptions, type SandboxTimeoutAction, type SandboxTimeoutOptions, type SandboxWaitOptions, Sandboxes, type Scope, type ShareUrlOptions, type ShareUrlResult, type Signature, TOKEN_ENV, type TokenUser, Tokens, type Tree, type TreeEntry, USER_AGENT, type UploadPart, VERSION, Workspace, authenticatedRemoteUrl, configure, createApiKey, createDisk, createSandbox, credentialHelper, deleteApiKey, desktopViewerPath, effectiveUploadPartSize, exec, getDisk, getSandbox, gitEnv, listApiKeys, listDisks, listSandboxes, repoMount, workspace };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import { $ as effectiveUploadPartSize, $t as SandboxNetwork, A as Disk, At as ExecNetwork, B as MultipartUpload, Bt as SandboxProcesses, C as ListDisksOptions, Cn as ArchilTlsOptions, Ct as R2Mount, D as DeleteObjectsError, Dt as S3User, E as CreateBranchOptions, Et as S3Mount, F as ListMultipartUploadsOptions, Ft as SandboxProcessOutputHandler, G as PartListing, Gt as Sandbox, H as MultipartUploadSummary, Ht as CreateSandboxPortTokenOptions, I as ListObjectsOptions, It as SandboxProcessResult, J as PutObjectResult, Jt as SandboxEgressTransform, K as PosixCreateAttrs, Kt as SandboxEgressPolicy, L as ListObjectsResult, Lt as SandboxProcessStartOptions, M as ExecResult, Mt as SandboxProcess, N as GrepOptions, Nt as SandboxProcessConnectOptions, O as DeleteObjectsOptions, Ot as TokenUser, P as GrepResult, Pt as SandboxProcessOutput, Q as UploadPart, Qt as SandboxMountSpec, R as ListPartsOptions, Rt as SandboxProcessStatus, S as Disks, Sn as desktopViewerPath, St as MountResponse, T as CompletedMultipartUpload, Tt as S3CompatibleMount, U as ObjectMetadata, Ut as CreatedSandboxPortToken, V as MultipartUploadListing, Vt as SandboxTerminalOptions, W as PartInfo, Wt as ListSandboxPortTokensOptions, X as ShareUrlOptions, Xt as SandboxForkOptions, Y as S3Object, Yt as SandboxEndpoint, Z as ShareUrlResult, Zt as SandboxMount, _ as ImageStatus, _n as DESKTOP_VCPUS, _t as GrepGroupLine, a as ExecOptions, an as SandboxStatus, at as ConnectedClient, b as CreateDiskResult, bn as DesktopScrollDirection, bt as MountConfig, c as ListTokensOptions, cn as SandboxWaitOptions, ct as Delegation, d as ListSandboxesOptions, dn as SandboxFileWriter, dt as DiskStatus, en as SandboxNetworkAction, et as ApiTokenResponse, f as Sandboxes, fn as SandboxFiles, ft as DiskUser, g as ImageFailureReason, gn as DESKTOP_PORT, gt as GrepGroup, h as Image, hn as DESKTOP_MEMORY_MIB, ht as GCSMount, i as ExecMountSpec, in as SandboxStartOptions, it as Branch, j as DiskMultipart, jt as ExecVmOptions, k as DeleteObjectsResult, kt as FileSystem, l as Tokens, ln as SandboxFileSource, lt as DiskMetrics, m as BuildImageRequest, mn as DESKTOP_MAX_TTL_SECONDS, mt as ExecRequest, n as ArchilOptions, nn as SandboxPortTokenPage, nt as AwsStsUser, o as ExecStreamOptions, on as SandboxTimeoutAction, ot as CreateApiTokenRequest, p as BuildImageOptions, pn as DESKTOP_IMAGE, pt as ExecDiskResult, q as PutObjectOptions, qt as SandboxEgressRule, r as ExecMount, rn as SandboxResponse, rt as AzureBlobMount, s as Workspace, sn as SandboxTimeoutOptions, st as CreateDiskRequest, t as Archil, tn as SandboxPortToken, tt as AuthorizedUser, u as CreateSandboxRequest, un as SandboxFileUploadOptions, ut as DiskResponse, v as Images, vn as DesktopMouseButton, vt as GrepMatch, w as AppendObjectOptions, wt as RootAttrs, x as DiskListPage, xn as SandboxDesktop, xt as MountConfigResponse, y as RegistryAuth, yn as DesktopNotInstalledError, yt as GrepStoppedReason, z as MountOptions, zt as SandboxProcessStream } from "./archil-
|
|
1
|
+
import { $ as effectiveUploadPartSize, $t as SandboxNetwork, A as Disk, At as ExecNetwork, B as MultipartUpload, Bt as SandboxProcesses, C as ListDisksOptions, Cn as ArchilTlsOptions, Ct as R2Mount, D as DeleteObjectsError, Dt as S3User, E as CreateBranchOptions, Et as S3Mount, F as ListMultipartUploadsOptions, Ft as SandboxProcessOutputHandler, G as PartListing, Gt as Sandbox, H as MultipartUploadSummary, Ht as CreateSandboxPortTokenOptions, I as ListObjectsOptions, It as SandboxProcessResult, J as PutObjectResult, Jt as SandboxEgressTransform, K as PosixCreateAttrs, Kt as SandboxEgressPolicy, L as ListObjectsResult, Lt as SandboxProcessStartOptions, M as ExecResult, Mt as SandboxProcess, N as GrepOptions, Nt as SandboxProcessConnectOptions, O as DeleteObjectsOptions, Ot as TokenUser, P as GrepResult, Pt as SandboxProcessOutput, Q as UploadPart, Qt as SandboxMountSpec, R as ListPartsOptions, Rt as SandboxProcessStatus, S as Disks, Sn as desktopViewerPath, St as MountResponse, T as CompletedMultipartUpload, Tt as S3CompatibleMount, U as ObjectMetadata, Ut as CreatedSandboxPortToken, V as MultipartUploadListing, Vt as SandboxTerminalOptions, W as PartInfo, Wt as ListSandboxPortTokensOptions, X as ShareUrlOptions, Xt as SandboxForkOptions, Y as S3Object, Yt as SandboxEndpoint, Z as ShareUrlResult, Zt as SandboxMount, _ as ImageStatus, _n as DESKTOP_VCPUS, _t as GrepGroupLine, a as ExecOptions, an as SandboxStatus, at as ConnectedClient, b as CreateDiskResult, bn as DesktopScrollDirection, bt as MountConfig, c as ListTokensOptions, cn as SandboxWaitOptions, ct as Delegation, d as ListSandboxesOptions, dn as SandboxFileWriter, dt as DiskStatus, en as SandboxNetworkAction, et as ApiTokenResponse, f as Sandboxes, fn as SandboxFiles, ft as DiskUser, g as ImageFailureReason, gn as DESKTOP_PORT, gt as GrepGroup, h as Image, hn as DESKTOP_MEMORY_MIB, ht as GCSMount, i as ExecMountSpec, in as SandboxStartOptions, it as Branch, j as DiskMultipart, jt as ExecVmOptions, k as DeleteObjectsResult, kt as FileSystem, l as Tokens, ln as SandboxFileSource, lt as DiskMetrics, m as BuildImageRequest, mn as DESKTOP_MAX_TTL_SECONDS, mt as ExecRequest, n as ArchilOptions, nn as SandboxPortTokenPage, nt as AwsStsUser, o as ExecStreamOptions, on as SandboxTimeoutAction, ot as CreateApiTokenRequest, p as BuildImageOptions, pn as DESKTOP_IMAGE, pt as ExecDiskResult, q as PutObjectOptions, qt as SandboxEgressRule, r as ExecMount, rn as SandboxResponse, rt as AzureBlobMount, s as Workspace, sn as SandboxTimeoutOptions, st as CreateDiskRequest, t as Archil, tn as SandboxPortToken, tt as AuthorizedUser, u as CreateSandboxRequest, un as SandboxFileUploadOptions, ut as DiskResponse, v as Images, vn as DesktopMouseButton, vt as GrepMatch, w as AppendObjectOptions, wt as RootAttrs, x as DiskListPage, xn as SandboxDesktop, xt as MountConfigResponse, y as RegistryAuth, yn as DesktopNotInstalledError, yt as GrepStoppedReason, z as MountOptions, zt as SandboxProcessStream } from "./archil-DiKN8QjJ.mjs";
|
|
2
|
+
import { ArchilGit, ArchilGitError, BlobOptions, ChangedFile, Commit, CommitFile, CommitIdentity, CommitParams, CommitResult, Comparison, DeleteOptions, FileMode, ForkParams, ForkRef, GitCredentials, ListReposOptions, LogOptions, LogPage, MintOptions, MintedToken, Ref, Refs, Repo, RepoData, RepoMountSpec, RepoPage, Scope, Signature, TOKEN_ENV, Tree, TreeEntry, authenticatedRemoteUrl, credentialHelper, gitEnv, repoMount } from "@archildata/git";
|
|
3
|
+
import { ArchilError } from "@archildata/core";
|
|
2
4
|
|
|
3
5
|
//#region src/errors.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
6
|
-
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
7
|
-
* code and `code` a machine-readable error code when the server provided one.
|
|
8
|
-
*/
|
|
9
|
-
declare class ArchilError extends Error {
|
|
10
|
-
/** HTTP status code associated with the failure. */
|
|
11
|
-
readonly status: number;
|
|
12
|
-
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
13
|
-
readonly code?: string;
|
|
14
|
-
constructor(message: string, status: number, code?: string);
|
|
15
|
-
}
|
|
16
6
|
/** Error from the control-plane REST API. */
|
|
17
7
|
declare class ArchilApiError extends ArchilError {
|
|
18
8
|
constructor(message: string, status: number, code?: string);
|
|
@@ -83,4 +73,4 @@ declare function exec(opts: ExecStreamOptions): Promise<SandboxProcess>;
|
|
|
83
73
|
*/
|
|
84
74
|
declare function workspace(mounts: Record<string, ExecMount>): Workspace;
|
|
85
75
|
//#endregion
|
|
86
|
-
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilOptions, ArchilS3Error, type ArchilTlsOptions, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type Branch, type BuildImageOptions, type BuildImageRequest, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateBranchOptions, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxPortTokenOptions, type CreateSandboxRequest, type CreatedSandboxPortToken, DESKTOP_IMAGE, DESKTOP_MAX_TTL_SECONDS, DESKTOP_MEMORY_MIB, DESKTOP_PORT, DESKTOP_VCPUS, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, type DesktopMouseButton, DesktopNotInstalledError, type DesktopScrollDirection, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecNetwork, type ExecOptions, type ExecRequest, type ExecResult, type ExecStreamOptions, type ExecVmOptions, type FileSystem, type GCSMount, type GrepGroup, type GrepGroupLine, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type Image, ImageBuildError, type ImageFailureReason, type ImageStatus, Images, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListSandboxPortTokensOptions, type ListSandboxesOptions, type ListTokensOptions, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type RegistryAuth, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, type S3User, Sandbox, SandboxDesktop, type SandboxEgressPolicy, type SandboxEgressRule, type SandboxEgressTransform, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxMount, type SandboxMountSpec, type SandboxNetwork, type SandboxNetworkAction, SandboxPauseError, type SandboxPortToken, type SandboxPortTokenPage, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStartOptions, type SandboxStatus, type SandboxTerminalOptions, type SandboxTimeoutAction, type SandboxTimeoutOptions, type SandboxWaitOptions, Sandboxes, type ShareUrlOptions, type ShareUrlResult, type TokenUser, Tokens, USER_AGENT, type UploadPart, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, desktopViewerPath, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
|
76
|
+
export { type ApiTokenResponse, type AppendObjectOptions, Archil, ArchilApiError, ArchilError, type ArchilGit, ArchilGitError, type ArchilOptions, ArchilS3Error, type ArchilTlsOptions, type AuthorizedUser, type AwsStsUser, type AzureBlobMount, type BlobOptions, type Branch, type BuildImageOptions, type BuildImageRequest, type ChangedFile, type Commit, type CommitFile, type CommitIdentity, type CommitParams, type CommitResult, type Comparison, type CompletedMultipartUpload, type ConnectedClient, type CreateApiTokenRequest, type CreateBranchOptions, type CreateDiskRequest, type CreateDiskResult, type CreateSandboxPortTokenOptions, type CreateSandboxRequest, type CreatedSandboxPortToken, DESKTOP_IMAGE, DESKTOP_MAX_TTL_SECONDS, DESKTOP_MEMORY_MIB, DESKTOP_PORT, DESKTOP_VCPUS, type Delegation, type DeleteObjectsError, type DeleteObjectsOptions, type DeleteObjectsResult, type DeleteOptions, type DesktopMouseButton, DesktopNotInstalledError, type DesktopScrollDirection, Disk, type DiskListPage, type DiskMetrics, DiskMultipart, type DiskResponse, type DiskStatus, type DiskUser, Disks, type ExecMount, type ExecMountSpec, type ExecNetwork, type ExecOptions, type ExecRequest, type ExecResult, type ExecStreamOptions, type ExecVmOptions, type FileMode, type FileSystem, type ForkParams, type ForkRef, type GCSMount, type GitCredentials, type GrepGroup, type GrepGroupLine, type GrepMatch, type GrepOptions, type GrepResult, type GrepStoppedReason, type Image, ImageBuildError, type ImageFailureReason, type ImageStatus, Images, type ListDisksOptions, type ListMultipartUploadsOptions, type ListObjectsOptions, type ListObjectsResult, type ListPartsOptions, type ListReposOptions, type ListSandboxPortTokensOptions, type ListSandboxesOptions, type ListTokensOptions, type LogOptions, type LogPage, type MintOptions, type MintedToken, type MountConfig, type MountConfigResponse, type MountOptions, type MountResponse, type MultipartUpload, type MultipartUploadListing, type MultipartUploadSummary, type ObjectMetadata, type PartInfo, type PartListing, type PosixCreateAttrs, type PutObjectOptions, type PutObjectResult, type R2Mount, type Ref, type Refs, type RegistryAuth, Repo, type RepoData, type RepoMountSpec, type RepoPage, type RootAttrs, type S3CompatibleMount, type S3Mount, type S3Object, type S3User, Sandbox, SandboxDesktop, type SandboxEgressPolicy, type SandboxEgressRule, type SandboxEgressTransform, type SandboxEndpoint, type SandboxFileSource, SandboxFileTransferError, type SandboxFileUploadOptions, type SandboxFileWriter, SandboxFiles, type SandboxForkOptions, type SandboxMount, type SandboxMountSpec, type SandboxNetwork, type SandboxNetworkAction, SandboxPauseError, type SandboxPortToken, type SandboxPortTokenPage, SandboxProcess, type SandboxProcessConnectOptions, type SandboxProcessOutput, type SandboxProcessOutputHandler, type SandboxProcessResult, type SandboxProcessStartOptions, type SandboxProcessStatus, type SandboxProcessStream, SandboxProcesses, type SandboxResponse, type SandboxStartOptions, type SandboxStatus, type SandboxTerminalOptions, type SandboxTimeoutAction, type SandboxTimeoutOptions, type SandboxWaitOptions, Sandboxes, type Scope, type ShareUrlOptions, type ShareUrlResult, type Signature, TOKEN_ENV, type TokenUser, Tokens, type Tree, type TreeEntry, USER_AGENT, type UploadPart, VERSION, Workspace, authenticatedRemoteUrl, configure, createApiKey, createDisk, createSandbox, credentialHelper, deleteApiKey, desktopViewerPath, effectiveUploadPartSize, exec, getDisk, getSandbox, gitEnv, listApiKeys, listDisks, listSandboxes, repoMount, workspace };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as effectiveUploadPartSize, B as VERSION, C as Sandboxes, D as Disks, E as Images, F as SandboxFileTransferError, I as SandboxPauseError, L as SandboxProcess, M as ArchilError, N as ArchilS3Error, O as Disk, P as ImageBuildError, R as SandboxProcesses, S as Tokens, T as SandboxFiles, _ as listSandboxes, a as configure, b as Archil, c as createSandbox, d as exec, f as getDisk, g as listDisks, h as listApiKeys, i as authenticatedRemoteUrl, j as ArchilApiError, k as DiskMultipart, l as credentialHelper, m as gitEnv, n as Repo, o as createApiKey, p as getSandbox, r as TOKEN_ENV, s as createDisk, t as ArchilGitError, u as deleteApiKey, v as repoMount, w as Sandbox, x as Workspace, y as workspace, z as USER_AGENT } from "./src-D6Zm2pS3.mjs";
|
|
2
2
|
import { a as DESKTOP_VCPUS, c as desktopViewerPath, i as DESKTOP_PORT, n as DESKTOP_MAX_TTL_SECONDS, o as DesktopNotInstalledError, r as DESKTOP_MEMORY_MIB, s as SandboxDesktop, t as DESKTOP_IMAGE } from "./sandbox-desktop-CrvuoiGi.mjs";
|
|
3
|
-
export { Archil, ArchilApiError, ArchilError, ArchilS3Error, DESKTOP_IMAGE, DESKTOP_MAX_TTL_SECONDS, DESKTOP_MEMORY_MIB, DESKTOP_PORT, DESKTOP_VCPUS, DesktopNotInstalledError, Disk, DiskMultipart, Disks, ImageBuildError, Images, Sandbox, SandboxDesktop, SandboxFileTransferError, SandboxFiles, SandboxPauseError, SandboxProcess, SandboxProcesses, Sandboxes, Tokens, USER_AGENT, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, desktopViewerPath, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
|
3
|
+
export { Archil, ArchilApiError, ArchilError, ArchilGitError, ArchilS3Error, DESKTOP_IMAGE, DESKTOP_MAX_TTL_SECONDS, DESKTOP_MEMORY_MIB, DESKTOP_PORT, DESKTOP_VCPUS, DesktopNotInstalledError, Disk, DiskMultipart, Disks, ImageBuildError, Images, Repo, Sandbox, SandboxDesktop, SandboxFileTransferError, SandboxFiles, SandboxPauseError, SandboxProcess, SandboxProcesses, Sandboxes, TOKEN_ENV, Tokens, USER_AGENT, VERSION, Workspace, authenticatedRemoteUrl, configure, createApiKey, createDisk, createSandbox, credentialHelper, deleteApiKey, desktopViewerPath, effectiveUploadPartSize, exec, getDisk, getSandbox, gitEnv, listApiKeys, listDisks, listSandboxes, repoMount, workspace };
|
package/dist/node/index.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_sandbox_desktop = require("./sandbox-desktop-DBs8jhKW.cjs");
|
|
3
3
|
const require_paths = require("./paths-1c4QqbOB.cjs");
|
|
4
|
+
let _archildata_git = require("@archildata/git");
|
|
4
5
|
let _bufbuild_protobuf = require("@bufbuild/protobuf");
|
|
5
6
|
let _archildata_api_types_process = require("@archildata/api-types/process");
|
|
7
|
+
let _archildata_core = require("@archildata/core");
|
|
6
8
|
//#region src/generated/http-spec.ts
|
|
7
9
|
const RETRY_CAP_MS = 2e3;
|
|
8
10
|
const TRANSIENT_STATUSES = [
|
|
@@ -122,7 +124,7 @@ function deriveS3BaseUrl(controlBaseUrl) {
|
|
|
122
124
|
}
|
|
123
125
|
//#endregion
|
|
124
126
|
//#region src/version.ts
|
|
125
|
-
const VERSION = "1.
|
|
127
|
+
const VERSION = "1.18.0";
|
|
126
128
|
const USER_AGENT = `archil-js/${VERSION}`;
|
|
127
129
|
//#endregion
|
|
128
130
|
//#region src/client.ts
|
|
@@ -1583,31 +1585,14 @@ function parseXml(xml) {
|
|
|
1583
1585
|
}
|
|
1584
1586
|
//#endregion
|
|
1585
1587
|
//#region src/errors.ts
|
|
1586
|
-
/**
|
|
1587
|
-
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
1588
|
-
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
1589
|
-
* code and `code` a machine-readable error code when the server provided one.
|
|
1590
|
-
*/
|
|
1591
|
-
var ArchilError = class extends Error {
|
|
1592
|
-
/** HTTP status code associated with the failure. */
|
|
1593
|
-
status;
|
|
1594
|
-
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
1595
|
-
code;
|
|
1596
|
-
constructor(message, status, code) {
|
|
1597
|
-
super(message);
|
|
1598
|
-
this.name = "ArchilError";
|
|
1599
|
-
this.status = status;
|
|
1600
|
-
this.code = code;
|
|
1601
|
-
}
|
|
1602
|
-
};
|
|
1603
1588
|
/** Error from the control-plane REST API. */
|
|
1604
|
-
var ArchilApiError = class extends ArchilError {
|
|
1589
|
+
var ArchilApiError = class extends _archildata_core.ArchilError {
|
|
1605
1590
|
constructor(message, status, code) {
|
|
1606
1591
|
super(message, status, code);
|
|
1607
1592
|
this.name = "ArchilApiError";
|
|
1608
1593
|
}
|
|
1609
1594
|
};
|
|
1610
|
-
var SandboxPauseError = class extends ArchilError {
|
|
1595
|
+
var SandboxPauseError = class extends _archildata_core.ArchilError {
|
|
1611
1596
|
latest;
|
|
1612
1597
|
constructor(latest) {
|
|
1613
1598
|
super(`Sandbox entered ${latest.status} before it paused${latest.exitReason ? `: ${latest.exitReason}` : ""}`, 409, "SANDBOX_PAUSE_FAILED");
|
|
@@ -1615,7 +1600,7 @@ var SandboxPauseError = class extends ArchilError {
|
|
|
1615
1600
|
this.name = "SandboxPauseError";
|
|
1616
1601
|
}
|
|
1617
1602
|
};
|
|
1618
|
-
var ImageBuildError = class extends ArchilError {
|
|
1603
|
+
var ImageBuildError = class extends _archildata_core.ArchilError {
|
|
1619
1604
|
latest;
|
|
1620
1605
|
reason;
|
|
1621
1606
|
constructor(latest) {
|
|
@@ -1625,7 +1610,7 @@ var ImageBuildError = class extends ArchilError {
|
|
|
1625
1610
|
this.reason = latest.failureReason;
|
|
1626
1611
|
}
|
|
1627
1612
|
};
|
|
1628
|
-
var SandboxFileTransferError = class extends ArchilError {
|
|
1613
|
+
var SandboxFileTransferError = class extends _archildata_core.ArchilError {
|
|
1629
1614
|
operation;
|
|
1630
1615
|
path;
|
|
1631
1616
|
constructor(operation, path, cause) {
|
|
@@ -1642,7 +1627,7 @@ var SandboxFileTransferError = class extends ArchilError {
|
|
|
1642
1627
|
* this surfaces its parts as structured fields (`status`, `code`, `requestId`)
|
|
1643
1628
|
* rather than a raw blob, while keeping the full body on `raw` for debugging.
|
|
1644
1629
|
*/
|
|
1645
|
-
var ArchilS3Error = class extends ArchilError {
|
|
1630
|
+
var ArchilS3Error = class extends _archildata_core.ArchilError {
|
|
1646
1631
|
/** S3 request id, if the gateway returned one. */
|
|
1647
1632
|
requestId;
|
|
1648
1633
|
/** Raw response body (the XML document), for debugging. */
|
|
@@ -2949,7 +2934,7 @@ var Images = class {
|
|
|
2949
2934
|
lastRequest = Date.now();
|
|
2950
2935
|
continue;
|
|
2951
2936
|
}
|
|
2952
|
-
if (Date.now() >= deadline) throw new ArchilError(`Image ${image.imageId} was not ready after ${timeoutSeconds} seconds`, 408, "IMAGE_BUILD_TIMEOUT");
|
|
2937
|
+
if (Date.now() >= deadline) throw new _archildata_core.ArchilError(`Image ${image.imageId} was not ready after ${timeoutSeconds} seconds`, 408, "IMAGE_BUILD_TIMEOUT");
|
|
2953
2938
|
await new Promise((resolve) => setTimeout(resolve, pollMs));
|
|
2954
2939
|
pollMs = Math.min(pollMs * 2, MAX_POLL_MS);
|
|
2955
2940
|
image = await this.get(image.imageId);
|
|
@@ -4003,6 +3988,8 @@ var Archil = class {
|
|
|
4003
3988
|
tokens;
|
|
4004
3989
|
/** @internal */
|
|
4005
3990
|
_client;
|
|
3991
|
+
#gitOptions;
|
|
3992
|
+
#git;
|
|
4006
3993
|
/** @internal Opens control-plane WebSockets for streamed execs. */
|
|
4007
3994
|
_execSocket;
|
|
4008
3995
|
/** @internal Created on the first streamed exec. */
|
|
@@ -4024,6 +4011,10 @@ var Archil = class {
|
|
|
4024
4011
|
});
|
|
4025
4012
|
const s3BaseUrl = opts.s3BaseUrl ?? envVar("ARCHIL_S3_BASE_URL") ?? deriveS3BaseUrl(controlBaseUrl);
|
|
4026
4013
|
this._client = client;
|
|
4014
|
+
this.#gitOptions = {
|
|
4015
|
+
apiKey,
|
|
4016
|
+
endpoint: opts.git?.endpoint
|
|
4017
|
+
};
|
|
4027
4018
|
const authorization = apiKeyAuthorization(apiKey);
|
|
4028
4019
|
this._execSocket = () => controlPlaneSocket({
|
|
4029
4020
|
baseUrl: controlBaseUrl,
|
|
@@ -4037,6 +4028,14 @@ var Archil = class {
|
|
|
4037
4028
|
this.sandboxes = new Sandboxes(client);
|
|
4038
4029
|
this.tokens = new Tokens(client);
|
|
4039
4030
|
}
|
|
4031
|
+
/**
|
|
4032
|
+
* Git hosting in this account, created on first use: `archil.git.repos.create(...)`. Enable it in the
|
|
4033
|
+
* Archil console and pass the endpoint it shows as `git: { endpoint }` (or set ARCHIL_GIT_URL).
|
|
4034
|
+
*/
|
|
4035
|
+
get git() {
|
|
4036
|
+
this.#git ??= new _archildata_git.ArchilGit(this.#gitOptions);
|
|
4037
|
+
return this.#git;
|
|
4038
|
+
}
|
|
4040
4039
|
async exec(opts) {
|
|
4041
4040
|
if (opts.stream) return this._execStream(opts);
|
|
4042
4041
|
const disks = {};
|
|
@@ -4181,7 +4180,13 @@ function workspace(mounts) {
|
|
|
4181
4180
|
//#endregion
|
|
4182
4181
|
exports.Archil = Archil;
|
|
4183
4182
|
exports.ArchilApiError = ArchilApiError;
|
|
4184
|
-
exports.ArchilError = ArchilError;
|
|
4183
|
+
exports.ArchilError = _archildata_core.ArchilError;
|
|
4184
|
+
Object.defineProperty(exports, "ArchilGitError", {
|
|
4185
|
+
enumerable: true,
|
|
4186
|
+
get: function() {
|
|
4187
|
+
return _archildata_git.ArchilGitError;
|
|
4188
|
+
}
|
|
4189
|
+
});
|
|
4185
4190
|
exports.ArchilS3Error = ArchilS3Error;
|
|
4186
4191
|
exports.DESKTOP_IMAGE = require_sandbox_desktop.DESKTOP_IMAGE;
|
|
4187
4192
|
exports.DESKTOP_MAX_TTL_SECONDS = require_sandbox_desktop.DESKTOP_MAX_TTL_SECONDS;
|
|
@@ -4194,6 +4199,12 @@ exports.DiskMultipart = DiskMultipart;
|
|
|
4194
4199
|
exports.Disks = Disks;
|
|
4195
4200
|
exports.ImageBuildError = ImageBuildError;
|
|
4196
4201
|
exports.Images = Images;
|
|
4202
|
+
Object.defineProperty(exports, "Repo", {
|
|
4203
|
+
enumerable: true,
|
|
4204
|
+
get: function() {
|
|
4205
|
+
return _archildata_git.Repo;
|
|
4206
|
+
}
|
|
4207
|
+
});
|
|
4197
4208
|
exports.Sandbox = Sandbox;
|
|
4198
4209
|
exports.SandboxDesktop = require_sandbox_desktop.SandboxDesktop;
|
|
4199
4210
|
exports.SandboxFileTransferError = SandboxFileTransferError;
|
|
@@ -4202,21 +4213,51 @@ exports.SandboxPauseError = SandboxPauseError;
|
|
|
4202
4213
|
exports.SandboxProcess = SandboxProcess;
|
|
4203
4214
|
exports.SandboxProcesses = SandboxProcesses;
|
|
4204
4215
|
exports.Sandboxes = Sandboxes;
|
|
4216
|
+
Object.defineProperty(exports, "TOKEN_ENV", {
|
|
4217
|
+
enumerable: true,
|
|
4218
|
+
get: function() {
|
|
4219
|
+
return _archildata_git.TOKEN_ENV;
|
|
4220
|
+
}
|
|
4221
|
+
});
|
|
4205
4222
|
exports.Tokens = Tokens;
|
|
4206
4223
|
exports.USER_AGENT = USER_AGENT;
|
|
4207
4224
|
exports.VERSION = VERSION;
|
|
4208
4225
|
exports.Workspace = Workspace;
|
|
4226
|
+
Object.defineProperty(exports, "authenticatedRemoteUrl", {
|
|
4227
|
+
enumerable: true,
|
|
4228
|
+
get: function() {
|
|
4229
|
+
return _archildata_git.authenticatedRemoteUrl;
|
|
4230
|
+
}
|
|
4231
|
+
});
|
|
4209
4232
|
exports.configure = configure;
|
|
4210
4233
|
exports.createApiKey = createApiKey;
|
|
4211
4234
|
exports.createDisk = createDisk;
|
|
4212
4235
|
exports.createSandbox = createSandbox;
|
|
4236
|
+
Object.defineProperty(exports, "credentialHelper", {
|
|
4237
|
+
enumerable: true,
|
|
4238
|
+
get: function() {
|
|
4239
|
+
return _archildata_git.credentialHelper;
|
|
4240
|
+
}
|
|
4241
|
+
});
|
|
4213
4242
|
exports.deleteApiKey = deleteApiKey;
|
|
4214
4243
|
exports.desktopViewerPath = require_sandbox_desktop.desktopViewerPath;
|
|
4215
4244
|
exports.effectiveUploadPartSize = effectiveUploadPartSize;
|
|
4216
4245
|
exports.exec = exec;
|
|
4217
4246
|
exports.getDisk = getDisk;
|
|
4218
4247
|
exports.getSandbox = getSandbox;
|
|
4248
|
+
Object.defineProperty(exports, "gitEnv", {
|
|
4249
|
+
enumerable: true,
|
|
4250
|
+
get: function() {
|
|
4251
|
+
return _archildata_git.gitEnv;
|
|
4252
|
+
}
|
|
4253
|
+
});
|
|
4219
4254
|
exports.listApiKeys = listApiKeys;
|
|
4220
4255
|
exports.listDisks = listDisks;
|
|
4221
4256
|
exports.listSandboxes = listSandboxes;
|
|
4257
|
+
Object.defineProperty(exports, "repoMount", {
|
|
4258
|
+
enumerable: true,
|
|
4259
|
+
get: function() {
|
|
4260
|
+
return _archildata_git.repoMount;
|
|
4261
|
+
}
|
|
4262
|
+
});
|
|
4222
4263
|
exports.workspace = workspace;
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { a as DESKTOP_VCPUS, c as desktopViewerPath, i as DESKTOP_PORT, n as DESKTOP_MAX_TTL_SECONDS, o as DesktopNotInstalledError, r as DESKTOP_MEMORY_MIB, s as SandboxDesktop, t as DESKTOP_IMAGE } from "./sandbox-desktop-CrvuoiGi.mjs";
|
|
2
2
|
import { t as toSegments } from "./paths-Br9snUhy.mjs";
|
|
3
|
+
import { ArchilGit, ArchilGitError, Repo, TOKEN_ENV, authenticatedRemoteUrl, credentialHelper, gitEnv, repoMount } from "@archildata/git";
|
|
3
4
|
import { create, fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
4
5
|
import { ClientFrameSchema, Exit_Status, Limits, SandboxEgressPolicy_Action, ServerFrameSchema } from "@archildata/api-types/process";
|
|
6
|
+
import { ArchilError } from "@archildata/core";
|
|
5
7
|
//#region src/generated/http-spec.ts
|
|
6
8
|
const RETRY_CAP_MS = 2e3;
|
|
7
9
|
const TRANSIENT_STATUSES = [
|
|
@@ -121,7 +123,7 @@ function deriveS3BaseUrl(controlBaseUrl) {
|
|
|
121
123
|
}
|
|
122
124
|
//#endregion
|
|
123
125
|
//#region src/version.ts
|
|
124
|
-
const VERSION = "1.
|
|
126
|
+
const VERSION = "1.18.0";
|
|
125
127
|
const USER_AGENT = `archil-js/${VERSION}`;
|
|
126
128
|
//#endregion
|
|
127
129
|
//#region src/client.ts
|
|
@@ -1582,23 +1584,6 @@ function parseXml(xml) {
|
|
|
1582
1584
|
}
|
|
1583
1585
|
//#endregion
|
|
1584
1586
|
//#region src/errors.ts
|
|
1585
|
-
/**
|
|
1586
|
-
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
1587
|
-
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
1588
|
-
* code and `code` a machine-readable error code when the server provided one.
|
|
1589
|
-
*/
|
|
1590
|
-
var ArchilError = class extends Error {
|
|
1591
|
-
/** HTTP status code associated with the failure. */
|
|
1592
|
-
status;
|
|
1593
|
-
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
1594
|
-
code;
|
|
1595
|
-
constructor(message, status, code) {
|
|
1596
|
-
super(message);
|
|
1597
|
-
this.name = "ArchilError";
|
|
1598
|
-
this.status = status;
|
|
1599
|
-
this.code = code;
|
|
1600
|
-
}
|
|
1601
|
-
};
|
|
1602
1587
|
/** Error from the control-plane REST API. */
|
|
1603
1588
|
var ArchilApiError = class extends ArchilError {
|
|
1604
1589
|
constructor(message, status, code) {
|
|
@@ -4002,6 +3987,8 @@ var Archil = class {
|
|
|
4002
3987
|
tokens;
|
|
4003
3988
|
/** @internal */
|
|
4004
3989
|
_client;
|
|
3990
|
+
#gitOptions;
|
|
3991
|
+
#git;
|
|
4005
3992
|
/** @internal Opens control-plane WebSockets for streamed execs. */
|
|
4006
3993
|
_execSocket;
|
|
4007
3994
|
/** @internal Created on the first streamed exec. */
|
|
@@ -4023,6 +4010,10 @@ var Archil = class {
|
|
|
4023
4010
|
});
|
|
4024
4011
|
const s3BaseUrl = opts.s3BaseUrl ?? envVar("ARCHIL_S3_BASE_URL") ?? deriveS3BaseUrl(controlBaseUrl);
|
|
4025
4012
|
this._client = client;
|
|
4013
|
+
this.#gitOptions = {
|
|
4014
|
+
apiKey,
|
|
4015
|
+
endpoint: opts.git?.endpoint
|
|
4016
|
+
};
|
|
4026
4017
|
const authorization = apiKeyAuthorization(apiKey);
|
|
4027
4018
|
this._execSocket = () => controlPlaneSocket({
|
|
4028
4019
|
baseUrl: controlBaseUrl,
|
|
@@ -4036,6 +4027,14 @@ var Archil = class {
|
|
|
4036
4027
|
this.sandboxes = new Sandboxes(client);
|
|
4037
4028
|
this.tokens = new Tokens(client);
|
|
4038
4029
|
}
|
|
4030
|
+
/**
|
|
4031
|
+
* Git hosting in this account, created on first use: `archil.git.repos.create(...)`. Enable it in the
|
|
4032
|
+
* Archil console and pass the endpoint it shows as `git: { endpoint }` (or set ARCHIL_GIT_URL).
|
|
4033
|
+
*/
|
|
4034
|
+
get git() {
|
|
4035
|
+
this.#git ??= new ArchilGit(this.#gitOptions);
|
|
4036
|
+
return this.#git;
|
|
4037
|
+
}
|
|
4039
4038
|
async exec(opts) {
|
|
4040
4039
|
if (opts.stream) return this._execStream(opts);
|
|
4041
4040
|
const disks = {};
|
|
@@ -4178,4 +4177,4 @@ function workspace(mounts) {
|
|
|
4178
4177
|
return archil().workspace(mounts);
|
|
4179
4178
|
}
|
|
4180
4179
|
//#endregion
|
|
4181
|
-
export { Archil, ArchilApiError, ArchilError, ArchilS3Error, DESKTOP_IMAGE, DESKTOP_MAX_TTL_SECONDS, DESKTOP_MEMORY_MIB, DESKTOP_PORT, DESKTOP_VCPUS, DesktopNotInstalledError, Disk, DiskMultipart, Disks, ImageBuildError, Images, Sandbox, SandboxDesktop, SandboxFileTransferError, SandboxFiles, SandboxPauseError, SandboxProcess, SandboxProcesses, Sandboxes, Tokens, USER_AGENT, VERSION, Workspace, configure, createApiKey, createDisk, createSandbox, deleteApiKey, desktopViewerPath, effectiveUploadPartSize, exec, getDisk, getSandbox, listApiKeys, listDisks, listSandboxes, workspace };
|
|
4180
|
+
export { Archil, ArchilApiError, ArchilError, ArchilGitError, ArchilS3Error, DESKTOP_IMAGE, DESKTOP_MAX_TTL_SECONDS, DESKTOP_MEMORY_MIB, DESKTOP_PORT, DESKTOP_VCPUS, DesktopNotInstalledError, Disk, DiskMultipart, Disks, ImageBuildError, Images, Repo, Sandbox, SandboxDesktop, SandboxFileTransferError, SandboxFiles, SandboxPauseError, SandboxProcess, SandboxProcesses, Sandboxes, TOKEN_ENV, Tokens, USER_AGENT, VERSION, Workspace, authenticatedRemoteUrl, configure, createApiKey, createDisk, createSandbox, credentialHelper, deleteApiKey, desktopViewerPath, effectiveUploadPartSize, exec, getDisk, getSandbox, gitEnv, listApiKeys, listDisks, listSandboxes, repoMount, workspace };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var _archildata_git_webhooks = require("@archildata/git/webhooks");
|
|
2
|
+
Object.keys(_archildata_git_webhooks).forEach(function(k) {
|
|
3
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _archildata_git_webhooks[k];
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
});
|
package/dist/sandbox-cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { C as printError } from "./sandbox-options-
|
|
4
|
-
import { n as createSandboxProgram } from "./sandbox-command-
|
|
2
|
+
import { b as Archil } from "./src-D6Zm2pS3.mjs";
|
|
3
|
+
import { C as printError } from "./sandbox-options-LF4zG3Gd.mjs";
|
|
4
|
+
import { n as createSandboxProgram } from "./sandbox-command-CGh24ty9.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
//#region bin/sandbox-cli.ts
|
|
7
7
|
const pkg = createRequire(import.meta.url)("../package.json");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as desktopViewerPath, i as DESKTOP_PORT } from "./sandbox-desktop-CrvuoiGi.mjs";
|
|
2
2
|
import { forwardPort, openPortTunnel } from "./tunnel.mjs";
|
|
3
|
-
import { S as formatDuration, T as styles, a as addGlobalOptions, b as colorEnabled, c as resolveProgramCredentials, f as renderTable, h as readProfileCredential, i as validateSandboxName, n as parseCreateSandboxOptions, o as addProfileCommands, r as parseRunOptions, s as isProfileCommand, t as optionalInteger, u as loadProfiles, v as diskConfigDir, w as statusStyle, x as createUi, y as Command } from "./sandbox-options-
|
|
3
|
+
import { S as formatDuration, T as styles, a as addGlobalOptions, b as colorEnabled, c as resolveProgramCredentials, f as renderTable, h as readProfileCredential, i as validateSandboxName, n as parseCreateSandboxOptions, o as addProfileCommands, r as parseRunOptions, s as isProfileCommand, t as optionalInteger, u as loadProfiles, v as diskConfigDir, w as statusStyle, x as createUi, y as Command } from "./sandbox-options-LF4zG3Gd.mjs";
|
|
4
4
|
import { mkdir, open, readFile, rename, stat, unlink, writeFile } from "node:fs/promises";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
import { homedir } from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V as REGION_URLS, b as Archil, j as ArchilApiError } from "./src-D6Zm2pS3.mjs";
|
|
2
2
|
import "./sandbox-desktop-CrvuoiGi.mjs";
|
|
3
3
|
import { chmod, mkdir, open, readFile, rename, rm, stat } from "node:fs/promises";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { n as DESKTOP_MAX_TTL_SECONDS, r as DESKTOP_MEMORY_MIB, s as SandboxDesktop } from "./sandbox-desktop-CrvuoiGi.mjs";
|
|
2
2
|
import { t as toSegments } from "./paths-Br9snUhy.mjs";
|
|
3
|
+
import { ArchilGit, ArchilGitError, Repo, TOKEN_ENV, authenticatedRemoteUrl, credentialHelper, gitEnv, repoMount } from "@archildata/git";
|
|
3
4
|
import { create, fromBinary, toBinary } from "@bufbuild/protobuf";
|
|
4
5
|
import { ClientFrameSchema, Exit_Status, Limits, SandboxEgressPolicy_Action, ServerFrameSchema } from "@archildata/api-types/process";
|
|
6
|
+
import { ArchilError } from "@archildata/core";
|
|
5
7
|
//#region src/generated/http-spec.ts
|
|
6
8
|
const RETRY_CAP_MS = 2e3;
|
|
7
9
|
const TRANSIENT_STATUSES = [
|
|
@@ -121,7 +123,7 @@ function deriveS3BaseUrl(controlBaseUrl) {
|
|
|
121
123
|
}
|
|
122
124
|
//#endregion
|
|
123
125
|
//#region src/version.ts
|
|
124
|
-
const VERSION = "1.
|
|
126
|
+
const VERSION = "1.18.0";
|
|
125
127
|
const USER_AGENT = `archil-js/${VERSION}`;
|
|
126
128
|
//#endregion
|
|
127
129
|
//#region src/client.ts
|
|
@@ -1582,23 +1584,6 @@ function parseXml(xml) {
|
|
|
1582
1584
|
}
|
|
1583
1585
|
//#endregion
|
|
1584
1586
|
//#region src/errors.ts
|
|
1585
|
-
/**
|
|
1586
|
-
* Base class for every error the SDK throws. Catch with `instanceof ArchilError`
|
|
1587
|
-
* to handle control-plane and S3 failures uniformly; `status` is the HTTP status
|
|
1588
|
-
* code and `code` a machine-readable error code when the server provided one.
|
|
1589
|
-
*/
|
|
1590
|
-
var ArchilError = class extends Error {
|
|
1591
|
-
/** HTTP status code associated with the failure. */
|
|
1592
|
-
status;
|
|
1593
|
-
/** Machine-readable error code (e.g. an S3 code like "NoSuchKey"), if known. */
|
|
1594
|
-
code;
|
|
1595
|
-
constructor(message, status, code) {
|
|
1596
|
-
super(message);
|
|
1597
|
-
this.name = "ArchilError";
|
|
1598
|
-
this.status = status;
|
|
1599
|
-
this.code = code;
|
|
1600
|
-
}
|
|
1601
|
-
};
|
|
1602
1587
|
/** Error from the control-plane REST API. */
|
|
1603
1588
|
var ArchilApiError = class extends ArchilError {
|
|
1604
1589
|
constructor(message, status, code) {
|
|
@@ -4002,6 +3987,8 @@ var Archil = class {
|
|
|
4002
3987
|
tokens;
|
|
4003
3988
|
/** @internal */
|
|
4004
3989
|
_client;
|
|
3990
|
+
#gitOptions;
|
|
3991
|
+
#git;
|
|
4005
3992
|
/** @internal Opens control-plane WebSockets for streamed execs. */
|
|
4006
3993
|
_execSocket;
|
|
4007
3994
|
/** @internal Created on the first streamed exec. */
|
|
@@ -4023,6 +4010,10 @@ var Archil = class {
|
|
|
4023
4010
|
});
|
|
4024
4011
|
const s3BaseUrl = opts.s3BaseUrl ?? envVar("ARCHIL_S3_BASE_URL") ?? deriveS3BaseUrl(controlBaseUrl);
|
|
4025
4012
|
this._client = client;
|
|
4013
|
+
this.#gitOptions = {
|
|
4014
|
+
apiKey,
|
|
4015
|
+
endpoint: opts.git?.endpoint
|
|
4016
|
+
};
|
|
4026
4017
|
const authorization = apiKeyAuthorization(apiKey);
|
|
4027
4018
|
this._execSocket = () => controlPlaneSocket({
|
|
4028
4019
|
baseUrl: controlBaseUrl,
|
|
@@ -4036,6 +4027,14 @@ var Archil = class {
|
|
|
4036
4027
|
this.sandboxes = new Sandboxes(client);
|
|
4037
4028
|
this.tokens = new Tokens(client);
|
|
4038
4029
|
}
|
|
4030
|
+
/**
|
|
4031
|
+
* Git hosting in this account, created on first use: `archil.git.repos.create(...)`. Enable it in the
|
|
4032
|
+
* Archil console and pass the endpoint it shows as `git: { endpoint }` (or set ARCHIL_GIT_URL).
|
|
4033
|
+
*/
|
|
4034
|
+
get git() {
|
|
4035
|
+
this.#git ??= new ArchilGit(this.#gitOptions);
|
|
4036
|
+
return this.#git;
|
|
4037
|
+
}
|
|
4039
4038
|
async exec(opts) {
|
|
4040
4039
|
if (opts.stream) return this._execStream(opts);
|
|
4041
4040
|
const disks = {};
|
|
@@ -4178,4 +4177,4 @@ function workspace(mounts) {
|
|
|
4178
4177
|
return archil().workspace(mounts);
|
|
4179
4178
|
}
|
|
4180
4179
|
//#endregion
|
|
4181
|
-
export {
|
|
4180
|
+
export { effectiveUploadPartSize as A, VERSION as B, Sandboxes as C, Disks as D, Images as E, SandboxFileTransferError as F, SandboxPauseError as I, SandboxProcess as L, ArchilError as M, ArchilS3Error as N, Disk as O, ImageBuildError as P, SandboxProcesses as R, Tokens as S, SandboxFiles as T, REGION_URLS as V, listSandboxes as _, configure as a, Archil as b, createSandbox as c, exec as d, getDisk as f, listDisks as g, listApiKeys as h, authenticatedRemoteUrl as i, ArchilApiError as j, DiskMultipart as k, credentialHelper as l, gitEnv as m, Repo as n, createApiKey as o, getSandbox as p, TOKEN_ENV as r, createDisk as s, ArchilGitError as t, deleteApiKey as u, repoMount as v, Sandbox as w, Workspace as x, workspace as y, USER_AGENT as z };
|
package/dist/tunnel.d.cts
CHANGED
package/dist/tunnel.d.mts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var _archildata_git_webhooks = require("@archildata/git/webhooks");
|
|
2
|
+
Object.keys(_archildata_git_webhooks).forEach(function(k) {
|
|
3
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _archildata_git_webhooks[k];
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@archildata/git/webhooks";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@archildata/git/webhooks";
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "disk",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Pure-JS client and CLIs for Archil disks and sandboxes",
|
|
3
|
+
"version": "1.18.0",
|
|
4
|
+
"description": "Pure-JS client and CLIs for Archil disks and sandboxes, plus archil.git: git hosting in your own account",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"archil",
|
|
7
7
|
"disk",
|
|
8
8
|
"filesystem",
|
|
9
9
|
"sandbox",
|
|
10
|
-
"cli"
|
|
10
|
+
"cli",
|
|
11
|
+
"git",
|
|
12
|
+
"git-hosting"
|
|
11
13
|
],
|
|
12
14
|
"homepage": "https://archil.com",
|
|
13
15
|
"license": "MIT",
|
|
@@ -46,6 +48,15 @@
|
|
|
46
48
|
"import": "./dist/tunnel.mjs",
|
|
47
49
|
"require": "./dist/tunnel.cjs"
|
|
48
50
|
},
|
|
51
|
+
"./webhooks": {
|
|
52
|
+
"types": "./dist/webhooks.d.mts",
|
|
53
|
+
"node": {
|
|
54
|
+
"import": "./dist/node/webhooks.mjs",
|
|
55
|
+
"require": "./dist/node/webhooks.cjs"
|
|
56
|
+
},
|
|
57
|
+
"import": "./dist/webhooks.mjs",
|
|
58
|
+
"require": "./dist/webhooks.cjs"
|
|
59
|
+
},
|
|
49
60
|
"./archil-cli": "./dist/archil-cli.mjs"
|
|
50
61
|
},
|
|
51
62
|
"bin": {
|
|
@@ -59,6 +70,8 @@
|
|
|
59
70
|
],
|
|
60
71
|
"dependencies": {
|
|
61
72
|
"@archildata/api-types": "^0.0.111",
|
|
73
|
+
"@archildata/core": "0.1.0",
|
|
74
|
+
"@archildata/git": "0.1.0",
|
|
62
75
|
"@bufbuild/protobuf": "^2.16.0",
|
|
63
76
|
"undici": "^8.12.3"
|
|
64
77
|
},
|