instabox 0.8.247 → 0.8.249
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 +19 -1
- package/cli/SHA256SUMS +6 -6
- package/cli/instabox-darwin-amd64 +0 -0
- package/cli/instabox-darwin-arm64 +0 -0
- package/cli/instabox-linux-amd64 +0 -0
- package/cli/instabox-linux-arm64 +0 -0
- package/cli/instabox-windows-amd64.exe +0 -0
- package/cli/instabox-windows-arm64.exe +0 -0
- package/package.json +1 -1
- package/skills/instabox/SKILL.md +3 -1
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
4eba59e9f46acf1125b55ddc165980a41527b973b1b8d3dc67e7f8a67e1b16c6 instabox-darwin-amd64
|
|
2
|
+
335e431d0f58356c67f33d59f681f22445e8d0024f5874cb21a90970c5df39d0 instabox-darwin-arm64
|
|
3
|
+
1184fd3cd855e416cc95c6b9f3899e815912f60236a4bbe6d2ee6365c959177d instabox-linux-amd64
|
|
4
|
+
a51d1a11bd3dfde3a59b9757e94d21c23eb001cf0e3cddcb59101818abc9fa8e instabox-linux-arm64
|
|
5
|
+
15e3fbd5da3394bf48858d3df3a03af4d7538582193857a53cd08c8be348c3ab instabox-windows-amd64.exe
|
|
6
|
+
b52d2bf3d00be8f15951f394f2411abdb749920359adef2c4116d24a8429fa45 instabox-windows-arm64.exe
|
|
Binary file
|
|
Binary file
|
package/cli/instabox-linux-amd64
CHANGED
|
Binary file
|
package/cli/instabox-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/skills/instabox/SKILL.md
CHANGED
|
@@ -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
|
|