@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
|
@@ -10,6 +10,8 @@ export interface PlatformFactorySandboxSettings extends Record<string, unknown>
|
|
|
10
10
|
cpuCount?: number;
|
|
11
11
|
/** Memory in MB for the sandbox template. Part of the template identity. */
|
|
12
12
|
memoryMb?: number;
|
|
13
|
+
/** Install Docker Engine and Compose, started on first use. Part of the template identity. */
|
|
14
|
+
docker?: boolean;
|
|
13
15
|
/** Minutes idle before the sandbox pauses. Runtime only. */
|
|
14
16
|
idleTimeoutMinutes?: number;
|
|
15
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory-sandbox.d.ts","sourceRoot":"","sources":["../src/factory-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAIV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG3D,uHAAuH;AACvH,MAAM,WAAW,8BAA+B,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAA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;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,cAAc,CAAC,8BAA8B,CAAC;;IACxF,QAAQ,CAAC,QAAQ,cAAc;IAC/B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,8BAA8B,CAAC,CAAC;IAehE,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC,8BAA8B,CAAC,CAGnE;IAEF,YAAY,OAAO,GAAE,6BAAkC,EAOtD;IAED,QAAQ,CACN,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,8BAA8B,GACvC,4BAA4B,GAAG,SAAS,CAS1C;IAED,MAAM,CAAC,GAAG,EAAE,qBAAqB,EAAE,QAAQ,EAAE,8BAA8B,GAAG,eAAe,CAiB5F;CA4CF"}
|
package/dist/index.cjs
CHANGED
|
@@ -441,6 +441,9 @@ var SerializableSandboxTemplateBuilder = class SerializableSandboxTemplateBuilde
|
|
|
441
441
|
memoryMB(memoryMB) {
|
|
442
442
|
return this.#append("memoryMB", [validateResourceValue(memoryMB, "memoryMB")]);
|
|
443
443
|
}
|
|
444
|
+
docker() {
|
|
445
|
+
return this.#append("docker", [true]);
|
|
446
|
+
}
|
|
444
447
|
async build(options = {}) {
|
|
445
448
|
return buildSandboxTemplate(this, options);
|
|
446
449
|
}
|
|
@@ -2980,9 +2983,9 @@ function rememberHead(cloneUrl, sha) {
|
|
|
2980
2983
|
* transient build envs; they never enter the serialized definition. A failed
|
|
2981
2984
|
* head lookup reuses the last head resolved for the same clone URL in this
|
|
2982
2985
|
* process. If the repository cannot be resolved, or no head has been resolved
|
|
2983
|
-
* yet, the resolver keeps `cpuCount` and
|
|
2984
|
-
* `
|
|
2985
|
-
* requested size, and the caller's runtime setup materializes the checkout.
|
|
2986
|
+
* yet, the resolver keeps `cpuCount`, `memoryMB` and
|
|
2987
|
+
* `docker` in a resources-only template so the sandbox still boots at the
|
|
2988
|
+
* requested size with Docker when asked, and the caller's runtime setup materializes the checkout.
|
|
2986
2989
|
*/
|
|
2987
2990
|
function createRepoTemplate(options) {
|
|
2988
2991
|
if (options.getRepositoryAccess && options.repos) throw new TypeError("createRepoTemplate: pass either getRepositoryAccess or repos, not both");
|
|
@@ -2993,7 +2996,7 @@ function createRepoTemplate(options) {
|
|
|
2993
2996
|
setupCommand: options.setupCommand
|
|
2994
2997
|
}] : [];
|
|
2995
2998
|
const resourcesOnly = () => {
|
|
2996
|
-
if (options.cpuCount === void 0 && options.memoryMB === void 0) return void 0;
|
|
2999
|
+
if (options.cpuCount === void 0 && options.memoryMB === void 0 && !options.docker) return void 0;
|
|
2997
3000
|
return withResources(Template(), options);
|
|
2998
3001
|
};
|
|
2999
3002
|
if (entries.length === 0) {
|
|
@@ -3111,6 +3114,7 @@ function createRepoTemplate(options) {
|
|
|
3111
3114
|
function withResources(template, options) {
|
|
3112
3115
|
if (options.cpuCount !== void 0) template = template.cpuCount(options.cpuCount);
|
|
3113
3116
|
if (options.memoryMB !== void 0) template = template.memoryMB(options.memoryMB);
|
|
3117
|
+
if (options.docker) template = template.docker();
|
|
3114
3118
|
return template;
|
|
3115
3119
|
}
|
|
3116
3120
|
function isValidCloneUrl(cloneUrl) {
|
|
@@ -3324,6 +3328,7 @@ const platformFilesystemProvider = {
|
|
|
3324
3328
|
const DEFAULT_SETTINGS = {
|
|
3325
3329
|
cpuCount: 2,
|
|
3326
3330
|
memoryMb: 1024,
|
|
3331
|
+
docker: false,
|
|
3327
3332
|
idleTimeoutMinutes: 5
|
|
3328
3333
|
};
|
|
3329
3334
|
const SETTINGS_SCHEMA = {
|
|
@@ -3365,6 +3370,12 @@ const SETTINGS_SCHEMA = {
|
|
|
3365
3370
|
}
|
|
3366
3371
|
]
|
|
3367
3372
|
},
|
|
3373
|
+
docker: {
|
|
3374
|
+
type: "boolean",
|
|
3375
|
+
title: "Docker",
|
|
3376
|
+
description: "Install Docker Engine and Compose; the daemon starts on first use. We recommend at least 2 GB of memory for Docker.",
|
|
3377
|
+
default: DEFAULT_SETTINGS.docker
|
|
3378
|
+
},
|
|
3368
3379
|
idleTimeoutMinutes: {
|
|
3369
3380
|
type: "integer",
|
|
3370
3381
|
title: "Idle timeout (minutes)",
|
|
@@ -3434,7 +3445,8 @@ var PlatformFactorySandbox = class extends _mastra_core_workspace.FactorySandbox
|
|
|
3434
3445
|
...ctx,
|
|
3435
3446
|
...template?.buildEnv ? { buildEnv: template.buildEnv } : {},
|
|
3436
3447
|
cpuCount: settings.cpuCount ?? defaults?.cpuCount ?? DEFAULT_SETTINGS.cpuCount,
|
|
3437
|
-
memoryMB: settings.memoryMb ?? defaults?.memoryMb ?? DEFAULT_SETTINGS.memoryMb
|
|
3448
|
+
memoryMB: settings.memoryMb ?? defaults?.memoryMb ?? DEFAULT_SETTINGS.memoryMb,
|
|
3449
|
+
docker: settings.docker ?? defaults?.docker ?? DEFAULT_SETTINGS.docker
|
|
3438
3450
|
});
|
|
3439
3451
|
}
|
|
3440
3452
|
create(ctx, settings) {
|