tensorlake 0.4.47 → 0.4.48

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-B130uMYt.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-BQ6fJT92.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-B130uMYt.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-BQ6fJT92.js';
@@ -112,6 +112,17 @@ var RemoteAPIError = class extends SandboxError {
112
112
  };
113
113
 
114
114
  // src/http.ts
115
+ import {
116
+ Agent,
117
+ fetch as undiciFetch,
118
+ setGlobalDispatcher
119
+ } from "undici";
120
+ setGlobalDispatcher(
121
+ new Agent({
122
+ keepAliveTimeout: 6e4,
123
+ allowH2: true
124
+ })
125
+ );
115
126
  var HttpClient = class {
116
127
  baseUrl;
117
128
  headers;
@@ -163,31 +174,26 @@ var HttpClient = class {
163
174
  if (options?.contentType) {
164
175
  headers["Content-Type"] = options.contentType;
165
176
  }
166
- const response = await this.requestResponse(
167
- method,
168
- path2,
169
- {
170
- body: options?.body,
171
- headers,
172
- signal: options?.signal
173
- }
174
- );
177
+ const response = await this.requestResponse(method, path2, {
178
+ body: options?.body,
179
+ headers,
180
+ signal: options?.signal
181
+ });
175
182
  const buffer = await response.arrayBuffer();
176
183
  return new Uint8Array(buffer);
177
184
  }
178
185
  /** Make a request and return the response body as an SSE stream. */
179
186
  async requestStream(method, path2, options) {
180
- const response = await this.requestResponse(
181
- method,
182
- path2,
183
- {
184
- json: options?.json,
185
- headers: { Accept: "text/event-stream" },
186
- signal: options?.signal
187
- }
188
- );
187
+ const response = await this.requestResponse(method, path2, {
188
+ json: options?.json,
189
+ headers: { Accept: "text/event-stream" },
190
+ signal: options?.signal
191
+ });
189
192
  if (!response.body) {
190
- throw new RemoteAPIError(response.status, "No response body for SSE stream");
193
+ throw new RemoteAPIError(
194
+ response.status,
195
+ "No response body for SSE stream"
196
+ );
191
197
  }
192
198
  return response.body;
193
199
  }
@@ -226,7 +232,7 @@ var HttpClient = class {
226
232
  );
227
233
  const combinedSignal = signal ? anySignal([signal, this.abortController.signal]) : this.abortController.signal;
228
234
  try {
229
- const response = await fetch(url, {
235
+ const response = await undiciFetch(url, {
230
236
  method,
231
237
  headers,
232
238
  body,
@@ -3659,7 +3665,7 @@ var SandboxClient = class _SandboxClient {
3659
3665
  while (Date.now() < deadline) {
3660
3666
  const info = await this.get(result.sandboxId);
3661
3667
  if (info.status === "running" /* RUNNING */) {
3662
- const sandbox = this.connect(result.sandboxId, options?.proxyUrl);
3668
+ const sandbox = this.connect(result.sandboxId, options?.proxyUrl, info.routingHint);
3663
3669
  sandbox._setOwner(this);
3664
3670
  return sandbox;
3665
3671
  }