instavm 0.16.0 → 0.17.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.
Files changed (50) hide show
  1. package/README.md +86 -9
  2. package/dist/InstaVM-DjkmUcaP.d.mts +1393 -0
  3. package/dist/InstaVM-DjkmUcaP.d.ts +1393 -0
  4. package/dist/_instavmToolsCore-34H4iqVZ.d.mts +26 -0
  5. package/dist/_instavmToolsCore-BuaJyxXB.d.ts +26 -0
  6. package/dist/cli.js +5821 -2296
  7. package/dist/cli.js.map +1 -1
  8. package/dist/index.d.mts +12 -919
  9. package/dist/index.d.ts +12 -919
  10. package/dist/index.js +1464 -140
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +1449 -135
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/integrations/azure-openai.d.mts +18 -0
  15. package/dist/integrations/azure-openai.d.ts +18 -0
  16. package/dist/integrations/azure-openai.js +332 -0
  17. package/dist/integrations/azure-openai.js.map +1 -0
  18. package/dist/integrations/azure-openai.mjs +299 -0
  19. package/dist/integrations/azure-openai.mjs.map +1 -0
  20. package/dist/integrations/langchain.d.mts +7 -0
  21. package/dist/integrations/langchain.d.ts +7 -0
  22. package/dist/integrations/langchain.js +364 -0
  23. package/dist/integrations/langchain.js.map +1 -0
  24. package/dist/integrations/langchain.mjs +327 -0
  25. package/dist/integrations/langchain.mjs.map +1 -0
  26. package/dist/integrations/llamaindex.d.mts +11 -0
  27. package/dist/integrations/llamaindex.d.ts +11 -0
  28. package/dist/integrations/llamaindex.js +415 -0
  29. package/dist/integrations/llamaindex.js.map +1 -0
  30. package/dist/integrations/llamaindex.mjs +378 -0
  31. package/dist/integrations/llamaindex.mjs.map +1 -0
  32. package/dist/integrations/ollama.d.mts +35 -0
  33. package/dist/integrations/ollama.d.ts +35 -0
  34. package/dist/integrations/ollama.js +421 -0
  35. package/dist/integrations/ollama.js.map +1 -0
  36. package/dist/integrations/ollama.mjs +391 -0
  37. package/dist/integrations/ollama.mjs.map +1 -0
  38. package/dist/integrations/openai.d.mts +19 -0
  39. package/dist/integrations/openai.d.ts +19 -0
  40. package/dist/integrations/openai.js +302 -0
  41. package/dist/integrations/openai.js.map +1 -0
  42. package/dist/integrations/openai.mjs +272 -0
  43. package/dist/integrations/openai.mjs.map +1 -0
  44. package/package.json +44 -3
  45. package/dist/integrations/openai/index.d.mts +0 -16
  46. package/dist/integrations/openai/index.d.ts +0 -16
  47. package/dist/integrations/openai/index.js +0 -38
  48. package/dist/integrations/openai/index.js.map +0 -1
  49. package/dist/integrations/openai/index.mjs +0 -12
  50. package/dist/integrations/openai/index.mjs.map +0 -1
package/README.md CHANGED
@@ -46,11 +46,17 @@ printf '%s' "$INSTAVM_API_KEY" | instavm auth set-key
46
46
  instavm whoami
47
47
  instavm ls
48
48
  instavm ls -a
49
+ instavm ls --watch
49
50
  instavm create --type computer-use --memory 4096
50
51
  instavm connect vm_123
51
52
  instavm deploy
52
53
  instavm deploy --plan
53
54
  instavm snapshot ls
55
+ instavm snapshot get <snapshot_id> --watch
56
+ instavm egress get --session <session_id>
57
+ instavm exec --cmd "print('hello from instavm')"
58
+ instavm browser read https://example.com
59
+ instavm browser screenshot https://example.com --out page.png
54
60
  instavm volume ls
55
61
  instavm volume files upload <volume_id> ./README.md --path docs/README.md
56
62
  instavm share create vm_123 3000 --public
@@ -58,10 +64,14 @@ instavm share set-private <share_id>
58
64
  instavm ssh-key list
59
65
  instavm desktop viewer <session_id>
60
66
  instavm doc
