@agentgates/cli 0.89.0 → 0.90.1
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.mjs +157 -13
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -3163,7 +3163,7 @@ var init_constants = __esm({
|
|
|
3163
3163
|
trim = (v) => v ? v.replace(/\/$/, "") : "";
|
|
3164
3164
|
CLI_API_ORIGIN = trim(process.env.BOUNTY_API_ORIGIN) || "https://cli.agentgates.ai";
|
|
3165
3165
|
CREATORS_ORIGIN = trim(process.env.BOUNTY_CREATORS_ORIGIN) || "https://agentgates.ai";
|
|
3166
|
-
CLI_VERSION = "0.
|
|
3166
|
+
CLI_VERSION = "0.90.1";
|
|
3167
3167
|
CLI_USER_AGENT = `agentgates-cli/${CLI_VERSION}`;
|
|
3168
3168
|
AI_DIRECTIVE = "\n[AI: present the above verbatim inside a markdown code block. Do not reformat, summarize, or omit rows.]";
|
|
3169
3169
|
}
|
|
@@ -74930,7 +74930,7 @@ async function payFor2(args) {
|
|
|
74930
74930
|
}
|
|
74931
74931
|
let answer;
|
|
74932
74932
|
try {
|
|
74933
|
-
answer = await computeCall({ method: "POST", url: args.url, body: args.body, headers, timeoutMs: 15e4 });
|
|
74933
|
+
answer = await computeCall({ method: "POST", url: args.url, body: { ...args.body, maxDrawMicro: atMost.toString() }, headers, timeoutMs: 15e4 });
|
|
74934
74934
|
} catch (err) {
|
|
74935
74935
|
throw new SandboxError(`the compute API did not answer: ${err.message}. A draw that went through shows in agentgates sandbox ls${args.mode === "key" ? " --key <the same key>" : ""}`, "no_answer");
|
|
74936
74936
|
}
|
|
@@ -74938,6 +74938,10 @@ async function payFor2(args) {
|
|
|
74938
74938
|
const short5 = answer.json?.code === "insufficient_balance" || answer.json?.accepts ? "the balance does not cover it" : apiWords2(answer);
|
|
74939
74939
|
throw new SandboxError(`${short5}: nothing was drawn. Pay over x402 instead (the same command without ${args.mode === "key" ? "--key" : "--from-balance"}), or top up the balance`, "insufficient_balance", { status: 402 });
|
|
74940
74940
|
}
|
|
74941
|
+
if (answer.status === 409 && answer.json?.code === "price_above_max_draw") {
|
|
74942
|
+
const now = typeof answer.json?.priceMicro === "string" && /^\d+$/.test(answer.json.priceMicro) ? usd(BigInt(answer.json.priceMicro)) : null;
|
|
74943
|
+
throw new SandboxError(`the price from ${from} is ${now ?? "higher"} now, over the ${usd(atMost)} it was priced at: nothing was drawn. Run it again to pay the price now`, "price_above_max_draw", { status: 409, atMostUsd: usd(atMost), ...now ? { priceUsd: now } : {} });
|
|
74944
|
+
}
|
|
74941
74945
|
if (answer.status < 200 || answer.status >= 300) throw new SandboxError(apiWords2(answer), apiCode2(answer), { status: answer.status });
|
|
74942
74946
|
const charged = answer.json?.charged?.amountMicro;
|
|
74943
74947
|
const drawn = typeof charged === "string" && /^\d+$/.test(charged) ? BigInt(charged) : null;
|
|
@@ -75108,17 +75112,28 @@ async function findSandbox(id2, opts = {}) {
|
|
|
75108
75112
|
}
|
|
75109
75113
|
const readAuth = rec?.paidWith === "key" && key ? { key } : wallet ? { wallet } : key ? { key } : null;
|
|
75110
75114
|
let machine = null;
|
|
75115
|
+
const doorOnly = Boolean(rec && rec.paidWith === "attached" && SANDBOX_ID_RE.test(rec.deploymentId));
|
|
75111
75116
|
const depId = rec?.deploymentId ?? (SANDBOX_ID_RE.test(clean3) ? null : clean3);
|
|
75112
|
-
|
|
75117
|
+
let unread = false;
|
|
75118
|
+
if (doorOnly) {
|
|
75119
|
+
} else if (readAuth && depId) {
|
|
75113
75120
|
const a = await readMachine(depId, readAuth).catch(() => null);
|
|
75121
|
+
if (a === null) unread = true;
|
|
75114
75122
|
if (a && a.status === 200) machine = a.json;
|
|
75115
75123
|
else if (a && a.status === 404 && !rec) throw new SandboxError(`${apiWords2(a)}${wallet ? ` (this key is ${wallet.address})` : ""}`, "not_found", { status: 404 });
|
|
75116
75124
|
} else if (readAuth) {
|
|
75117
|
-
const all = await listMachines(readAuth).catch(() =>
|
|
75125
|
+
const all = await listMachines(readAuth).catch(() => {
|
|
75126
|
+
unread = true;
|
|
75127
|
+
return [];
|
|
75128
|
+
});
|
|
75118
75129
|
machine = all.find((m) => sandboxOf(m)?.id === clean3) ?? null;
|
|
75119
75130
|
} else if (!rec) {
|
|
75120
75131
|
throw walletError instanceof Error ? walletError : new SandboxError("no account on this machine to read it with", "no_account");
|
|
75121
75132
|
}
|
|
75133
|
+
if (!machine && !rec) {
|
|
75134
|
+
if (unread) throw new SandboxError("the compute API did not answer, and this machine keeps no record of that sandbox", "unreachable");
|
|
75135
|
+
throw new SandboxError(`no sandbox ${clean3} here or in ${wallet ? `${wallet.address}'s list` : "this key's list"} (agentgates sandbox ls shows yours)`, "not_found", { status: 404 });
|
|
75136
|
+
}
|
|
75122
75137
|
const sb = machine ? sandboxOf(machine) : null;
|
|
75123
75138
|
const api2 = sb?.api ?? rec?.api ?? null;
|
|
75124
75139
|
const tlsPin = sb?.tlsPin ?? rec?.tlsPin ?? null;
|
|
@@ -75142,9 +75157,57 @@ async function findSandbox(id2, opts = {}) {
|
|
|
75142
75157
|
else if (wallet) doorAuth = { kind: "wallet", signer: walletSigner(wallet) };
|
|
75143
75158
|
else throw new SandboxError("no key on this machine opens that sandbox's door", "no_account");
|
|
75144
75159
|
const owner = rec?.owner ?? (machine && readAuth && "wallet" in readAuth && wallet ? wallet.address : null);
|
|
75145
|
-
const ownerUnchecked = owner !== null ? null : rec?.paidWith === "key" ? "the owner check did not run: a sandbox bought with a compute key opens with its access key, and this CLI does not know the key's wallet to hold the statement to it" : "the owner check did not run: this CLI does not know the owner's wallet";
|
|
75160
|
+
const ownerUnchecked = owner !== null ? null : rec?.paidWith === "key" ? "the owner check did not run: a sandbox bought with a compute key opens with its access key, and this CLI does not know the key's wallet to hold the statement to it" : rec?.paidWith === "attached" ? ATTACHED_OWNER_WORDS : "the owner check did not run: this CLI does not know the owner's wallet";
|
|
75146
75161
|
return { deploymentId, sandboxId, api: api2, tlsPin, owner, ownerUnchecked, auth: doorAuth, record, machine };
|
|
75147
75162
|
}
|
|
75163
|
+
var ATTACHED_OWNER_WORDS = "the owner check did not run: this sandbox was attached here from its address, pin and access key, and this CLI does not know the wallet that bought it";
|
|
75164
|
+
var ATTACHED_DELETE_WORDS = "a sandbox attached here is deleted by the wallet that bought it (agentgates.ai/sandboxes, Delete): its access key opens its door, not our API";
|
|
75165
|
+
var ACCESS_KEY_RE = /^sbxk_[0-9a-f]{64}$/;
|
|
75166
|
+
async function attachSandbox(args) {
|
|
75167
|
+
const accessKey = String(args.accessKey ?? "").trim();
|
|
75168
|
+
if (!ACCESS_KEY_RE.test(accessKey)) throw new SandboxError("the access key is sbxk_ and 64 hex characters, as agentgates.ai/sandboxes showed it once", "bad_input");
|
|
75169
|
+
const tlsPin = String(args.tlsPin ?? "").trim();
|
|
75170
|
+
const api2 = String(args.api ?? "").trim().replace(/\/+$/, "");
|
|
75171
|
+
const sandboxId = /\/v1\/sandboxes\/(sbx_[0-9a-f]{16})$/.exec(api2)?.[1] ?? null;
|
|
75172
|
+
if (!sandboxId) throw new SandboxError(`"${args.api}" is not a sandbox's address (https://<host>/v1/sandboxes/sbx_...)`, "bad_address");
|
|
75173
|
+
const deploymentId = args.deploymentId ? String(args.deploymentId).trim() : sandboxId;
|
|
75174
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(deploymentId)) throw new SandboxError(`"${args.deploymentId}" is not a deployment id`, "bad_input");
|
|
75175
|
+
const found = {
|
|
75176
|
+
deploymentId,
|
|
75177
|
+
sandboxId,
|
|
75178
|
+
api: api2,
|
|
75179
|
+
tlsPin,
|
|
75180
|
+
owner: null,
|
|
75181
|
+
ownerUnchecked: ATTACHED_OWNER_WORDS,
|
|
75182
|
+
auth: { kind: "key", secret: accessKey },
|
|
75183
|
+
record: null,
|
|
75184
|
+
machine: null
|
|
75185
|
+
};
|
|
75186
|
+
let door;
|
|
75187
|
+
try {
|
|
75188
|
+
door = await openCheckedDoor(found);
|
|
75189
|
+
} catch (err) {
|
|
75190
|
+
if (err instanceof DoorError) throw new SandboxError(err.message, err.code, { status: err.status });
|
|
75191
|
+
throw err;
|
|
75192
|
+
}
|
|
75193
|
+
let view;
|
|
75194
|
+
try {
|
|
75195
|
+
view = await door.door.read();
|
|
75196
|
+
} catch (err) {
|
|
75197
|
+
const e = err;
|
|
75198
|
+
if (e.status === 401 || e.status === 403) throw new SandboxError("that access key does not open this sandbox's door: nothing was kept", "wrong_key", { status: e.status });
|
|
75199
|
+
if (err instanceof DoorError) throw new SandboxError(err.message, err.code, { status: err.status });
|
|
75200
|
+
throw err;
|
|
75201
|
+
}
|
|
75202
|
+
const kept = await findRecord(deploymentId) ?? await findRecord(sandboxId);
|
|
75203
|
+
const record = kept ? { ...kept, sandboxId, api: api2, tlsPin, accessKey } : { v: 1, deploymentId, plan: null, sandboxId, api: api2, tlsPin, owner: null, accessKey, paidWith: "attached", createdAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
75204
|
+
await writeRecord(record);
|
|
75205
|
+
return { record, verdict: door.verdict, view };
|
|
75206
|
+
}
|
|
75207
|
+
function canOf(rec, deploymentId) {
|
|
75208
|
+
const known = Boolean(deploymentId && !SANDBOX_ID_RE.test(deploymentId));
|
|
75209
|
+
return { exec: true, cp: true, verify: true, logs: true, status: true, renew: known, rm: known && rec?.paidWith !== "attached" };
|
|
75210
|
+
}
|
|
75148
75211
|
function receiptStateOf(found) {
|
|
75149
75212
|
const rec = found.record;
|
|
75150
75213
|
return {
|
|
@@ -75190,6 +75253,7 @@ async function renewSandbox(args) {
|
|
|
75190
75253
|
}
|
|
75191
75254
|
async function deleteSandbox(id2) {
|
|
75192
75255
|
const rec = await findRecord(id2);
|
|
75256
|
+
if (rec?.paidWith === "attached") throw new SandboxError(ATTACHED_DELETE_WORDS, "needs_owner");
|
|
75193
75257
|
let depId = rec?.deploymentId ?? id2;
|
|
75194
75258
|
const wallet = await payingWallet();
|
|
75195
75259
|
if (SANDBOX_ID_RE.test(depId)) {
|
|
@@ -75646,9 +75710,9 @@ async function sandboxVerify(id2, opts) {
|
|
|
75646
75710
|
} catch (err) {
|
|
75647
75711
|
return failWith(opts, err);
|
|
75648
75712
|
}
|
|
75649
|
-
const door = new SandboxDoor({ api: found.api, tlsPin: found.tlsPin, sandboxId: found.sandboxId, auth: found.auth, owner: found.owner, ownerUnchecked: found.ownerUnchecked, siteOrigin: siteOrigin() });
|
|
75650
75713
|
let v;
|
|
75651
75714
|
try {
|
|
75715
|
+
const door = new SandboxDoor({ api: found.api, tlsPin: found.tlsPin, sandboxId: found.sandboxId, auth: found.auth, owner: found.owner, ownerUnchecked: found.ownerUnchecked, siteOrigin: siteOrigin() });
|
|
75652
75716
|
v = await door.verify();
|
|
75653
75717
|
} catch (err) {
|
|
75654
75718
|
return failWith(opts, err);
|
|
@@ -76016,6 +76080,63 @@ async function sandboxLs(opts) {
|
|
|
76016
76080
|
for (const e of list.errors) sayErr2(` ${import_picocolors13.default.yellow("!")} ${e}
|
|
76017
76081
|
`);
|
|
76018
76082
|
}
|
|
76083
|
+
var CHAIN_WORDS = { 8453: "Base", 137: "Polygon", 900: "Solana", 1: "Ethereum", 42161: "Arbitrum" };
|
|
76084
|
+
function paymentLine(inv) {
|
|
76085
|
+
const when3 = typeof inv.createdAt === "string" ? inv.createdAt.replace("T", " ").replace(/\.\d+Z$/, "Z") : "?";
|
|
76086
|
+
const minutes = typeof inv.minutes === "number" && inv.minutes > 0 ? inv.minutes : null;
|
|
76087
|
+
const hours = typeof inv.hours === "number" ? inv.hours : 0;
|
|
76088
|
+
const time = minutes !== null ? `${minutes} min` : hours > 0 ? `${hours} h` : "";
|
|
76089
|
+
const kind = inv.kind === "renew" ? "renewal" : inv.kind === "create" ? "purchase" : String(inv.kind ?? "payment");
|
|
76090
|
+
const how = typeof inv.chainId === "number" ? `paid on ${CHAIN_WORDS[inv.chainId] ?? `chain ${inv.chainId}`}` : "from a balance";
|
|
76091
|
+
return `${when3} ${kind}${time ? ` of ${time}` : ""} $${String(inv.amountUsd ?? "?")} ${how}`;
|
|
76092
|
+
}
|
|
76093
|
+
var STDIN_KEY_MS = 3e3;
|
|
76094
|
+
function firstLineOf(stream, ms) {
|
|
76095
|
+
return new Promise((resolve5) => {
|
|
76096
|
+
let text = "";
|
|
76097
|
+
const done = () => {
|
|
76098
|
+
clearTimeout(timer);
|
|
76099
|
+
stream.removeListener("data", onData);
|
|
76100
|
+
stream.removeListener("end", done);
|
|
76101
|
+
stream.removeListener("error", done);
|
|
76102
|
+
stream.pause?.();
|
|
76103
|
+
stream.unref?.();
|
|
76104
|
+
resolve5(text.split(/\r?\n/)[0] ?? "");
|
|
76105
|
+
};
|
|
76106
|
+
const onData = (c) => {
|
|
76107
|
+
text += c.toString();
|
|
76108
|
+
if (/\n/.test(text) || text.length > 4096) done();
|
|
76109
|
+
};
|
|
76110
|
+
const timer = setTimeout(done, ms);
|
|
76111
|
+
stream.on("data", onData);
|
|
76112
|
+
stream.once("end", done);
|
|
76113
|
+
stream.once("error", done);
|
|
76114
|
+
});
|
|
76115
|
+
}
|
|
76116
|
+
async function sandboxAttach(address, opts) {
|
|
76117
|
+
if (!opts.pin) return failWith(opts, new SandboxError("--pin is the sandbox's pin, sha256//..., as agentgates.ai/sandboxes shows it", "bad_input"));
|
|
76118
|
+
let accessKey = opts.accessKey ?? process.env.AGENTGATES_SANDBOX_ACCESS_KEY ?? "";
|
|
76119
|
+
if (!accessKey && !process.stdin.isTTY) accessKey = (await firstLineOf(process.stdin, STDIN_KEY_MS)).trim().split(/\s+/)[0] ?? "";
|
|
76120
|
+
if (!accessKey) return failWith(opts, new SandboxError("its access key: --access-key, AGENTGATES_SANDBOX_ACCESS_KEY, or piped on stdin", "bad_input"));
|
|
76121
|
+
let out;
|
|
76122
|
+
try {
|
|
76123
|
+
out = await attachSandbox({ api: address, tlsPin: opts.pin, accessKey, deploymentId: opts.id ?? null });
|
|
76124
|
+
} catch (err) {
|
|
76125
|
+
return failWith(opts, err);
|
|
76126
|
+
}
|
|
76127
|
+
const r = out.record;
|
|
76128
|
+
if (jsonMode7(opts)) {
|
|
76129
|
+
say3(JSON.stringify({ ok: true, attached: { deploymentId: r.deploymentId, sandbox: { id: r.sandboxId, api: r.api, tlsPin: r.tlsPin } }, proof: "checked", ownerCheck: ATTACHED_OWNER_WORDS, door: out.view, delete: ATTACHED_DELETE_WORDS }, null, 2) + "\n");
|
|
76130
|
+
return;
|
|
76131
|
+
}
|
|
76132
|
+
say3(` ${import_picocolors13.default.green("ok")} ${r.sandboxId} attached: its proof checked and its door opened with the access key
|
|
76133
|
+
`);
|
|
76134
|
+
say3(` ${import_picocolors13.default.dim(`exec, cp, verify, logs and status reach it from here: agentgates sandbox exec ${r.sandboxId} -- <command>`)}
|
|
76135
|
+
`);
|
|
76136
|
+
say3(` ${import_picocolors13.default.dim(ATTACHED_DELETE_WORDS)}
|
|
76137
|
+
|
|
76138
|
+
`);
|
|
76139
|
+
}
|
|
76019
76140
|
async function sandboxStatus(id2, opts) {
|
|
76020
76141
|
let found;
|
|
76021
76142
|
try {
|
|
@@ -76038,14 +76159,26 @@ async function sandboxStatus(id2, opts) {
|
|
|
76038
76159
|
} catch (err) {
|
|
76039
76160
|
doorError = err.message;
|
|
76040
76161
|
}
|
|
76162
|
+
const m = found.machine;
|
|
76163
|
+
const status4 = typeof m?.status === "string" ? m.status : typeof doorView?.state === "string" ? String(doorView.state) : "unread";
|
|
76164
|
+
const doorEnds = typeof doorView?.paidUntil === "number" ? new Date(doorView.paidUntil * 1e3).toISOString() : void 0;
|
|
76165
|
+
const can = canOf(found.record, found.deploymentId);
|
|
76166
|
+
if (!doorView) process.exitCode = 1;
|
|
76041
76167
|
if (jsonMode7(opts)) {
|
|
76042
|
-
|
|
76168
|
+
const payments = Array.isArray(found.machine?.invoices) ? found.machine.invoices : [];
|
|
76169
|
+
say3(JSON.stringify({ ok: Boolean(doorView), status: status4, deployment: found.machine, sandbox: { id: found.sandboxId, api: found.api, tlsPin: found.tlsPin }, payments, proof: doorView ? "checked" : "not checked", ...found.ownerUnchecked ? { ownerCheck: found.ownerUnchecked } : {}, can, door: doorView, ...doorError ? { doorError } : {} }, null, 2) + "\n");
|
|
76043
76170
|
return;
|
|
76044
76171
|
}
|
|
76045
|
-
const m = found.machine;
|
|
76046
76172
|
say3(`
|
|
76047
|
-
${sandboxLines({ deploymentId: found.deploymentId, status:
|
|
76173
|
+
${sandboxLines({ deploymentId: found.deploymentId, status: status4, plan: m?.plan ?? found.record?.plan, expiresAt: m?.expiresAt ?? doorEnds }, { id: found.sandboxId, api: found.api })}
|
|
76048
76174
|
`);
|
|
76175
|
+
const invoices = Array.isArray(m?.invoices) ? m.invoices : [];
|
|
76176
|
+
if (invoices.length) {
|
|
76177
|
+
say3(` payments ${invoices.length} on record
|
|
76178
|
+
`);
|
|
76179
|
+
for (const inv of invoices) say3(` ${import_picocolors13.default.dim(paymentLine(inv))}
|
|
76180
|
+
`);
|
|
76181
|
+
}
|
|
76049
76182
|
if (doorView) {
|
|
76050
76183
|
say3(` proof ${import_picocolors13.default.green("checked")} ${import_picocolors13.default.dim("(4 checks, your own nonce; agentgates sandbox verify shows each)")}
|
|
76051
76184
|
`);
|
|
@@ -76058,7 +76191,8 @@ ${sandboxLines({ deploymentId: found.deploymentId, status: m?.status ?? "running
|
|
|
76058
76191
|
say3(` proof ${import_picocolors13.default.red("not checked")} ${import_picocolors13.default.dim(doorError)}
|
|
76059
76192
|
`);
|
|
76060
76193
|
}
|
|
76061
|
-
|
|
76194
|
+
const then = [can.renew ? "renew it (agentgates sandbox renew)" : null, can.rm ? "delete it (agentgates sandbox rm)" : null].filter(Boolean).join(", or ");
|
|
76195
|
+
say3(` ${import_picocolors13.default.dim(`it does not stop, start, resize or take a new setup${then ? `: ${then}` : ""}`)}
|
|
76062
76196
|
|
|
76063
76197
|
`);
|
|
76064
76198
|
}
|
|
@@ -78122,7 +78256,9 @@ var MCP_PAID_BUDGET_MS = 45e3;
|
|
|
78122
78256
|
async function sandboxListing(env = process.env, fetchImpl = fetch) {
|
|
78123
78257
|
if (env.AGENTGATES_SANDBOX_TOOLS === "1") return true;
|
|
78124
78258
|
try {
|
|
78125
|
-
|
|
78259
|
+
const plans = await listedSandboxPlans(fetchImpl);
|
|
78260
|
+
readWait = plans.length === 0 ? null : plans.some((p) => p.waitsForHost === true) ? true : plans.every((p) => p.waitsForHost === false) ? false : null;
|
|
78261
|
+
return plans.length > 0;
|
|
78126
78262
|
} catch {
|
|
78127
78263
|
return null;
|
|
78128
78264
|
}
|
|
@@ -78170,11 +78306,16 @@ function payOf(args) {
|
|
|
78170
78306
|
return { mode: pay, key: null };
|
|
78171
78307
|
}
|
|
78172
78308
|
var ID_PROP = { id: { type: "string", description: "The sandbox's deployment id (or its sbx_ id), from sandbox_create or sandbox_list." } };
|
|
78173
|
-
|
|
78309
|
+
var readWait = null;
|
|
78310
|
+
function sandboxCreateWords(wait2) {
|
|
78311
|
+
const now = wait2 === true ? "When this server read the catalog no host had a free seat: one bought then waits for a host to start and runs about two minutes after its payment, its price carrying that start, and this tool answers at once with its id (sandbox_list shows it running). " : wait2 === false ? "When this server read the catalog a host had a free seat: one bought then answers running with its address; once the seats are taken, one waits about two minutes after its payment and this tool answers at once with its id. " : "It answers running with its address when a host has a seat; else it waits for a seat and runs about two minutes after its payment when a host must start for it, and this tool answers at once with its id (sandbox_list shows it running). ";
|
|
78312
|
+
return "Buy a sealed sandbox: a small Linux computer for one agent in a confidential VM (Intel TDX), by the minute. " + now + "The key that pays owns it. With access_key (always with pay key) it is made with a key kept on this machine.";
|
|
78313
|
+
}
|
|
78314
|
+
function sandboxTools(wait2 = readWait) {
|
|
78174
78315
|
return [
|
|
78175
78316
|
{
|
|
78176
78317
|
name: "sandbox_create",
|
|
78177
|
-
description:
|
|
78318
|
+
description: sandboxCreateWords(wait2),
|
|
78178
78319
|
inputSchema: {
|
|
78179
78320
|
type: "object",
|
|
78180
78321
|
properties: {
|
|
@@ -86191,6 +86332,9 @@ sandbox.command("status <id>").description("One sandbox: its state, address, end
|
|
|
86191
86332
|
sandbox.command("renew <id>").description("Add paid minutes to its end. Any wallet may pay over x402; the owner may draw its balance.").option("--minutes <n>", "whole minutes to add").option("--hours <n>", "whole hours in place of --minutes").option("--from-balance", "draw this key's prepaid balance (priced first, held to --max-usd)").option("--key <agc_key>", "draw this compute key's balance (priced first, held to --max-usd)").option("--network <name>", "pay on this network only").option("--max-usd <dollars>", "refuse to pay or draw above this price").option("--quote", "print the price and stop: nothing is paid or drawn").option("--yes", "pay without the prompt (with --max-usd)").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (id2, opts) => {
|
|
86192
86333
|
await sandboxRenew(id2, opts);
|
|
86193
86334
|
});
|
|
86335
|
+
sandbox.command("attach <address>").description("Keep a sandbox bought on agentgates.ai here, from what its page showed once: its address, its pin and its access key. Its proof is checked and its door opened first; then exec, cp, verify, logs and status reach it. A delete still takes the wallet that bought it.").option("--pin <pin>", "its pin, sha256//..., as the page shows it").option("--access-key <key>", "its access key, sbxk_... (or AGENTGATES_SANDBOX_ACCESS_KEY, or piped on stdin)").option("--id <deployment-id>", "its deployment id, when you have it").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (address, opts) => {
|
|
86336
|
+
await sandboxAttach(address, opts);
|
|
86337
|
+
});
|
|
86194
86338
|
sandbox.command("rm <id>").description("Delete it now: it ends with its disk, and its unused minutes are not refunded. Signed by the owner's key.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (id2, opts) => {
|
|
86195
86339
|
await sandboxRm(id2, opts);
|
|
86196
86340
|
});
|