instabox 0.8.246 → 0.8.248

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/bin/instabox.mjs CHANGED
@@ -243,10 +243,28 @@ async function newBox() {
243
243
  // box from one of your own snapshots keeps the snapshot's user.
244
244
  const user = localGuestUser();
245
245
  if (user.name && src.templateId) body.guestUser = user.name;
246
- const op = await waitOp(await client.call('POST', '/v1/machines', body));
246
+ let created;
247
+ try {
248
+ created = await client.call('POST', '/v1/machines', body);
249
+ } catch (e) {
250
+ if (e?.code !== 'minimum_lease_required' || !(await askLease(e.message))) throw e;
251
+ created = await client.call('POST', '/v1/machines', { ...body, acceptMinimumLease: true });
252
+ }
253
+ const op = await waitOp(created);
247
254
  return { id: op.machineId, name: body.name, user };
248
255
  }
249
256
 
257
+ // askLease asks to accept a macOS box's 24-hour Mac lease; false without a terminal or with -y.
258
+ async function askLease(message) {
259
+ if (YES || !process.stdin.isTTY || !process.stdout.isTTY) return false;
260
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
261
+ try {
262
+ return /^y(es)?$/i.test((await rl.question(` ${message}\n ${bold('Lease the Mac?')} [y/N]: `)).trim());
263
+ } finally {
264
+ rl.close();
265
+ }
266
+ }
267
+
250
268
  // Runs while the box starts; never fatal. Returns a line to print, or null: a string, or
251
269
  // { line, tryLs, more } when `instabox ls` is worth suggesting after it (reportInstalls decides).
252
270
  // The CLI comes from this package only (cli/<build>); without one for this machine there is
