@mastra/platform-workspace 1.12.0-alpha.1 → 1.13.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/index.js CHANGED
@@ -1971,6 +1971,7 @@ var PlatformSandbox = class PlatformSandbox extends MastraSandbox {
1971
1971
  _templateResolutionInFlight;
1972
1972
  _idleTimeoutMinutes;
1973
1973
  _networkIsolation;
1974
+ _publicPorts;
1974
1975
  _env;
1975
1976
  _timeout;
1976
1977
  _instructionsOverride;
@@ -2069,6 +2070,7 @@ var PlatformSandbox = class PlatformSandbox extends MastraSandbox {
2069
2070
  this._template = options.template;
2070
2071
  this._idleTimeoutMinutes = options.idleTimeoutMinutes;
2071
2072
  this._networkIsolation = options.networkIsolation;
2073
+ this._publicPorts = options.publicPorts;
2072
2074
  this._env = options.env ?? {};
2073
2075
  this._timeout = options.timeout;
2074
2076
  this._instructionsOverride = options.instructions;
@@ -2126,6 +2128,7 @@ var PlatformSandbox = class PlatformSandbox extends MastraSandbox {
2126
2128
  ...this._template !== void 0 && { template: this._template },
2127
2129
  idleTimeoutMinutes: options.idleTimeoutMinutes ?? this._idleTimeoutMinutes,
2128
2130
  ...this._networkIsolation !== void 0 && { networkIsolation: this._networkIsolation },
2131
+ ...this._publicPorts !== void 0 && { publicPorts: this._publicPorts },
2129
2132
  env: options.env ?? this._env,
2130
2133
  ...this._timeout !== void 0 && { timeout: this._timeout },
2131
2134
  ...this._instructionsOverride !== void 0 && { instructions: this._instructionsOverride },
@@ -2181,6 +2184,7 @@ var PlatformSandbox = class PlatformSandbox extends MastraSandbox {
2181
2184
  environmentId: this._environmentId,
2182
2185
  idleTimeoutMinutes: this._idleTimeoutMinutes,
2183
2186
  networkIsolation: this._networkIsolation,
2187
+ publicPorts: this._publicPorts,
2184
2188
  env: this._env
2185
2189
  });
2186
2190
  let response;
@@ -3320,6 +3324,11 @@ const platformSandboxProvider = {
3320
3324
  enum: ["ISOLATED", "PRIVATE"],
3321
3325
  default: "ISOLATED"
3322
3326
  },
3327
+ publicPorts: {
3328
+ type: "boolean",
3329
+ description: "Let anyone with a port URL reach it without signing in",
3330
+ default: false
3331
+ },
3323
3332
  env: {
3324
3333
  type: "object",
3325
3334
  description: "Environment variables",
@@ -3367,7 +3376,8 @@ const DEFAULT_SETTINGS = {
3367
3376
  cpuCount: 2,
3368
3377
  memoryMb: 1024,
3369
3378
  docker: false,
3370
- idleTimeoutMinutes: 5
3379
+ idleTimeoutMinutes: 5,
3380
+ publicPorts: false
3371
3381
  };
3372
3382
  const SETTINGS_SCHEMA = {
3373
3383
  type: "object",
@@ -3421,14 +3431,20 @@ const SETTINGS_SCHEMA = {
3421
3431
  default: DEFAULT_SETTINGS.idleTimeoutMinutes,
3422
3432
  minimum: 1,
3423
3433
  maximum: 1440
3434
+ },
3435
+ publicPorts: {
3436
+ type: "boolean",
3437
+ title: "Public preview links",
3438
+ description: "Anyone with a sandbox's preview link can open it without signing in. Applies to newly created sandboxes, not existing ones.",
3439
+ default: DEFAULT_SETTINGS.publicPorts
3424
3440
  }
3425
3441
  },
3426
3442
  additionalProperties: false
3427
3443
  };
3428
3444
  /**
3429
3445
  * The settings schema with the provider's effective defaults as `default`:
3430
- * the built-in values, overridden by the host's `idleTimeoutMinutes` option and
3431
- * then its `defaults` option. The schema
3446
+ * the built-in values, overridden by the host's `idleTimeoutMinutes` and
3447
+ * `publicPorts` options and then its `defaults` option. The schema
3432
3448
  * is what clients show as placeholders, so it must match what the provider
3433
3449
  * applies when a setting is unset.
3434
3450
  */
@@ -3474,6 +3490,7 @@ var PlatformFactorySandbox = class extends FactorySandbox {
3474
3490
  this.#options = options;
3475
3491
  this.settings = settingsSchema({
3476
3492
  ...options.idleTimeoutMinutes !== void 0 ? { idleTimeoutMinutes: options.idleTimeoutMinutes } : {},
3493
+ ...options.publicPorts !== void 0 ? { publicPorts: options.publicPorts } : {},
3477
3494
  ...options.defaults
3478
3495
  });
3479
3496
  }
@@ -3497,7 +3514,8 @@ var PlatformFactorySandbox = class extends FactorySandbox {
3497
3514
  sandboxId: ctx.sandboxId,
3498
3515
  template: this.template(ctx, settings),
3499
3516
  ...ctx.workingDirectory ? { workingDirectory: ctx.workingDirectory } : {},
3500
- idleTimeoutMinutes: settings.idleTimeoutMinutes ?? defaults?.idleTimeoutMinutes ?? options.idleTimeoutMinutes ?? DEFAULT_SETTINGS.idleTimeoutMinutes
3517
+ idleTimeoutMinutes: settings.idleTimeoutMinutes ?? defaults?.idleTimeoutMinutes ?? options.idleTimeoutMinutes ?? DEFAULT_SETTINGS.idleTimeoutMinutes,
3518
+ publicPorts: settings.publicPorts ?? defaults?.publicPorts ?? options.publicPorts ?? DEFAULT_SETTINGS.publicPorts
3501
3519
  });
3502
3520
  }
3503
3521
  async #startBuild(ctx, settings) {