tensorlake 0.5.95 → 0.5.103

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.d.cts CHANGED
@@ -213,6 +213,14 @@ interface GPUResources {
213
213
  count: number;
214
214
  model: string;
215
215
  }
216
+ /**
217
+ * Egress network access control policy for a sandbox.
218
+ *
219
+ * `denyOut` takes precedence over `allowOut`: a destination matched by both is
220
+ * blocked. Entries may be IPv4 addresses, CIDR ranges, or DNS hostnames;
221
+ * hostname rules are followed across DNS changes. The policy can be changed on
222
+ * a running sandbox via `Sandbox.update({ network })` (pass `null` to clear).
223
+ */
216
224
  interface NetworkConfig {
217
225
  allowInternetAccess: boolean;
218
226
  allowOut: string[];
@@ -258,6 +266,12 @@ interface UpdateSandboxOptions {
258
266
  allowUnauthenticatedAccess?: boolean;
259
267
  /** User ports that should be routable through the sandbox proxy. Port 9501 is reserved. */
260
268
  exposedPorts?: number[];
269
+ /**
270
+ * Egress network policy for the running sandbox, applied to the live VM's
271
+ * firewall in one atomic swap. Omit to keep the current policy, set to
272
+ * replace it, or pass `null` to clear it to unrestricted egress.
273
+ */
274
+ network?: NetworkConfig | null;
261
275
  }
262
276
  interface CreateSandboxResponse {
263
277
  sandboxId: string;
@@ -877,10 +891,12 @@ declare class Sandbox {
877
891
  */
878
892
  status(): Promise<SandboxStatus>;
879
893
  /**
880
- * Update this sandbox's properties (name, exposed ports, proxy auth).
894
+ * Update this sandbox's properties (name, exposed ports, proxy auth, and
895
+ * egress network policy).
881
896
  *
882
897
  * Naming an ephemeral sandbox makes it non-ephemeral and enables
883
- * suspend/resume.
898
+ * suspend/resume. For `network`, omit to keep the current policy, pass an
899
+ * object to replace it, or pass `null` to clear it to unrestricted egress.
884
900
  */
885
901
  update(options: UpdateSandboxOptions): Promise<Traced<SandboxInfo>>;
886
902
  /**
package/dist/index.d.ts CHANGED
@@ -213,6 +213,14 @@ interface GPUResources {
213
213
  count: number;
214
214
  model: string;
215
215
  }
216
+ /**
217
+ * Egress network access control policy for a sandbox.
218
+ *
219
+ * `denyOut` takes precedence over `allowOut`: a destination matched by both is
220
+ * blocked. Entries may be IPv4 addresses, CIDR ranges, or DNS hostnames;
221
+ * hostname rules are followed across DNS changes. The policy can be changed on
222
+ * a running sandbox via `Sandbox.update({ network })` (pass `null` to clear).
223
+ */
216
224
  interface NetworkConfig {
217
225
  allowInternetAccess: boolean;
218
226
  allowOut: string[];
@@ -258,6 +266,12 @@ interface UpdateSandboxOptions {
258
266
  allowUnauthenticatedAccess?: boolean;
259
267
  /** User ports that should be routable through the sandbox proxy. Port 9501 is reserved. */
260
268
  exposedPorts?: number[];
269
+ /**
270
+ * Egress network policy for the running sandbox, applied to the live VM's
271
+ * firewall in one atomic swap. Omit to keep the current policy, set to
272
+ * replace it, or pass `null` to clear it to unrestricted egress.
273
+ */
274
+ network?: NetworkConfig | null;
261
275
  }
262
276
  interface CreateSandboxResponse {
263
277
  sandboxId: string;
@@ -877,10 +891,12 @@ declare class Sandbox {
877
891
  */
878
892
  status(): Promise<SandboxStatus>;
879
893
  /**
880
- * Update this sandbox's properties (name, exposed ports, proxy auth).
894
+ * Update this sandbox's properties (name, exposed ports, proxy auth, and
895
+ * egress network policy).
881
896
  *
882
897
  * Naming an ephemeral sandbox makes it non-ephemeral and enables
883
- * suspend/resume.
898
+ * suspend/resume. For `network`, omit to keep the current policy, pass an
899
+ * object to replace it, or pass `null` to clear it to unrestricted egress.
884
900
  */
885
901
  update(options: UpdateSandboxOptions): Promise<Traced<SandboxInfo>>;
886
902
  /**
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var SDK_VERSION, API_URL, API_KEY, NAMESPACE, SANDBOX_PROXY_URL, DEFAULT_HTTP_TI
19
19
  var init_defaults = __esm({
20
20
  "src/defaults.ts"() {
21
21
  "use strict";
22
- SDK_VERSION = "0.5.95";
22
+ SDK_VERSION = "0.5.103";
23
23
  API_URL = process.env.TENSORLAKE_API_URL ?? "https://api.tensorlake.ai";
24
24
  API_KEY = process.env.TENSORLAKE_API_KEY ?? void 0;
25
25
  NAMESPACE = process.env.INDEXIFY_NAMESPACE ?? "default";
@@ -3438,10 +3438,12 @@ var init_sandbox = __esm({
3438
3438
  return info.status;
3439
3439
  }
3440
3440
  /**
3441
- * Update this sandbox's properties (name, exposed ports, proxy auth).
3441
+ * Update this sandbox's properties (name, exposed ports, proxy auth, and
3442
+ * egress network policy).
3442
3443
  *
3443
3444
  * Naming an ephemeral sandbox makes it non-ephemeral and enables
3444
- * suspend/resume.
3445
+ * suspend/resume. For `network`, omit to keep the current policy, pass an
3446
+ * object to replace it, or pass `null` to clear it to unrestricted egress.
3445
3447
  */
3446
3448
  async update(options) {
3447
3449
  const client = this.requireLifecycleClient("update");
@@ -4307,6 +4309,9 @@ var init_client = __esm({
4307
4309
  if (options.exposedPorts != null) {
4308
4310
  body.exposed_ports = normalizeUserPorts(options.exposedPorts);
4309
4311
  }
4312
+ if (options.network !== void 0) {
4313
+ body.network = options.network === null ? null : toSnakeKeys(options.network);
4314
+ }
4310
4315
  if (Object.keys(body).length === 0) {
4311
4316
  throw new SandboxError(
4312
4317
  "At least one sandbox update field must be provided."