agental 0.25.2 → 0.27.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/cli.js +27 -10
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7411,7 +7411,7 @@ import { parseArgs } from "node:util";
|
|
|
7411
7411
|
|
|
7412
7412
|
// ../src/cli-build.ts
|
|
7413
7413
|
var PUBLISHED = true;
|
|
7414
|
-
var CLI_VERSION = true ? "0.
|
|
7414
|
+
var CLI_VERSION = true ? "0.27.0" : "dev";
|
|
7415
7415
|
var DEFAULT_API_URL = true ? "https://agental.io" : "http://127.0.0.1:8741";
|
|
7416
7416
|
var PACKAGE_NAME = "agental";
|
|
7417
7417
|
var USER_AGENT = `agental-cli/${CLI_VERSION}`;
|
|
@@ -7739,9 +7739,10 @@ var FILES_USAGE = [
|
|
|
7739
7739
|
"agental files <sandbox-id> get <path> [<local-file>]",
|
|
7740
7740
|
"agental files <sandbox-id> mkdir <folder>",
|
|
7741
7741
|
"agental files <sandbox-id> mv <from> <to>",
|
|
7742
|
-
"agental files <sandbox-id> rm <path> [--recursive]"
|
|
7742
|
+
"agental files <sandbox-id> rm <path> [--recursive]",
|
|
7743
|
+
"agental files <sandbox-id> link put|get <path> [--json]"
|
|
7743
7744
|
];
|
|
7744
|
-
var USAGE2 = `files takes a sandbox's id and one of ls, cat, put, get, mkdir, mv and
|
|
7745
|
+
var USAGE2 = `files takes a sandbox's id and one of ls, cat, put, get, mkdir, mv, rm and link:
|
|
7745
7746
|
${FILES_USAGE.join("\n ")}`;
|
|
7746
7747
|
var LIMIT = 1e7;
|
|
7747
7748
|
async function readObject2(response) {
|
|
@@ -7855,6 +7856,25 @@ ${USAGE2}`);
|
|
|
7855
7856
|
await ask2(client, "DELETE", `${base}/files?path=${encodeURIComponent(path5)}${options.recursive ? "&recursive=true" : ""}`);
|
|
7856
7857
|
return;
|
|
7857
7858
|
}
|
|
7859
|
+
case "link": {
|
|
7860
|
+
const way = need(first, "put or get, and a path");
|
|
7861
|
+
if (way !== "put" && way !== "get") {
|
|
7862
|
+
throw new Error(`files link takes put or get, not ${way}.
|
|
7863
|
+
${USAGE2}`);
|
|
7864
|
+
}
|
|
7865
|
+
const body = await ask2(client, "POST", `${base}/files/${way === "put" ? "upload" : "download"}-link`, { path: need(second, "a path in the sandbox") });
|
|
7866
|
+
if (options.json) {
|
|
7867
|
+
process.stdout.write(`${JSON.stringify(body, null, 2)}
|
|
7868
|
+
`);
|
|
7869
|
+
return;
|
|
7870
|
+
}
|
|
7871
|
+
process.stdout.write(`${String(body["url"])}
|
|
7872
|
+
`);
|
|
7873
|
+
const example = way === "put" ? `curl -fsS -T <local-file> "<url>"` : `curl -fsS -o <local-file> "<url>"`;
|
|
7874
|
+
process.stderr.write(`${way === "put" ? "Writes" : "Reads"} ${String(body["path"])}, with no key, until ${String(body["expiresAt"])}: ${example}
|
|
7875
|
+
`);
|
|
7876
|
+
return;
|
|
7877
|
+
}
|
|
7858
7878
|
default:
|
|
7859
7879
|
throw new Error(`files does not ${verb}.
|
|
7860
7880
|
${USAGE2}`);
|
|
@@ -9175,7 +9195,7 @@ var COMMANDS = [
|
|
|
9175
9195
|
summary: "Make a sandbox: a Linux machine of its own, started from a template.",
|
|
9176
9196
|
examples: ["agental create --name review-pr-218", "agental create --name build --size medium --template ci", "agental create --name scraper --egress residential:de --ttl 2h"],
|
|
9177
9197
|
flags: [
|
|
9178
|
-
["-n, --name <name>", "what to call it
|
|
9198
|
+
["-n, --name <name>", "what to call it; left out, it is made up as sbx-\u2026"],
|
|
9179
9199
|
["-t, --template <template>", "what it starts from (default: your default template)"],
|
|
9180
9200
|
["-s, --size <size>", "tiny, small, medium or large (default: the template's)"],
|
|
9181
9201
|
[" --region <region>", "where it runs; agental regions lists them"],
|
|
@@ -9424,7 +9444,7 @@ var COMMANDS = [
|
|
|
9424
9444
|
summary: "Your sandboxes, as agental sandbox <verb>: each is the same as the command without sandbox in front.",
|
|
9425
9445
|
usage: [
|
|
9426
9446
|
"agental sandbox list [flags]",
|
|
9427
|
-
"agental sandbox create --name <name> [flags]",
|
|
9447
|
+
"agental sandbox create [--name <name>] [flags]",
|
|
9428
9448
|
"agental sandbox start|stop|delete|recover <sandbox-id> [flags]",
|
|
9429
9449
|
"agental sandbox exec <sandbox-id> -- <command> [args...]",
|
|
9430
9450
|
"agental sandbox shell <sandbox-id>",
|
|
@@ -12818,9 +12838,6 @@ function once(given, name) {
|
|
|
12818
12838
|
return given?.[0];
|
|
12819
12839
|
}
|
|
12820
12840
|
async function create(values) {
|
|
12821
|
-
if (!values.name) {
|
|
12822
|
-
throw new Error("create needs --name: what to call the sandbox, as agental create --name review-pr-218.");
|
|
12823
|
-
}
|
|
12824
12841
|
const given = labelsGiven(values);
|
|
12825
12842
|
const burstHeaders = maxBurstFeeHeaders(values["max-burst-fee"]);
|
|
12826
12843
|
const ttlSeconds = ttlOption(values.ttl);
|
|
@@ -12846,7 +12863,7 @@ async function create(values) {
|
|
|
12846
12863
|
method: "POST",
|
|
12847
12864
|
headers: { "Idempotency-Key": idempotencyKey, ...box ? { "X-Agental-Box": box } : {}, ...burstHeaders },
|
|
12848
12865
|
body: JSON.stringify({
|
|
12849
|
-
name: values.name,
|
|
12866
|
+
...values.name ? { name: values.name } : {},
|
|
12850
12867
|
...values.size ? { size: values.size } : {},
|
|
12851
12868
|
...templateId ? { templateId } : {},
|
|
12852
12869
|
...regionsOption(values.region),
|
|
@@ -15358,7 +15375,7 @@ Setting up
|
|
|
15358
15375
|
agental completion zsh|bash|fish
|
|
15359
15376
|
|
|
15360
15377
|
Usage
|
|
15361
|
-
agental create --name <name> [--template <template>] [--size tiny|small|medium|large] [--region <region>[,<region>...]] [--ttl <time> | --ttl default] [--on-timeout delete|stop] [--idempotency-key <key>]
|
|
15378
|
+
agental create [--name <name>] [--template <template>] [--size tiny|small|medium|large] [--region <region>[,<region>...]] [--ttl <time> | --ttl default] [--on-timeout delete|stop] [--idempotency-key <key>]
|
|
15362
15379
|
${operator ? "[--box <name-or-id>] " : ""}[--allow <address>[,<address>...]] [--egress box | residential:<country>[:sticky|rotating]] [--max-burst-fee <dollars>]
|
|
15363
15380
|
[--ssh-key <public-key-or-file>]... [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]...
|
|
15364
15381
|
agental summary [--where '<words>'] [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]... [--facets <field>[,<field>...]] [--json]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agental",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "The agental command: Linux sandboxes for your agents, from the terminal. npx agental@latest signs you in and installs the agent skills.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "VERTIXER LTD",
|