@miosa/sdk 3.0.1 → 3.1.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 +57 -0
- package/dist/index.d.ts +585 -75
- package/dist/index.js +1152 -398
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -55,6 +55,7 @@ await sbx.pause();
|
|
|
55
55
|
| `miosa.sandboxes` | Lightweight code-execution VMs — exec, files, snapshots, previews |
|
|
56
56
|
| `miosa.computers` | Full Linux desktop VMs with desktop control for agents |
|
|
57
57
|
| `miosa.deployments` | Versioned production releases with rollback |
|
|
58
|
+
| `miosa.appDocuments` | Durable generated apps with exact-version review approvals and immutable publication bindings |
|
|
58
59
|
| `miosa.databases` | Managed Postgres / Redis lifecycle |
|
|
59
60
|
| `miosa.storage` | S3-compatible object storage |
|
|
60
61
|
| `miosa.volumes` | Persistent block storage |
|
|
@@ -69,6 +70,38 @@ await sbx.pause();
|
|
|
69
70
|
| `miosa.completions` | OpenAI-compatible chat completions with SSE streaming |
|
|
70
71
|
| `miosa.embeddings` | OpenAI-compatible embedding vectors |
|
|
71
72
|
|
|
73
|
+
## Durable generated apps
|
|
74
|
+
|
|
75
|
+
App Documents persist the generated app contract outside the browser.
|
|
76
|
+
They are workspace-scoped and include the view, declared capabilities, connectors, collections, automations, and component pins.
|
|
77
|
+
Native rendering authority is a separate approval pinned to the current canonical version hash.
|
|
78
|
+
Editing the document changes the hash and invalidates the old approval.
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
const app = await miosa.appDocuments.create({
|
|
82
|
+
workspaceId: "workspace-id",
|
|
83
|
+
name: "Clinic triage",
|
|
84
|
+
document: {
|
|
85
|
+
id: crypto.randomUUID(),
|
|
86
|
+
name: "Clinic triage",
|
|
87
|
+
format: "miosa-app/v1",
|
|
88
|
+
view: { kind: "generated", source: "<main>Triage</main>" },
|
|
89
|
+
capabilities: ["computer.exec"],
|
|
90
|
+
collections: ["tickets"],
|
|
91
|
+
connectors: ["linear"],
|
|
92
|
+
automations: [],
|
|
93
|
+
pins: [],
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const approval = await miosa.appDocuments.approveExactVersion(
|
|
98
|
+
app.id,
|
|
99
|
+
"Reviewed for exact release publishing",
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
await miosa.appDocuments.revokeApproval(app.id, approval.id);
|
|
103
|
+
```
|
|
104
|
+
|
|
72
105
|
## Connect vs Egress
|
|
73
106
|
|
|
74
107
|
Use **Connect** when your product needs to manage provider credentials for
|
|
@@ -258,6 +291,30 @@ const deployment = await sbx.deploy({
|
|
|
258
291
|
});
|
|
259
292
|
```
|
|
260
293
|
|
|
294
|
+
To publish the exact snapshot that passed QA instead of whatever the editable
|
|
295
|
+
sandbox holds right now, use `deploySnapshot`. It forks the snapshot into a
|
|
296
|
+
temporary release sandbox, deploys that fork, and destroys it again, so the
|
|
297
|
+
source sandbox is never mutated:
|
|
298
|
+
|
|
299
|
+
```ts
|
|
300
|
+
const snap = await sbx.snapshots.create("qa-approved");
|
|
301
|
+
|
|
302
|
+
const release = await sbx.deploySnapshot(snap.id, {
|
|
303
|
+
name: "clinic-intake",
|
|
304
|
+
outputPath: "/workspace/dist",
|
|
305
|
+
entrypoint: "index.html",
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
console.log(release.source_snapshot_id, release.release_sandbox_id);
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
The result always carries `source_snapshot_id` and `release_sandbox_id` for
|
|
312
|
+
provenance. Pass `{ cleanup: false }` as the third argument to keep the release
|
|
313
|
+
sandbox for inspection. If the release sandbox could not be destroyed, the
|
|
314
|
+
deployment still succeeds and `release.release_cleanup_error` explains why; when
|
|
315
|
+
the deploy itself fails and the release sandbox survives, the thrown error
|
|
316
|
+
carries the same fields so the leftover sandbox can be cleaned up by id.
|
|
317
|
+
|
|
261
318
|
For workspace App Engine, publish from the same sandbox but choose the
|
|
262
319
|
App Engine target:
|
|
263
320
|
|