@mastra/e2b 0.0.2 → 0.0.3-alpha.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/CHANGELOG.md CHANGED
@@ -1,5 +1,118 @@
1
1
  # @mastra/e2b
2
2
 
3
+ ## 0.0.3-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Removed unused SandboxRuntime type, runtimes option, supportedRuntimes/defaultRuntime getters, and getMounts() method. These were defined but never used for any actual behavior. ([#13053](https://github.com/mastra-ai/mastra/pull/13053))
8
+
9
+ - Added editor provider descriptors for workspace filesystem, sandbox, and blob store packages. Each provider exports an object with `id`, `name`, `description`, `configSchema` (JSON Schema), and a factory method, enabling the editor UI to auto-discover and render configuration forms for workspace providers. ([#13156](https://github.com/mastra-ai/mastra/pull/13156))
10
+ - `@mastra/gcs`: Added `gcsFilesystemProvider` with config schema for bucket, projectId, credentials, prefix, readOnly, and endpoint
11
+ - `@mastra/e2b`: Added `e2bSandboxProvider` with config schema for template, timeout, env, metadata, runtimes, domain, and API settings
12
+
13
+ ```ts
14
+ import { gcsFilesystemProvider } from '@mastra/gcs';
15
+ import { e2bSandboxProvider } from '@mastra/e2b';
16
+
17
+ const editor = new MastraEditor({
18
+ filesystems: {
19
+ gcs: gcsFilesystemProvider,
20
+ },
21
+ sandboxes: {
22
+ e2b: e2bSandboxProvider,
23
+ },
24
+ });
25
+
26
+ // Enumerate available providers and their config schemas for UI rendering
27
+ const fsProviders = editor.getFilesystemProviders();
28
+ const sbProviders = editor.getSandboxProviders();
29
+ ```
30
+
31
+ - Added workspace and skill storage domains with full CRUD, versioning, and implementations across LibSQL, Postgres, and MongoDB. Added `editor.workspace` and `editor.skill` namespaces for managing workspace configurations and skill definitions through the editor. Agents stored in the editor can now reference workspaces (by ID or inline config) and skills, with full hydration to runtime `Workspace` instances during agent resolution. ([#13156](https://github.com/mastra-ai/mastra/pull/13156))
32
+
33
+ **Filesystem-native skill versioning (draft → publish model):**
34
+
35
+ Skills are versioned as filesystem trees with content-addressable blob storage. The editing surface (live filesystem) is separated from the serving surface (versioned blob store), enabling a `draft → publish` workflow:
36
+ - `editor.skill.publish(skillId, source, skillPath)` — Snapshots a skill directory from the filesystem into blob storage, creates a new version with a tree manifest, and sets `activeVersionId`
37
+ - Version switching via `editor.skill.update({ id, activeVersionId })` — Points the skill to a previous version without re-publishing
38
+ - Publishing a skill automatically invalidates cached agents that reference it, so they re-hydrate with the updated version on next access
39
+
40
+ **Agent skill resolution strategies:**
41
+
42
+ Agents can reference skills with different resolution strategies:
43
+ - `strategy: 'latest'` — Resolves the skill's active version (honors `activeVersionId` for rollback)
44
+ - `pin: '<versionId>'` — Pins to a specific version, immune to publishes
45
+ - `strategy: 'live'` — Reads directly from the live filesystem (no blob store)
46
+
47
+ **Blob storage infrastructure:**
48
+ - `BlobStore` abstract class for content-addressable storage keyed by SHA-256 hash
49
+ - `InMemoryBlobStore` for testing
50
+ - LibSQL, Postgres, and MongoDB implementations
51
+ - `S3BlobStore` for storing blobs in S3 or S3-compatible storage (AWS, R2, MinIO, DO Spaces)
52
+ - `BlobStoreProvider` interface and `MastraEditorConfig.blobStores` registry for pluggable blob storage
53
+ - `VersionedSkillSource` and `CompositeVersionedSkillSource` for reading skill files from the blob store at runtime
54
+
55
+ **New storage types:**
56
+ - `StorageWorkspaceSnapshotType` and `StorageSkillSnapshotType` with corresponding input/output types
57
+ - `StorageWorkspaceRef` for ID-based or inline workspace references on agents
58
+ - `StorageSkillConfig` for per-agent skill overrides (`pin`, `strategy`, description, instructions)
59
+ - `SkillVersionTree` and `SkillVersionTreeEntry` for tree manifests
60
+ - `StorageBlobEntry` for content-addressable blob entries
61
+ - `SKILL_BLOBS_SCHEMA` for the `mastra_skill_blobs` table
62
+
63
+ **New editor namespaces:**
64
+ - `editor.workspace` — CRUD for workspace configs, plus `hydrateSnapshotToWorkspace()` for resolving to runtime `Workspace` instances
65
+ - `editor.skill` — CRUD for skill definitions, plus `publish()` for filesystem-to-blob snapshots
66
+
67
+ **Provider registries:**
68
+ - `MastraEditorConfig` accepts `filesystems`, `sandboxes`, and `blobStores` provider registries (keyed by provider ID)
69
+ - Built-in `local` filesystem and sandbox providers are auto-registered
70
+ - `editor.resolveBlobStore()` resolves from provider registry or falls back to the storage backend's blobs domain
71
+ - Providers expose `id`, `name`, `description`, `configSchema` (JSON Schema for UI form rendering), and a factory method
72
+
73
+ **Storage adapter support:**
74
+ - LibSQL: Full `workspaces`, `skills`, and `blobs` domain implementations
75
+ - Postgres: Full `workspaces`, `skills`, and `blobs` domain implementations
76
+ - MongoDB: Full `workspaces`, `skills`, and `blobs` domain implementations
77
+ - All three include `workspace`, `skills`, and `skillsFormat` fields on agent versions
78
+
79
+ **Server endpoints:**
80
+ - `GET/POST/PATCH/DELETE /stored/workspaces` — CRUD for stored workspaces
81
+ - `GET/POST/PATCH/DELETE /stored/skills` — CRUD for stored skills
82
+ - `POST /stored/skills/:id/publish` — Publish a skill from a filesystem source
83
+
84
+ ```ts
85
+ import { MastraEditor } from '@mastra/editor';
86
+ import { s3FilesystemProvider, s3BlobStoreProvider } from '@mastra/s3';
87
+ import { e2bSandboxProvider } from '@mastra/e2b';
88
+
89
+ const editor = new MastraEditor({
90
+ filesystems: { s3: s3FilesystemProvider },
91
+ sandboxes: { e2b: e2bSandboxProvider },
92
+ blobStores: { s3: s3BlobStoreProvider },
93
+ });
94
+
95
+ // Create a skill and publish it
96
+ const skill = await editor.skill.create({
97
+ name: 'Code Review',
98
+ description: 'Reviews code for best practices',
99
+ instructions: 'Analyze the code and provide feedback...',
100
+ });
101
+ await editor.skill.publish(skill.id, source, 'skills/code-review');
102
+
103
+ // Agents resolve skills by strategy
104
+ await editor.agent.create({
105
+ name: 'Dev Assistant',
106
+ model: { provider: 'openai', name: 'gpt-4' },
107
+ workspace: { type: 'id', workspaceId: workspace.id },
108
+ skills: { [skill.id]: { strategy: 'latest' } },
109
+ skillsFormat: 'xml',
110
+ });
111
+ ```
112
+
113
+ - Updated dependencies [[`252580a`](https://github.com/mastra-ai/mastra/commit/252580a71feb0e46d0ccab04a70a79ff6a2ee0ab), [`f8e819f`](https://github.com/mastra-ai/mastra/commit/f8e819fabdfdc43d2da546a3ad81ba23685f603d), [`5c75261`](https://github.com/mastra-ai/mastra/commit/5c7526120d936757d4ffb7b82232e1641ebd45cb), [`e27d832`](https://github.com/mastra-ai/mastra/commit/e27d83281b5e166fd63a13969689e928d8605944), [`e37ef84`](https://github.com/mastra-ai/mastra/commit/e37ef8404043c94ca0c8e35ecdedb093b8087878), [`6fdd3d4`](https://github.com/mastra-ai/mastra/commit/6fdd3d451a07a8e7e216c62ac364f8dd8e36c2af), [`10cf521`](https://github.com/mastra-ai/mastra/commit/10cf52183344743a0d7babe24cd24fd78870c354), [`efdb682`](https://github.com/mastra-ai/mastra/commit/efdb682887f6522149769383908f9790c188ab88), [`0dee7a0`](https://github.com/mastra-ai/mastra/commit/0dee7a0ff4c2507e6eb6e6ee5f9738877ebd4ad1), [`04c2c8e`](https://github.com/mastra-ai/mastra/commit/04c2c8e888984364194131aecb490a3d6e920e61), [`02dc07a`](https://github.com/mastra-ai/mastra/commit/02dc07acc4ad42d93335825e3308f5b42266eba2), [`bb7262b`](https://github.com/mastra-ai/mastra/commit/bb7262b7c0ca76320d985b40510b6ffbbb936582), [`cf1c6e7`](https://github.com/mastra-ai/mastra/commit/cf1c6e789b131f55638fed52183a89d5078b4876), [`5ffadfe`](https://github.com/mastra-ai/mastra/commit/5ffadfefb1468ac2612b20bb84d24c39de6961c0), [`1e1339c`](https://github.com/mastra-ai/mastra/commit/1e1339cc276e571a48cfff5014487877086bfe68), [`d03df73`](https://github.com/mastra-ai/mastra/commit/d03df73f8fe9496064a33e1c3b74ba0479bf9ee6), [`79b8f45`](https://github.com/mastra-ai/mastra/commit/79b8f45a6767e1a5c3d56cd3c5b1214326b81661), [`9bbf08e`](https://github.com/mastra-ai/mastra/commit/9bbf08e3c20731c79dea13a765895b9fcf29cbf1), [`0a25952`](https://github.com/mastra-ai/mastra/commit/0a259526b5e1ac11e6efa53db1f140272962af2d), [`ffa5468`](https://github.com/mastra-ai/mastra/commit/ffa546857fc4821753979b3a34e13b4d76fbbcd4), [`3264a04`](https://github.com/mastra-ai/mastra/commit/3264a04e30340c3c5447433300a035ea0878df85), [`6fdd3d4`](https://github.com/mastra-ai/mastra/commit/6fdd3d451a07a8e7e216c62ac364f8dd8e36c2af), [`088d9ba`](https://github.com/mastra-ai/mastra/commit/088d9ba2577518703c52b0dccd617178d9ee6b0d), [`74fbebd`](https://github.com/mastra-ai/mastra/commit/74fbebd918a03832a2864965a8bea59bf617d3a2), [`aea6217`](https://github.com/mastra-ai/mastra/commit/aea621790bfb2291431b08da0cc5e6e150303ae7), [`b6a855e`](https://github.com/mastra-ai/mastra/commit/b6a855edc056e088279075506442ba1d6fa6def9), [`ae408ea`](https://github.com/mastra-ai/mastra/commit/ae408ea7128f0d2710b78d8623185198e7cb19c1), [`17e942e`](https://github.com/mastra-ai/mastra/commit/17e942eee2ba44985b1f807e6208cdde672f82f9), [`2015cf9`](https://github.com/mastra-ai/mastra/commit/2015cf921649f44c3f5bcd32a2c052335f8e49b4), [`7ef454e`](https://github.com/mastra-ai/mastra/commit/7ef454eaf9dcec6de60021c8f42192052dd490d6), [`2be1d99`](https://github.com/mastra-ai/mastra/commit/2be1d99564ce79acc4846071082bff353035a87a), [`2708fa1`](https://github.com/mastra-ai/mastra/commit/2708fa1055ac91c03e08b598869f6b8fb51fa37f), [`ba74aef`](https://github.com/mastra-ai/mastra/commit/ba74aef5716142dbbe931351f5243c9c6e4128a9), [`ba74aef`](https://github.com/mastra-ai/mastra/commit/ba74aef5716142dbbe931351f5243c9c6e4128a9), [`ec53e89`](https://github.com/mastra-ai/mastra/commit/ec53e8939c76c638991e21af762e51378eff7543), [`9b5a8cb`](https://github.com/mastra-ai/mastra/commit/9b5a8cb13e120811b0bf14140ada314f1c067894), [`607e66b`](https://github.com/mastra-ai/mastra/commit/607e66b02dc7f531ee37799f3456aa2dc0ca7ac5), [`a215d06`](https://github.com/mastra-ai/mastra/commit/a215d06758dcf590eabfe0b7afd4ae39bdbf082c), [`6909c74`](https://github.com/mastra-ai/mastra/commit/6909c74a7781e0447d475e9dbc1dc871b700f426), [`192438f`](https://github.com/mastra-ai/mastra/commit/192438f8a90c4f375e955f8ff179bf8dc6821a83)]:
114
+ - @mastra/core@1.5.0-alpha.0
115
+
3
116
  ## 0.0.2
4
117
 
5
118
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -201,7 +201,6 @@ var E2BSandbox = class extends workspace.MastraSandbox {
201
201
  templateSpec;
202
202
  env;
203
203
  metadata;
204
- configuredRuntimes;
205
204
  connectionOpts;
206
205
  // Non-optional (initialized by BaseSandbox)
207
206
  /** Resolved template ID after building (if needed) */
@@ -215,7 +214,6 @@ var E2BSandbox = class extends workspace.MastraSandbox {
215
214
  this.templateSpec = options.template;
216
215
  this.env = options.env ?? {};
217
216
  this.metadata = options.metadata ?? {};
218
- this.configuredRuntimes = options.runtimes ?? ["node", "python", "bash"];
219
217
  this.connectionOpts = {
220
218
  ...options.domain && { domain: options.domain },
221
219
  ...options.apiUrl && { apiUrl: options.apiUrl },
@@ -230,12 +228,6 @@ var E2BSandbox = class extends workspace.MastraSandbox {
230
228
  generateId() {
231
229
  return `e2b-sandbox-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
232
230
  }
233
- get supportedRuntimes() {
234
- return this.configuredRuntimes;
235
- }
236
- get defaultRuntime() {
237
- return this.configuredRuntimes[0] ?? "node";
238
- }
239
231
  /**
240
232
  * Get the underlying E2B Sandbox instance for direct access to E2B APIs.
241
233
  *
@@ -417,15 +409,6 @@ var E2BSandbox = class extends workspace.MastraSandbox {
417
409
  );
418
410
  }
419
411
  }
420
- /**
421
- * Get list of current mounts in the sandbox.
422
- */
423
- async getMounts() {
424
- return Array.from(this.mounts.entries).map(([path, entry]) => ({
425
- path,
426
- filesystem: entry.filesystem?.provider ?? entry.config?.type ?? "unknown"
427
- }));
428
- }
429
412
  /**
430
413
  * Unmount all stale mounts that are not in the expected mounts list.
431
414
  * Also cleans up orphaned directories and marker files from failed mount attempts.
@@ -852,7 +835,37 @@ ${stderr}`);
852
835
  }
853
836
  };
854
837
 
838
+ // src/provider.ts
839
+ var e2bSandboxProvider = {
840
+ id: "e2b",
841
+ name: "E2B Sandbox",
842
+ description: "Cloud sandbox powered by E2B",
843
+ configSchema: {
844
+ type: "object",
845
+ properties: {
846
+ template: { type: "string", description: "Sandbox template ID" },
847
+ timeout: { type: "number", description: "Execution timeout in milliseconds", default: 3e5 },
848
+ env: {
849
+ type: "object",
850
+ description: "Environment variables",
851
+ additionalProperties: { type: "string" }
852
+ },
853
+ metadata: {
854
+ type: "object",
855
+ description: "Custom metadata",
856
+ additionalProperties: true
857
+ },
858
+ domain: { type: "string", description: "Domain for self-hosted E2B" },
859
+ apiUrl: { type: "string", description: "API URL for self-hosted E2B" },
860
+ apiKey: { type: "string", description: "E2B API key" },
861
+ accessToken: { type: "string", description: "E2B access token" }
862
+ }
863
+ },
864
+ createSandbox: (config) => new E2BSandbox(config)
865
+ };
866
+
855
867
  exports.E2BSandbox = E2BSandbox;
856
868
  exports.createDefaultMountableTemplate = createDefaultMountableTemplate;
869
+ exports.e2bSandboxProvider = e2bSandboxProvider;
857
870
  //# sourceMappingURL=index.cjs.map
858
871
  //# sourceMappingURL=index.cjs.map