@computesdk/opencomputer 1.0.12 → 1.0.13
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 +6 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ compute.setConfig({
|
|
|
32
32
|
provider: opencomputer({ apiKey: process.env.OPENCOMPUTER_API_KEY }),
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
const sandbox = await compute.
|
|
35
|
+
const sandbox = await compute.instances.create({ templateId: 'base' });
|
|
36
36
|
|
|
37
37
|
const result = await sandbox.runCommand('echo "Hello from OpenComputer"');
|
|
38
38
|
console.log(result.stdout);
|
|
@@ -77,22 +77,22 @@ interface OpenComputerConfig {
|
|
|
77
77
|
|
|
78
78
|
## Snapshots
|
|
79
79
|
|
|
80
|
-
OpenComputer checkpoints are scoped to a source sandbox. This provider returns snapshot IDs in the form `
|
|
80
|
+
OpenComputer checkpoints are scoped to a source sandbox. This provider returns snapshot IDs in the form `instanceId:checkpointId` so ComputeSDK can later delete the checkpoint.
|
|
81
81
|
|
|
82
82
|
```typescript
|
|
83
|
-
const sandbox = await compute.
|
|
83
|
+
const sandbox = await compute.instances.create();
|
|
84
84
|
|
|
85
|
-
const snapshot = await compute.snapshot.create(sandbox.
|
|
85
|
+
const snapshot = await compute.snapshot.create(sandbox.instanceId, {
|
|
86
86
|
name: 'ready-state',
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
const clone = await compute.
|
|
89
|
+
const clone = await compute.instances.create({ snapshotId: snapshot.id });
|
|
90
90
|
|
|
91
91
|
await compute.snapshot.delete(snapshot.id);
|
|
92
92
|
await clone.destroy();
|
|
93
93
|
await sandbox.destroy();
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
You can also pass a raw OpenComputer checkpoint ID to `compute.
|
|
96
|
+
You can also pass a raw OpenComputer checkpoint ID to `compute.instances.create({ snapshotId })` when you only need to fork from it.
|
|
97
97
|
|
|
98
98
|
Snapshots default to OpenComputer `disk_only` checkpoints with `promoteToFull: true`. Override with `metadata: { kind: 'full' }` or `metadata: { promoteToFull: false }` when needed.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@computesdk/opencomputer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "OpenComputer provider for ComputeSDK - persistent cloud VMs with checkpoints, preview URLs, command execution, and filesystem access",
|
|
5
5
|
"author": "ComputeSDK",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@opencomputer/sdk": "latest",
|
|
32
|
-
"@computesdk/provider": "2.1.
|
|
33
|
-
"computesdk": "4.1.
|
|
32
|
+
"@computesdk/provider": "2.1.14",
|
|
33
|
+
"computesdk": "4.1.12"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^20.0.0",
|