tensorlake 0.4.46 → 0.4.47

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.
@@ -1 +1 @@
1
- export { v as CreateSandboxImageOptions, x as DockerfileBuildPlan, y as DockerfileInstruction, J as SandboxImageSource, V as createSandboxImage, X as defaultRegisteredName, Y as loadDockerfilePlan, Z as loadImagePlan, _ as logicalDockerfileLines, $ as runCreateSandboxImageCli } from './sandbox-image-B5Fa0xqb.cjs';
1
+ export { v as CreateSandboxImageOptions, x as DockerfileBuildPlan, y as DockerfileInstruction, J as SandboxImageSource, V as createSandboxImage, X as defaultRegisteredName, Y as loadDockerfilePlan, Z as loadImagePlan, _ as logicalDockerfileLines, $ as runCreateSandboxImageCli } from './sandbox-image-B130uMYt.cjs';
@@ -1 +1 @@
1
- export { v as CreateSandboxImageOptions, x as DockerfileBuildPlan, y as DockerfileInstruction, J as SandboxImageSource, V as createSandboxImage, X as defaultRegisteredName, Y as loadDockerfilePlan, Z as loadImagePlan, _ as logicalDockerfileLines, $ as runCreateSandboxImageCli } from './sandbox-image-B5Fa0xqb.js';
1
+ export { v as CreateSandboxImageOptions, x as DockerfileBuildPlan, y as DockerfileInstruction, J as SandboxImageSource, V as createSandboxImage, X as defaultRegisteredName, Y as loadDockerfilePlan, Z as loadImagePlan, _ as logicalDockerfileLines, $ as runCreateSandboxImageCli } from './sandbox-image-B130uMYt.js';
@@ -138,6 +138,9 @@ var HttpClient = class {
138
138
  if (options.hostHeader) {
139
139
  this.headers["Host"] = options.hostHeader;
140
140
  }
141
+ if (options.routingHint) {
142
+ this.headers["X-Tensorlake-Route-Hint"] = options.routingHint;
143
+ }
141
144
  }
142
145
  close() {
143
146
  this.abortController?.abort();
@@ -3032,7 +3035,8 @@ var Sandbox = class {
3032
3035
  apiKey: options.apiKey,
3033
3036
  organizationId: options.organizationId,
3034
3037
  projectId: options.projectId,
3035
- hostHeader
3038
+ hostHeader,
3039
+ routingHint: options.routingHint
3036
3040
  });
3037
3041
  }
3038
3042
  /** @internal Used by SandboxClient.createAndConnect to set ownership. */
@@ -3627,14 +3631,15 @@ var SandboxClient = class _SandboxClient {
3627
3631
  );
3628
3632
  }
3629
3633
  // --- Connect ---
3630
- connect(identifier, proxyUrl) {
3634
+ connect(identifier, proxyUrl, routingHint) {
3631
3635
  const resolvedProxy = proxyUrl ?? resolveProxyUrl(this.apiUrl);
3632
3636
  return new Sandbox({
3633
3637
  sandboxId: identifier,
3634
3638
  proxyUrl: resolvedProxy,
3635
3639
  apiKey: this.apiKey,
3636
3640
  organizationId: this.organizationId,
3637
- projectId: this.projectId
3641
+ projectId: this.projectId,
3642
+ routingHint
3638
3643
  });
3639
3644
  }
3640
3645
  async createAndConnect(options) {
@@ -3645,6 +3650,11 @@ var SandboxClient = class _SandboxClient {
3645
3650
  } else {
3646
3651
  result = await this.create(options);
3647
3652
  }
3653
+ if (result.status === "running" /* RUNNING */) {
3654
+ const sandbox = this.connect(result.sandboxId, options?.proxyUrl, result.routingHint);
3655
+ sandbox._setOwner(this);
3656
+ return sandbox;
3657
+ }
3648
3658
  const deadline = Date.now() + startupTimeout * 1e3;
3649
3659
  while (Date.now() < deadline) {
3650
3660
  const info = await this.get(result.sandboxId);