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.
Files changed (44) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/INSTALL.md +11 -11
  3. package/README.de.md +34 -9
  4. package/README.es.md +35 -9
  5. package/README.fr.md +35 -9
  6. package/README.ja.md +35 -9
  7. package/README.ko.md +35 -9
  8. package/README.md +34 -13
  9. package/README.pt-BR.md +35 -9
  10. package/README.ru.md +35 -9
  11. package/README.zh-CN.md +34 -13
  12. package/docs/02-architecture.md +4 -3
  13. package/docs/02-architecture.zh-CN.md +8 -3
  14. package/lib/adapter.d.ts.map +1 -1
  15. package/lib/alias-adapter.d.ts.map +1 -1
  16. package/lib/client.js +1 -1
  17. package/lib/client.js.map +4 -4
  18. package/lib/grok-errors.d.ts +13 -0
  19. package/lib/grok-errors.d.ts.map +1 -0
  20. package/lib/index.js +13 -3
  21. package/lib/index.js.map +3 -3
  22. package/media/settings_accounts.png +0 -0
  23. package/media/settings_capabilities.png +0 -0
  24. package/media/settings_gateway.png +0 -0
  25. package/media/settings_overview.png +0 -0
  26. package/package.json +2 -1
  27. package/src/adapter.ts +7 -2
  28. package/src/alias-adapter.ts +2 -1
  29. package/src/client/GrokBuildSettings.tsx +247 -1772
  30. package/src/client/api.ts +88 -0
  31. package/src/client/components/AboutTab.tsx +20 -0
  32. package/src/client/components/AccountsTab.tsx +224 -0
  33. package/src/client/components/CapabilitiesTab.tsx +214 -0
  34. package/src/client/components/CliPullPreview.tsx +107 -0
  35. package/src/client/components/GatewayTab.tsx +287 -0
  36. package/src/client/components/ProviderCard.tsx +322 -0
  37. package/src/client/components/SettingsTabs.tsx +65 -0
  38. package/src/client/constants.ts +206 -0
  39. package/src/client/display.ts +61 -0
  40. package/src/client/locales.ts +47 -15
  41. package/src/client/parsers.ts +386 -0
  42. package/src/client/styles.ts +180 -0
  43. package/src/client/types.ts +185 -0
  44. package/src/grok-errors.ts +24 -0
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-coding-subscription-oauth",
3
3
  "description": "DeepSeek Harness coding-subscription OAuth: SuperGrok/Grok Build, ChatGPT Plus Codex, Kimi Code, Claude Code. Fixes AUTH API key is invalid, INVALID_REPLAY_STATE, grok-4.6 xhigh, Kimi Bearer vs x-api-key.",
4
- "version": "0.5.2",
4
+ "version": "0.5.4",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/"
@@ -76,6 +76,7 @@
76
76
  "files": [
77
77
  "lib",
78
78
  "src",
79
+ "media",
79
80
  "cordis.patch.yml",
80
81
  "INSTALL.md",
81
82
  "CHANGELOG.md",
package/src/adapter.ts CHANGED
@@ -58,12 +58,17 @@ const MIN_OAUTH_VALIDITY_MS = 60_000;
58
58
  * set: retrying a billing-limit 403 cannot succeed and only delays the real
59
59
  * message. Genuine credential death is converted to MISSING_CREDENTIAL (not
60
60
  * retryable) by the resolver below, so it cannot loop either.
61
+ *
62
+ * Five stacked exponential delays (5s → 10s → 20s → 40s → 80s, ~155s total)
63
+ * pair with the xAI capacity remap in {@link AliasLlmAdapter}: "at capacity"
64
+ * finish errors become RATE_LIMIT so they enter this policy instead of failing
65
+ * as PI_AI_ERROR.
61
66
  */
62
67
  const CODING_OAUTH_RETRY_POLICY = {
63
68
  mode: "normal" as const,
64
- maxRetries: 2,
69
+ maxRetries: 5,
65
70
  retryableCodes: ["EMPTY_RESPONSE", "RATE_LIMIT", "SERVER", "TIMEOUT", "TRANSPORT", "AUTH"],
66
- backoff: { initialDelayMs: 500, maxDelayMs: 10_000, jitterRatio: 0.1 },
71
+ backoff: { initialDelayMs: 5_000, maxDelayMs: 80_000, jitterRatio: 0.1 },
67
72
  };
68
73
 
69
74
  function profile(
@@ -12,6 +12,7 @@ import type {
12
12
  StreamChunk,
13
13
  } from "@deepseek-ai/dsh-llm";
14
14
  import { LlmAdapter, LlmError } from "@deepseek-ai/dsh-llm";
15
+ import { remapXaiCapacityFailure } from "./grok-errors.ts";
15
16
  import { remapAuthFailureIfContextOverflow } from "./kimi-errors.ts";
16
17
 
17
18
  export interface AliasLlmRoutePolicy {
@@ -121,7 +122,7 @@ export class AliasLlmAdapter extends LlmAdapter {
121
122
  ...raw,
122
123
  reason: {
123
124
  ...raw.reason,
124
- failure: remapAuthFailureIfContextOverflow(raw.reason.failure),
125
+ failure: remapXaiCapacityFailure(remapAuthFailureIfContextOverflow(raw.reason.failure)),
125
126
  },
126
127
  }
127
128
  : raw;