@tonbo/cli 0.28.0 → 0.30.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/bin/tonbo.js +22 -12
- package/package.json +1 -1
package/dist/bin/tonbo.js
CHANGED
|
@@ -2028,10 +2028,6 @@ var cliSessionContract = {
|
|
|
2028
2028
|
},
|
|
2029
2029
|
"idleDays": 30
|
|
2030
2030
|
};
|
|
2031
|
-
var machineIdleActions = [
|
|
2032
|
-
"suspend",
|
|
2033
|
-
"release"
|
|
2034
|
-
];
|
|
2035
2031
|
var machinePortAccess = [
|
|
2036
2032
|
"private",
|
|
2037
2033
|
"public"
|
|
@@ -6229,6 +6225,25 @@ function sleepText(machine) {
|
|
|
6229
6225
|
if (action !== "release") return `${when2}; it then ${action}s`;
|
|
6230
6226
|
return `${when2}; the disk resets at every sleep${reason2 === "suspend_unavailable" ? " until suspend ships" : ""}`;
|
|
6231
6227
|
}
|
|
6228
|
+
var RESTORE_WORDS = {
|
|
6229
|
+
snapshot_evicted: "Snapshot expired",
|
|
6230
|
+
host_unavailable: "Its host was unavailable",
|
|
6231
|
+
spec_changed: "Its configuration changed",
|
|
6232
|
+
stopped: "It was stopped",
|
|
6233
|
+
domain_mismatch: "Snapshot did not fit the host",
|
|
6234
|
+
memory_missing: "Snapshot was incomplete",
|
|
6235
|
+
generation_absent: "Snapshot was not found",
|
|
6236
|
+
generation_unfit: "Snapshot could not be used",
|
|
6237
|
+
failed_after_load: "Resume failed"
|
|
6238
|
+
};
|
|
6239
|
+
function restoreFields(machine) {
|
|
6240
|
+
const restore = machine.status.restore;
|
|
6241
|
+
if (!restore) return [];
|
|
6242
|
+
if (restore.outcome === "restored") return [["Last wake", "resumed where it slept"]];
|
|
6243
|
+
const fresh = restore.outcome === "fresh_retained_disks" ? "booted fresh, disk kept" : "booted fresh";
|
|
6244
|
+
const why = restore.reason ? RESTORE_WORDS[restore.reason] ?? restore.reason : null;
|
|
6245
|
+
return [["Last wake", why ? `${why}; ${fresh}` : fresh]];
|
|
6246
|
+
}
|
|
6232
6247
|
function activationFields(machine) {
|
|
6233
6248
|
const { activation } = machine;
|
|
6234
6249
|
if (!activation) return [];
|
|
@@ -6336,6 +6351,7 @@ function machineFields(machine, billing, etag = null, lastEnd = null, volumeName
|
|
|
6336
6351
|
["Power", powerText(machine)],
|
|
6337
6352
|
...awakeFields(machine),
|
|
6338
6353
|
...activationFields(machine),
|
|
6354
|
+
...restoreFields(machine),
|
|
6339
6355
|
...lastEnd ? [["Last end", endText(lastEnd)]] : [],
|
|
6340
6356
|
...conditionFields(machine, billing),
|
|
6341
6357
|
["Sleeps", sleepText(machine)],
|
|
@@ -6755,7 +6771,6 @@ async function machineCreateCommand(deps, name, command, options = {}) {
|
|
|
6755
6771
|
env: Object.keys(env).length ? env : void 0,
|
|
6756
6772
|
...Object.keys(secrets).length ? { secrets } : {},
|
|
6757
6773
|
sleep_after_seconds: options.sleepAfter,
|
|
6758
|
-
idle_action: options.idleAction,
|
|
6759
6774
|
stop_grace_seconds: options.stopGrace,
|
|
6760
6775
|
...bound ? { volumes: [bound.binding] } : {},
|
|
6761
6776
|
delete_after_seconds: deleteAfterSeconds(options.deleteAfter),
|
|
@@ -6923,7 +6938,6 @@ async function machineUpdateCommand(deps, name, command, options = {}) {
|
|
|
6923
6938
|
shape: options.shape,
|
|
6924
6939
|
command: options.imageCommand ? null : command.length ? command : void 0,
|
|
6925
6940
|
sleep_after_seconds: options.sleepAfter,
|
|
6926
|
-
idle_action: options.idleAction,
|
|
6927
6941
|
stop_grace_seconds: options.stopGrace,
|
|
6928
6942
|
delete_after_seconds: deleteAfterSeconds(options.deleteAfter)
|
|
6929
6943
|
};
|
|
@@ -7655,7 +7669,7 @@ var COMMAND_HELP = {
|
|
|
7655
7669
|
},
|
|
7656
7670
|
"tonbo machine create": {
|
|
7657
7671
|
about: [
|
|
7658
|
-
"Creates a Machine, a VM booted from an image in one region. It has no database of its own: `--database <name>` binds one of the account's databases of its region, which it then reaches at `TONBO_DATABASE_URL`, and a database binds one Machine at a time; its disk can last on a Volume (`--volume <name>` keeps the Machine's whole disk on it, and `--volume <name>:<path>` mounts it at a path instead), and its program can open any other database by URL with a key. The image is a public OCI image
|
|
7672
|
+
"Creates a Machine, a VM booted from an image in one region. It has no database of its own: `--database <name>` binds one of the account's databases of its region, which it then reaches at `TONBO_DATABASE_URL`, and a database binds one Machine at a time; its disk can last on a Volume (`--volume <name>` keeps the Machine's whole disk on it, and `--volume <name>:<path>` mounts it at a path instead), and its program can open any other database by URL with a key. The image is a public OCI image, multi-arch (as the official Docker Hub images are) or built for linux/arm64, from Docker Hub or another public registry (`nginx:1.27`, `ghcr.io/org/app:v1`, or one pinned by digest), or `tonbo.dev/platform`, the platform image. A registry reachable only over IPv6, one named by an IP address, and one that redirects its manifests are refused. The CLI resolves a registry image to its linux/arm64 digest, and the image is pulled before the Machine leaves `creating`.",
|
|
7659
7673
|
"The Machine is served at `https://<name>-<account>.tonbo.sh` on its default port. `--port <port>` serves a private port, which takes a member's token, and `--port <port>:public` an open one, which needs the `machines.public` capability. A command after `--` replaces the image's CMD. `--secret-env KEY=FILE` and `--secret-file KEY=FILE` read initial secrets from local files and store them with the Machine before its first boot; their values are never returned. The CLI warns on stderr when the Machine has no port, since nothing can wake it then, and when an `--env` key looks secret: env values are readable by every member through the API.",
|
|
7660
7674
|
"`--move-from <machine>` takes the `--volume` from the Machine that has it now, in the same write as the create: that Machine's binding is removed (its ETag changes) and it boots without the Volume. It is refused while that Machine is awake with the Volume attached (`volume_attached`: `tonbo machine sleep <machine>` first), or when another Machine has the Volume (`volume_holder_changed`); either way nothing is created or changed. Without it, a Volume another Machine has is refused.",
|
|
7661
7675
|
"The answer is the Machine while it is `creating`. With `--wait` the CLI reads it until it is `active` or `failed`, or `--timeout` passes: a failure prints what to do and exits 1, and a timeout says it is still creating and undoes nothing. A creation the network or a 5xx answer did not confirm is sent at most three times with the same idempotency key, each retry after its `Retry-After` (at most 30 s) or a short backoff; a `name_taken` refusal says which Machine holds the name and how old it is, in case it is yours from a lost reply. In a region not open for Machines the creation is refused with `region_not_offered`, and nothing is created."
|
|
@@ -9414,10 +9428,6 @@ function machineSpecOptions(command, update) {
|
|
|
9414
9428
|
"--sleep-after <seconds>",
|
|
9415
9429
|
"how long the Machine stays awake without a connection",
|
|
9416
9430
|
parseWhole
|
|
9417
|
-
).addOption(
|
|
9418
|
-
new Option("--idle-action <action>", "what sleeping does to the Machine").choices(
|
|
9419
|
-
machineIdleActions
|
|
9420
|
-
)
|
|
9421
9431
|
).option(
|
|
9422
9432
|
"--stop-grace <seconds>",
|
|
9423
9433
|
"the seconds between SIGTERM and SIGKILL on a planned stop",
|
|
@@ -9776,7 +9786,7 @@ function createProgram(makeDependencies = createDependencies) {
|
|
|
9776
9786
|
"create a Machine from an image; [command...] after -- replaces the image's CMD"
|
|
9777
9787
|
).requiredOption(
|
|
9778
9788
|
"--image <reference>",
|
|
9779
|
-
"the image the Machine boots: a public OCI image
|
|
9789
|
+
"the image the Machine boots: a public OCI image, multi-arch or built for linux/arm64 (nginx:1.27, ghcr.io/org/app@sha256:...), or tonbo.dev/platform"
|
|
9780
9790
|
).option("--region <region>", "the Machine's region, fixed for its life").option(
|
|
9781
9791
|
"--database <name>",
|
|
9782
9792
|
"bind the account's database <name> (see tonbo database list), of the Machine's region: its URL is TONBO_DATABASE_URL and the Machine writes it"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonbo/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "The Tonbo CLI. Compute, disks, databases and streams for AI agents: your agent picks what it needs, sets it up, and knows what it costs, from the command line.",
|
|
5
5
|
"homepage": "https://tonbo.dev",
|
|
6
6
|
"bugs": {
|