@mastra/platform-workspace 1.10.0-alpha.1 → 1.10.0-alpha.3
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/factory-sandbox.d.ts +2 -0
- package/dist/factory-sandbox.d.ts.map +1 -1
- package/dist/index.cjs +17 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/repo-template.d.ts +9 -3
- package/dist/repo-template.d.ts.map +1 -1
- package/dist/template.d.ts +7 -1
- package/dist/template.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -418,6 +418,9 @@ var SerializableSandboxTemplateBuilder = class SerializableSandboxTemplateBuilde
|
|
|
418
418
|
memoryMB(memoryMB) {
|
|
419
419
|
return this.#append("memoryMB", [validateResourceValue(memoryMB, "memoryMB")]);
|
|
420
420
|
}
|
|
421
|
+
docker() {
|
|
422
|
+
return this.#append("docker", [true]);
|
|
423
|
+
}
|
|
421
424
|
async build(options = {}) {
|
|
422
425
|
return buildSandboxTemplate(this, options);
|
|
423
426
|
}
|
|
@@ -2957,9 +2960,9 @@ function rememberHead(cloneUrl, sha) {
|
|
|
2957
2960
|
* transient build envs; they never enter the serialized definition. A failed
|
|
2958
2961
|
* head lookup reuses the last head resolved for the same clone URL in this
|
|
2959
2962
|
* process. If the repository cannot be resolved, or no head has been resolved
|
|
2960
|
-
* yet, the resolver keeps `cpuCount` and
|
|
2961
|
-
* `
|
|
2962
|
-
* requested size, and the caller's runtime setup materializes the checkout.
|
|
2963
|
+
* yet, the resolver keeps `cpuCount`, `memoryMB` and
|
|
2964
|
+
* `docker` in a resources-only template so the sandbox still boots at the
|
|
2965
|
+
* requested size with Docker when asked, and the caller's runtime setup materializes the checkout.
|
|
2963
2966
|
*/
|
|
2964
2967
|
function createRepoTemplate(options) {
|
|
2965
2968
|
if (options.getRepositoryAccess && options.repos) throw new TypeError("createRepoTemplate: pass either getRepositoryAccess or repos, not both");
|
|
@@ -2970,7 +2973,7 @@ function createRepoTemplate(options) {
|
|
|
2970
2973
|
setupCommand: options.setupCommand
|
|
2971
2974
|
}] : [];
|
|
2972
2975
|
const resourcesOnly = () => {
|
|
2973
|
-
if (options.cpuCount === void 0 && options.memoryMB === void 0) return void 0;
|
|
2976
|
+
if (options.cpuCount === void 0 && options.memoryMB === void 0 && !options.docker) return void 0;
|
|
2974
2977
|
return withResources(Template(), options);
|
|
2975
2978
|
};
|
|
2976
2979
|
if (entries.length === 0) {
|
|
@@ -3088,6 +3091,7 @@ function createRepoTemplate(options) {
|
|
|
3088
3091
|
function withResources(template, options) {
|
|
3089
3092
|
if (options.cpuCount !== void 0) template = template.cpuCount(options.cpuCount);
|
|
3090
3093
|
if (options.memoryMB !== void 0) template = template.memoryMB(options.memoryMB);
|
|
3094
|
+
if (options.docker) template = template.docker();
|
|
3091
3095
|
return template;
|
|
3092
3096
|
}
|
|
3093
3097
|
function isValidCloneUrl(cloneUrl) {
|
|
@@ -3301,6 +3305,7 @@ const platformFilesystemProvider = {
|
|
|
3301
3305
|
const DEFAULT_SETTINGS = {
|
|
3302
3306
|
cpuCount: 2,
|
|
3303
3307
|
memoryMb: 1024,
|
|
3308
|
+
docker: false,
|
|
3304
3309
|
idleTimeoutMinutes: 5
|
|
3305
3310
|
};
|
|
3306
3311
|
const SETTINGS_SCHEMA = {
|
|
@@ -3342,6 +3347,12 @@ const SETTINGS_SCHEMA = {
|
|
|
3342
3347
|
}
|
|
3343
3348
|
]
|
|
3344
3349
|
},
|
|
3350
|
+
docker: {
|
|
3351
|
+
type: "boolean",
|
|
3352
|
+
title: "Docker",
|
|
3353
|
+
description: "Install Docker Engine and Compose; the daemon starts on first use. We recommend at least 2 GB of memory for Docker.",
|
|
3354
|
+
default: DEFAULT_SETTINGS.docker
|
|
3355
|
+
},
|
|
3345
3356
|
idleTimeoutMinutes: {
|
|
3346
3357
|
type: "integer",
|
|
3347
3358
|
title: "Idle timeout (minutes)",
|
|
@@ -3411,7 +3422,8 @@ var PlatformFactorySandbox = class extends FactorySandbox {
|
|
|
3411
3422
|
...ctx,
|
|
3412
3423
|
...template?.buildEnv ? { buildEnv: template.buildEnv } : {},
|
|
3413
3424
|
cpuCount: settings.cpuCount ?? defaults?.cpuCount ?? DEFAULT_SETTINGS.cpuCount,
|
|
3414
|
-
memoryMB: settings.memoryMb ?? defaults?.memoryMb ?? DEFAULT_SETTINGS.memoryMb
|
|
3425
|
+
memoryMB: settings.memoryMb ?? defaults?.memoryMb ?? DEFAULT_SETTINGS.memoryMb,
|
|
3426
|
+
docker: settings.docker ?? defaults?.docker ?? DEFAULT_SETTINGS.docker
|
|
3415
3427
|
});
|
|
3416
3428
|
}
|
|
3417
3429
|
create(ctx, settings) {
|