dsh-coding-subscription-oauth 0.5.8 → 0.6.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/CHANGELOG.md +217 -188
- package/CONTRIBUTING.md +120 -120
- package/INSTALL.md +241 -209
- package/LICENSE +19 -19
- package/NOTICE +11 -11
- package/README.de.md +298 -294
- package/README.es.md +299 -295
- package/README.fr.md +299 -295
- package/README.ja.md +299 -295
- package/README.ko.md +299 -295
- package/README.md +313 -307
- package/README.pt-BR.md +299 -295
- package/README.ru.md +299 -295
- package/README.zh-CN.md +311 -305
- package/compatibility/dsh-bom.json +30 -0
- package/cordis.patch.yml +13 -13
- package/docs/00-project-rules.md +195 -195
- package/docs/02-architecture.md +134 -129
- package/docs/02-architecture.zh-CN.md +134 -129
- package/lib/adapter.d.ts.map +1 -1
- package/lib/alias-adapter.d.ts +3 -1
- package/lib/alias-adapter.d.ts.map +1 -1
- package/lib/auth-routes.d.ts +8 -15
- package/lib/auth-routes.d.ts.map +1 -1
- package/lib/bin.js +746 -1402
- package/lib/bin.js.map +4 -4
- package/lib/capability-routes.d.ts +3 -3
- package/lib/capability-routes.d.ts.map +1 -1
- package/lib/capability-settings.d.ts +5 -4
- package/lib/capability-settings.d.ts.map +1 -1
- package/lib/client.js +27 -8
- package/lib/client.js.map +4 -4
- package/lib/compatibility.d.ts +46 -0
- package/lib/compatibility.d.ts.map +1 -0
- package/lib/dsh-host-adapter.d.ts +18 -0
- package/lib/dsh-host-adapter.d.ts.map +1 -0
- package/lib/gateway-auth.d.ts +1 -2
- package/lib/gateway-auth.d.ts.map +1 -1
- package/lib/gateway-routes.d.ts +3 -4
- package/lib/gateway-routes.d.ts.map +1 -1
- package/lib/gateway.d.ts +4 -0
- package/lib/gateway.d.ts.map +1 -1
- package/lib/ids.d.ts +3 -32
- package/lib/ids.d.ts.map +1 -1
- package/lib/imagine-routes.d.ts +2 -0
- package/lib/imagine-routes.d.ts.map +1 -1
- package/lib/index.d.ts +19 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +26627 -1047
- package/lib/index.js.map +4 -4
- package/lib/invariant.js.map +1 -1
- package/lib/oauth-import-routes.d.ts +3 -4
- package/lib/oauth-import-routes.d.ts.map +1 -1
- package/lib/proxy.d.ts +3 -16
- package/lib/proxy.d.ts.map +1 -1
- package/lib/web-origin.d.ts +28 -4
- package/lib/web-origin.d.ts.map +1 -1
- package/lib/web-routes.d.ts.map +1 -1
- package/media/en/settings_accounts.png +0 -0
- package/media/en/settings_capabilities.png +0 -0
- package/media/en/settings_gateway.png +0 -0
- 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/media/zh-CN/settings_accounts.png +0 -0
- package/media/zh-CN/settings_capabilities.png +0 -0
- package/media/zh-CN/settings_gateway.png +0 -0
- package/package.json +211 -174
- package/patches/dsh-agy@0.1.2.patch +25 -25
- package/scripts/release.mjs +186 -170
- package/scripts/smoke-deployed-routes.mjs +146 -146
- package/scripts/verify-deployed-catalog.mjs +87 -87
- package/src/adapter.ts +329 -268
- package/src/alias-adapter.ts +141 -147
- package/src/auth-routes.ts +921 -871
- package/src/auth.ts +67 -67
- package/src/bin.ts +350 -350
- package/src/capability-routes.ts +279 -275
- package/src/capability-runtime.ts +313 -313
- package/src/capability-settings.ts +658 -657
- package/src/capability-tools.ts +666 -666
- package/src/catalog.ts +271 -271
- package/src/client/GrokBuildSettings.tsx +770 -718
- package/src/client/api.ts +88 -88
- package/src/client/components/AboutTab.tsx +30 -30
- package/src/client/components/AccountsTab.tsx +241 -224
- package/src/client/components/Badge.tsx +33 -33
- package/src/client/components/CapabilitiesTab.tsx +265 -227
- package/src/client/components/CliPullPreview.tsx +116 -107
- package/src/client/components/CopyButton.tsx +57 -57
- package/src/client/components/GatewayTab.tsx +469 -409
- package/src/client/components/NoticeBanner.tsx +46 -46
- package/src/client/components/ProgressBar.tsx +53 -53
- package/src/client/components/ProviderCard.tsx +606 -502
- package/src/client/components/SettingsTabs.tsx +75 -75
- package/src/client/components/ToggleSwitch.tsx +71 -62
- package/src/client/constants.ts +224 -206
- package/src/client/display.ts +61 -61
- package/src/client/dshClientAdapter.ts +127 -0
- package/src/client/gatewaySnippets.ts +37 -36
- package/src/client/index.tsx +156 -37
- package/src/client/locales.ts +535 -491
- package/src/client/microStyles.ts +52 -33
- package/src/client/parsers.ts +396 -386
- package/src/client/styles.ts +325 -307
- package/src/client/types.ts +197 -185
- package/src/codex-http.ts +447 -447
- package/src/codex-images.ts +485 -485
- package/src/codex-model-capabilities.ts +320 -320
- package/src/codex-search.ts +245 -245
- package/src/codex-usage.ts +263 -263
- package/src/compatibility.ts +55 -0
- package/src/dsh-host-adapter.ts +173 -0
- package/src/gateway-anthropic-messages.ts +84 -84
- package/src/gateway-auth.ts +102 -100
- package/src/gateway-backend.ts +274 -274
- package/src/gateway-body.ts +49 -49
- package/src/gateway-config.ts +76 -76
- package/src/gateway-http.ts +104 -104
- package/src/gateway-openai-chat.ts +124 -124
- package/src/gateway-openai-responses.ts +53 -53
- package/src/gateway-parse.ts +224 -224
- package/src/gateway-protocol.ts +52 -52
- package/src/gateway-routes.ts +158 -152
- package/src/gateway.ts +258 -242
- package/src/grok-errors.ts +24 -24
- package/src/grok-imagine.ts +1627 -1627
- package/src/grok-import.ts +151 -151
- package/src/http-json.ts +82 -82
- package/src/ids.ts +59 -45
- package/src/imagine-routes.ts +463 -461
- package/src/index.ts +729 -592
- package/src/invariant.ts +17 -17
- package/src/kimi-errors.ts +26 -26
- package/src/media-store.ts +927 -927
- package/src/oauth-import-routes.ts +324 -314
- package/src/oauth-providers.ts +152 -152
- package/src/oauth-session.ts +183 -183
- package/src/oauth-sources.ts +1104 -1104
- package/src/oauth.ts +620 -620
- package/src/provider.ts +128 -128
- package/src/proxy.ts +11 -99
- package/src/redact.ts +72 -72
- package/src/session.ts +218 -218
- package/src/store.ts +217 -217
- package/src/web-origin.ts +296 -60
- package/src/web-routes.ts +38 -75
package/README.md
CHANGED
|
@@ -1,314 +1,320 @@
|
|
|
1
|
-
|
|
2
|
-
<!-- banner -->
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-
# 🔐 dsh-coding-subscription-oauth
|
|
6
|
-
|
|
7
|
-
**v0.
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
[](LICENSE)
|
|
12
|
-
[](CONTRIBUTING.md)
|
|
13
|
-
|
|
14
|
-
*[English](README.md) · [中文版](README.zh-CN.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Português (BR)](README.pt-BR.md) · [Español](README.es.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Русский](README.ru.md)*
|
|
15
|
-
|
|
1
|
+
|
|
2
|
+
<!-- banner -->
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
# 🔐 dsh-coding-subscription-oauth
|
|
6
|
+
|
|
7
|
+
**v0.6.2** · formerly `dsh-grok-build`
|
|
8
|
+
|
|
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
|
+
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](CONTRIBUTING.md)
|
|
13
|
+
|
|
14
|
+
*[English](README.md) · [中文版](README.zh-CN.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Português (BR)](README.pt-BR.md) · [Español](README.es.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Русский](README.ru.md)*
|
|
15
|
+
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Published first as **`dsh-grok-build`** when it only covered Grok Build. The current name matches the full coding-subscription OAuth surface.
|
|
23
|
-
|
|
24
|
-
| | Use this | Still works |
|
|
25
|
-
|---|---|---|
|
|
26
|
-
| npm (recommended) | Current release is `0.5.8`: `dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.8` | 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
|
-
| CLI | `dsh-coding-oauth` | `dsh-grok-build` |
|
|
29
|
-
| Cordis plugin id | `llm-grok-build-oauth` | unchanged |
|
|
30
|
-
| Settings HTTP API | `/plugins/dsh-grok-build/*` | unchanged |
|
|
31
|
-
| Credential files | `$DSH_HOME/.grok-build-auth.json` and the other `*-oauth-auth.json` files | unchanged |
|
|
32
|
-
|
|
33
|
-
## ✨ Features
|
|
34
|
-
|
|
35
|
-
- 🧽 **Bring your own subscription** — SuperGrok, ChatGPT Plus/Pro, Kimi Code, Claude Pro/Max; no extra pay-as-you-go key.
|
|
36
|
-
- 🔑 **Local OAuth, no key-pasting** — authorize in Settings or CLI; access/refresh tokens never enter chat, logs or HTTP status.
|
|
37
|
-
- 🧩 **One plugin, five providers** — Grok Build (`cli-chat-proxy.grok.com`), Codex, Kimi Code, Claude Code and Google Antigravity.
|
|
38
|
-
- 🛡️ **Secure by design** — credential files are owner-only `0600`, atomically written, cross-process locked.
|
|
39
|
-
- ⚙️ **Dynamic catalog** — the selector lists only signed-in routes, labelled `(OAuth)`, including grok-4.6 `xhigh`.
|
|
40
|
-
- 🌐 **Proxy-aware** — proxies only reviewed subscription domains; Kimi China stays direct by default.
|
|
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; remote hosts prefer device-code sign-in with quieter CLI-missing tips; signed-in cards stay collapsed until expanded.
|
|
43
|
-
- 🎛️ **Optional capabilities, default off** — Codex search, usage/quota, image generate/edit, Fast, and Grok Imagine apply live when you turn them on.
|
|
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
|
-
|
|
46
|
-
## Problems this plugin solves
|
|
47
|
-
|
|
48
|
-
These are the searches and DSH errors that usually lead here. If one of them is your tab title, you are in the right repo.
|
|
49
|
-
|
|
50
|
-
| You searched / saw | What was actually broken | What this plugin does |
|
|
51
|
-
|---|---|---|
|
|
52
|
-
| SuperGrok / X Premium in DSH, “Grok Build vs `api.x.ai`” | The built-in `xai` route is the **pay-as-you-go API**. Coding-plan inference is `cli-chat-proxy.grok.com` | Dedicated `grok-build` route + official CLI fingerprint headers (`X-XAI-Token-Auth`, `x-grok-client-identifier`, `x-grok-client-version`) so you do not get a silent 403 |
|
|
53
|
-
| `本轮运行失败` **API key is invalid** / `AUTH` mid-turn | The GUI maps **every** `AUTH` code to that banner. Often the OAuth access token just expired (Kimi ~15 min) | Refresh **5 minutes** before expiry; on a 401, invalidate the stored token and **retry the step** after refresh |
|
|
54
|
-
| `INVALID_REPLAY_STATE` on the second Codex / Kimi turn | Replay state still carried the native pi-ai provider id after the Harness route alias | Keep the Harness route id in replay state and heal older poisoned messages |
|
|
55
|
-
| grok-4.6 **xhigh** / Extra High Effort missing | Live `GET /v1/models-v2` already returns `reasoning_efforts` including `xhigh`; cloning the grok-4.5 template hides it (pi-ai treats absent `xhigh` as unsupported) | Parse live `reasoning_efforts` into `thinkingLevelMap`. grok-4.6 gets `xhigh`; grok-4.5 stays low/medium/high |
|
|
56
|
-
| Kimi Code 401, or requests going out as Anthropic `x-api-key` | The OAuth token was attached as an Anthropic key | Wire **only** `Authorization: Bearer` on `api.kimi.com/coding` |
|
|
57
|
-
| Unsigned-in Grok / Codex / Claude still in the model picker | Every registered route was listed | Unauthenticated routes expose **no models**; signed-in names show `(OAuth)` |
|
|
58
|
-
| Device login on a **remote / headless** DSH | Browser PKCE cannot reach `localhost` | Device-code for Grok, Codex and Kimi; Claude accepts a pasted localhost redirect URL |
|
|
59
|
-
| Proxy works for Grok/Codex but breaks Kimi in China | One global `HTTPS_PROXY` | Allowlisted proxy; Kimi stays **direct** unless `proxyKimi: true`. `auth.kimi.com` ≠ `api.moonshot.cn` |
|
|
60
|
-
| ChatGPT Plus / Claude Pro in DSH without another API bill | Separate OpenAI / Anthropic API keys | Local OAuth on `codex-oauth` / `claude-code-oauth`, coexist with existing `openai` / `kimi-coding` API-key routes |
|
|
61
|
-
|
|
62
|
-
Grok Build device login, live `/v1/models-v2` and Responses streaming are verified on real deployments. Codex / Kimi / Claude reuse `@earendil-works/pi-ai` native OAuth instead of re-implementing vendor flows.
|
|
63
|
-
|
|
64
|
-
## Supported providers
|
|
65
|
-
|
|
66
|
-
| Provider | Route | Auth | Coexists with |
|
|
67
|
-
|---|---|---|---|
|
|
68
|
-
| **xAI Grok Build** | `grok-build` | SuperGrok / X Premium OAuth | `xai` |
|
|
69
|
-
| **OpenAI Codex** | `codex-oauth` · optional `codex-oauth-fast` | ChatGPT Plus/Pro OAuth | `openai` |
|
|
70
|
-
| **Kimi Code** | `kimi-code-oauth` | Kimi Code OAuth | `kimi-coding` |
|
|
71
|
-
| **Claude Code** | `claude-code-oauth` | Claude Pro/Max OAuth | — |
|
|
72
|
-
| **Google Antigravity** | `agy` | `dsh-agy` Google OAuth | — |
|
|
73
|
-
|
|
74
|
-
> Grok Build's device login, dynamic `/v1/models-v2` catalog and Responses streaming are verified on real deployments. Codex/Kimi/Claude reuse the provider-native OAuth/refresh from `@earendil-works/pi-ai` instead of re-implementing vendor flows.
|
|
75
|
-
|
|
76
|
-
## 🚀 Quick start
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
# 1. install the current npm release into the web profile
|
|
80
|
-
dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.8
|
|
81
|
-
|
|
82
|
-
# 2. optional — Google Antigravity (pinned, reviewed version)
|
|
83
|
-
dsh plugin --profile web add dsh-agy@0.1.2
|
|
84
|
-
|
|
85
|
-
# 3. restart the resident dsh web service
|
|
86
|
-
systemctl --user restart dsh-web.service
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Then open **Settings → Coding OAuth** and sign in to any provider. Done — pick your authenticated model from the selector.
|
|
90
|
-
|
|
91
|
-
## 📚 Table of contents
|
|
92
|
-
|
|
93
|
-
- [Name change](#name-change)
|
|
94
|
-
- [Features](#-features)
|
|
95
|
-
- [Problems this plugin solves](#problems-this-plugin-solves)
|
|
96
|
-
- [Supported providers](#supported-providers)
|
|
97
|
-
- [Quick start](#-quick-start)
|
|
98
|
-
- [Install](#install)
|
|
99
|
-
- [Settings page](#settings-page)
|
|
100
|
-
- [Optional capabilities](#optional-capabilities)
|
|
101
|
-
- [Local API gateway](#local-api-gateway)
|
|
102
|
-
- [CLI](#cli)
|
|
103
|
-
- [Kimi in China](#kimi-in-china)
|
|
104
|
-
- [Network proxy](#network-proxy)
|
|
105
|
-
- [Resilience](#resilience)
|
|
106
|
-
- [Credentials](#credentials)
|
|
107
|
-
- [Architecture](#architecture)
|
|
108
|
-
- [Technical notes](#technical-notes)
|
|
109
|
-
- [Compliance](#compliance)
|
|
110
|
-
- [Documentation](#documentation)
|
|
111
|
-
- [Related](#related)
|
|
112
|
-
- [Contributing](#contributing)
|
|
113
|
-
- [License](#license)
|
|
114
|
-
|
|
115
|
-
## Install
|
|
116
|
-
|
|
117
|
-
Requires DeepSeek Harness `0.1.0-rc.6+` and Node.js 22.19+. Full details in the [installation notes](INSTALL.md).
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
# current npm release
|
|
121
|
-
dsh plugin --profile web add dsh-coding-subscription-oauth@0.5.8
|
|
122
|
-
|
|
123
|
-
# development / alternative: from GitHub
|
|
124
|
-
dsh plugin --profile web add github:lninghaha/dsh-coding-subscription-oauth
|
|
125
|
-
|
|
126
|
-
# local development checkout (alternative)
|
|
127
|
-
# dsh plugin --profile web add ./dsh-coding-subscription-oauth
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Restart `dsh web` after installing. Maintainers can verify a live deployment from a source checkout (npm installs do not include these scripts):
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
pnpm run verify:deployed # checks real /api/llm.models + OAuth state
|
|
134
|
-
DSH_EXPECT_AGY_AUTH=signed-in pnpm run verify:deployed # if Google is signed in
|
|
135
|
-
|
|
136
|
-
DSH_RESTORE_PROVIDER=openai \
|
|
137
|
-
DSH_RESTORE_MODEL=gpt-5.6-sol \
|
|
138
|
-
DSH_RESTORE_REASONING=max \
|
|
139
|
-
pnpm run smoke:deployed # real Codex/Kimi tool-calls + second-turn replay
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
> `smoke:deployed` creates temporary sessions, exercises Codex and Kimi tool-calls plus a second user turn (regression coverage for `INVALID_REPLAY_STATE`), restores the declared default model, then archives the sessions.
|
|
143
|
-
|
|
144
|
-
## Settings page
|
|
20
|
+
> **Upgrade / 升级:** Follow the versioned steps in [`INSTALL.md`](INSTALL.md). `0.6.2` includes the strict Cordis injection startup fix and DSH `0.1.1-rc.2` support; keep profile/config/credential files and restart one existing DSH Web process only after updating. `dsh-coding-oauth-core@0.1.0` remains a shared npm dependency, not a separate DSH plugin.
|
|
145
21
|
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Name change
|
|
25
|
+
|
|
26
|
+
Published first as **`dsh-grok-build`** when it only covered Grok Build. The current name matches the full coding-subscription OAuth surface.
|
|
27
|
+
|
|
28
|
+
| | Use this | Still works |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| npm (recommended) | Current release is `0.6.2`: `dsh plugin --profile web add dsh-coding-subscription-oauth@0.6.2` | No legacy npm package was published |
|
|
31
|
+
| GitHub / development | [`dsh-coding-subscription-oauth`](https://github.com/lninghaha/dsh-coding-subscription-oauth) | Previous GitHub repo `dsh-grok-build` was removed |
|
|
32
|
+
| CLI | `dsh-coding-oauth` | `dsh-grok-build` |
|
|
33
|
+
| Cordis plugin id | `llm-grok-build-oauth` | unchanged |
|
|
34
|
+
| Settings HTTP API | `/plugins/dsh-grok-build/*` | unchanged |
|
|
35
|
+
| Credential files | `$DSH_HOME/.grok-build-auth.json` and the other `*-oauth-auth.json` files | unchanged |
|
|
36
|
+
|
|
37
|
+
## ✨ Features
|
|
38
|
+
|
|
39
|
+
- 🧽 **Bring your own subscription** — SuperGrok, ChatGPT Plus/Pro, Kimi Code, Claude Pro/Max; no extra pay-as-you-go key.
|
|
40
|
+
- 🔑 **Local OAuth, no key-pasting** — authorize in Settings or CLI; access/refresh tokens never enter chat, logs or HTTP status.
|
|
41
|
+
- 🧩 **One plugin, five providers** — Grok Build (`cli-chat-proxy.grok.com`), Codex, Kimi Code, Claude Code and Google Antigravity.
|
|
42
|
+
- 🛡️ **Secure by design** — credential files are owner-only `0600`, atomically written, cross-process locked.
|
|
43
|
+
- ⚙️ **Dynamic catalog** — the selector lists only signed-in routes, labelled `(OAuth)`, including grok-4.6 `xhigh`.
|
|
44
|
+
- 🌐 **Proxy-aware** — proxies only reviewed subscription domains; Kimi China stays direct by default.
|
|
45
|
+
- 📥 **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.
|
|
46
|
+
- 🗂️ **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.
|
|
47
|
+
- 🎛️ **Optional capabilities, default off** — Codex search, usage/quota, image generate/edit, Fast, and Grok Imagine apply live when you turn them on.
|
|
48
|
+
- 🔌 **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.
|
|
49
|
+
|
|
50
|
+
## Problems this plugin solves
|
|
51
|
+
|
|
52
|
+
These are the searches and DSH errors that usually lead here. If one of them is your tab title, you are in the right repo.
|
|
53
|
+
|
|
54
|
+
| You searched / saw | What was actually broken | What this plugin does |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| SuperGrok / X Premium in DSH, “Grok Build vs `api.x.ai`” | The built-in `xai` route is the **pay-as-you-go API**. Coding-plan inference is `cli-chat-proxy.grok.com` | Dedicated `grok-build` route + official CLI fingerprint headers (`X-XAI-Token-Auth`, `x-grok-client-identifier`, `x-grok-client-version`) so you do not get a silent 403 |
|
|
57
|
+
| `本轮运行失败` **API key is invalid** / `AUTH` mid-turn | The GUI maps **every** `AUTH` code to that banner. Often the OAuth access token just expired (Kimi ~15 min) | Refresh **5 minutes** before expiry; on a 401, invalidate the stored token and **retry the step** after refresh |
|
|
58
|
+
| `INVALID_REPLAY_STATE` on the second Codex / Kimi turn | Replay state still carried the native pi-ai provider id after the Harness route alias | Keep the Harness route id in replay state and heal older poisoned messages |
|
|
59
|
+
| grok-4.6 **xhigh** / Extra High Effort missing | Live `GET /v1/models-v2` already returns `reasoning_efforts` including `xhigh`; cloning the grok-4.5 template hides it (pi-ai treats absent `xhigh` as unsupported) | Parse live `reasoning_efforts` into `thinkingLevelMap`. grok-4.6 gets `xhigh`; grok-4.5 stays low/medium/high |
|
|
60
|
+
| Kimi Code 401, or requests going out as Anthropic `x-api-key` | The OAuth token was attached as an Anthropic key | Wire **only** `Authorization: Bearer` on `api.kimi.com/coding` |
|
|
61
|
+
| Unsigned-in Grok / Codex / Claude still in the model picker | Every registered route was listed | Unauthenticated routes expose **no models**; signed-in names show `(OAuth)` |
|
|
62
|
+
| Device login on a **remote / headless** DSH | Browser PKCE cannot reach `localhost` | Device-code for Grok, Codex and Kimi; Claude accepts a pasted localhost redirect URL |
|
|
63
|
+
| Proxy works for Grok/Codex but breaks Kimi in China | One global `HTTPS_PROXY` | Allowlisted proxy; Kimi stays **direct** unless `proxyKimi: true`. `auth.kimi.com` ≠ `api.moonshot.cn` |
|
|
64
|
+
| ChatGPT Plus / Claude Pro in DSH without another API bill | Separate OpenAI / Anthropic API keys | Local OAuth on `codex-oauth` / `claude-code-oauth`, coexist with existing `openai` / `kimi-coding` API-key routes |
|
|
65
|
+
|
|
66
|
+
Grok Build device login, live `/v1/models-v2` and Responses streaming are verified on real deployments. Codex / Kimi / Claude reuse `@earendil-works/pi-ai` native OAuth instead of re-implementing vendor flows.
|
|
67
|
+
|
|
68
|
+
## Supported providers
|
|
69
|
+
|
|
70
|
+
| Provider | Route | Auth | Coexists with |
|
|
71
|
+
|---|---|---|---|
|
|
72
|
+
| **xAI Grok Build** | `grok-build` | SuperGrok / X Premium OAuth | `xai` |
|
|
73
|
+
| **OpenAI Codex** | `codex-oauth` · optional `codex-oauth-fast` | ChatGPT Plus/Pro OAuth | `openai` |
|
|
74
|
+
| **Kimi Code** | `kimi-code-oauth` | Kimi Code OAuth | `kimi-coding` |
|
|
75
|
+
| **Claude Code** | `claude-code-oauth` | Claude Pro/Max OAuth | — |
|
|
76
|
+
| **Google Antigravity** | `agy` | `dsh-agy` Google OAuth | — |
|
|
77
|
+
|
|
78
|
+
> Grok Build's device login, dynamic `/v1/models-v2` catalog and Responses streaming are verified on real deployments. Codex/Kimi/Claude reuse the provider-native OAuth/refresh from `@earendil-works/pi-ai` instead of re-implementing vendor flows.
|
|
79
|
+
|
|
80
|
+
## 🚀 Quick start
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# 1. install the current npm release into the web profile
|
|
84
|
+
dsh plugin --profile web add dsh-coding-subscription-oauth@0.6.2
|
|
85
|
+
|
|
86
|
+
# 2. optional — Google Antigravity (pinned, reviewed version)
|
|
87
|
+
dsh plugin --profile web add dsh-agy@0.1.2
|
|
88
|
+
|
|
89
|
+
# 3. restart the existing DSH Web process with its configured process manager
|
|
90
|
+
# `dsh web` is the official CLI alias for the web profile, not a service-unit name.
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Then open **Settings → Coding OAuth** and sign in to any provider. Done — pick your authenticated model from the selector.
|
|
94
|
+
|
|
95
|
+
## 📚 Table of contents
|
|
96
|
+
|
|
97
|
+
- [Name change](#name-change)
|
|
98
|
+
- [Features](#-features)
|
|
99
|
+
- [Problems this plugin solves](#problems-this-plugin-solves)
|
|
100
|
+
- [Supported providers](#supported-providers)
|
|
101
|
+
- [Quick start](#-quick-start)
|
|
102
|
+
- [Install](#install)
|
|
103
|
+
- [Settings page](#settings-page)
|
|
104
|
+
- [Optional capabilities](#optional-capabilities)
|
|
105
|
+
- [Local API gateway](#local-api-gateway)
|
|
106
|
+
- [CLI](#cli)
|
|
107
|
+
- [Kimi in China](#kimi-in-china)
|
|
108
|
+
- [Network proxy](#network-proxy)
|
|
109
|
+
- [Resilience](#resilience)
|
|
110
|
+
- [Credentials](#credentials)
|
|
111
|
+
- [Architecture](#architecture)
|
|
112
|
+
- [Technical notes](#technical-notes)
|
|
113
|
+
- [Compliance](#compliance)
|
|
114
|
+
- [Documentation](#documentation)
|
|
115
|
+
- [Related](#related)
|
|
116
|
+
- [Contributing](#contributing)
|
|
117
|
+
- [License](#license)
|
|
118
|
+
|
|
119
|
+
## Install
|
|
120
|
+
|
|
121
|
+
Requires DeepSeek Harness `0.1.1-rc.2` and Node.js 22.19+. Full details in the [installation notes](INSTALL.md).
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# current npm release
|
|
125
|
+
dsh plugin --profile web add dsh-coding-subscription-oauth@0.6.2
|
|
126
|
+
|
|
127
|
+
# development / alternative: from GitHub
|
|
128
|
+
dsh plugin --profile web add github:lninghaha/dsh-coding-subscription-oauth
|
|
129
|
+
|
|
130
|
+
# local development checkout (alternative)
|
|
131
|
+
# dsh plugin --profile web add ./dsh-coding-subscription-oauth
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Restart the existing DSH Web process after installing. Maintainers can verify a live deployment from a source checkout (npm installs do not include these scripts):
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
pnpm run verify:deployed # checks real /api/llm.models + OAuth state
|
|
138
|
+
DSH_EXPECT_AGY_AUTH=signed-in pnpm run verify:deployed # if Google is signed in
|
|
139
|
+
|
|
140
|
+
DSH_RESTORE_PROVIDER=openai \
|
|
141
|
+
DSH_RESTORE_MODEL=gpt-5.6-sol \
|
|
142
|
+
DSH_RESTORE_REASONING=max \
|
|
143
|
+
pnpm run smoke:deployed # real Codex/Kimi tool-calls + second-turn replay
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
> `smoke:deployed` creates temporary sessions, exercises Codex and Kimi tool-calls plus a second user turn (regression coverage for `INVALID_REPLAY_STATE`), restores the declared default model, then archives the sessions.
|
|
147
|
+
|
|
148
|
+
## Settings page
|
|
149
|
+
|
|
146
150
|
Open **Settings → Coding OAuth**. The page uses segmented tabs — **Accounts**, **Gateway**, **Capabilities**, and **About** — with live status hints, semantic badges, and skeleton loading states. 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 for model search/filter, quota progress bars, or CLI Pull controls. Gateway adds quick-setup snippets (cURL / Python / IDE), and Capabilities uses toggle switches with dependency-aware disabled states plus Imagine status.
|
|
147
151
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
</
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
|
168
|
-
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
dsh-coding-oauth
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
Kimi
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
-
|
|
259
|
-
|
|
260
|
-
- `$DSH_HOME/.
|
|
261
|
-
- `$DSH_HOME/.
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
PI -->
|
|
277
|
-
PI -->
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
-
|
|
286
|
-
- **Codex
|
|
287
|
-
-
|
|
288
|
-
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
|
299
|
-
|
|
300
|
-
| [`
|
|
301
|
-
| [`
|
|
302
|
-
| [`
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
152
|
+
DSH Web remains loopback-only. Remote Settings must travel through an SSH tunnel or an owner-authenticated HTTPS reverse proxy. The plugin prefers a DSH-native `ownerRequestPolicy`; its fallback requires the real trusted TCP peer, exact HTTPS Origin/Host, same-origin Fetch Metadata, a proxy-injected owner proof, and an independent mutation CSRF proof. Forwarded headers never grant access, and incomplete policy fails closed. See [INSTALL.md](INSTALL.md#安全访问远程-settings).
|
|
153
|
+
|
|
154
|
+
<table>
|
|
155
|
+
<tr>
|
|
156
|
+
<td align="center" valign="top" width="33%">
|
|
157
|
+
<a href="media/en/settings_accounts.png"><img src="media/en/settings_accounts.png" alt="Coding OAuth Accounts tab" width="280" /></a><br />
|
|
158
|
+
<sub>Accounts</sub>
|
|
159
|
+
</td>
|
|
160
|
+
<td align="center" valign="top" width="33%">
|
|
161
|
+
<a href="media/en/settings_gateway.png"><img src="media/en/settings_gateway.png" alt="Coding OAuth Gateway tab" width="280" /></a><br />
|
|
162
|
+
<sub>Gateway</sub>
|
|
163
|
+
</td>
|
|
164
|
+
<td align="center" valign="top" width="33%">
|
|
165
|
+
<a href="media/en/settings_capabilities.png"><img src="media/en/settings_capabilities.png" alt="Coding OAuth Capabilities tab" width="280" /></a><br />
|
|
166
|
+
<sub>Capabilities</sub>
|
|
167
|
+
</td>
|
|
168
|
+
</tr>
|
|
169
|
+
</table>
|
|
170
|
+
|
|
171
|
+
| Provider | Methods |
|
|
172
|
+
|---|---|
|
|
173
|
+
| Grok | auth code · device code · model selection |
|
|
174
|
+
| Codex | device code (recommended on remote DSH) · browser PKCE |
|
|
175
|
+
| Kimi | device code |
|
|
176
|
+
| Claude | browser PKCE (remote browser can paste the full localhost redirect URL) |
|
|
177
|
+
| Antigravity | `dsh-agy` install status + profile-local CLI commands |
|
|
178
|
+
|
|
179
|
+
Use device code when the DSH host is remote. Browser/PKCE sign-in opens the provider URL; if the localhost callback cannot reach this DSH host, paste either the returned authorization code or the complete redirect URL into the waiting Settings card.
|
|
180
|
+
|
|
181
|
+
Settings also **discovers** allowlisted official Grok / Codex / Kimi / Claude CLI OAuth files (read-only). Synchronization is an explicit one-way **Pull** — not auto-import: discover → preview → conflict/fingerprint check → confirm overwrite. Official CLI files are never written. Reads refuse symlinks, non-regular files, non-owner files, group/other access, and oversized documents (`O_NOFOLLOW`). Preview tickets are one-use, expire in five minutes, and are capped at 32.
|
|
182
|
+
|
|
183
|
+
The selector only lists routes that completed authentication; unauthenticated providers return an empty list. Provider names carry `(OAuth)`, and the catalog refreshes via `llm/adapters-updated` after sign-in/out.
|
|
184
|
+
|
|
185
|
+
## Optional capabilities
|
|
186
|
+
|
|
187
|
+
All seven switches start **off** and apply **live** (no restart): `codexSearch`, `codexImages`, `codexImageEdits`, `codexUsage`, `codexFast`, `grokImagineImage`, and `grokImagineVideo`. Numeric controls are `searchResults` (1–20, default 5), `imageCount` (1–4, default 1), and `videoArtifactTtlMs` (1 hour–7 days, default 7 days; the UI shows 1–168 hours). Lowering video retention shortens and cleans existing artifacts immediately; raising it affects only artifacts created afterward. Administrators may provide secret-free composition defaults under plugin config `capabilities`; live user settings in the `coding-subscription-oauth` settings section override that base, and omitting it keeps every switch off.
|
|
188
|
+
|
|
189
|
+
`codex-oauth-fast` is advertised only after a **fresh live catalog** lists at least one `priority`-eligible model. Those requests send `service_tier: priority` plus a routing hint. The UI says **Fast requested** and never guarantees latency or that upstream will honor the request.
|
|
190
|
+
|
|
191
|
+
Codex search, usage, and images are **opt-in** private `chatgpt.com/backend-api` endpoints. Image generation uses the fixed model `gpt-image-2`. Image edit accepts only current-session top-level attachment ids that this session already owns.
|
|
192
|
+
|
|
193
|
+
Grok Imagine calls official `https://api.x.ai` with `grok-imagine-image-2.0` and `grok-imagine-video-1.5`. It uses a **separate** DSH credential reference `XAI_API_KEY` — never Grok OAuth and never a process-env fallback. Generated outputs are fetched under MIME / size / time / redirect / DNS controls from frozen hosts `imgen.x.ai`, `videogen.x.ai`, and `vidgen.x.ai`, stored privately (256 MiB hard caps for one object and aggregate unique bytes, seven days), and served only on same-origin loopback routes.
|
|
194
|
+
|
|
195
|
+
## Local API gateway
|
|
196
|
+
|
|
197
|
+
Default **off**. When enabled it starts an isolated `node:http` server (not the DSH web port) on `127.0.0.1:18080` and reuses the same signed-in OAuth sessions:
|
|
198
|
+
|
|
199
|
+
```yaml
|
|
200
|
+
gateway:
|
|
201
|
+
enabled: false
|
|
202
|
+
bind: 127.0.0.1
|
|
203
|
+
port: 18080
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
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`).
|
|
207
|
+
|
|
208
|
+
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.
|
|
209
|
+
|
|
210
|
+
## CLI
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# `dsh-grok-build` remains a command alias
|
|
214
|
+
dsh-coding-oauth login [--pkce] | import | status | logout
|
|
215
|
+
|
|
216
|
+
# newer providers
|
|
217
|
+
dsh-coding-oauth login codex --device-auth | codex --browser | kimi | claude
|
|
218
|
+
dsh-coding-oauth status all
|
|
219
|
+
dsh-coding-oauth logout codex
|
|
220
|
+
|
|
221
|
+
# Antigravity (install into web profile first)
|
|
222
|
+
dsh plugin --profile web exec dsh-agy login --headless
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
> `dsh-agy` CLI edits the account pool outside the DSH process, so it can't emit an in-process catalog event — close and reopen the model selector after signing in/out.
|
|
226
|
+
|
|
227
|
+
## Kimi in China
|
|
228
|
+
|
|
229
|
+
Kimi Code subscription OAuth uses `https://auth.kimi.com`; inference uses `https://api.kimi.com/coding`. `https://api.moonshot.cn/v1` is the pay-as-you-go **Moonshot Open Platform** API-key channel — there is no switchable "China OAuth endpoint". This plugin uses a separate `kimi-code-oauth` route and doesn't affect an existing `kimi-coding` API-key config.
|
|
230
|
+
|
|
231
|
+
## Network proxy
|
|
232
|
+
|
|
233
|
+
Priority: `config.proxy` → `CODING_OAUTH_PROXY` → `GROK_BUILD_PROXY` → `HTTPS_PROXY`/`HTTP_PROXY`.
|
|
234
|
+
|
|
235
|
+
```yaml
|
|
236
|
+
- id: llm-grok-build-oauth
|
|
237
|
+
config:
|
|
238
|
+
proxy: http://127.0.0.1:7890
|
|
239
|
+
proxyKimi: false
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Only reviewed subscription domains are proxied (xAI/Grok, OpenAI Codex, Claude/Anthropic, Google Antigravity); all other DSH traffic keeps its original dispatcher. Kimi stays direct by default and only uses the proxy when `proxyKimi: true`.
|
|
243
|
+
|
|
244
|
+
## Resilience
|
|
245
|
+
|
|
246
|
+
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.
|
|
247
|
+
|
|
248
|
+
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:
|
|
249
|
+
|
|
250
|
+
```yaml
|
|
251
|
+
- id: llm-grok-build-oauth
|
|
252
|
+
config:
|
|
253
|
+
retryPolicy:
|
|
254
|
+
mode: normal
|
|
255
|
+
maxRetries: 5
|
|
256
|
+
retryableCodes: [EMPTY_RESPONSE, RATE_LIMIT, SERVER, TIMEOUT, TRANSPORT, AUTH]
|
|
257
|
+
backoff: { initialDelayMs: 5000, maxDelayMs: 80000, jitterRatio: 0.1 }
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Credentials
|
|
261
|
+
|
|
262
|
+
Owner-only `0600`, atomically written, cross-process file lock:
|
|
263
|
+
|
|
264
|
+
- `$DSH_HOME/.grok-build-auth.json`
|
|
265
|
+
- `$DSH_HOME/.codex-oauth-auth.json`
|
|
266
|
+
- `$DSH_HOME/.kimi-code-oauth-auth.json`
|
|
267
|
+
- `$DSH_HOME/.claude-code-oauth-auth.json`
|
|
268
|
+
|
|
269
|
+
Selection caches live in the matching `*-models.json` files. Grok Imagine uses a separate DSH credential named `XAI_API_KEY` (not the Grok OAuth file). **No HTTP status, log or UI may ever return a token.**
|
|
270
|
+
|
|
271
|
+
## Architecture
|
|
272
|
+
|
|
273
|
+
```mermaid
|
|
274
|
+
flowchart LR
|
|
275
|
+
subgraph DSH["DSH Harness"]
|
|
276
|
+
UI[Settings / Web · Coding OAuth] --> LLM[llm route]
|
|
277
|
+
LLM --> ALIA[Route-alias adapter]
|
|
278
|
+
end
|
|
279
|
+
ALIA --> PI[pi-ai native provider<br/>OAuth · refresh · stream]
|
|
280
|
+
PI --> GROK[Grok Build]
|
|
281
|
+
PI --> COD[Codex]
|
|
282
|
+
PI --> KIMI[Kimi]
|
|
283
|
+
PI --> CLAU[Claude]
|
|
284
|
+
AGY[dsh-agy plugin] --> GAL[Google Antigravity]
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Technical notes
|
|
288
|
+
|
|
289
|
+
- **Grok Build**: Responses API on `cli-chat-proxy.grok.com/v1` (not `api.x.ai`), CLI fingerprint headers, live `/v1/models-v2` including grok-4.6 `reasoning.effort: xhigh`.
|
|
290
|
+
- **Codex/Kimi/Claude**: pi-ai native providers handle OAuth and refresh; the route-alias adapter maps them to native ids so multi-turn replay does not throw `INVALID_REPLAY_STATE`.
|
|
291
|
+
- The Kimi access token is explicitly converted to `Authorization: Bearer` — never mistakenly an Anthropic `x-api-key`.
|
|
292
|
+
- **Codex Fast / private endpoints**: `codex-oauth-fast` is opt-in and fail-closed on a stale catalog; search, usage and `gpt-image-2` images stay off until enabled.
|
|
293
|
+
- **Grok Imagine**: official `api.x.ai` only, `XAI_API_KEY` through DSH credentials, same-origin download routes under `/plugins/dsh-grok-build/imagine/*`.
|
|
294
|
+
- Google Antigravity is **not** reverse-engineered here; it uses a version-pinned dedicated DSH plugin.
|
|
295
|
+
|
|
296
|
+
## Compliance
|
|
297
|
+
|
|
298
|
+
Using coding subscriptions through a third-party harness may sit in a gray area of each vendor's terms and can trigger quota, regional or account-risk controls. **Use only your own accounts**; this project does not support bulk accounts, quota resale, remote relay, paywall bypass or client impersonation. For commercial use, prefer the vendors' official API-key channels.
|
|
299
|
+
|
|
300
|
+
## Documentation
|
|
301
|
+
|
|
302
|
+
| Doc | Purpose |
|
|
303
|
+
|---|---|
|
|
304
|
+
| [`INSTALL.md`](INSTALL.md) | Installation & usage details |
|
|
305
|
+
| [`CHANGELOG.md`](CHANGELOG.md) | Release history |
|
|
306
|
+
| [`docs/00-project-rules.md`](docs/00-project-rules.md) | Versioning, release loop, publish vs local-only split |
|
|
307
|
+
| [`docs/02-architecture.md`](docs/02-architecture.md) | Internal architecture (routes, data flow, modules, API) · [中文](docs/02-architecture.zh-CN.md) |
|
|
308
|
+
| [`CONTRIBUTING.md`](CONTRIBUTING.md) | Contribution guide |
|
|
309
|
+
|
|
310
|
+
## Related
|
|
311
|
+
|
|
312
|
+
- [`dsh-agy`](https://www.npmjs.com/package/dsh-agy) — separate pinned plugin for Google Antigravity.
|
|
313
|
+
|
|
314
|
+
## Contributing
|
|
315
|
+
|
|
316
|
+
Contributions of all kinds are welcome — features, docs, translations, bug reports. See **[CONTRIBUTING](CONTRIBUTING.md)** for the flow, commit conventions and the release loop. If your language isn't listed, PR a README translation and we'll add it to the table above.
|
|
317
|
+
|
|
318
|
+
## License
|
|
319
|
+
|
|
320
|
+
[Apache-2.0](LICENSE) · see [NOTICE](NOTICE). Portions derived from the [dsh-xai](https://github.com/MirDie/dsh-xai) project (Apache-2.0).
|