dsh-coding-subscription-oauth 0.5.2 → 0.5.4
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/CHANGELOG.md +20 -0
- package/INSTALL.md +11 -11
- package/README.de.md +34 -9
- package/README.es.md +35 -9
- package/README.fr.md +35 -9
- package/README.ja.md +35 -9
- package/README.ko.md +35 -9
- package/README.md +34 -13
- package/README.pt-BR.md +35 -9
- package/README.ru.md +35 -9
- package/README.zh-CN.md +34 -13
- package/docs/02-architecture.md +4 -3
- package/docs/02-architecture.zh-CN.md +8 -3
- package/lib/adapter.d.ts.map +1 -1
- package/lib/alias-adapter.d.ts.map +1 -1
- package/lib/client.js +1 -1
- package/lib/client.js.map +4 -4
- package/lib/grok-errors.d.ts +13 -0
- package/lib/grok-errors.d.ts.map +1 -0
- package/lib/index.js +13 -3
- package/lib/index.js.map +3 -3
- package/media/settings_accounts.png +0 -0
- package/media/settings_capabilities.png +0 -0
- package/media/settings_gateway.png +0 -0
- package/media/settings_overview.png +0 -0
- package/package.json +2 -1
- package/src/adapter.ts +7 -2
- package/src/alias-adapter.ts +2 -1
- package/src/client/GrokBuildSettings.tsx +247 -1772
- package/src/client/api.ts +88 -0
- package/src/client/components/AboutTab.tsx +20 -0
- package/src/client/components/AccountsTab.tsx +224 -0
- package/src/client/components/CapabilitiesTab.tsx +214 -0
- package/src/client/components/CliPullPreview.tsx +107 -0
- package/src/client/components/GatewayTab.tsx +287 -0
- package/src/client/components/ProviderCard.tsx +322 -0
- package/src/client/components/SettingsTabs.tsx +65 -0
- package/src/client/constants.ts +206 -0
- package/src/client/display.ts +61 -0
- package/src/client/locales.ts +47 -15
- package/src/client/parsers.ts +386 -0
- package/src/client/styles.ts +180 -0
- package/src/client/types.ts +185 -0
- package/src/grok-errors.ts +24 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* xAI / Grok Build error remapping.
|
|
3
|
+
* @module dsh-coding-subscription-oauth/grok-errors
|
|
4
|
+
*/
|
|
5
|
+
export declare function isXaiCapacityError(detail: string): boolean;
|
|
6
|
+
export declare function remapXaiCapacityFailure(failure: {
|
|
7
|
+
message: string;
|
|
8
|
+
code: string;
|
|
9
|
+
}): {
|
|
10
|
+
message: string;
|
|
11
|
+
code: string;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=grok-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-errors.d.ts","sourceRoot":"","sources":["../../src/grok-errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb,CAGA"}
|
package/lib/index.js
CHANGED
|
@@ -25616,6 +25616,16 @@ import { PiAiAdapter } from "@deepseek-ai/dsh-llm-pi-ai";
|
|
|
25616
25616
|
// src/alias-adapter.ts
|
|
25617
25617
|
import { LlmAdapter, LlmError } from "@deepseek-ai/dsh-llm";
|
|
25618
25618
|
|
|
25619
|
+
// src/grok-errors.ts
|
|
25620
|
+
var XAI_CAPACITY = /\b(?:at\s+capacity|high\s+demand|priority\s+processing|overloaded)\b/i;
|
|
25621
|
+
function isXaiCapacityError(detail) {
|
|
25622
|
+
return XAI_CAPACITY.test(detail);
|
|
25623
|
+
}
|
|
25624
|
+
function remapXaiCapacityFailure(failure) {
|
|
25625
|
+
if (!isXaiCapacityError(failure.message)) return failure;
|
|
25626
|
+
return { ...failure, code: "RATE_LIMIT" };
|
|
25627
|
+
}
|
|
25628
|
+
|
|
25619
25629
|
// src/kimi-errors.ts
|
|
25620
25630
|
import { CONTEXT_WINDOW_EXCEEDED_CODE, isContextWindowExceededError } from "@deepseek-ai/dsh-llm";
|
|
25621
25631
|
var KIMI_CONTEXT_CAPACITY = /\bsupports only\s+\d+\s*k\s+context\b/i;
|
|
@@ -25697,7 +25707,7 @@ var AliasLlmAdapter = class extends LlmAdapter {
|
|
|
25697
25707
|
...raw,
|
|
25698
25708
|
reason: {
|
|
25699
25709
|
...raw.reason,
|
|
25700
|
-
failure: remapAuthFailureIfContextOverflow(raw.reason.failure)
|
|
25710
|
+
failure: remapXaiCapacityFailure(remapAuthFailureIfContextOverflow(raw.reason.failure))
|
|
25701
25711
|
}
|
|
25702
25712
|
} : raw;
|
|
25703
25713
|
if (!authFailureNotified && chunk.type === "finish" && chunk.reason.kind === "error" && chunk.reason.failure.code === "AUTH") {
|
|
@@ -26632,9 +26642,9 @@ function missingCredential(name2) {
|
|
|
26632
26642
|
var MIN_OAUTH_VALIDITY_MS = 6e4;
|
|
26633
26643
|
var CODING_OAUTH_RETRY_POLICY = {
|
|
26634
26644
|
mode: "normal",
|
|
26635
|
-
maxRetries:
|
|
26645
|
+
maxRetries: 5,
|
|
26636
26646
|
retryableCodes: ["EMPTY_RESPONSE", "RATE_LIMIT", "SERVER", "TIMEOUT", "TRANSPORT", "AUTH"],
|
|
26637
|
-
backoff: { initialDelayMs:
|
|
26647
|
+
backoff: { initialDelayMs: 5e3, maxDelayMs: 8e4, jitterRatio: 0.1 }
|
|
26638
26648
|
};
|
|
26639
26649
|
function profile(provider, displayName, piProvider, retryPolicy, headers) {
|
|
26640
26650
|
return {
|