blun-king-cli 9.1.86 → 9.1.87
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/LIESMICH.txt +8 -1
- package/README.md +6 -1
- package/bin/rate-limit-recovery-policy.cjs +13 -0
- package/blun.mjs +4 -2
- package/package.json +1 -1
package/LIESMICH.txt
CHANGED
|
@@ -9,7 +9,7 @@ Installation
|
|
|
9
9
|
------------
|
|
10
10
|
Die geprüfte Version exakt global installieren:
|
|
11
11
|
|
|
12
|
-
npm install -g blun-king-cli@9.1.
|
|
12
|
+
npm install -g blun-king-cli@9.1.87
|
|
13
13
|
|
|
14
14
|
Start
|
|
15
15
|
-----
|
|
@@ -50,6 +50,13 @@ FIFO-Warteschlange. Für diesen normalen Wartestatus erscheint kein
|
|
|
50
50
|
|
|
51
51
|
Zuverlässiger King-Start
|
|
52
52
|
-----------------------
|
|
53
|
+
Bei einer ausdrücklich als wiederholbar gekennzeichneten Serverüberlastung
|
|
54
|
+
(HTTP 429 mit x-should-retry: true) wartet BLUN King gemäß Retry-After und
|
|
55
|
+
sendet dieselbe Anfrage höchstens zweimal erneut. Authentifizierungs-,
|
|
56
|
+
Kontingent- und andere nicht wiederholbare Fehler brechen weiterhin sofort ab.
|
|
57
|
+
Bleibt der Server nach den begrenzten Versuchen überlastet, erhält der Nutzer
|
|
58
|
+
weiterhin die klare Fehlermeldung.
|
|
59
|
+
|
|
53
60
|
Der Windows-Hilfsprozess für private Pfade übernimmt TEMP und TMP aus der
|
|
54
61
|
Benutzersitzung. Dadurch arbeitet die ACL-Prüfung auch unter einem normalen
|
|
55
62
|
Benutzerkonto. Bei einem Fehler wird die tatsächliche Ursache des
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Voraussetzung ist Node.js 24.15 oder neuer. Die geprüfte Version wird exakt
|
|
|
9
9
|
installiert:
|
|
10
10
|
|
|
11
11
|
```powershell
|
|
12
|
-
npm install -g blun-king-cli@9.1.
|
|
12
|
+
npm install -g blun-king-cli@9.1.87
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Reproduzierbares Staging und Packen
|
|
@@ -72,6 +72,11 @@ Geistervorschlägen, Bash-Eingabe und einer noch offenen Mehrzeileneingabe.
|
|
|
72
72
|
|
|
73
73
|
## Zuverlässiger King-Start
|
|
74
74
|
|
|
75
|
+
Bei einer vom Server ausdrücklich als wiederholbar gekennzeichneten
|
|
76
|
+
Überlastung (`HTTP 429`, `x-should-retry: true`) wartet BLUN King entsprechend
|
|
77
|
+
`Retry-After` und sendet dieselbe Anfrage höchstens zweimal erneut. Andere
|
|
78
|
+
Fehler und dauerhaft überlastete Server bleiben klar begrenzt und sichtbar.
|
|
79
|
+
|
|
75
80
|
Der Windows-Hilfsprozess für private Pfade übernimmt `TEMP` und `TMP` aus der
|
|
76
81
|
Benutzersitzung. Dadurch kann der C#-Compiler für die ACL-Prüfung auch unter
|
|
77
82
|
einem normalen Benutzerkonto arbeiten. Scheitert der Unterprozess, nennt die
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const MAX_AUTOMATIC_RATE_LIMIT_RESUMES = 3;
|
|
4
|
+
const MAX_EXPLICIT_RATE_LIMIT_RETRIES = 2;
|
|
4
5
|
const RATE_LIMIT_RETRY_BASE_MS = 60_000;
|
|
5
6
|
const RATE_LIMIT_COMPACTION_THRESHOLD_TOKENS = 64_000;
|
|
6
7
|
|
|
@@ -8,6 +9,16 @@ function isImmediateGenerateRetryAllowed(statusCode) {
|
|
|
8
9
|
return statusCode !== 429 && [500, 502, 503, 504].includes(statusCode);
|
|
9
10
|
}
|
|
10
11
|
|
|
12
|
+
function resolveTransportRetryBudget(configuredMaxRetries, statusCode, shouldRetryHeader) {
|
|
13
|
+
if (!Number.isInteger(configuredMaxRetries) || configuredMaxRetries < 0) {
|
|
14
|
+
throw new Error("configuredMaxRetries must be a non-negative integer.");
|
|
15
|
+
}
|
|
16
|
+
const explicitRetry = typeof shouldRetryHeader === "string"
|
|
17
|
+
&& shouldRetryHeader.trim().toLowerCase() === "true";
|
|
18
|
+
if (statusCode !== 429 || !explicitRetry) return configuredMaxRetries;
|
|
19
|
+
return Math.max(configuredMaxRetries, MAX_EXPLICIT_RATE_LIMIT_RETRIES);
|
|
20
|
+
}
|
|
21
|
+
|
|
11
22
|
function rateLimitRetryDelayMs(retryCount) {
|
|
12
23
|
if (!Number.isInteger(retryCount) || retryCount < 1) {
|
|
13
24
|
throw new Error("retryCount must be a positive integer.");
|
|
@@ -26,9 +37,11 @@ function shouldCompactBeforeRateLimitResume(estimatedRequestTokens) {
|
|
|
26
37
|
|
|
27
38
|
module.exports = {
|
|
28
39
|
MAX_AUTOMATIC_RATE_LIMIT_RESUMES,
|
|
40
|
+
MAX_EXPLICIT_RATE_LIMIT_RETRIES,
|
|
29
41
|
RATE_LIMIT_RETRY_BASE_MS,
|
|
30
42
|
isImmediateGenerateRetryAllowed,
|
|
31
43
|
rateLimitRetryDelayMs,
|
|
44
|
+
resolveTransportRetryBudget,
|
|
32
45
|
shouldCompactBeforeRateLimitResume,
|
|
33
46
|
shouldStopAutomaticRateLimitResume,
|
|
34
47
|
};
|
package/blun.mjs
CHANGED
|
@@ -1935,9 +1935,10 @@ function getRecord(value) {
|
|
|
1935
1935
|
function getString(value) {
|
|
1936
1936
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
1937
1937
|
}
|
|
1938
|
-
var DEFAULT_MAX_RETRIES$1, MAX_RETRY_DELAY_MS, FetchTransport, DONE;
|
|
1938
|
+
var DEFAULT_MAX_RETRIES$1, MAX_RETRY_DELAY_MS, resolveTransportRetryBudget, FetchTransport, DONE;
|
|
1939
1939
|
var init_fetch_http_client = __esmMin((() => {
|
|
1940
1940
|
init_errors$10();
|
|
1941
|
+
({ resolveTransportRetryBudget } = createRequire(import.meta.url)("./bin/rate-limit-recovery-policy.cjs"));
|
|
1941
1942
|
DEFAULT_MAX_RETRIES$1 = 2;
|
|
1942
1943
|
MAX_RETRY_DELAY_MS = 6e4;
|
|
1943
1944
|
FetchTransport = class {
|
|
@@ -1993,7 +1994,8 @@ var init_fetch_http_client = __esmMin((() => {
|
|
|
1993
1994
|
const startedAt = performance.now();
|
|
1994
1995
|
try {
|
|
1995
1996
|
const response = await this.fetch(`${this.baseUrl}${pathname}`, init);
|
|
1996
|
-
const
|
|
1997
|
+
const retryBudget = resolveTransportRetryBudget(maxRetries, response.status, response.headers.get("x-should-retry"));
|
|
1998
|
+
const willRetry = attempt < retryBudget && shouldRetryResponse(response);
|
|
1997
1999
|
notifyTransportAttempt(requestOptions?.onTransportAttempt, {
|
|
1998
2000
|
transportAttempt: attempt + 1,
|
|
1999
2001
|
...requestBytes === void 0 ? {} : { requestBytes },
|