package/cli/SHA256SUMS CHANGED
@@ -1,6 +1,6 @@
1
- 3aae9d63e3c73cc0f6262642ec98db4e05a1744a4891650bb8004bab047ff872 instabox-darwin-amd64
2
- d706e1d1a1aa5cbed599db4ddd322cbbf7515fceeb67ac4667454e427c390004 instabox-darwin-arm64
3
- f265a67188829dbfca016b2a486f92702afe4f7a6e51113419c0cb639ae90b37 instabox-linux-amd64
4
- 8737767baa72b9ed743f548aad4e96e31ec0df111a666c5ef37cb687b729a23f instabox-linux-arm64
5
- caa2b250e32f6614d409cc1fa35adf2f914fe4ffa31c17ce4cbdbce05fbd6a19 instabox-windows-amd64.exe
6
- 3990a0d7ae9fa7be916d5bdec75997f5ef92a558c83d955d21f426e4acff1099 instabox-windows-arm64.exe
1
+ d78ec373f1e17dce24bb834de925f13383ae1bcc3d6260e1f812b963dbd88235 instabox-darwin-amd64
2
+ 0148fd96288fddf7a0c4989fd2595c93a30098e685dd4638668b61fd508b095d instabox-darwin-arm64
3
+ 6aee03b822c31ed128b8268b271da9c6a19055edb62dd328221bf4c1ea16e4fc instabox-linux-amd64
4
+ 8358426dcbf7ae58ff0f70d11120132cb15662152ef909d97c204bd22b9a2722 instabox-linux-arm64
5
+ a81e7261f2516206802ffbac27eb8982e6b63af01da4bf11b3038f490123aaf6 instabox-windows-amd64.exe
6
+ 24c0000b301aaede4ce6f24c98c24142e2e6d31b05cdb2957bda2d366642ed4e instabox-windows-arm64.exe
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instabox",
3
- "version": "0.8.246",
3
+ "version": "0.8.248",
4
4
  "description": "A cloud box for your coding agent, the instabox CLI and its agent skills in one command: npx instabox@latest",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,7 +36,9 @@ With no key and nobody at the keyboard, sign up by yourself: `instabox login --a
36
36
 
37
37
  To run an older or different image (say `node:16-buster`), use Docker in the box: on `agent-browser`, `universal` and `t3` the box user is in group `docker`, so `docker run --rm node:16-buster node -v` works without sudo. An operator can also turn a public Debian- or Ubuntu-based image into its own template (`images/templates/oci/build.sh`); it then shows up in `instabox templates` like any other.
38
38
 
39
- `instabox templates` lists the ones this server offers, one row per template: the version `create` gets for `--template T` alone, with its VERSION and a description; its TAG column (`--json`: `"latest"`, `"default"`) says latest, or default for the one `create` gets with no `--template`. `--all` lists every version, with a CREATABLE column. Pin another version with `--template T@VERSION` (or `--template-version`). `--json` (also what a piped `instabox templates` prints) has the same rows, the one `create` gets per template; `instabox templates --json --all` lists every version, retired ones with `"creatable": false`, which no new box can start from. The free plan creates boxes from `agent-browser`, `android`, `omarchy` or `ci` only: another template is refused with `403 template_not_allowed` and needs a paid plan (the user upgrades on the dashboard). A box from a snapshot (`--snapshot`) works on every plan, whatever template the snapshot came from. Do not retry another template on the free plan; use `agent-browser` (or `android` for Android, `omarchy` for an Arch Linux desktop). Over the HTTP API, `POST /v1/machines` with an unknown `templateId` is `400 bad_request` whose message lists the templates your plan can create from, and a version that template does not have (`agent-browser@nope`, or `templateVersion`) is `400 bad_request` listing its versions newest first, the one you get without a version tagged `(latest)` or `(default)`; a body field the API does not have is `400 unknown_field` naming the closest real one (`template`: did you mean `templateId`?); `name` may be left out (`box-` and 8 random hex digits).
39
+ `instabox templates` lists the ones this server offers, one row per template: the version `create` gets for `--template T` alone, with its VERSION and a description; its TAG column (`--json`: `"latest"`, `"default"`) says latest, or default for the one `create` gets with no `--template`. `--all` lists every version, with a CREATABLE column. Pin another version with `--template T@VERSION` (or `--template-version`). `--json` (also what a piped `instabox templates` prints) has the same rows, the one `create` gets per template; `instabox templates --json --all` lists every version, retired ones with `"creatable": false`, which no new box can start from. The free plan creates boxes from `agent-browser`, `android`, `omarchy` or `ci` only: another template is refused with `403 template_not_allowed` and needs a paid plan (the user upgrades on the dashboard). A box from a snapshot (`--snapshot`) works on every plan, whatever template the snapshot came from, except a GPU or macOS one. Do not retry another template on the free plan; use `agent-browser` (or `android` for Android, `omarchy` for an Arch Linux desktop). Over the HTTP API, `POST /v1/machines` with an unknown `templateId` is `400 bad_request` whose message lists the templates your plan can create from, and a version that template does not have (`agent-browser@nope`, or `templateVersion`) is `400 bad_request` listing its versions newest first, the one you get without a version tagged `(latest)` or `(default)`; a body field the API does not have is `400 unknown_field` naming the closest real one (`template`: did you mean `templateId`?); `name` may be left out (`box-` and 8 random hex digits).
40
+
41
+ macOS: the `macos` template, where `instabox templates` lists it (Pro plan and up; the free plan gets `403 template_not_allowed`), runs on a whole Mac leased to the workspace for at least 24 hours, billed whatever the box does; `instabox templates` shows the price per hour, the minimum and the sizes (half a Mac or a whole Mac). Create one only when the user asked for macOS, with `--accept-24h-minimum`: without it a create off a terminal fails with `400 minimum_lease_required`, whose message gives the price. Do not add the flag on your own: it commits the user to the 24-hour charge, so ask them first. Inside the 24 hours `stop` and `rm` are scheduled for their end (`--now` acts at once and the 24 hours are still billed; `--cancel` cancels). A macOS box cannot be paused and takes no `--env`.
40
42
 
41
43
  ## Sizes
42
44