@tonbo/cli 0.29.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.
Files changed (2) hide show
  1. package/dist/bin/tonbo.js +22 -2
  2. package/package.json +1 -1
package/dist/bin/tonbo.js CHANGED
@@ -6225,6 +6225,25 @@ function sleepText(machine) {
6225
6225
  if (action !== "release") return `${when2}; it then ${action}s`;
6226
6226
  return `${when2}; the disk resets at every sleep${reason2 === "suspend_unavailable" ? " until suspend ships" : ""}`;
6227
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
+ }
6228
6247
  function activationFields(machine) {
6229
6248
  const { activation } = machine;
6230
6249
  if (!activation) return [];
@@ -6332,6 +6351,7 @@ function machineFields(machine, billing, etag = null, lastEnd = null, volumeName
6332
6351
  ["Power", powerText(machine)],
6333
6352
  ...awakeFields(machine),
6334
6353
  ...activationFields(machine),
6354
+ ...restoreFields(machine),
6335
6355
  ...lastEnd ? [["Last end", endText(lastEnd)]] : [],
6336
6356
  ...conditionFields(machine, billing),
6337
6357
  ["Sleeps", sleepText(machine)],
@@ -7649,7 +7669,7 @@ var COMMAND_HELP = {
7649
7669
  },
7650
7670
  "tonbo machine create": {
7651
7671
  about: [
7652
- "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 with a linux/arm64 variant, 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`.",
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`.",
7653
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.",
7654
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.",
7655
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."
@@ -9766,7 +9786,7 @@ function createProgram(makeDependencies = createDependencies) {
9766
9786
  "create a Machine from an image; [command...] after -- replaces the image's CMD"
9767
9787
  ).requiredOption(
9768
9788
  "--image <reference>",
9769
- "the image the Machine boots: a public OCI image with a linux/arm64 variant (nginx:1.27, ghcr.io/org/app@sha256:...), or tonbo.dev/platform"
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"
9770
9790
  ).option("--region <region>", "the Machine's region, fixed for its life").option(
9771
9791
  "--database <name>",
9772
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.29.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": {