disk 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{archil-DJFgh83T.d.mts → archil-DaIWdn2s.d.cts} +10 -1
- package/dist/{archil-md8t7zzg.d.cts → archil-DbdoAk0f.d.mts} +10 -1
- package/dist/cli.mjs +2 -2
- package/dist/index.cjs +6 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/internal/tools.d.cts +1 -1
- package/dist/internal/tools.d.mts +1 -1
- package/dist/node/index.cjs +3495 -0
- package/dist/node/index.mjs +3462 -0
- package/dist/node/internal/tools.cjs +328 -0
- package/dist/node/internal/tools.mjs +326 -0
- package/dist/node/paths-1c4QqbOB.cjs +33 -0
- package/dist/node/paths-Br9snUhy.mjs +28 -0
- package/dist/sandbox-cli.mjs +2 -2
- package/dist/{sandbox-options-D99F52j0.mjs → sandbox-options-trHjQs_f.mjs} +1 -1
- package/dist/{src-CRvOOCjY.mjs → src-DGB_iQTG.mjs} +6 -2
- package/package.json +10 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/paths.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a filesystem path to its segments, resolving "." and ".." (so a
|
|
4
|
+
* path means the same as in a shell, and ".." can't escape above the root) and
|
|
5
|
+
* optionally stripping a shell-style mount prefix (e.g. "/mnt" or "/mnt/archil")
|
|
6
|
+
* so a path copied from a `run_bash` command resolves the same way.
|
|
7
|
+
*
|
|
8
|
+
* toSegments("/a/b/../c") -> ["a", "c"]
|
|
9
|
+
* toSegments("/mnt/x", "/mnt") -> ["x"]
|
|
10
|
+
* toSegments("/../../etc/x") -> ["etc", "x"]
|
|
11
|
+
*/
|
|
12
|
+
function toSegments(path, containerRoot) {
|
|
13
|
+
let p = (path ?? "").trim();
|
|
14
|
+
if (containerRoot) {
|
|
15
|
+
const root = containerRoot.replace(/\/+$/, "");
|
|
16
|
+
if (p === root) p = "/";
|
|
17
|
+
else if (p.startsWith(root + "/")) p = p.slice(root.length);
|
|
18
|
+
}
|
|
19
|
+
const resolved = [];
|
|
20
|
+
for (const seg of p.split("/")) {
|
|
21
|
+
if (seg === "" || seg === ".") continue;
|
|
22
|
+
if (seg === "..") resolved.pop();
|
|
23
|
+
else resolved.push(seg);
|
|
24
|
+
}
|
|
25
|
+
return resolved;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { toSegments as t };
|
package/dist/sandbox-cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { k as ArchilApiError, p as Archil } from "./src-
|
|
3
|
-
import { a as addGlobalOptions, c as resolveProgramCredentials, d as Command, i as validateSandboxName, l as renderTable, n as parseCreateSandboxOptions, o as addProfileCommands, r as parseRunOptions, s as isProfileCommand, u as spinner } from "./sandbox-options-
|
|
2
|
+
import { k as ArchilApiError, p as Archil } from "./src-DGB_iQTG.mjs";
|
|
3
|
+
import { a as addGlobalOptions, c as resolveProgramCredentials, d as Command, i as validateSandboxName, l as renderTable, n as parseCreateSandboxOptions, o as addProfileCommands, r as parseRunOptions, s as isProfileCommand, u as spinner } from "./sandbox-options-trHjQs_f.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { createInterface } from "node:readline/promises";
|
|
6
6
|
//#region src/cli/sandbox-output.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as REGION_URLS, p as Archil } from "./src-
|
|
1
|
+
import { O as REGION_URLS, p as Archil } from "./src-DGB_iQTG.mjs";
|
|
2
2
|
import { chmod, mkdir, open, readFile, rename, rm, stat } from "node:fs/promises";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { homedir } from "node:os";
|
|
@@ -289,7 +289,7 @@ function deriveS3BaseUrl(controlBaseUrl) {
|
|
|
289
289
|
}
|
|
290
290
|
//#endregion
|
|
291
291
|
//#region src/version.ts
|
|
292
|
-
const VERSION = "1.
|
|
292
|
+
const VERSION = "1.14.0";
|
|
293
293
|
const USER_AGENT = `archil-js/${VERSION}`;
|
|
294
294
|
//#endregion
|
|
295
295
|
//#region src/client.ts
|
|
@@ -1566,6 +1566,8 @@ function imageFromWire(data) {
|
|
|
1566
1566
|
digest: data.digest,
|
|
1567
1567
|
canonicalSource: data.canonical_source,
|
|
1568
1568
|
failureReason: data.failure_reason,
|
|
1569
|
+
vcpuCount: data.vcpu_count,
|
|
1570
|
+
memSizeMiB: data.mem_size_mib,
|
|
1569
1571
|
createdAt: new Date(data.created_at),
|
|
1570
1572
|
updatedAt: new Date(data.updated_at)
|
|
1571
1573
|
};
|
|
@@ -1617,7 +1619,9 @@ var Images = class {
|
|
|
1617
1619
|
async _request(request) {
|
|
1618
1620
|
return imageFromWire(await unwrap(retryApiRequest(() => this._client.POST("/api/images", { body: {
|
|
1619
1621
|
source: request.source,
|
|
1620
|
-
registry_auth: request.registryAuth
|
|
1622
|
+
registry_auth: request.registryAuth,
|
|
1623
|
+
vcpu_count: request.vcpuCount,
|
|
1624
|
+
mem_size_mib: request.memSizeMiB
|
|
1621
1625
|
} }), "transient")));
|
|
1622
1626
|
}
|
|
1623
1627
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "disk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Pure-JS client and CLIs for Archil disks and sandboxes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"archil",
|
|
@@ -21,11 +21,19 @@
|
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./dist/index.d.mts",
|
|
24
|
+
"node": {
|
|
25
|
+
"import": "./dist/node/index.mjs",
|
|
26
|
+
"require": "./dist/node/index.cjs"
|
|
27
|
+
},
|
|
24
28
|
"import": "./dist/index.mjs",
|
|
25
29
|
"require": "./dist/index.cjs"
|
|
26
30
|
},
|
|
27
31
|
"./internal/tools": {
|
|
28
32
|
"types": "./dist/internal/tools.d.mts",
|
|
33
|
+
"node": {
|
|
34
|
+
"import": "./dist/node/internal/tools.mjs",
|
|
35
|
+
"require": "./dist/node/internal/tools.cjs"
|
|
36
|
+
},
|
|
29
37
|
"import": "./dist/internal/tools.mjs",
|
|
30
38
|
"require": "./dist/internal/tools.cjs"
|
|
31
39
|
}
|
|
@@ -40,7 +48,7 @@
|
|
|
40
48
|
"LICENSE"
|
|
41
49
|
],
|
|
42
50
|
"dependencies": {
|
|
43
|
-
"@archildata/api-types": "^0.0.
|
|
51
|
+
"@archildata/api-types": "^0.0.98",
|
|
44
52
|
"@bufbuild/protobuf": "^2.16.0",
|
|
45
53
|
"undici": "^8.12.3"
|
|
46
54
|
},
|