61
- instavm billing
67
+ instavm billing portal
68
+ instavm login
69
+ instavm tape ls
70
+ instavm vault list
71
+ instavm desktop recordings ls
62
72
  ```
63
73
 
64
- `instavm ls` shows active VMs only. Use `-a` or `--all` to include terminated VM records.
74
+ `instavm ls` shows active VMs only. Use `-a` or `--all` to include terminated VM records. On ANSI terminals the human-readable list uses colored status badges, and both `instavm ls` and `instavm snapshot get` support `--watch` for periodic refreshes.
65
75
 
66
76
  ### Cookbooks
67
77
 
@@ -72,6 +82,8 @@ instavm cookbook list
72
82
  instavm cookbook info neon-city-webgl
73
83
  instavm cookbook deploy neon-city-webgl
74
84
  instavm cookbook deploy hello-fastapi
85
+ instavm cookbook deploy my-app --vault vault_a --vault vault_b
86
+ instavm deploy ./app --no-vault
75
87
  ```
76
88
 
77
89
  The CLI syncs the cookbook repo into `~/.instavm/cookbooks/`, checks for `git`, `ssh`, `scp`, and `tar`, prompts for any required secrets, and auto-registers a local public SSH key if your account does not already have one.
@@ -93,20 +105,39 @@ instavm deploy ./path/to/app
93
105
  ### Command Reference
94
106
 
95
107
  - `auth`: `set-key`, `status`, `logout`
108
+ - `login`: browser PKCE login (writes profile API key)
96
109
  - `whoami`: show account details and SSH keys
97
110
  - `ls`/`list`: show active VMs by default; use `-a` or `--all` for all VM records
98
111
  - `cookbook`: `list`, `info`, `deploy` for curated starter apps from `instavm/cookbooks`
99
112
  - `deploy`: experimental zero-config deploy for the current app directory
100
113
  - `create`/`new`, `rm`/`delete`, `clone`, `connect`: core VM workflows
101
114
  - `snapshot`: `ls`, `create`, `build`, `get`, `rm`
102
- - `desktop`: `status`, `start`, `stop`, `viewer`
115
+ - `egress`: `get`, `set` for VM and session egress policies
116
+ - `exec`: run inline commands, local files, or fetch async task results
117
+ - `browser`: `read`, `screenshot`; `browser session` (`create`, `close`, `ls`); `navigate`, `click`, `type`, `fill`, `scroll`, `wait`, `extract`
118
+ - `desktop`: `status`, `start`, `stop`, `viewer`; `desktop recordings` (`ls`, `get`, `download`, `rm`)
119
+ - `vm`/`vms`: includes `vm update` (memory, snapshot-on-terminate, snapshot name)
120
+ - `tape`: `ls`, `get`, `start`, `stop`, `events`, `diff`, `branch`, `play`, `lanes`, `export`, `rm`
121
+ - `vault` / `secrets` / `secret`: vault CRUD, secrets, services, `setup`, `catalog`, `logs`, `discover`
122
+ - `pty`: attach PTY shell to a VM over WebSocket
123
+ - `billing`: `portal`, `status`, `allocation`, `usage`, `usage-history`, `check`, `rates`, `trends`, `forecast`
103
124
  - `volume`: `ls`, `get`, `create`, `update`, `rm`, `checkpoint`, `files`
104
125
  - `share`: `create`, `set-public`, `set-private`, `revoke`
105
126
  - `ssh-key`: `list`, `add`, `remove`
106
- - `doc`/`docs`, `billing`: docs and billing links
127
+ - `doc`/`docs`: docs links
107
128
 
108
129
  All leaf commands support `--json`. Share visibility updates use `share_id`, which matches the public API.
109
130
 
131
+ Examples:
132
+
133
+ ```bash
134
+ instavm egress set --session <session_id> --no-allow-package-managers --deny-http --domain pypi.org
135
+ instavm exec ./script.py
136
+ instavm exec result <task_id>
137
+ instavm browser read --session <browser_session_id>
138
+ instavm browser screenshot https://example.com --out ./page.png
139
+ ```
140
+
110
141
  ## Library Quick Start
111
142
 
112
143
  ```typescript
@@ -123,6 +154,34 @@ console.log(me.email);
123
154
  console.log(vms.length);
124
155
  ```
125
156
 
