tensorlake 0.4.47 → 0.4.49

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/dist/index.cjs CHANGED
@@ -150,6 +150,13 @@ var RequestExecutionError = class extends Error {
150
150
  };
151
151
 
152
152
  // src/http.ts
153
+ var import_undici = require("undici");
154
+ (0, import_undici.setGlobalDispatcher)(
155
+ new import_undici.Agent({
156
+ keepAliveTimeout: 6e4,
157
+ allowH2: true
158
+ })
159
+ );
153
160
  var HttpClient = class {
154
161
  baseUrl;
155
162
  headers;
@@ -201,31 +208,26 @@ var HttpClient = class {
201
208
  if (options?.contentType) {
202
209
  headers["Content-Type"] = options.contentType;
203
210
  }
204
- const response = await this.requestResponse(
205
- method,
206
- path2,
207
- {
208
- body: options?.body,
209
- headers,
210
- signal: options?.signal
211
- }
212
- );
211
+ const response = await this.requestResponse(method, path2, {
212
+ body: options?.body,
213
+ headers,
214
+ signal: options?.signal
215
+ });
213
216
  const buffer = await response.arrayBuffer();
214
217
  return new Uint8Array(buffer);
215
218
  }
216
219
  /** Make a request and return the response body as an SSE stream. */
217
220
  async requestStream(method, path2, options) {
218
- const response = await this.requestResponse(
219
- method,
220
- path2,
221
- {
222
- json: options?.json,
223
- headers: { Accept: "text/event-stream" },
224
- signal: options?.signal
225
- }
226
- );
221
+ const response = await this.requestResponse(method, path2, {
222
+ json: options?.json,
223
+ headers: { Accept: "text/event-stream" },
224
+ signal: options?.signal
225
+ });
227
226
  if (!response.body) {
228
- throw new RemoteAPIError(response.status, "No response body for SSE stream");
227
+ throw new RemoteAPIError(
228
+ response.status,
229
+ "No response body for SSE stream"
230
+ );
229
231
  }
230
232
  return response.body;
231
233
  }
@@ -264,7 +266,7 @@ var HttpClient = class {
264
266
  );
265
267
  const combinedSignal = signal ? anySignal([signal, this.abortController.signal]) : this.abortController.signal;
266
268
  try {
267
- const response = await fetch(url, {
269
+ const response = await (0, import_undici.fetch)(url, {
268
270
  method,
269
271
  headers,
270
272
  body,
@@ -3776,7 +3778,7 @@ var SandboxClient = class _SandboxClient {
3776
3778
  while (Date.now() < deadline) {
3777
3779
  const info = await this.get(result.sandboxId);
3778
3780
  if (info.status === "running" /* RUNNING */) {
3779
- const sandbox = this.connect(result.sandboxId, options?.proxyUrl);
3781
+ const sandbox = this.connect(result.sandboxId, options?.proxyUrl, info.routingHint);
3780
3782
  sandbox._setOwner(this);
3781
3783
  return sandbox;
3782
3784
  }