@mastra/platform-workspace 1.10.0-alpha.3 → 1.11.0-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/dist/factory-sandbox.d.ts +7 -1
- package/dist/factory-sandbox.d.ts.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -15,7 +15,13 @@ export interface PlatformFactorySandboxSettings extends Record<string, unknown>
|
|
|
15
15
|
/** Minutes idle before the sandbox pauses. Runtime only. */
|
|
16
16
|
idleTimeoutMinutes?: number;
|
|
17
17
|
}
|
|
18
|
-
export interface PlatformFactorySandboxOptions extends Omit<PlatformSandboxOptions, 'id' | 'sandboxId' | 'sessionId' | 'template'> {
|
|
18
|
+
export interface PlatformFactorySandboxOptions extends Omit<PlatformSandboxOptions, 'id' | 'sandboxId' | 'sessionId' | 'template' | 'env'> {
|
|
19
|
+
/**
|
|
20
|
+
* Runtime environment of every session sandbox. A function receives each
|
|
21
|
+
* session's context, so a credential can go to one factory's sessions only:
|
|
22
|
+
* `ctx => (ctx.factoryId === id ? { TOKEN } : {})`.
|
|
23
|
+
*/
|
|
24
|
+
env?: Record<string, string> | ((ctx: FactorySandboxContext) => Record<string, string>);
|
|
19
25
|
/** Options for the environment's repo template. */
|
|
20
26
|
template?: {
|
|
21
27
|
/** Build-only environment, excluded from template identity and runtime sandboxes. */
|
|
@@ -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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IACjB,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAqED,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,sBAAsB,EACtB,IAAI,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,KAAK,CACtD;IACC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,qBAAqB,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxF,mDAAmD;IACnD,QAAQ,CAAC,EAAE;QACT,qFAAqF;QACrF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,CAAC;IACF,oFAAoF;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC;CACpD;AAED;;;;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,CAkB5F;CA4CF"}
|
package/dist/index.cjs
CHANGED
|
@@ -3450,9 +3450,10 @@ var PlatformFactorySandbox = class extends _mastra_core_workspace.FactorySandbox
|
|
|
3450
3450
|
});
|
|
3451
3451
|
}
|
|
3452
3452
|
create(ctx, settings) {
|
|
3453
|
-
const { defaults, template: _template, ...options } = this.#options;
|
|
3453
|
+
const { defaults, template: _template, env, ...options } = this.#options;
|
|
3454
3454
|
return new PlatformSandbox({
|
|
3455
3455
|
...options,
|
|
3456
|
+
...env ? { env: typeof env === "function" ? env(ctx) : env } : {},
|
|
3456
3457
|
id: ctx.sessionId,
|
|
3457
3458
|
sessionId: ctx.sessionId,
|
|
3458
3459
|
sandboxId: ctx.sandboxId,
|