@hasna/sandboxes 0.1.27 → 0.1.29
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 +32 -4
- package/dist/cli/cloud.d.ts +2 -0
- package/dist/cli/index.js +5454 -9376
- package/dist/db/cloud-config.d.ts +13 -0
- package/dist/db/cloud-sync.d.ts +29 -0
- package/dist/db/database.d.ts +1 -0
- package/dist/db/pg-migrate.d.ts +7 -0
- package/dist/db/remote-storage.d.ts +11 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5525 -9678
- package/dist/lib/archive.d.ts +2 -0
- package/dist/lib/secrets.d.ts +1 -1
- package/dist/mcp/cloud-tools.d.ts +2 -0
- package/dist/mcp/http.d.ts +2 -1
- package/dist/mcp/index.js +1989 -6787
- package/dist/sdk.d.ts +1 -0
- package/dist/server/index.js +2560 -7388
- package/dist/types/index.d.ts +6 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -17,6 +17,29 @@ npm install -g @hasna/sandboxes
|
|
|
17
17
|
sandboxes --help
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
## SDK One-shot Commands
|
|
21
|
+
|
|
22
|
+
Use the SDK to create a sandbox, upload a local project, run a command, and clean up:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { createSandboxesSDK } from "@hasna/sandboxes";
|
|
26
|
+
|
|
27
|
+
const sandboxes = createSandboxesSDK();
|
|
28
|
+
|
|
29
|
+
await sandboxes.runCommandInSandbox({
|
|
30
|
+
provider: "e2b",
|
|
31
|
+
command: "bun test",
|
|
32
|
+
upload: {
|
|
33
|
+
localDir: process.cwd(),
|
|
34
|
+
remoteDir: "/workspace/app",
|
|
35
|
+
syncStrategy: "rsync",
|
|
36
|
+
},
|
|
37
|
+
cleanup: "delete",
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Set `E2B_API_KEY` for E2B-backed runs. `syncStrategy: "rsync"` mirrors the local directory into a temporary staging tree with `rsync` before uploading it through the provider file APIs.
|
|
42
|
+
|
|
20
43
|
## MCP Server
|
|
21
44
|
|
|
22
45
|
```bash
|
|
@@ -44,14 +67,19 @@ sandboxes-serve
|
|
|
44
67
|
|
|
45
68
|
## Cloud Sync
|
|
46
69
|
|
|
47
|
-
|
|
70
|
+
Cloud sync is optional. By default sandboxes use local SQLite at `~/.hasna/sandboxes/`.
|
|
48
71
|
|
|
49
72
|
```bash
|
|
50
|
-
cloud
|
|
51
|
-
cloud
|
|
52
|
-
cloud
|
|
73
|
+
sandboxes cloud status
|
|
74
|
+
sandboxes cloud push
|
|
75
|
+
sandboxes cloud pull
|
|
76
|
+
sandboxes cloud sync
|
|
53
77
|
```
|
|
54
78
|
|
|
79
|
+
Set `HASNA_SANDBOXES_CLOUD_DATABASE_URL` or configure
|
|
80
|
+
`~/.hasna/sandboxes/cloud/config.json` to run in hybrid/cloud mode with
|
|
81
|
+
PostgreSQL.
|
|
82
|
+
|
|
55
83
|
## Data Directory
|
|
56
84
|
|
|
57
85
|
Data is stored in `~/.hasna/sandboxes/`.
|