instabox 0.8.247 → 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
- 9ce35ff3d99ca98c52b3b1d7141346b59055c6f3858d88250a9784e27d6e0ede instabox-darwin-amd64
2
- 7f220338e4905fbd96a1cdb9cbdd5d0ebac0c42d6629a74ac916a687b98b95a1 instabox-darwin-arm64
3
- 13e61a177744e0fede7be58dcb1b862b5433882d68f0df3d1acccb4e2d93b4e0 instabox-linux-amd64
4
- f810853322cb09c8f6e9acc883b6fc50d4a980f5958ebd1253cad1ceb204c238 instabox-linux-arm64
5
- bae1b31da8df2dce74c34d45d682eb5a4e4dd7f9fef0911006794cd57c23cc0f instabox-windows-amd64.exe
6
- ff39f1c6534bd8f0d45c0a515073a4f5c69a5d160c8edce30a38f99f74e270f9 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.247",
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