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
package/README.ko.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # 🔐 dsh-coding-subscription-oauth
6
6
 
7
- **v0.5.2 · 이전 이름 `dsh-grok-build`
7
+ **v0.5.4 · 이전 이름 `dsh-grok-build`
8
8
 
9
9
  **[DeepSeek Harness](https://github.com/deepseek-ai/dsh)용 코딩 구독 OAuth 플러그인.** 이미 결제한 구독으로 한 번에 로그인하고, dsh 설정 페이지나 CLI에서 그 모델을 사용하세요. **채팅에 토큰을 붙여넣을 필요가 없습니다.**
10
10
 
@@ -20,11 +20,10 @@
20
20
  ## 이름 변경
21
21
 
22
22
  처음에는 Grok Build 전용 **`dsh-grok-build`** 였습니다. 지금은 SuperGrok / Codex / Kimi / Claude / Antigravity 코딩 구독 OAuth입니다.
23
-
24
23
  | | 이것을 쓰세요 | 계속 동작 |
25
24
  |---|---|---|
26
25
  | GitHub / `dsh plugin add` | [`dsh-coding-subscription-oauth`](https://github.com/lninghaha/dsh-coding-subscription-oauth) | `github:lninghaha/dsh-grok-build`(같은 `main`) |
27
- | npm | `dsh-coding-subscription-oauth@0.5.2`(현재 릴리스) | 레거시 npm 패키지는 게시된 적 없음 |
26
+ | npm | `dsh-coding-subscription-oauth@0.5.4`(현재 릴리스) | 레거시 npm 패키지는 게시된 적 없음 |
28
27
  | CLI | `dsh-coding-oauth` | `dsh-grok-build` |
29
28
  | Cordis 플러그인 id | `llm-grok-build-oauth` | 그대로 |
30
29
  | 설정 페이지 HTTP API | `/plugins/dsh-grok-build/*` | 그대로 |
@@ -36,8 +35,11 @@
36
35
  - 🔑 **로컬 OAuth, 키 붙여넣기 불필요** — 설정 페이지나 CLI에서 인증하며, 토큰이 채팅에 들어가지 않습니다.
37
36
  - 🧩 **하나의 플러그인, 다섯 프로바이더** — Grok Build, Codex, Kimi, Claude, Google Antigravity.
38
37
  - 🛡️ **안전한 설계** — 인증 파일은 소유자 전용 `0600`, 원자적 쓰기, 크로스 프로세스 파일 잠금.
39
- - ⚙️ **동적 카탈로그** — 모델 선택기에 인증을 완료한 프로바이더만 표시됩니다.
38
+ - ⚙️ **동적 카탈로그** — 선택기에는 인증을 완료한 라우트만 `(OAuth)` 라벨과 함께 표시되며, grok-4.6의 `xhigh`도 포함됩니다.
40
39
  - 🌐 **프록시 인지형** — 검증된 신뢰 가능한 구독 도메인만 프록시합니다.
40
+ - 📥 **수동 CLI Pull** — 설정 페이지가 허용 목록에 있는 공식 Grok/Codex/Kimi/Claude CLI OAuth 파일을 읽기 전용으로 검색합니다. 미리보기와 덮어쓰기 확인 후 단방향 복사본을 가져옵니다.
41
+ - 🗂️ **탭으로 나뉜 설정** — Accounts, Gateway, Capabilities, About. 원격 호스트에서는 device code를 우선하고 CLI missing 소음을 줄이며, 로그인된 카드는 펼칠 때까지 접혀 있습니다.
42
+ - 🎛️ **선택적 기능 (기본 꺼짐)** — Codex 검색, 사용량/쿼터, 이미지 생성/편집, Fast, Grok Imagine은 스위치를 켜면 즉시 적용됩니다.
41
43
  - 🔌 **옵트인 로컬 API 게이트웨이** — 기본 꺼짐의 루프백 OpenAI/Anthropic 호환 서버. 내 도구 전용이며 공개 릴레이가 아닙니다.
42
44
 
43
45
  ## 이 플러그인이 푸는 연동 문제
@@ -71,7 +73,7 @@
71
73
 
72
74
  ```bash
73
75
  # 1. web 프로필에 플러그인 설치 (현재 npm 릴리스)
74
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
76
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
75
77
 
76
78
  # 2. 선택 사항 — Google Antigravity (검증된 고정 버전)
77
79
  dsh plugin --profile web add dsh-agy@0.1.2
@@ -85,9 +87,13 @@ systemctl --user restart dsh-web.service
85
87
  ## 📚 목차
86
88
 
87
89
  - [이름 변경](#이름-변경)
90
+ - [기능](#-기능)
88
91
  - [이 플러그인이 푸는 연동 문제](#이-플러그인이-푸는-연동-문제)
92
+ - [지원 프로바이더](#지원-프로바이더)
93
+ - [빠른 시작](#-빠른-시작)
89
94
  - [설치](#설치)
90
95
  - [설정 페이지](#설정-페이지)
96
+ - [선택적 기능](#선택적-기능)
91
97
  - [로컬 API 게이트웨이](#로컬-api-게이트웨이)
92
98
  - [CLI](#cli)
93
99
  - [중국에서의 Kimi](#중국에서의-kimi)
@@ -98,6 +104,7 @@ systemctl --user restart dsh-web.service
98
104
  - [기술 메모](#기술-메모)
99
105
  - [준수](#준수)
100
106
  - [문서](#문서)
107
+ - [관련 프로젝트](#관련-프로젝트)
101
108
  - [기여](#기여)
102
109
  - [라이선스](#라이선스)
103
110
 
@@ -107,7 +114,7 @@ DeepSeek Harness `0.1.0-rc.6+` 및 Node.js 22.19+가 필요합니다. 자세한
107
114
 
108
115
  ```bash
109
116
  # 현재 npm 릴리스 (권장)
110
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
117
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
111
118
 
112
119
  # 개발/대안: GitHub에서
113
120
  dsh plugin --profile web add github:lninghaha/dsh-coding-subscription-oauth
@@ -134,6 +141,25 @@ pnpm run smoke:deployed # 실제 Codex/Kimi 도구 호출 + 두 번
134
141
 
135
142
  **Settings → Coding OAuth**를 열어 주세요:
136
143
 
144
+
145
+
146
+ <table>
147
+ <tr>
148
+ <td align="center" valign="top" width="33%">
149
+ <a href="media/settings_accounts.png"><img src="media/settings_accounts.png" alt="Coding OAuth Accounts tab" width="280" /></a><br />
150
+ <sub>Accounts</sub>
151
+ </td>
152
+ <td align="center" valign="top" width="33%">
153
+ <a href="media/settings_gateway.png"><img src="media/settings_gateway.png" alt="Coding OAuth Gateway tab" width="280" /></a><br />
154
+ <sub>Gateway</sub>
155
+ </td>
156
+ <td align="center" valign="top" width="33%">
157
+ <a href="media/settings_capabilities.png"><img src="media/settings_capabilities.png" alt="Coding OAuth Capabilities tab" width="280" /></a><br />
158
+ <sub>Capabilities</sub>
159
+ </td>
160
+ </tr>
161
+ </table>
162
+
137
163
  | 프로바이더 | 방식 |
138
164
  |---|---|
139
165
  | Grok | 인증 코드 · 디바이스 코드 · Grok CLI import · 모델 선택 |
@@ -201,16 +227,16 @@ Kimi Code 구독 OAuth는 `https://auth.kimi.com`, 추론은 `https://api.kimi.c
201
227
 
202
228
  OAuth 액세스 토큰은 저장된 만료 시각 **5분 전**에 선제적으로 갱신됩니다(pi-ai 0.84+). 업스트림이 로컬에서는 아직 유효한 토큰을 401/403으로 거절하면, 플러그인이 저장된 `expires`를 과거로 되돌리고 재시도 단계에서 먼저 갱신한 뒤 다시 요청합니다.
203
229
 
204
- 요청 재시도는 harness retry 정책을 따릅니다. 일시 오류(`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`)와 **`AUTH`**는 지수 백오프로 재시도합니다(기본 2회, 500 ms → 10 s, 10% jitter). 쿼터 소진과 죽은 refresh token은 재시도하지 않습니다. 배포별 재정의:
230
+ 요청 재시도는 harness retry 정책을 따릅니다. 일시 오류(`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`)와 **`AUTH`**는 지수 백오프로 재시도합니다(기본 5회, 5 s → 10 s → 20 s → 40 s → 80 s (~155 s 누적), 10% jitter). 쿼터 소진과 죽은 refresh token은 재시도하지 않습니다. 배포별 재정의:
205
231
 
206
232
  ```yaml
207
233
  - id: llm-grok-build-oauth
208
234
  config:
209
235
  retryPolicy:
210
236
  mode: normal
211
- maxRetries: 2
237
+ maxRetries: 5
212
238
  retryableCodes: [EMPTY_RESPONSE, RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, AUTH]
213
- backoff: { initialDelayMs: 500, maxDelayMs: 10000, jitterRatio: 0.1 }
239
+ backoff: { initialDelayMs: 5000, maxDelayMs: 80000, jitterRatio: 0.1 }
214
240
  ```
215
241
 
216
242
  ## 자격 증명
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # 🔐 dsh-coding-subscription-oauth
6
6
 
7
- **v0.5.2** · formerly `dsh-grok-build`
7
+ **v0.5.4** · formerly `dsh-grok-build`
8
8
 
9
9
  **Coding-subscription OAuth for [DeepSeek Harness](https://github.com/deepseek-ai/dsh).** Use SuperGrok / X Premium (Grok Build), ChatGPT Plus/Pro (Codex), Kimi Code, Claude Pro/Max and Google Antigravity inside DSH — without a second API-key bill and **without pasting any token into chat.**
10
10
 
@@ -23,8 +23,8 @@ Published first as **`dsh-grok-build`** when it only covered Grok Build. The cur
23
23
 
24
24
  | | Use this | Still works |
25
25
  |---|---|---|
26
- | npm (recommended) | Current release is `0.5.2`: `dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2` | No legacy npm package was published |
27
- | GitHub / development | [`dsh-coding-subscription-oauth`](https://github.com/lninghaha/dsh-coding-subscription-oauth) | `github:lninghaha/dsh-grok-build` (same `main`) |
26
+ | npm (recommended) | Current release is `0.5.4`: `dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4` | No legacy npm package was published |
27
+ | GitHub / development | [`dsh-coding-subscription-oauth`](https://github.com/lninghaha/dsh-coding-subscription-oauth) | Previous GitHub repo `dsh-grok-build` was removed |
28
28
  | CLI | `dsh-coding-oauth` | `dsh-grok-build` |
29
29
  | Cordis plugin id | `llm-grok-build-oauth` | unchanged |
30
30
  | Settings HTTP API | `/plugins/dsh-grok-build/*` | unchanged |
@@ -32,14 +32,14 @@ Published first as **`dsh-grok-build`** when it only covered Grok Build. The cur
32
32
 
33
33
  ## ✨ Features
34
34
 
35
- - 🧾 **Bring your own subscription** — SuperGrok, ChatGPT Plus/Pro, Kimi Code, Claude Pro/Max; no extra pay-as-you-go key.
35
+ - 🧽 **Bring your own subscription** — SuperGrok, ChatGPT Plus/Pro, Kimi Code, Claude Pro/Max; no extra pay-as-you-go key.
36
36
  - 🔑 **Local OAuth, no key-pasting** — authorize in Settings or CLI; access/refresh tokens never enter chat, logs or HTTP status.
37
37
  - 🧩 **One plugin, five providers** — Grok Build (`cli-chat-proxy.grok.com`), Codex, Kimi Code, Claude Code and Google Antigravity.
38
38
  - 🛡️ **Secure by design** — credential files are owner-only `0600`, atomically written, cross-process locked.
39
39
  - ⚙️ **Dynamic catalog** — the selector lists only signed-in routes, labelled `(OAuth)`, including grok-4.6 `xhigh`.
40
40
  - 🌐 **Proxy-aware** — proxies only reviewed subscription domains; Kimi China stays direct by default.
41
41
  - 📥 **Manual CLI Pull** — Settings discovers allowlisted official Grok/Codex/Kimi/Claude CLI OAuth files read-only; you pull a one-way copy after preview and overwrite confirmation.
42
- - 🗂️ **Tabbed Settings** — Accounts, Gateway, Capabilities, and About replace the long waterfall; signed-in provider cards stay collapsed until you expand them.
42
+ - 🗂️ **Tabbed Settings** — Accounts, Gateway, Capabilities, and About; remote hosts prefer device-code sign-in with quieter CLI-missing tips; signed-in cards stay collapsed until expanded.
43
43
  - 🎛️ **Optional capabilities, default off** — Codex search, usage/quota, image generate/edit, Fast, and Grok Imagine apply live when you turn them on.
44
44
  - 🔌 **Opt-in local API gateway** — default-off loopback OpenAI/Anthropic-compatible server for your own tools, with copyable base URLs and Bearer key; never a public relay.
45
45
 
@@ -77,7 +77,7 @@ Grok Build device login, live `/v1/models-v2` and Responses streaming are verifi
77
77
 
78
78
  ```bash
79
79
  # 1. install the current npm release into the web profile
80
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
80
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
81
81
 
82
82
  # 2. optional — Google Antigravity (pinned, reviewed version)
83
83
  dsh plugin --profile web add dsh-agy@0.1.2
@@ -91,7 +91,10 @@ Then open **Settings → Coding OAuth** and sign in to any provider. Done — pi
91
91
  ## 📚 Table of contents
92
92
 
93
93
  - [Name change](#name-change)
94
+ - [Features](#-features)
94
95
  - [Problems this plugin solves](#problems-this-plugin-solves)
96
+ - [Supported providers](#supported-providers)
97
+ - [Quick start](#-quick-start)
95
98
  - [Install](#install)
96
99
  - [Settings page](#settings-page)
97
100
  - [Optional capabilities](#optional-capabilities)
@@ -105,6 +108,7 @@ Then open **Settings → Coding OAuth** and sign in to any provider. Done — pi
105
108
  - [Technical notes](#technical-notes)
106
109
  - [Compliance](#compliance)
107
110
  - [Documentation](#documentation)
111
+ - [Related](#related)
108
112
  - [Contributing](#contributing)
109
113
  - [License](#license)
110
114
 
@@ -114,7 +118,7 @@ Requires DeepSeek Harness `0.1.0-rc.6+` and Node.js 22.19+. Full details in the
114
118
 
115
119
  ```bash
116
120
  # current npm release
117
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
121
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
118
122
 
119
123
  # development / alternative: from GitHub
120
124
  dsh plugin --profile web add github:lninghaha/dsh-coding-subscription-oauth
@@ -123,7 +127,7 @@ dsh plugin --profile web add github:lninghaha/dsh-coding-subscription-oauth
123
127
  # dsh plugin --profile web add ./dsh-coding-subscription-oauth
124
128
  ```
125
129
 
126
- Restart `dsh web` after installing. Verification against a live deployment:
130
+ Restart `dsh web` after installing. Maintainers can verify a live deployment from a source checkout (npm installs do not include these scripts):
127
131
 
128
132
  ```bash
129
133
  pnpm run verify:deployed # checks real /api/llm.models + OAuth state
@@ -139,7 +143,24 @@ pnpm run smoke:deployed # real Codex/Kimi tool-calls + second-turn r
139
143
 
140
144
  ## Settings page
141
145
 
142
- Open **Settings → Coding OAuth**. The page is organized into four top tabs — **Accounts**, **Gateway**, **Capabilities**, and **About** — so it no longer requires a long waterfall scroll. Signed-in provider cards collapse to a compact summary; expand one to edit models or use its CLI Pull controls. CLI previews span the full content width, and the Capabilities tab shows live optional switches plus Imagine status.
146
+ Open **Settings → Coding OAuth**. The page is organized into four top tabs — **Accounts**, **Gateway**, **Capabilities**, and **About** — so it no longer requires a long waterfall scroll. On a remote (non-loopback) host, Accounts prefers device-code sign-in and collapses noisy CLI-missing hints into one tip. Signed-in provider cards collapse to a compact summary; expand one to edit models or use its CLI Pull controls. CLI previews span the full content width, and the Capabilities tab shows live optional switches plus Imagine status.
147
+
148
+ <table>
149
+ <tr>
150
+ <td align="center" valign="top" width="33%">
151
+ <a href="media/settings_accounts.png"><img src="media/settings_accounts.png" alt="Coding OAuth Accounts tab" width="280" /></a><br />
152
+ <sub>Accounts</sub>
153
+ </td>
154
+ <td align="center" valign="top" width="33%">
155
+ <a href="media/settings_gateway.png"><img src="media/settings_gateway.png" alt="Coding OAuth Gateway tab" width="280" /></a><br />
156
+ <sub>Gateway</sub>
157
+ </td>
158
+ <td align="center" valign="top" width="33%">
159
+ <a href="media/settings_capabilities.png"><img src="media/settings_capabilities.png" alt="Coding OAuth Capabilities tab" width="280" /></a><br />
160
+ <sub>Capabilities</sub>
161
+ </td>
162
+ </tr>
163
+ </table>
143
164
 
144
165
  | Provider | Methods |
145
166
  |---|---|
@@ -178,7 +199,7 @@ gateway:
178
199
 
179
200
  Endpoints: `GET /healthz`, `GET /v1/models`, `POST /v1/chat/completions`, `POST /v1/responses`, `POST /v1/messages`. A Bearer key is stored at `$DSH_HOME/.coding-oauth-gateway.json` (`0600`).
180
201
 
181
- On the **Gateway** tab, copy the OpenAI base URL (for example, `http://127.0.0.1:18080/v1`), the Anthropic base URL, or the current Bearer key without rotating it. Key rotation requires confirmation. Edit the listen port with **Apply** or fill it with **Random** (`18100`–`18999`); the selected port is persisted in the owner-only gateway document, and a running listener rebinds to it. Bind remains YAML-only; a non-loopback bind requires a key. This is not a remote relay.
202
+ On the **Gateway** tab, copy the OpenAI base URL (for example, `http://127.0.0.1:18080/v1`), the Anthropic base URL, or the current Bearer key without rotating it. Key reveal is loopback-only and is never persisted to browser storage. Key rotation requires confirmation. Edit the listen port with **Apply** or fill it with **Random** (`18100`–`18999`); the selected port is persisted in the owner-only gateway document, and a running listener rebinds to it. Bind remains YAML-only; a non-loopback bind requires a key. This is not a remote relay.
182
203
 
183
204
  ## CLI
184
205
 
@@ -218,16 +239,16 @@ Only reviewed subscription domains are proxied (xAI/Grok, OpenAI Codex, Claude/A
218
239
 
219
240
  OAuth access tokens refresh proactively **five minutes** before their stored expiry (pi-ai 0.84+), so a request never rides a token into its final seconds. If an upstream still rejects a locally-valid token with 401/403 — server-side revocation or clock skew — the plugin backdates the stored credential and the retried step refreshes before reuse, recovering transparently instead of failing the turn.
220
241
 
221
- Request retries use the harness retry policy: transient failures (`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`) **and `AUTH`** retry with exponential backoff (default 2 retries, 500 ms → 10 s, 10% jitter). Quota exhaustion and a dead refresh token are **not** retried — they fail fast with the real message and a sign-in prompt. Override per deployment:
242
+ Request retries use the harness retry policy: transient failures (`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`) **and `AUTH`** retry with exponential backoff (default 5 retries, 5 s → 10 s → 20 s → 40 s → 80 s, ~155 s stacked, 10% jitter). xAI “at capacity / high demand / priority processing” finish messages are remapped to `RATE_LIMIT` so they enter this policy (pi-ai would otherwise label them `PI_AI_ERROR` when upstream `error.code` is null). Quota exhaustion and a dead refresh token are **not** retried — they fail fast with the real message and a sign-in prompt. Override per deployment:
222
243
 
223
244
  ```yaml
224
245
  - id: llm-grok-build-oauth
225
246
  config:
226
247
  retryPolicy:
227
248
  mode: normal
228
- maxRetries: 2
249
+ maxRetries: 5
229
250
  retryableCodes: [EMPTY_RESPONSE, RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, AUTH]
230
- backoff: { initialDelayMs: 500, maxDelayMs: 10000, jitterRatio: 0.1 }
251
+ backoff: { initialDelayMs: 5000, maxDelayMs: 80000, jitterRatio: 0.1 }
231
252
  ```
232
253
 
233
254
  ## Credentials
package/README.pt-BR.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # 🔐 dsh-coding-subscription-oauth
6
6
 
7
- **v0.5.2 · antigo `dsh-grok-build`
7
+ **v0.5.4 · antigo `dsh-grok-build`
8
8
 
9
9
  **Plugin de OAuth para assinaturas de codificação do [DeepSeek Harness](https://github.com/deepseek-ai/dsh).** Entre com as assinaturas que você já paga — depois use os modelos delas a partir da página de configurações do dsh ou da CLI. **Nenhum token colado no chat.**
10
10
 
@@ -24,7 +24,7 @@ O projeto começou como **`dsh-grok-build`** (só Grok Build). Agora cobre Super
24
24
  | | Use isto | Ainda funciona |
25
25
  |---|---|---|
26
26
  | GitHub / `dsh plugin add` | [`dsh-coding-subscription-oauth`](https://github.com/lninghaha/dsh-coding-subscription-oauth) | `github:lninghaha/dsh-grok-build` (mesmo `main`) |
27
- | npm | `dsh-coding-subscription-oauth@0.5.2` (versão atual) | Nenhum pacote npm legado foi publicado |
27
+ | npm | `dsh-coding-subscription-oauth@0.5.4` (versão atual) | Nenhum pacote npm legado foi publicado |
28
28
  | CLI | `dsh-coding-oauth` | `dsh-grok-build` |
29
29
  | Cordis plugin id | `llm-grok-build-oauth` | inalterado |
30
30
  | API HTTP das configurações | `/plugins/dsh-grok-build/*` | inalterado |
@@ -36,14 +36,16 @@ O projeto começou como **`dsh-grok-build`** (só Grok Build). Agora cobre Super
36
36
  - 🔑 **OAuth local, sem colar chave** — autorize na página de configurações ou na CLI; os tokens nunca entram no chat.
37
37
  - 🧩 **Um plugin, cinco provedores** — Grok Build, Codex, Kimi, Claude e Google Antigravity.
38
38
  - 🛡️ **Seguro por design** — arquivos de credenciais com permissão somente-dono `0600`, escrita atômica, bloqueio de arquivo entre processos.
39
- - ⚙️ **Catálogo dinâmico** — o seletor de modelos lista exatamente os provedores que você autenticou.
39
+ - ⚙️ **Catálogo dinâmico** — o seletor lista apenas rotas autenticadas, rotuladas com `(OAuth)`, incluindo o `xhigh` do grok-4.6.
40
40
  - 🌐 **Ciente de proxy** — faz proxy apenas de domínios de assinatura revisados e confiáveis.
41
+ - 📥 **CLI Pull manual** — as configurações descobrem os arquivos OAuth oficiais dos CLIs Grok/Codex/Kimi/Claude permitidos, somente leitura; você puxa uma cópia de via única após pré-visualização e confirmação de sobrescrita.
42
+ - 🗂️ **Configurações em abas** — Accounts, Gateway, Capabilities e About; hosts remotos preferem device code com menos ruído de CLI missing; cartões conectados ficam recolhidos até serem expandidos.
43
+ - 🎛️ **Capacidades opcionais, padrão desligado** — busca do Codex, uso/cota, geração/edição de imagens, Fast e Grok Imagine são aplicadas ao vivo quando ativadas.
41
44
  - 🔌 **Gateway de API local opt-in** — servidor loopback compatível com OpenAI/Anthropic, desligado por padrão; para as suas próprias ferramentas, nunca um relé público.
42
45
 
43
46
  ## Problemas de integração que este plugin resolve
44
47
 
45
48
  Estas são as buscas e erros do DSH que costumam trazer as pessoas até aqui.
46
-
47
49
  | Você buscou / viu | O que estava quebrado | O que o plugin faz |
48
50
  |---|---|---|
49
51
  | SuperGrok / X Premium no DSH, Grok Build vs `api.x.ai` | A rota `xai` é a API paga por uso. A assinatura de coding vai a `cli-chat-proxy.grok.com` | Rota `grok-build` + cabeçalhos de fingerprint da CLI (`X-XAI-Token-Auth` etc.) para evitar 403 silencioso |
@@ -71,7 +73,7 @@ Estas são as buscas e erros do DSH que costumam trazer as pessoas até aqui.
71
73
 
72
74
  ```bash
73
75
  # 1. instale o plugin no perfil web (versão atual do npm)
74
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
76
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
75
77
 
76
78
  # 2. opcional — Google Antigravity (versão fixa revisada)
77
79
  dsh plugin --profile web add dsh-agy@0.1.2
@@ -85,9 +87,13 @@ Depois abra **Settings → Coding OAuth** e faça login em qualquer provedor. Pr
85
87
  ## 📚 Sumário
86
88
 
87
89
  - [Mudança de nome](#mudança-de-nome)
90
+ - [Recursos](#-recursos)
88
91
  - [Problemas de integração que este plugin resolve](#problemas-de-integração-que-este-plugin-resolve)
92
+ - [Provedores suportados](#provedores-suportados)
93
+ - [Início rápido](#-início-rápido)
89
94
  - [Instalação](#instalação)
90
95
  - [Página de configurações](#página-de-configurações)
96
+ - [Capacidades opcionais](#capacidades-opcionais)
91
97
  - [Gateway de API local](#gateway-de-api-local)
92
98
  - [CLI](#cli)
93
99
  - [Kimi na China](#kimi-na-china)
@@ -98,6 +104,7 @@ Depois abra **Settings → Coding OAuth** e faça login em qualquer provedor. Pr
98
104
  - [Notas técnicas](#notas-técnicas)
99
105
  - [Conformidade](#conformidade)
100
106
  - [Documentação](#documentação)
107
+ - [Relacionados](#relacionados)
101
108
  - [Contribuição](#contribuição)
102
109
  - [Licença](#licença)
103
110
 
@@ -107,7 +114,7 @@ Requer DeepSeek Harness `0.1.0-rc.6+` e Node.js 22.19+. Detalhes completos nas [
107
114
 
108
115
  ```bash
109
116
  # versão atual do npm (recomendado)
110
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
117
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
111
118
 
112
119
  # desenvolvimento/alternativo: do GitHub
113
120
  dsh plugin --profile web add github:lninghaha/dsh-coding-subscription-oauth
@@ -134,6 +141,25 @@ pnpm run smoke:deployed # chamadas reais Codex/Kimi + replay do segu
134
141
 
135
142
  Abra **Settings → Coding OAuth**:
136
143
 
144
+
145
+
146
+ <table>
147
+ <tr>
148
+ <td align="center" valign="top" width="33%">
149
+ <a href="media/settings_accounts.png"><img src="media/settings_accounts.png" alt="Coding OAuth Accounts tab" width="280" /></a><br />
150
+ <sub>Accounts</sub>
151
+ </td>
152
+ <td align="center" valign="top" width="33%">
153
+ <a href="media/settings_gateway.png"><img src="media/settings_gateway.png" alt="Coding OAuth Gateway tab" width="280" /></a><br />
154
+ <sub>Gateway</sub>
155
+ </td>
156
+ <td align="center" valign="top" width="33%">
157
+ <a href="media/settings_capabilities.png"><img src="media/settings_capabilities.png" alt="Coding OAuth Capabilities tab" width="280" /></a><br />
158
+ <sub>Capabilities</sub>
159
+ </td>
160
+ </tr>
161
+ </table>
162
+
137
163
  | Provedor | Métodos |
138
164
  |---|---|
139
165
  | Grok | código de autorização · código de dispositivo · importação via CLI Grok · seleção de modelos |
@@ -201,16 +227,16 @@ Apenas domínios de assinatura revisados são usados via proxy (xAI/Grok, OpenAI
201
227
 
202
228
  Os tokens de acesso OAuth são renovados **cinco minutos** antes do vencimento armazenado (pi-ai 0.84+). Se o upstream ainda rejeitar um token localmente válido com 401/403, o plugin retrocede o `expires` gravado e o step repetido renova o token antes de reenviar.
203
229
 
204
- As novas tentativas seguem a política do harness: falhas transitórias (`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`) **e `AUTH`** repetem com backoff exponencial (padrão: 2 tentativas, 500 ms → 10 s, 10% de jitter). Esgotamento de cota e refresh token morto **não** são repetidos. Sobrescrita por implantação:
230
+ As novas tentativas seguem a política do harness: falhas transitórias (`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`) **e `AUTH`** repetem com backoff exponencial (padrão: 5 tentativas, 5 s → 10 s → 20 s → 40 s → 80 s (~155 s acumulados), 10% de jitter). Esgotamento de cota e refresh token morto **não** são repetidos. Sobrescrita por implantação:
205
231
 
206
232
  ```yaml
207
233
  - id: llm-grok-build-oauth
208
234
  config:
209
235
  retryPolicy:
210
236
  mode: normal
211
- maxRetries: 2
237
+ maxRetries: 5
212
238
  retryableCodes: [EMPTY_RESPONSE, RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, AUTH]
213
- backoff: { initialDelayMs: 500, maxDelayMs: 10000, jitterRatio: 0.1 }
239
+ backoff: { initialDelayMs: 5000, maxDelayMs: 80000, jitterRatio: 0.1 }
214
240
  ```
215
241
 
216
242
  ## Credenciais
package/README.ru.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # 🔐 dsh-coding-subscription-oauth
6
6
 
7
- **v0.5.2 · ранее `dsh-grok-build`
7
+ **v0.5.4 · ранее `dsh-grok-build`
8
8
 
9
9
  **Плагин OAuth для подписок на кодинг для [DeepSeek Harness](https://github.com/deepseek-ai/dsh).** Войдите один раз по уже оплаченным подпискам — и используйте их модели из страницы настроек или CLI dsh. **Никаких вставленных токенов в чат.**
10
10
 
@@ -24,7 +24,7 @@
24
24
  | | Используйте | По-прежнему работает |
25
25
  |---|---|---|
26
26
  | GitHub / `dsh plugin add` | [`dsh-coding-subscription-oauth`](https://github.com/lninghaha/dsh-coding-subscription-oauth) | `github:lninghaha/dsh-grok-build` (тот же `main`) |
27
- | npm | `dsh-coding-subscription-oauth@0.5.2` (текущая версия) | Старого npm-пакета не было |
27
+ | npm | `dsh-coding-subscription-oauth@0.5.4` (текущая версия) | Старого npm-пакета не было |
28
28
  | CLI | `dsh-coding-oauth` | `dsh-grok-build` |
29
29
  | Cordis plugin id | `llm-grok-build-oauth` | без изменений |
30
30
  | HTTP API страницы настроек | `/plugins/dsh-grok-build/*` | без изменений |
@@ -36,14 +36,16 @@
36
36
  - 🔑 **Локальный OAuth, без вставки ключа** — авторизация в странице настроек или CLI; токены никогда не попадают в чат.
37
37
  - 🧩 **Один плагин, пять провайдеров** — Grok Build, Codex, Kimi, Claude и Google Antigravity.
38
38
  - 🛡️ **Безопасность по замыслу** — файлы учётных данных только-владелец `0600`, атомарная запись, межпроцессная блокировка файла.
39
- - ⚙️ **Динамический каталог** — селектор моделей показывает ровно те провайдеры, которые вы авторизовали.
39
+ - ⚙️ **Динамический каталог** — селектор показывает только авторизованные маршруты с пометкой `(OAuth)`, включая `xhigh` для grok-4.6.
40
40
  - 🌐 **С учётом прокси** — проксируется только проверенные доверенные домены подписок.
41
+ - 📥 **Ручной CLI Pull** — настройки обнаруживают разрешённые официальные OAuth-файлы CLI Grok/Codex/Kimi/Claude только для чтения; вы забираете одностороннюю копию после предпросмотра и подтверждения перезаписи.
42
+ - 🗂️ **Настройки во вкладках** — Accounts, Gateway, Capabilities и About; на удалённых хостах предпочтителен device code и меньше шума CLI missing; вошедшие карточки свёрнуты, пока их не развернёшь.
43
+ - 🎛️ **Опциональные возможности, по умолчанию выключены** — поиск Codex, использование/квота, генерация/редактирование изображений, Fast и Grok Imagine применяются сразу при включении.
41
44
  - 🔌 **Локальный API-шлюз по opt-in** — по умолчанию выключенный loopback-сервер, совместимый с OpenAI/Anthropic; для ваших собственных инструментов, а не публичный relay.
42
45
 
43
46
  ## Какие проблемы подключения закрывает этот плагин
44
47
 
45
48
  Обычно сюда приходят по этим поисковым запросам и ошибкам DSH.
46
-
47
49
  | Искали / увидели | Что на самом деле сломано | Что делает плагин |
48
50
  |---|---|---|
49
51
  | SuperGrok / X Premium в DSH, Grok Build vs `api.x.ai` | Встроенный маршрут `xai` — это pay-as-you-go API. Подписка ходит на `cli-chat-proxy.grok.com` | Маршрут `grok-build` + отпечаток CLI (`X-XAI-Token-Auth` и др.), чтобы не ловить тихий 403 |
@@ -71,7 +73,7 @@
71
73
 
72
74
  ```bash
73
75
  # 1. установите текущую npm-версию в web-профиль
74
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
76
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
75
77
 
76
78
  # 2. опционально — Google Antigravity (зафиксированная проверенная версия)
77
79
  dsh plugin --profile web add dsh-agy@0.1.2
@@ -85,9 +87,13 @@ systemctl --user restart dsh-web.service
85
87
  ## 📚 Содержание
86
88
 
87
89
  - [Смена имени](#смена-имени)
90
+ - [Возможности](#-возможности)
88
91
  - [Какие проблемы подключения закрывает этот плагин](#какие-проблемы-подключения-закрывает-этот-плагин)
92
+ - [Поддерживаемые провайдеры](#поддерживаемые-провайдеры)
93
+ - [Быстрый старт](#-быстрый-старт)
89
94
  - [Установка](#установка)
90
95
  - [Страница настроек](#страница-настроек)
96
+ - [Дополнительные возможности](#дополнительные-возможности)
91
97
  - [Локальный API-шлюз](#локальный-api-шлюз)
92
98
  - [CLI](#cli)
93
99
  - [Kimi в Китае](#kimi-в-китае)
@@ -98,6 +104,7 @@ systemctl --user restart dsh-web.service
98
104
  - [Технические заметки](#технические-заметки)
99
105
  - [Соответствие](#соответствие)
100
106
  - [Документация](#документация)
107
+ - [Связанное](#связанное)
101
108
  - [Участие](#участие)
102
109
  - [Лицензия](#лицензия)
103
110
 
@@ -107,7 +114,7 @@ systemctl --user restart dsh-web.service
107
114
 
108
115
  ```bash
109
116
  # текущая npm-версия (рекомендуется)
110
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
117
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
111
118
 
112
119
  # разработка/альтернатива: из GitHub
113
120
  dsh plugin --profile web add github:lninghaha/dsh-coding-subscription-oauth
@@ -134,6 +141,25 @@ pnpm run smoke:deployed # реальные вызовы Codex/Kimi +
134
141
 
135
142
  Откройте **Settings → Coding OAuth**:
136
143
 
144
+
145
+
146
+ <table>
147
+ <tr>
148
+ <td align="center" valign="top" width="33%">
149
+ <a href="media/settings_accounts.png"><img src="media/settings_accounts.png" alt="Coding OAuth Accounts tab" width="280" /></a><br />
150
+ <sub>Accounts</sub>
151
+ </td>
152
+ <td align="center" valign="top" width="33%">
153
+ <a href="media/settings_gateway.png"><img src="media/settings_gateway.png" alt="Coding OAuth Gateway tab" width="280" /></a><br />
154
+ <sub>Gateway</sub>
155
+ </td>
156
+ <td align="center" valign="top" width="33%">
157
+ <a href="media/settings_capabilities.png"><img src="media/settings_capabilities.png" alt="Coding OAuth Capabilities tab" width="280" /></a><br />
158
+ <sub>Capabilities</sub>
159
+ </td>
160
+ </tr>
161
+ </table>
162
+
137
163
  | Провайдер | Методы |
138
164
  |---|---|
139
165
  | Grok | код авторизации · код устройства · импорт CLI Grok · выбор моделей |
@@ -201,16 +227,16 @@ OAuth подписки Kimi Code использует `https://auth.kimi.com`;
201
227
 
202
228
  OAuth access token обновляется **за пять минут** до сохранённого срока (pi-ai 0.84+). Если апстрим всё же отклоняет локально ещё живой токен кодом 401/403, плагин сдвигает сохранённый `expires` в прошлое, и повторный шаг сначала обновляет токен, затем повторяет запрос.
203
229
 
204
- Повторы идут по политике harness: временные сбои (`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`) **и `AUTH`** повторяются с экспоненциальной задержкой (2 попытки, 500 мс → 10 с, 10% jitter). Исчерпание квоты и мёртвый refresh token **не** повторяются. Переопределение для развёртывания:
230
+ Повторы идут по политике harness: временные сбои (`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`) **и `AUTH`** повторяются с экспоненциальной задержкой (5 попыток, 5 с → 10 с → 20 с → 40 с → 80 с (~155 с суммарно), 10% jitter). Исчерпание квоты и мёртвый refresh token **не** повторяются. Переопределение для развёртывания:
205
231
 
206
232
  ```yaml
207
233
  - id: llm-grok-build-oauth
208
234
  config:
209
235
  retryPolicy:
210
236
  mode: normal
211
- maxRetries: 2
237
+ maxRetries: 5
212
238
  retryableCodes: [EMPTY_RESPONSE, RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, AUTH]
213
- backoff: { initialDelayMs: 500, maxDelayMs: 10000, jitterRatio: 0.1 }
239
+ backoff: { initialDelayMs: 5000, maxDelayMs: 80000, jitterRatio: 0.1 }
214
240
  ```
215
241
 
216
242
  ## Учётные данные
package/README.zh-CN.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # 🔐 dsh-coding-subscription-oauth
6
6
 
7
- **v0.5.2** · 原名 `dsh-grok-build`
7
+ **v0.5.4** · 原名 `dsh-grok-build`
8
8
 
9
9
  **面向 [DeepSeek Harness](https://github.com/deepseek-ai/dsh) 的编码订阅 OAuth 插件。** 把 SuperGrok / X Premium(Grok Build)、ChatGPT Plus/Pro(Codex)、Kimi Code、Claude Pro/Max 和 Google Antigravity 接到 DSH——不必再开一份按量 API-key,**也不要把 token 粘贴进聊天。**
10
10
 
@@ -23,8 +23,8 @@
23
23
 
24
24
  | | 请用这个 | 仍然可用 |
25
25
  |---|---|---|
26
- | npm(推荐) | 当前版本是 `0.5.2`:`dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2` | 没有发布过旧 npm 包 |
27
- | GitHub / 开发安装 | [`dsh-coding-subscription-oauth`](https://github.com/lninghaha/dsh-coding-subscription-oauth) | `github:lninghaha/dsh-grok-build`(同一条 `main`) |
26
+ | npm(推荐) | 当前版本是 `0.5.4`:`dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4` | 没有发布过旧 npm 包 |
27
+ | GitHub / 开发安装 | [`dsh-coding-subscription-oauth`](https://github.com/lninghaha/dsh-coding-subscription-oauth) | 旧仓库 `dsh-grok-build` 已删除 |
28
28
  | CLI | `dsh-coding-oauth` | `dsh-grok-build` |
29
29
  | Cordis 插件 id | `llm-grok-build-oauth` | 不变 |
30
30
  | 设置页 HTTP API | `/plugins/dsh-grok-build/*` | 不变 |
@@ -32,14 +32,14 @@
32
32
 
33
33
  ## ✨ 特性
34
34
 
35
- - 🧾 **自带订阅** —— SuperGrok、ChatGPT Plus/Pro、Kimi Code、Claude Pro/Max,不必另开按量 API-key。
35
+ - 🧳 **自带订阅** —— SuperGrok、ChatGPT Plus/Pro、Kimi Code、Claude Pro/Max,不必另开按量 API-key。
36
36
  - 🔑 **本地 OAuth,不用贴 key** —— 在设置页或 CLI 完成授权;access/refresh token 不进聊天、日志和 HTTP 状态。
37
37
  - 🧩 **一个插件,五大供应商** —— Grok Build(`cli-chat-proxy.grok.com`)、Codex、Kimi Code、Claude Code 与 Google Antigravity。
38
38
  - 🛡️ **安全设计** —— 凭据文件均为 owner-only `0600`、原子写、跨进程文件锁。
39
39
  - ⚙️ **动态目录** —— 选择器只列出已登录路由并标注 `(OAuth)`,含 grok-4.6 的 `xhigh`。
40
40
  - 🌐 **代理感知** —— 只代理审核过的订阅域名;Kimi 中国流量默认直连。
41
41
  - 📥 **手动 CLI 拉取** —— 设置页只读发现白名单内的官方 Grok/Codex/Kimi/Claude CLI OAuth 文件;预览并确认覆盖后,单向拉取一份副本。
42
- - 🗂️ **分栏设置页** —— Accounts、Gateway、Capabilities、About 四个顶部标签替代漫长瀑布流;已登录供应商卡片默认收起,展开后再编辑。
42
+ - 🗂️ **分栏设置页** —— Accounts、Gateway、Capabilities、About;远程主机优先设备码登录并弱化 CLI 缺失提示;已登录供应商卡片默认收起,展开后再编辑。
43
43
  - 🎛️ **可选能力默认关闭** —— Codex 搜索、用量/配额、图像生成/编辑、Fast、Grok Imagine 打开后立即生效。
44
44
  - 🔌 **可选本地 API 网关** —— 默认关闭的 loopback OpenAI/Anthropic 兼容服务,支持复制 base URL 和 Bearer key,只给你自己的工具用,不是公网中继。
45
45
 
@@ -75,7 +75,7 @@
75
75
 
76
76
  ```bash
77
77
  # 1. 安装当前 npm 发布版到 web profile
78
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
78
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
79
79
 
80
80
  # 2. 可选 —— Google Antigravity(固定审核过的版本)
81
81
  dsh plugin --profile web add dsh-agy@0.1.2
@@ -89,7 +89,10 @@ systemctl --user restart dsh-web.service
89
89
  ## 📚 目录
90
90
 
91
91
  - [项目更名](#项目更名)
92
+ - [特性](#-特性)
92
93
  - [本插件解决的接入问题](#本插件解决的接入问题)
94
+ - [支持的供应商](#支持的供应商)
95
+ - [快速开始](#-快速开始)
93
96
  - [安装](#安装)
94
97
  - [设置页](#设置页)
95
98
  - [可选能力](#可选能力)
@@ -103,6 +106,7 @@ systemctl --user restart dsh-web.service
103
106
  - [技术方案](#技术方案)
104
107
  - [合规](#合规)
105
108
  - [文档](#文档)
109
+ - [相关项目](#相关项目)
106
110
  - [贡献](#贡献)
107
111
  - [许可证](#许可证)
108
112
 
@@ -112,7 +116,7 @@ systemctl --user restart dsh-web.service
112
116
 
113
117
  ```bash
114
118
  # 当前 npm 版本
115
- dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.2
119
+ dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.4
116
120
 
117
121
  # 开发 / 备用:从 GitHub 安装
118
122
  dsh plugin --profile web add github:lninghaha/dsh-coding-subscription-oauth
@@ -121,7 +125,7 @@ dsh plugin --profile web add github:lninghaha/dsh-coding-subscription-oauth
121
125
  # dsh plugin --profile web add ./dsh-coding-subscription-oauth
122
126
  ```
123
127
 
124
- 安装后重启 `dsh web`。对实际部署的验证:
128
+ 安装后重启 `dsh web`。维护者可在源码 checkout 中对实际部署做验证(npm 安装不包含这些脚本):
125
129
 
126
130
  ```bash
127
131
  pnpm run verify:deployed # 核对真实 /api/llm.models 与 OAuth 状态
@@ -137,7 +141,24 @@ pnpm run smoke:deployed # 真实 Codex/Kimi tool-call + 第二个用
137
141
 
138
142
  ## 设置页
139
143
 
140
- 打开 **设置 → 编码 OAuth**。页面拆成四个顶部标签:**Accounts**、**Gateway**、**Capabilities**、**About**,不再需要长距离滚动。已登录供应商卡片默认折叠,展开后可编辑模型或使用卡片内的 CLI 拉取;CLI 预览占满内容宽度,Capabilities 标签还会显示实时可选开关和 Imagine 状态。
144
+ 打开 **设置 → 编码 OAuth**。页面拆成四个顶部标签:**Accounts**、**Gateway**、**Capabilities**、**About**,不再需要长距离滚动。远程(非 loopback)主机上,Accounts 会优先设备码登录,并把嘈杂的 CLI 缺失提示收成一条;已登录供应商卡片默认折叠,展开后可编辑模型或使用卡片内的 CLI 拉取;CLI 预览占满内容宽度,Capabilities 标签还会显示实时可选开关和 Imagine 状态。
145
+
146
+ <table>
147
+ <tr>
148
+ <td align="center" valign="top" width="33%">
149
+ <a href="media/settings_accounts.png"><img src="media/settings_accounts.png" alt="编码 OAuth · Accounts 标签" width="280" /></a><br />
150
+ <sub>Accounts</sub>
151
+ </td>
152
+ <td align="center" valign="top" width="33%">
153
+ <a href="media/settings_gateway.png"><img src="media/settings_gateway.png" alt="编码 OAuth · Gateway 标签" width="280" /></a><br />
154
+ <sub>Gateway</sub>
155
+ </td>
156
+ <td align="center" valign="top" width="33%">
157
+ <a href="media/settings_capabilities.png"><img src="media/settings_capabilities.png" alt="编码 OAuth · Capabilities 标签" width="280" /></a><br />
158
+ <sub>Capabilities</sub>
159
+ </td>
160
+ </tr>
161
+ </table>
141
162
 
142
163
  | 供应商 | 方式 |
143
164
  |---|---|
@@ -176,7 +197,7 @@ gateway:
176
197
 
177
198
  端点:`GET /healthz`、`GET /v1/models`、`POST /v1/chat/completions`、`POST /v1/responses`、`POST /v1/messages`。Bearer key 保存在 `$DSH_HOME/.coding-oauth-gateway.json`(`0600`)。
178
199
 
179
- 在 **Gateway** 标签中,可以复制 OpenAI base URL(例如 `http://127.0.0.1:18080/v1`)、Anthropic base URL,或直接复制当前 Bearer key,不必轮换;轮换 key 前必须确认。监听端口可直接 **Apply/确定**,也可用 **Random/随机** 填充(`18100`–`18999`);选定端口会持久化到属主专用的网关文档,运行中的监听器会重新绑定。bind 仍只能写在 YAML 中;非 loopback bind 必须配置 key。这不是远程中继。
200
+ 在 **Gateway** 标签中,可以复制 OpenAI base URL(例如 `http://127.0.0.1:18080/v1`)、Anthropic base URL,或直接复制当前 Bearer key,不必轮换;密钥显示仅限 loopback,且不会写入浏览器存储;轮换 key 前必须确认。监听端口可直接 **Apply/确定**,也可用 **Random/随机** 填充(`18100`–`18999`);选定端口会持久化到属主专用的网关文档,运行中的监听器会重新绑定。bind 仍只能写在 YAML 中;非 loopback bind 必须配置 key。这不是远程中继。
180
201
 
181
202
  ## CLI
182
203
 
@@ -216,16 +237,16 @@ Kimi Code 订阅 OAuth 使用 `https://auth.kimi.com`;推理使用 `https://ap
216
237
 
217
238
  OAuth access token 会在本地记录过期时间前 **5 分钟**主动刷新(pi-ai 0.84+),避免请求踩到令牌寿命的最后几秒。若服务端仍以 401/403 拒绝一个本地尚未过期的令牌(服务端提前吊销或时钟偏差),插件会把凭据的 `expires` 回写到过去,重试的 step 会先刷新再发请求——用户无感知自愈,而不是本轮直接失败。
218
239
 
219
- 请求重试走 harness 的 retry 策略:瞬时故障(`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`)**以及 `AUTH`** 会按指数退避重试(默认 2 次,500 ms → 10 s10% jitter)。配额耗尽和 refresh token 失效**不**重试——会立刻给出真实错误和重新登录提示。部署级覆盖:
240
+ 请求重试走 harness 的 retry 策略:瞬时故障(`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`)**以及 `AUTH`** 会按指数退避重试(默认 5 次,5 s → 10 s → 20 s → 40 s → 80 s,约 155 s 叠加时常,10% jitter)。xAI「at capacity / high demand / priority processing」等文案会在 finish 管道重映射为 `RATE_LIMIT`,从而进入该策略(上游 `error.code: null` 时 pi-ai 会标成 `PI_AI_ERROR`)。配额耗尽和 refresh token 失效**不**重试——会立刻给出真实错误和重新登录提示。部署级覆盖:
220
241
 
221
242
  ```yaml
222
243
  - id: llm-grok-build-oauth
223
244
  config:
224
245
  retryPolicy:
225
246
  mode: normal
226
- maxRetries: 2
247
+ maxRetries: 5
227
248
  retryableCodes: [EMPTY_RESPONSE, RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, AUTH]
228
- backoff: { initialDelayMs: 500, maxDelayMs: 10000, jitterRatio: 0.1 }
249
+ backoff: { initialDelayMs: 5000, maxDelayMs: 80000, jitterRatio: 0.1 }
229
250
  ```
230
251
 
231
252
  ## 凭据