@insforge/instabox-sdk 0.7.0 → 0.8.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@insforge/instabox-sdk",
3
- "version": "0.7.0",
4
- "description": "TypeScript SDK for instabox: create sandboxes on Firecracker dev machines, run commands, move files, pause, resume, snapshot and SSH in.",
3
+ "version": "0.8.0",
4
+ "description": "TypeScript SDK for instabox: create sandboxes on Firecracker dev machines, run commands, move files, pause, resume, snapshot, publish ports and SSH in.",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",
@@ -16,14 +16,14 @@ export INSTABOX_API_URL=https://api.instabox.sh
16
16
 
17
17
  Obtain keys from the dashboard's API Keys page or `instabox keys create`. If no key is configured, ask the user to configure one. Never print keys, commit them, or put them into metadata.
18
18
 
19
- | Scope | Operations |
20
- | ----------------- | ------------------------------------------------------------------- |
21
- | `machines:read` | List/get machines, templates and operations, a machine's Vault view |
22
- | `machines:write` | Create, start, stop, pause, resume, metadata, exec, SSH, Vault push |
23
- | `machines:delete` | Delete machines |
24
- | `images:read` | List/get snapshots and resolve snapshot names |
25
- | `images:write` | Save a stopped machine as a snapshot |
26
- | `images:delete` | Delete snapshots |
19
+ | Scope | Operations |
20
+ | ----------------- | ------------------------------------------------------------------------------------------------ |
21
+ | `machines:read` | List/get machines, templates and operations, a machine's Vault view, published ports |
22
+ | `machines:write` | Create, start, stop, pause, resume, metadata, exec, SSH, Vault push, publish and unpublish ports |
23
+ | `machines:delete` | Delete machines |
24
+ | `images:read` | List/get snapshots and resolve snapshot names |
25
+ | `images:write` | Save a stopped machine as a snapshot |
26
+ | `images:delete` | Delete snapshots |
27
27
 
28
28
  The current API calls snapshot scopes `images:*`. Write and delete imply read. Keys cannot manage keys or use admin routes. A `403 insufficient_scope` requires the relevant scope; do not retry it.
29
29
 
@@ -56,6 +56,8 @@ Connection options `{ apiKey, apiUrl }` override environment variables. `agent-b
56
56
 
57
57
  Drive the desktop with `box.desktop`: `start()`, `open(url)`, `screenshot()` (PNG bytes), `click(x, y)`, `move`, `drag`, `scroll`, `type(text)`, `press('Enter' | ['ctrl', 'l'])`, `cursorPosition()`. `streamUrl({ viewOnly: true })` returns a link (also embeddable in an iframe) that shows the desktop to people without an account; its expiry stops new connections, and `revokeStreamUrls()` ends every link and disconnects open viewers.
58
58
 
59
+ Give a server in the box an HTTPS URL with `box.ports.publish(port, { name?, access?: 'public' | 'private' })`. It returns `{ url, access, token?, tokenUrl? }`, and WebSockets pass through. Use the returned `url`, never build one. A private port's `tokenUrl` comes only from the publish that created or rotated its token. `ports.list()` and `ports.unpublish(port)` manage them.
60
+
59
61
  Save and restore a private snapshot with the required snapshot scopes:
60
62
 
61
63
  ```ts