157
+ ## Parity with Python `sandbox_client`
158
+
159
+ This package tracks **API and CLI parity** with the official Python distribution **`instavm`** in **[sandbox_client](https://github.com/BandarLabs/sandbox_client)** (baseline **~0.23.0**: `instavm/sandbox_client.py`, `instavm/cli.py`, `instavm/_cookbook.py`). The **npm semver line is independent** of Python’s `pyproject.toml` version—see [Changelog](#changelog).
160
+
161
+ **Naming:** the JS `InstaVM` client uses **camelCase** methods; several Python-style operations are also exposed as thin delegators on `InstaVM` (for example vault helpers) for readability across languages.
162
+
163
+ **Not available in this JS SDK** (by design; tied to the Python ecosystem or deferred):
164
+
165
+ - `instavm.integrations.openai_agents` (`InstaVMSandboxClient`)
166
+ - `instavm.integrations.mounts` (`InstaVMCloudBucketMountStrategy`)
167
+ - `cassette_replay`–style HTTP transports
168
+
169
+ ### Optional LLM integrations
170
+
171
+ Subpath exports match the Python integration modules. Install **optional peers** only for the stack you use:
172
+
173
+ | Import path | Purpose | Typical optional deps |
174
+ |-------------|---------|------------------------|
175
+ | `instavm/integrations/openai` | `getOpenAITools`, `executeToolCall` | none (uses your OpenAI client) |
176
+ | `instavm/integrations/azure-openai` | Same tools + `getSystemPrompt` | — |
177
+ | `instavm/integrations/langchain` | `getLangchainTools()` | `@langchain/core` |
178
+ | `instavm/integrations/llamaindex` | `getLlamaIndexTools()` | `llamaindex`, `zod` |
179
+ | `instavm/integrations/ollama` | `getOllamaTools`, `executeOllamaTool`, `OllamaAgent` | none (uses `fetch` to Ollama) |
180
+
181
+ ```typescript
182
+ import { getOpenAITools, executeToolCall } from 'instavm/integrations/openai';
183
+ ```
184
+
126
185
  ## Table of Contents
127
186
 
128
187
  - [CLI](#cli)
@@ -132,6 +191,7 @@ console.log(vms.length);
132
191
  - [Deploy](#deploy)
133
192
  - [Command Reference](#command-reference)
134
193
  - [Library Quick Start](#library-quick-start)
194
+ - [Parity with Python `sandbox_client`](#parity-with-python-sandbox_client)
135
195
  - [Code Execution](#code-execution)
136
196
  - [Cloud Mode](#cloud-mode)
137
197
  - [Local Mode](#local-mode)
@@ -505,12 +565,16 @@ try {
505
565
  ## Development & Testing
506
566
 
507
567
  ```bash
508
- npm install # Install dependencies
509
- npm run test:unit # Unit tests
510
- npm test # Full test suite
511
- npm run build # Build package
568
+ npm install # Install dependencies
569
+ npm run test:unit # Unit tests (includes a repo scan for accidental secret patterns)
570
+ npm run build && npm run test:smoke # After a build: CLI + dist SDK smoke checks
571
+ npm test # Full vitest default suite
572
+ npm run test:e2e # Live API tests — only when INSTAVM_API_KEY is set (see tests/integration/README.md)
573
+ npm run build # Build package
512
574
  ```
513
575
 
576
+ Do **not** commit real API keys or `.env` files. Use placeholders in docs/tests (`your_api_key`, `instavm_sk_test`, `test-api-key`) and keep production keys in environment variables or GitHub Actions **secrets**.
577
+
514
578
  ---
515
579
 
516
580
  ## Further Reading
@@ -526,7 +590,20 @@ npm run build # Build package
526
590
 
527
591
  ## Changelog
528
592
 
529
- Current package version: **0.16.0**
593
+ When checking **SDK / CLI parity** with the official Python client, use a checkout of **[sandbox_client](https://github.com/BandarLabs/sandbox_client)** (for example `~/Documents/projects/sandbox_client` — there is typically no `Documents/project/` path). Treat **`[project] version` in that repo’s `pyproject.toml`** as the API parity baseline. Diff `instavm/sandbox_client.py` and `instavm/cli.py` against this SDK when adding or reviewing APIs.
594
+
595
+ **npm semver is independent** of the Python package version: this JS library advances on its own minor/patch line (for example **0.16.x → 0.17.0**) and does not mirror Python’s `pyproject.toml` version number.
596
+
597
+ Current npm package version: **0.17.0**
598
+
599
+ ### 0.17.0
600
+
601
+ - Broad parity with Python **sandbox_client ~0.23.0**: tapes, vaults, PTY, recordings, credits, session/usage helpers, client-level browser APIs, cookbook/deploy vault flags (`--vault`, `--no-vault`, `--no-setup-vault`), expanded CLI (`login`, `billing`, `tape`, `vault`, `pty`, `vm update`, browser subcommands, `desktop recordings`), and integration entry points (`integrations/openai`, `azure-openai`, `langchain`, `llamaindex`, `ollama`)
602
+ - Added colored VM status badges, `--watch` refreshes for `ls` and `snapshot get`, and snapshot-build spinner coverage (from earlier 0.17 work)
603
+
604
+ ### 0.16.1
605
+
606
+ - Fixed deploy and cookbook uploads through the SSH gateway by forcing legacy SCP mode
530
607
 
531
608
  ### 0.16.0
532
609