@mastra/e2b 0.12.4-alpha.0 → 0.13.0-alpha.1
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/dist/index.cjs +156 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +156 -51
- package/dist/index.js.map +1 -1
- package/dist/utils/repo-template.d.ts +65 -2
- package/dist/utils/repo-template.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -20,6 +20,19 @@ export interface RepositoryAccess {
|
|
|
20
20
|
token: string;
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
+
/** One repository of a multi-repository template. */
|
|
24
|
+
export interface RepoTemplateRepository {
|
|
25
|
+
/**
|
|
26
|
+
* Resolves this repository's clone URL and, for private repositories, a
|
|
27
|
+
* SHORT-LIVED credential, exactly as
|
|
28
|
+
* {@link RepoTemplateOptions.getRepositoryAccess} does for one repository.
|
|
29
|
+
* Each entry mints its own: installation tokens expire and one token
|
|
30
|
+
* rarely covers every repository.
|
|
31
|
+
*/
|
|
32
|
+
getRepositoryAccess: () => Promise<RepositoryAccess | undefined>;
|
|
33
|
+
/** Setup command(s) run inside this repository's checkout; see {@link RepoTemplateOptions.setupCommand}. */
|
|
34
|
+
setupCommand?: string | string[];
|
|
35
|
+
}
|
|
23
36
|
export interface RepoTemplateOptions {
|
|
24
37
|
/**
|
|
25
38
|
* Resolves the clone URL and, for private repositories, a SHORT-LIVED
|
|
@@ -39,14 +52,51 @@ export interface RepoTemplateOptions {
|
|
|
39
52
|
* The key is required so that passing a host context whose field was
|
|
40
53
|
* renamed fails to compile instead of silently producing no template.
|
|
41
54
|
* `undefined` means the session has no repository, and
|
|
42
|
-
* {@link createRepoTemplate} then returns undefined.
|
|
55
|
+
* {@link createRepoTemplate} then returns undefined (unless `repos` is set).
|
|
43
56
|
*/
|
|
44
|
-
getRepositoryAccess
|
|
57
|
+
getRepositoryAccess?: (() => Promise<RepositoryAccess | undefined>) | undefined;
|
|
45
58
|
/**
|
|
46
59
|
* Setup command(s) run inside the checkout and hashed into the template name.
|
|
47
60
|
* Array entries run as separate cached build steps.
|
|
48
61
|
*/
|
|
49
62
|
setupCommand?: string | string[];
|
|
63
|
+
/**
|
|
64
|
+
* Several repositories in one template, each with its own access resolver
|
|
65
|
+
* and setup command, cloned to `<workingDirectory>/<repo>` in this order.
|
|
66
|
+
* Public repositories (no `authorization`) are built before private ones in
|
|
67
|
+
* caller order within each group, the same layout the platform and Docker
|
|
68
|
+
* templates use; on E2B every build env is one step ahead of every clone,
|
|
69
|
+
* so a rotated token still rebuilds all of them. Each repository writes `.mastra-sandbox/repos/<repo>`
|
|
70
|
+
* (`setupMarkerContent` of its commands) once every step for it ran.
|
|
71
|
+
*
|
|
72
|
+
* Every credential enters the template definition as a build env visible to
|
|
73
|
+
* every build step (`GH_TOKEN_<n>`, `n` = position in this list), so any
|
|
74
|
+
* repository's setup command can read the other repositories' tokens: only
|
|
75
|
+
* list repositories whose setup commands are trusted together.
|
|
76
|
+
*
|
|
77
|
+
* Mutually exclusive with `getRepositoryAccess`. If any entry's access
|
|
78
|
+
* cannot be resolved the whole resolution rejects and the sandbox falls
|
|
79
|
+
* back to its default template, as the single form does: a sandbox missing
|
|
80
|
+
* one repository is worse than one missing all of them. Two entries that
|
|
81
|
+
* would clone into the same directory reject the same way. An empty array
|
|
82
|
+
* behaves like no repository.
|
|
83
|
+
*/
|
|
84
|
+
repos?: RepoTemplateRepository[];
|
|
85
|
+
/**
|
|
86
|
+
* `repos` only. Command(s) run at the working directory after every
|
|
87
|
+
* repository is set up (install a shared toolchain, link packages). A
|
|
88
|
+
* failure fails the build. `.mastra-sandbox/workspace-setup` records the
|
|
89
|
+
* digest of the commands that ran, even when there were none.
|
|
90
|
+
*/
|
|
91
|
+
workspaceSetupCommand?: string | string[];
|
|
92
|
+
/**
|
|
93
|
+
* `repos` only. When true a failing per-repository setup command records
|
|
94
|
+
* that repository's directory name in `.mastra-sandbox/setup-failed` (one
|
|
95
|
+
* line per repository) and the build continues; clone, pin, workspace and
|
|
96
|
+
* marker steps still fail the build. Default
|
|
97
|
+
* false: any failure fails the build.
|
|
98
|
+
*/
|
|
99
|
+
continueOnSetupFailure?: boolean;
|
|
50
100
|
/**
|
|
51
101
|
* Extra environment for the build, available to every build step
|
|
52
102
|
* including {@link RepoTemplateOptions.setupCommand}. Use it for the
|
|
@@ -101,6 +151,19 @@ export interface RepoTemplateIdentity {
|
|
|
101
151
|
cpuCount?: number;
|
|
102
152
|
memoryMB?: number;
|
|
103
153
|
workingDirectory?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Multi-repository form: every entry in caller order. `cloneUrl`/`sha`/
|
|
156
|
+
* `setupCommand` above then describe the first entry (the readable slug);
|
|
157
|
+
* the tag hashes every entry's sha.
|
|
158
|
+
*/
|
|
159
|
+
repos?: RepoTemplateIdentityRepository[];
|
|
160
|
+
workspaceSetupCommand?: string | string[];
|
|
161
|
+
continueOnSetupFailure?: boolean;
|
|
162
|
+
}
|
|
163
|
+
export interface RepoTemplateIdentityRepository {
|
|
164
|
+
cloneUrl: string;
|
|
165
|
+
sha?: string;
|
|
166
|
+
setupCommand?: string | string[];
|
|
104
167
|
}
|
|
105
168
|
/**
|
|
106
169
|
* Compute the deterministic template ref for a set of repo template inputs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-template.d.ts","sourceRoot":"","sources":["../../src/utils/repo-template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repo-template.d.ts","sourceRoot":"","sources":["../../src/utils/repo-template.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;AAGzD,OAAO,KAAK,EAAE,yBAAyB,EAAqB,MAAM,YAAY,CAAC;AA4D/E;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,MA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.0-alpha.1",
|
|
4
4
|
"description": "E2B cloud sandbox provider for Mastra workspaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"tsdown": "0.22.9",
|
|
33
33
|
"typescript": "^7.0.2",
|
|
34
34
|
"vitest": "4.1.11",
|
|
35
|
-
"@internal/types-builder": "0.0.116",
|
|
36
35
|
"@internal/lint": "0.0.141",
|
|
37
|
-
"@internal/workspace-test-utils": "0.0.85",
|
|
38
36
|
"@internal/workspace": "0.0.13",
|
|
39
|
-
"@
|
|
37
|
+
"@internal/workspace-test-utils": "0.0.85",
|
|
40
38
|
"@mastra/gcs": "0.3.3",
|
|
41
|
-
"@mastra/
|
|
39
|
+
"@mastra/core": "1.76.0-alpha.3",
|
|
40
|
+
"@mastra/s3": "0.6.3",
|
|
41
|
+
"@internal/types-builder": "0.0.116"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@mastra/core": ">=1.67.0-0 <2.0.0-0"
|