@insforge/instabox-sdk 0.6.0 → 0.7.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/README.md +63 -19
- package/dist/index.cjs +1141 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +178 -19
- package/dist/index.d.ts +178 -19
- package/dist/index.js +1131 -85
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/skills/instabox/SKILL.md +5 -4
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ console.log(r.stdout)
|
|
|
54
54
|
await sandbox.kill()
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
`Sandbox.create(template?, opts?)` takes a template ID (`agent-browser`), a private snapshot name (`my-setup`) or a snapshot ID (`sn_...`). It defaults to `agent-browser` (universal with a desktop and browser preinstalled, which the dashboard's Computer tab shows; `universal` on a server without it). The free plan creates from `agent-browser`
|
|
57
|
+
`Sandbox.create(template?, opts?)` takes a template ID (`agent-browser`), a private snapshot name (`my-setup`) or a snapshot ID (`sn_...`). It defaults to `agent-browser` (universal with a desktop and browser preinstalled, which the dashboard's Computer tab shows; `universal` on a server without it). The free plan creates from `agent-browser`, `android` or `ci` only; the other templates (`universal`, `t3`, `herdr`, `orca`) need a paid plan, and on free they throw `403 template_not_allowed`. Template IDs take precedence over snapshot names. An unknown name or an ambiguous snapshot name throws before creating a machine; use an ID to select a specific snapshot.
|
|
58
58
|
|
|
59
59
|
```ts
|
|
60
60
|
const sandbox = await Sandbox.create('agent-browser', {
|
|
@@ -63,7 +63,6 @@ const sandbox = await Sandbox.create('agent-browser', {
|
|
|
63
63
|
metadata: { userId: 'u_42' }, // labels stored with the sandbox (plaintext: not for secrets)
|
|
64
64
|
vault: false, // for a sandbox made for someone else: none of the account's Vault items
|
|
65
65
|
archiveMs: 24 * 60 * 60_000, // stops it at this deadline
|
|
66
|
-
autoSuspendMs: 10 * 60_000, // pauses it after 10 idle minutes (default 30; 0: never, see Manual lifecycle)
|
|
67
66
|
})
|
|
68
67
|
console.log(sandbox.sandboxId) // m_...
|
|
69
68
|
```
|
|
@@ -107,7 +106,7 @@ await sandbox.commands.run('for i in 1 2 3; do echo $i; sleep 1; done', {
|
|
|
107
106
|
})
|
|
108
107
|
```
|
|
109
108
|
|
|
110
|
-
The API returns `timedOut` and `truncated` flags. A command that runs past `timeoutMs` throws `CommandExitError` with `timedOut: true` and `exitCode` 124. `stdin` is
|
|
109
|
+
The API returns `timedOut` and `truncated` flags. A command that runs past `timeoutMs` throws `CommandExitError` with `timedOut: true` and `exitCode` 124. `stdin` is a string or a `Uint8Array`, and reaches the command byte for byte: up to 1 MiB of UTF-8 goes in the exec request itself, and anything else (bytes that are not UTF-8, or more than 1 MiB) is first uploaded to a temporary file in the sandbox (`/tmp/.instabox-stdin-*`, mode 0600) that the command reads and removes as it starts, as `instabox exec --stdin` does. That file goes over the file routes (up to 5 GiB), or in base64 chunks over exec on a server without them. Command timeouts are 1–600 seconds; the default HTTP request deadline, which covers the whole stream, allows an additional 30 seconds for the result. An explicit `requestTimeoutMs` overrides that default. `signal` (an `AbortSignal`) stops a command: the request is closed, which kills the command in the sandbox, and `run` throws `InstaboxError` with code `aborted`. A callback that throws also ends the command, and `run` rejects with that error.
|
|
111
110
|
|
|
112
111
|
`background: true` starts the command detached, as a job in its own session, and returns `{ pid, jobId, kill(), wait() }` right away. It is not limited to 10 minutes: use it for builds and test runs that may take longer. Its stdout and stderr go to one log in the sandbox (`~/.instabox/jobs/<jobId>/out`). `wait({ onStdout })` follows that log, calling `onStdout` with each new chunk from the start, and resolves with the whole log as `stdout` and the exit code; a non-zero exit throws `CommandExitError`. `wait({ timeoutMs })` gives up with `InstaboxTimeoutError` (code `job_wait_timeout`) and `signal` stops waiting; the job keeps running either way. `kill()` sends SIGTERM to the command and everything it started; it returns false if they had all exited. `run` does not take `onStdout` or `onStderr` together with `background: true` (it throws `InstaboxError` with code `bad_request`): pass `onStdout` to `wait()` instead. Background commands need bash, util-linux `setsid` and GNU coreutils (`stat`, `dd`, `base64`) in the sandbox; on an image without them `run` throws `InstaboxError` with code `background_unsupported`, naming what is missing, before starting anything. With a `requestTimeoutMs` of 5 seconds or less, `wait()` cannot long-poll and checks the log every 0.25 to 2 seconds instead. The CLI sees the same jobs: `instabox jobs ls`, `instabox jobs logs <sandbox> <jobId> -f`, `instabox jobs wait`.
|
|
113
112
|
|
|
@@ -119,12 +118,12 @@ const server = await sandbox.commands.run('node server.js', { background: true }
|
|
|
119
118
|
await server.kill()
|
|
120
119
|
```
|
|
121
120
|
|
|
122
|
-
Changed in
|
|
121
|
+
Changed in 0.6.0: `onStdout` and `onStderr` were called once, after the command finished, with its whole output; they are now called with each chunk as it is written. A background command's output was discarded; it is now kept in its job's log, which `wait()` and the CLI's `instabox jobs` commands read. Remove old logs with `rm -rf ~/.instabox/jobs/<jobId>`. `onStdout` or `onStderr` passed with `background: true` were ignored; they now throw `bad_request`.
|
|
123
122
|
|
|
124
123
|
## Files
|
|
125
124
|
|
|
126
125
|
```ts
|
|
127
|
-
await sandbox.files.write('/data/home/app.js', 'console.log(1)') // string or
|
|
126
|
+
await sandbox.files.write('/data/home/app.js', 'console.log(1)') // string, bytes or a stream -> { path }
|
|
128
127
|
const text = await sandbox.files.read('/data/home/app.js') // string; throws not_utf8 if the file is not UTF-8
|
|
129
128
|
const bytes = await sandbox.files.read('/data/home/logo.png', { format: 'bytes' })
|
|
130
129
|
const entries = await sandbox.files.list('/data/home') // [{ name, path, type: 'file' | 'dir' }]
|
|
@@ -132,7 +131,49 @@ await sandbox.files.exists('/data/home/app.js') // boolean
|
|
|
132
131
|
await sandbox.files.remove('/data/home/tmp') // files or directories
|
|
133
132
|
```
|
|
134
133
|
|
|
135
|
-
|
|
134
|
+
Large files, whole directories and binary stdin (the paths are relative to HOME in the sandbox, and to the current directory locally):
|
|
135
|
+
|
|
136
|
+
<!-- verbatim: test/readme-transfer.test.ts runs this block as written -->
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
import { createReadStream, createWriteStream } from 'node:fs'
|
|
140
|
+
import { readFile } from 'node:fs/promises'
|
|
141
|
+
import { Readable } from 'node:stream'
|
|
142
|
+
import { pipeline } from 'node:stream/promises'
|
|
143
|
+
|
|
144
|
+
// Stream a file of any size (up to 5 GiB) in, and back out, without holding it in memory.
|
|
145
|
+
await sandbox.files.write('dataset.bin', createReadStream('dataset.bin'))
|
|
146
|
+
await pipeline(Readable.fromWeb(await sandbox.files.readStream('dataset.bin')), createWriteStream('copy.bin'))
|
|
147
|
+
|
|
148
|
+
// A whole directory, one call each way.
|
|
149
|
+
const up = await sandbox.files.upload('my-app', 'my-app') // { path: '/data/home/my-app', files, bytes }
|
|
150
|
+
const down = await sandbox.files.download('my-app/dist', 'dist') // { path: 'dist', remotePath, files, bytes }
|
|
151
|
+
|
|
152
|
+
// Bytes on stdin arrive exactly as sent.
|
|
153
|
+
const logo = await readFile('logo.png')
|
|
154
|
+
const { stdout } = await sandbox.commands.run('sha256sum', { stdin: new Uint8Array(logo) })
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
`read`, `readStream` and `write` move the bytes in one request each over the API's file routes (`GET /v1/machines/{id}/files/content` and `PUT /v1/machines/{id}/files`), the path `instabox cp` uses, as the sandbox's user. Measured from us-west on 2026-10-30: about 1.3 s to write and 1.4 s to read 3 MiB, and under 3 s each for 10 MiB. A server without those routes gets base64 chunks over exec (about 21 s per MiB written), and there a write is capped at 10 MiB.
|
|
158
|
+
|
|
159
|
+
`write` takes a string, a `Uint8Array` (or `Buffer`, `ArrayBuffer`), or a stream: a Node `Readable` (`fs.createReadStream`), a web `ReadableStream`, or any `AsyncIterable` of `Uint8Array` or string chunks (an async generator). A stream is sent as it is read, so memory stays flat whatever its size: 100 MiB moved with about 6 MiB of chunks alive at once (test/stream-memory.test.ts holds it under 16 MiB). The server takes up to 5 GiB per file (`MAX_UPLOAD_BYTES`; `too_large` past it) and drops a transfer that moves nothing for 60 seconds; the SDK gives up on a streamed write that moves nothing for 2 minutes (`InstaboxTimeoutError`, `request_timeout`). A stream can be sent only once, so a streamed write is never retried; bytes are, on 502 to 504. An error thrown by your stream rejects `write` with `InstaboxError` code `source_error` (the original as `cause`), and the file keeps its old content. `signal` stops a write (`aborted`).
|
|
160
|
+
|
|
161
|
+
`read` loads the file into memory and is capped at 10 MiB by default (`file_too_large`): pass `maxBytes` to raise it, or use `readStream`. `readStream(path)` resolves once the file is open, to a `ReadableStream<Uint8Array>` that is also async-iterable (`for await`), with no size cap; in Node, `Readable.fromWeb(stream)` makes it a Node stream. A missing file or a directory rejects the promise with `not_found` before any byte; a stream that ends short of the file's size errors with `file_changed`.
|
|
162
|
+
|
|
163
|
+
`write` creates parent directories, checks the size and SHA-256 the server reports (`transfer_mismatch` when they differ) and replaces the file atomically; an existing file keeps its mode, a new one gets 0644. Writing to a path that is a directory throws `InstaboxError` with code `is_a_directory`; reading a missing path or a directory throws `not_found`. `read` returns a string only for valid UTF-8: a file with other bytes (an image, an archive, a compiled binary) throws `InstaboxNotUtf8Error` (code `not_utf8`, status 0, "file is not UTF-8 text; read it with { format: 'bytes' }") and never a string with U+FFFD in place of the bad bytes. Read such a file with `{ format: 'bytes' }`, which returns its exact bytes. Relative paths are relative to HOME (one exec looks it up, once per sandbox object). HOME is `/data/home`, on the persistent disk. `list`, `exists` and `remove` run over exec.
|
|
164
|
+
|
|
165
|
+
### Directories: `upload` and `download`
|
|
166
|
+
|
|
167
|
+
`files.upload(localDir, remoteDir)` puts the contents of a local directory into `remoteDir`, and `files.download(remoteDir, localDir)` the contents of a sandbox directory into `localDir`, in one call each. They move one gzipped tar the way `instabox push` and `instabox pull` do: `upload` packs it locally as it streams it to a temporary file in the sandbox (`/tmp/.instabox-transfer-*`) over `PUT /v1/machines/{id}/files`, then unpacks it there with `tar`; `download` packs the directory with `tar` in the sandbox (as root when sudo allows it, as the file routes read), streams the archive back over `GET /v1/machines/{id}/files/content` and unpacks it as it arrives. Neither holds the archive in memory, and the temporary file is removed. On a server without the file routes the archive moves in base64 chunks over exec instead.
|
|
168
|
+
|
|
169
|
+
- What `upload` sends: in a git work tree, only the files git tracks (`git ls-files`), as `instabox push` does; `{ all: true }` adds untracked files git does not ignore, and `{ git: false }` sends everything under the directory. Outside a git work tree, or with `git: false`, everything is sent, dot files and empty directories included. Git does not track empty directories, so in a work tree they are not sent.
|
|
170
|
+
- What `download` brings: everything under `remoteDir`, dot files and empty directories included.
|
|
171
|
+
- Symlinks are copied as symlinks (their target text as is), never followed. Sockets, FIFOs and devices are skipped. File and directory permission bits are kept; owners are not (files belong to the user that unpacks them).
|
|
172
|
+
- The destination and its parents are created. Existing files there are replaced; files the archive does not name are kept (a merge, not a mirror).
|
|
173
|
+
- `download` refuses an archive entry that would land outside `localDir` (an absolute path, `..`, or a path through a symlink), with `invalid_response`.
|
|
174
|
+
- Both return a summary: `upload` resolves to `{ path, files, bytes }` (the resolved sandbox directory, regular files sent, archive size); `download` to `{ path, remotePath, files, bytes }`.
|
|
175
|
+
- Errors: a missing local directory throws `local_not_found`, a local error `local_io_error`; a missing sandbox directory `not_found` (404); a file where a directory was expected `not_a_directory`; a failure of `tar` in the sandbox `transfer_failed` (`permission_denied`, 403, when it was refused access). Every error is an `InstaboxError`.
|
|
176
|
+
- They need Node.js (or Bun, Deno) for the local file system; in a browser or a Worker they throw `unsupported`. `read`, `readStream`, `write` and everything else work there too.
|
|
136
177
|
|
|
137
178
|
## Lifecycle
|
|
138
179
|
|
|
@@ -148,7 +189,7 @@ await sandbox.isRunning() // boolean
|
|
|
148
189
|
const all = await Sandbox.list() // your sandboxes, as SandboxInfo[]
|
|
149
190
|
const mine = await Sandbox.list({ metadata: { userId: 'u_42' } }) // all pairs must match
|
|
150
191
|
|
|
151
|
-
await sandbox.setAutoSuspend(10 * 60_000) // pause after 10 idle minutes; 0 keeps it on
|
|
192
|
+
await sandbox.setAutoSuspend(10 * 60_000) // paid plan: pause after 10 idle minutes; 0 keeps it on (free plan: 403)
|
|
152
193
|
await sandbox.setMetadata({ userId: 'u_42', stage: 'review' }) // replaces it; {} clears
|
|
153
194
|
|
|
154
195
|
await sandbox.kill() // delete the machine and its disks (sends X-Confirm-Delete); false if already gone
|
|
@@ -157,9 +198,9 @@ await Sandbox.kill(id)
|
|
|
157
198
|
|
|
158
199
|
Every lifecycle call waits for its operation to finish (default limit 10 minutes, `operationTimeoutMs` to change it).
|
|
159
200
|
|
|
160
|
-
Idle pause: a new sandbox pauses after 30 idle minutes (no agent working, no terminal use, little CPU) and resumes on the next `commands.run`, file read or SSH sign-in, processes and memory intact. `autoSuspendMs` sets another idle time or 0 (never)
|
|
201
|
+
Idle pause: a new sandbox pauses after 30 idle minutes (no agent working, no terminal use, little CPU) and resumes on the next `commands.run`, file read or SSH sign-in, processes and memory intact. On a paid plan, `autoSuspendMs` sets another idle time (5 to 30 minutes, in whole minutes) or 0 (never) and `setAutoSuspend(ms)` changes it later; the free plan keeps 30 minutes and refuses any other value with a 403, so leave both out there. The dashboard always uses 30 minutes. `getInfo().autoSuspendMs` shows what applies. The setting stays across pause and resume.
|
|
161
202
|
|
|
162
|
-
No lifetime timeout: since 0.6.0 (server change of 2026-10-20) a sandbox has no timeout that pauses or deletes it a fixed time after creation. Passing the 0.5 options `timeoutMs` or `onTimeout`, or calling `setTimeout()`, throws `InstaboxError` with code `retired_option` before any request, so code written for 0.5 fails instead of leaving sandboxes running. Use `autoSuspendMs` / `setAutoSuspend(ms)` for the idle pause, `archiveMs` to stop and archive a sandbox a set time after creation, and `kill()` in a `finally` block to delete it when you are done.
|
|
203
|
+
No lifetime timeout: since 0.6.0 (server change of 2026-10-20) a sandbox has no timeout that pauses or deletes it a fixed time after creation. Passing the 0.5 options `timeoutMs` or `onTimeout`, or calling `setTimeout()`, throws `InstaboxError` with code `retired_option` before any request, so code written for 0.5 fails instead of leaving sandboxes running. Use `autoSuspendMs` / `setAutoSuspend(ms)` (paid plan) for the idle pause, `archiveMs` to stop and archive a sandbox a set time after creation, and `kill()` in a `finally` block to delete it when you are done.
|
|
163
204
|
|
|
164
205
|
### Pause, stop or kill
|
|
165
206
|
|
|
@@ -173,14 +214,15 @@ No lifetime timeout: since 0.6.0 (server change of 2026-10-20) a sandbox has no
|
|
|
173
214
|
|
|
174
215
|
The server's idle pause is the same as `pause()`; `archiveMs` is a `stop()`.
|
|
175
216
|
|
|
176
|
-
### Manual lifecycle: the sandbox pauses only when you pause it
|
|
217
|
+
### Manual lifecycle: the sandbox pauses only when you pause it (paid plan)
|
|
177
218
|
|
|
178
|
-
For a product that decides itself when its sandboxes run, create them with `autoSuspendMs: 0`: the sandbox never pauses for idleness, and no archive deadline is set unless you pass one. It runs until your code pauses, stops or kills it, so keep its ID:
|
|
219
|
+
For a product that decides itself when its sandboxes run, create them on a paid plan with `autoSuspendMs: 0`: the sandbox never pauses for idleness, and no archive deadline is set unless you pass one. It runs until your code pauses, stops or kills it, so keep its ID. A free-plan key gets a 403 for `autoSuspendMs: 0`; there, create without it (the free-plan line below): the sandbox also pauses itself after 30 idle minutes, and `Sandbox.connect(id)` resumes it.
|
|
179
220
|
|
|
180
221
|
```ts
|
|
181
222
|
// `db` is your own store, mapping your user to their sandbox
|
|
182
223
|
async function start(userId: string) {
|
|
183
|
-
const box = await Sandbox.create({ autoSuspendMs: 0, metadata: { userId } })
|
|
224
|
+
const box = await Sandbox.create({ autoSuspendMs: 0, metadata: { userId } }) // paid plan
|
|
225
|
+
// free plan: const box = await Sandbox.create({ metadata: { userId } })
|
|
184
226
|
await db.saveSandbox(userId, box.sandboxId) // m_...
|
|
185
227
|
}
|
|
186
228
|
|
|
@@ -202,7 +244,7 @@ async function findSandbox(userId: string) {
|
|
|
202
244
|
}
|
|
203
245
|
```
|
|
204
246
|
|
|
205
|
-
`Sandbox.connect(id)` without `resume: false` resumes a paused or stopped sandbox, so use it when the user comes back, not to pause. A sandbox your code paused stays paused: commands, file reads and SSH do not wake it, only `resume()` or `connect()`.
|
|
247
|
+
`Sandbox.connect(id)` without `resume: false` resumes a paused or stopped sandbox, so use it when the user comes back, not to pause. A sandbox your code paused stays paused: commands, file reads and SSH do not wake it, only `resume()` or `connect()`. On a paid plan an existing sandbox switches with `setAutoSuspend(0)`. If your process can die before it pauses a sandbox, keep the default idle pause instead: the sandbox then pauses itself after 30 idle minutes.
|
|
206
248
|
|
|
207
249
|
## Vault
|
|
208
250
|
|
|
@@ -300,9 +342,10 @@ A product that gives each of its users a computer they watch, or drive, in its o
|
|
|
300
342
|
// your own records, never take it from the browser: the API key controls
|
|
301
343
|
// every sandbox of the account.
|
|
302
344
|
|
|
303
|
-
// sign-up: one sandbox per user, without your account's Vault
|
|
345
|
+
// sign-up: one sandbox per user, without your account's Vault
|
|
304
346
|
async function onSignUp(userId: string) {
|
|
305
|
-
const box = await Sandbox.create({ vault: false,
|
|
347
|
+
const box = await Sandbox.create({ vault: false, metadata: { userId } })
|
|
348
|
+
// paid plan: add autoSuspendMs: 0 so it pauses only when you pause it
|
|
306
349
|
await db.saveSandbox(userId, box.sandboxId)
|
|
307
350
|
}
|
|
308
351
|
|
|
@@ -338,7 +381,7 @@ const samples = await sandbox.getMetrics({ since: new Date(Date.now() - 15 * 60_
|
|
|
338
381
|
|
|
339
382
|
// What the sandbox used, for billing your own customers (default: this calendar month, UTC, to now)
|
|
340
383
|
const usage = await Sandbox.getUsage(sandbox.sandboxId, { from: new Date('2026-10-01T00:00:00Z') })
|
|
341
|
-
// { from, to, runningSeconds, vcpuSeconds, memGiBSeconds, diskGiBSeconds }
|
|
384
|
+
// { from, to, runningSeconds, vcpuSeconds, memGiBSeconds, diskGiBSeconds, egressBytes }
|
|
342
385
|
|
|
343
386
|
// Your account: counts, stored bytes (per sandbox in storage.machines, measured hourly) and limits
|
|
344
387
|
const account = await Sandbox.usage()
|
|
@@ -348,7 +391,7 @@ const account = await Sandbox.usage()
|
|
|
348
391
|
All three need `machines:read` (`Sandbox.usage()` also works with `images:read`).
|
|
349
392
|
|
|
350
393
|
- Metrics are measured on the host: `cpuUsedPct` is CPU time over the sandbox's vCPUs (0-100), `memUsed` the guest memory it has touched, in bytes. `diskUsed` is not reported yet. The list is empty while the sandbox is not running.
|
|
351
|
-
- `runningSeconds` counts time running, not paused or stopped; `vcpuSeconds` and `memGiBSeconds` multiply it by the sandbox's size. `diskGiBSeconds` is its disk size (system disk plus `/data`) times the time it existed in the window, paused or stopped included. Running time is recorded from the server release that added this route; earlier time is not counted. A deleted sandbox's usage stays readable by its ID.
|
|
394
|
+
- `runningSeconds` counts time running, not paused or stopped; `vcpuSeconds` and `memGiBSeconds` multiply it by the sandbox's size. `diskGiBSeconds` is its disk size (system disk plus `/data`) times the time it existed in the window, paused or stopped included. `egressBytes` is what it sent to the public internet, counted by the hour (every hour from the one `from` falls in up to `to`), billed or not; absent from servers before it. Running time is recorded from the server release that added this route; earlier time is not counted. A deleted sandbox's usage stays readable by its ID.
|
|
352
395
|
|
|
353
396
|
## Errors
|
|
354
397
|
|
|
@@ -367,9 +410,9 @@ A failed operation (for example `no_capacity` while creating) throws `InstaboxEr
|
|
|
367
410
|
|
|
368
411
|
`LIMIT_CODES` (exported, with `isLimitCode(code)`) lists the limit codes: `quota_exceeded`, `credit_exhausted`, `spend_limit_reached`, `subscription_required`, `payment_method_required`, `payment_failed`, `template_limit`, `template_not_allowed`, `spec_not_allowed`, `concurrency_limit`, `rate_limited`. A new API key does not fix them; a plan change, lower usage or (for `rate_limited` and `concurrency_limit`) waiting does.
|
|
369
412
|
|
|
370
|
-
Changed in
|
|
413
|
+
Changed in 0.6.0: a limit code returned with 401 or 403 (`template_not_allowed`, `template_limit`) threw `InstaboxAuthError` and now throws `InstaboxQuotaError`; a limit code with another status (402 `credit_exhausted`, 400 `spec_not_allowed`) threw `InstaboxError` and now throws `InstaboxQuotaError`. Both are still `InstaboxError`, and 429 is unchanged. Code that caught `InstaboxAuthError` for a plan limit should catch `InstaboxQuotaError` or check `err.code`.
|
|
371
414
|
|
|
372
|
-
Changed in
|
|
415
|
+
Changed in 0.6.0: `files.read` of a file that is not valid UTF-8 returned a string with U+FFFD in place of the bad bytes, silently; it now throws `InstaboxNotUtf8Error` (code `not_utf8`). Valid UTF-8 text and `{ format: 'bytes' }` reads are unchanged.
|
|
373
416
|
|
|
374
417
|
Reads, and mutations (which always carry an `Idempotency-Key`), are retried up to 3 times with backoff on 502, 503, 504 and network errors. Commands send no `Idempotency-Key` and are not retried.
|
|
375
418
|
|
|
@@ -378,6 +421,7 @@ Reads, and mutations (which always carry an `Idempotency-Key`), are retried up t
|
|
|
378
421
|
- Quotas are account-specific; inspect `GET /v1/usage`. Exceeding a quota throws `InstaboxQuotaError`.
|
|
379
422
|
- At most 32 requests per user run at once, across all your sandboxes. Commands, file reads, desktop, port-forward and vault-push calls share this limit. A `background: true` command counts only while it starts; each `wait()` holds one while it waits (it polls the job's log, up to 25 seconds per request). More throw `InstaboxQuotaError` (429, retryable).
|
|
380
423
|
- A command started with `run` runs for at most 10 minutes; longer ones need `background: true`. A background command takes no `stdin`, and its stdout and stderr share one log.
|
|
424
|
+
- A file moves at up to 5 GiB per `write` (the server's limit) in one request; the CLI's `instabox push` splits a file of 64 MiB or more into 4 parallel uploads, which the SDK does not do yet.
|
|
381
425
|
|
|
382
426
|
## Agent skill
|
|
383
427
|
|