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.
- package/dist/bin/darwin-arm64/tensorlake +0 -0
- package/dist/bin/darwin-arm64/tl +0 -0
- package/dist/bin/linux-x64/tensorlake +0 -0
- package/dist/bin/linux-x64/tl +0 -0
- package/dist/bin/win32-x64/tensorlake.exe +0 -0
- package/dist/bin/win32-x64/tl.exe +0 -0
- package/dist/index.cjs +23 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +27 -21
- package/dist/index.js.map +1 -1
- package/dist/{sandbox-image-B130uMYt.d.cts → sandbox-image-BQ6fJT92.d.cts} +1 -0
- package/dist/{sandbox-image-B130uMYt.d.ts → sandbox-image-BQ6fJT92.d.ts} +1 -0
- package/dist/sandbox-image.cjs +23 -21
- package/dist/sandbox-image.cjs.map +1 -1
- package/dist/sandbox-image.d.cts +1 -1
- package/dist/sandbox-image.d.ts +1 -1
- package/dist/sandbox-image.js +27 -21
- package/dist/sandbox-image.js.map +1 -1
- package/package.json +3 -2
package/dist/sandbox-image.cjs
CHANGED
|
@@ -151,6 +151,13 @@ var RemoteAPIError = class extends SandboxError {
|
|
|
151
151
|
};
|
|
152
152
|
|
|
153
153
|
// src/http.ts
|
|
154
|
+
var import_undici = require("undici");
|
|
155
|
+
(0, import_undici.setGlobalDispatcher)(
|
|
156
|
+
new import_undici.Agent({
|
|
157
|
+
keepAliveTimeout: 6e4,
|
|
158
|
+
allowH2: true
|
|
159
|
+
})
|
|
160
|
+
);
|
|
154
161
|
var HttpClient = class {
|
|
155
162
|
baseUrl;
|
|
156
163
|
headers;
|
|
@@ -202,31 +209,26 @@ var HttpClient = class {
|
|
|
202
209
|
if (options?.contentType) {
|
|
203
210
|
headers["Content-Type"] = options.contentType;
|
|
204
211
|
}
|
|
205
|
-
const response = await this.requestResponse(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
headers,
|
|
211
|
-
signal: options?.signal
|
|
212
|
-
}
|
|
213
|
-
);
|
|
212
|
+
const response = await this.requestResponse(method, path2, {
|
|
213
|
+
body: options?.body,
|
|
214
|
+
headers,
|
|
215
|
+
signal: options?.signal
|
|
216
|
+
});
|
|
214
217
|
const buffer = await response.arrayBuffer();
|
|
215
218
|
return new Uint8Array(buffer);
|
|
216
219
|
}
|
|
217
220
|
/** Make a request and return the response body as an SSE stream. */
|
|
218
221
|
async requestStream(method, path2, options) {
|
|
219
|
-
const response = await this.requestResponse(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
headers: { Accept: "text/event-stream" },
|
|
225
|
-
signal: options?.signal
|
|
226
|
-
}
|
|
227
|
-
);
|
|
222
|
+
const response = await this.requestResponse(method, path2, {
|
|
223
|
+
json: options?.json,
|
|
224
|
+
headers: { Accept: "text/event-stream" },
|
|
225
|
+
signal: options?.signal
|
|
226
|
+
});
|
|
228
227
|
if (!response.body) {
|
|
229
|
-
throw new RemoteAPIError(
|
|
228
|
+
throw new RemoteAPIError(
|
|
229
|
+
response.status,
|
|
230
|
+
"No response body for SSE stream"
|
|
231
|
+
);
|
|
230
232
|
}
|
|
231
233
|
return response.body;
|
|
232
234
|
}
|
|
@@ -265,7 +267,7 @@ var HttpClient = class {
|
|
|
265
267
|
);
|
|
266
268
|
const combinedSignal = signal ? anySignal([signal, this.abortController.signal]) : this.abortController.signal;
|
|
267
269
|
try {
|
|
268
|
-
const response = await fetch(url, {
|
|
270
|
+
const response = await (0, import_undici.fetch)(url, {
|
|
269
271
|
method,
|
|
270
272
|
headers,
|
|
271
273
|
body,
|
|
@@ -3698,7 +3700,7 @@ var SandboxClient = class _SandboxClient {
|
|
|
3698
3700
|
while (Date.now() < deadline) {
|
|
3699
3701
|
const info = await this.get(result.sandboxId);
|
|
3700
3702
|
if (info.status === "running" /* RUNNING */) {
|
|
3701
|
-
const sandbox = this.connect(result.sandboxId, options?.proxyUrl);
|
|
3703
|
+
const sandbox = this.connect(result.sandboxId, options?.proxyUrl, info.routingHint);
|
|
3702
3704
|
sandbox._setOwner(this);
|
|
3703
3705
|
return sandbox;
|
|
3704
3706
|
}
|