cliskill 1.0.1 → 1.0.2
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/bootstrap/cli.js
CHANGED
|
@@ -388,6 +388,19 @@ var BaseAdapter = class {
|
|
|
388
388
|
}
|
|
389
389
|
return timeoutSignal;
|
|
390
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* Build an AbortSignal for streaming requests with extended timeout.
|
|
393
|
+
* Streaming responses can take much longer than regular requests,
|
|
394
|
+
* so we use 3x the configured timeout to avoid premature aborts.
|
|
395
|
+
*/
|
|
396
|
+
buildStreamingSignal(external) {
|
|
397
|
+
const streamTimeout = Math.max(this.config.timeout * 3, 6e5);
|
|
398
|
+
const timeoutSignal = AbortSignal.timeout(streamTimeout);
|
|
399
|
+
if (external) {
|
|
400
|
+
return AbortSignal.any([timeoutSignal, external]);
|
|
401
|
+
}
|
|
402
|
+
return timeoutSignal;
|
|
403
|
+
}
|
|
391
404
|
/**
|
|
392
405
|
* Fetch with automatic retry for rate-limit (429), server errors (5xx),
|
|
393
406
|
* and network failures (TypeError: fetch failed).
|
|
@@ -461,7 +474,7 @@ var GenericCompatAdapter = class extends BaseAdapter {
|
|
|
461
474
|
method: "POST",
|
|
462
475
|
headers: this.buildHeaders(),
|
|
463
476
|
body: JSON.stringify(body),
|
|
464
|
-
signal: this.
|
|
477
|
+
signal: this.buildStreamingSignal(request.signal)
|
|
465
478
|
}));
|
|
466
479
|
if (!response.ok) {
|
|
467
480
|
const text = await response.text().catch(() => "unknown error");
|
|
@@ -670,7 +683,7 @@ var GLMAdapter = class extends BaseAdapter {
|
|
|
670
683
|
method: "POST",
|
|
671
684
|
headers: this.buildHeaders(),
|
|
672
685
|
body: JSON.stringify(body),
|
|
673
|
-
signal: this.
|
|
686
|
+
signal: this.buildStreamingSignal(request.signal)
|
|
674
687
|
}));
|
|
675
688
|
if (!response.ok) {
|
|
676
689
|
const text = await response.text().catch(() => "unknown error");
|
|
@@ -10021,4 +10034,4 @@ export {
|
|
|
10021
10034
|
MessageList,
|
|
10022
10035
|
runCli
|
|
10023
10036
|
};
|
|
10024
|
-
//# sourceMappingURL=chunk-
|
|
10037
|
+
//# sourceMappingURL=chunk-GCXQJ2SV.js.map
|