dsh-coding-subscription-oauth 0.5.8 → 0.6.0

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 (141) hide show
  1. package/CHANGELOG.md +211 -196
  2. package/CONTRIBUTING.md +120 -120
  3. package/INSTALL.md +240 -209
  4. package/LICENSE +19 -19
  5. package/NOTICE +11 -11
  6. package/README.de.md +298 -293
  7. package/README.es.md +299 -294
  8. package/README.fr.md +299 -294
  9. package/README.ja.md +299 -294
  10. package/README.ko.md +299 -294
  11. package/README.md +313 -306
  12. package/README.pt-BR.md +299 -294
  13. package/README.ru.md +299 -294
  14. package/README.zh-CN.md +311 -304
  15. package/compatibility/dsh-bom.json +43 -0
  16. package/cordis.patch.yml +13 -13
  17. package/docs/00-project-rules.md +195 -195
  18. package/docs/02-architecture.md +134 -129
  19. package/docs/02-architecture.zh-CN.md +134 -129
  20. package/lib/auth-routes.d.ts +8 -15
  21. package/lib/auth-routes.d.ts.map +1 -1
  22. package/lib/bin.js +746 -1402
  23. package/lib/bin.js.map +4 -4
  24. package/lib/capability-routes.d.ts +3 -3
  25. package/lib/capability-routes.d.ts.map +1 -1
  26. package/lib/capability-settings.d.ts +5 -4
  27. package/lib/capability-settings.d.ts.map +1 -1
  28. package/lib/client.js +27 -8
  29. package/lib/client.js.map +4 -4
  30. package/lib/compatibility.d.ts +46 -0
  31. package/lib/compatibility.d.ts.map +1 -0
  32. package/lib/dsh-host-adapter.d.ts +18 -0
  33. package/lib/dsh-host-adapter.d.ts.map +1 -0
  34. package/lib/gateway-auth.d.ts +1 -2
  35. package/lib/gateway-auth.d.ts.map +1 -1
  36. package/lib/gateway-routes.d.ts +3 -4
  37. package/lib/gateway-routes.d.ts.map +1 -1
  38. package/lib/gateway.d.ts +4 -0
  39. package/lib/gateway.d.ts.map +1 -1
  40. package/lib/ids.d.ts +3 -32
  41. package/lib/ids.d.ts.map +1 -1
  42. package/lib/imagine-routes.d.ts +2 -0
  43. package/lib/imagine-routes.d.ts.map +1 -1
  44. package/lib/index.d.ts +19 -4
  45. package/lib/index.d.ts.map +1 -1
  46. package/lib/index.js +26573 -1023
  47. package/lib/index.js.map +4 -4
  48. package/lib/invariant.js.map +1 -1
  49. package/lib/oauth-import-routes.d.ts +3 -4
  50. package/lib/oauth-import-routes.d.ts.map +1 -1
  51. package/lib/proxy.d.ts +3 -16
  52. package/lib/proxy.d.ts.map +1 -1
  53. package/lib/web-origin.d.ts +28 -4
  54. package/lib/web-origin.d.ts.map +1 -1
  55. package/lib/web-routes.d.ts.map +1 -1
  56. package/media/en/settings_accounts.png +0 -0
  57. package/media/en/settings_capabilities.png +0 -0
  58. package/media/en/settings_gateway.png +0 -0
  59. package/media/zh-CN/settings_accounts.png +0 -0
  60. package/media/zh-CN/settings_capabilities.png +0 -0
  61. package/media/zh-CN/settings_gateway.png +0 -0
  62. package/package.json +209 -172
  63. package/patches/dsh-agy@0.1.2.patch +25 -25
  64. package/scripts/release.mjs +186 -170
  65. package/scripts/smoke-deployed-routes.mjs +146 -146
  66. package/scripts/verify-deployed-catalog.mjs +87 -87
  67. package/src/adapter.ts +287 -287
  68. package/src/alias-adapter.ts +153 -153
  69. package/src/auth-routes.ts +921 -871
  70. package/src/auth.ts +67 -67
  71. package/src/bin.ts +350 -350
  72. package/src/capability-routes.ts +279 -275
  73. package/src/capability-runtime.ts +313 -313
  74. package/src/capability-settings.ts +658 -657
  75. package/src/capability-tools.ts +666 -666
  76. package/src/catalog.ts +271 -271
  77. package/src/client/GrokBuildSettings.tsx +770 -718
  78. package/src/client/api.ts +88 -88
  79. package/src/client/components/AboutTab.tsx +30 -30
  80. package/src/client/components/AccountsTab.tsx +241 -224
  81. package/src/client/components/Badge.tsx +33 -33
  82. package/src/client/components/CapabilitiesTab.tsx +265 -227
  83. package/src/client/components/CliPullPreview.tsx +116 -107
  84. package/src/client/components/CopyButton.tsx +57 -57
  85. package/src/client/components/GatewayTab.tsx +469 -409
  86. package/src/client/components/NoticeBanner.tsx +46 -46
  87. package/src/client/components/ProgressBar.tsx +53 -53
  88. package/src/client/components/ProviderCard.tsx +606 -502
  89. package/src/client/components/SettingsTabs.tsx +75 -75
  90. package/src/client/components/ToggleSwitch.tsx +71 -62
  91. package/src/client/constants.ts +224 -206
  92. package/src/client/display.ts +61 -61
  93. package/src/client/dshClientAdapter.ts +109 -0
  94. package/src/client/gatewaySnippets.ts +37 -36
  95. package/src/client/index.tsx +156 -37
  96. package/src/client/locales.ts +535 -491
  97. package/src/client/microStyles.ts +52 -33
  98. package/src/client/parsers.ts +396 -386
  99. package/src/client/styles.ts +325 -307
  100. package/src/client/types.ts +197 -185
  101. package/src/codex-http.ts +447 -447
  102. package/src/codex-images.ts +485 -485
  103. package/src/codex-model-capabilities.ts +320 -320
  104. package/src/codex-search.ts +245 -245
  105. package/src/codex-usage.ts +263 -263
  106. package/src/compatibility.ts +55 -0
  107. package/src/dsh-host-adapter.ts +171 -0
  108. package/src/gateway-anthropic-messages.ts +84 -84
  109. package/src/gateway-auth.ts +102 -100
  110. package/src/gateway-backend.ts +274 -274
  111. package/src/gateway-body.ts +49 -49
  112. package/src/gateway-config.ts +76 -76
  113. package/src/gateway-http.ts +104 -104
  114. package/src/gateway-openai-chat.ts +124 -124
  115. package/src/gateway-openai-responses.ts +53 -53
  116. package/src/gateway-parse.ts +224 -224
  117. package/src/gateway-protocol.ts +52 -52
  118. package/src/gateway-routes.ts +158 -152
  119. package/src/gateway.ts +258 -242
  120. package/src/grok-errors.ts +24 -24
  121. package/src/grok-imagine.ts +1627 -1627
  122. package/src/grok-import.ts +151 -151
  123. package/src/http-json.ts +82 -82
  124. package/src/ids.ts +59 -45
  125. package/src/imagine-routes.ts +463 -461
  126. package/src/index.ts +748 -598
  127. package/src/invariant.ts +17 -17
  128. package/src/kimi-errors.ts +26 -26
  129. package/src/media-store.ts +927 -927
  130. package/src/oauth-import-routes.ts +324 -314
  131. package/src/oauth-providers.ts +152 -152
  132. package/src/oauth-session.ts +183 -183
  133. package/src/oauth-sources.ts +1104 -1104
  134. package/src/oauth.ts +620 -620
  135. package/src/provider.ts +128 -128
  136. package/src/proxy.ts +11 -99
  137. package/src/redact.ts +72 -72
  138. package/src/session.ts +218 -218
  139. package/src/store.ts +217 -217
  140. package/src/web-origin.ts +296 -60
  141. package/src/web-routes.ts +38 -75
package/CHANGELOG.md CHANGED
@@ -1,207 +1,222 @@
1
- # Changelog
2
-
3
- All notable changes to `dsh-coding-subscription-oauth` are documented here, following the release loop in `docs/00-project-rules.md`. Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Versioning follows [SemVer](https://semver.org/).
4
-
1
+ # Changelog
2
+
3
+ All notable changes to `dsh-coding-subscription-oauth` are documented here, following the release loop in `docs/00-project-rules.md`. Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Versioning follows [SemVer](https://semver.org/).
4
+
5
5
  ## Unreleased
6
6
 
7
- ## v0.5.8 - 2026-08-22
8
-
9
- ### Fixed
10
-
11
- - Make the tag Release workflow idempotent for GitHub Releases (create or edit) and run npm provenance publish in a separate job so a pre-existing release no longer skips publishing.
12
- - Skip npm publish when the exact version is already on the registry, then verify `npm view` matches the tag.
13
- - Finish Settings theme polish: Gateway enable uses ToggleSwitch, OpenAI/Anthropic copy actions share CopyButton, snippet tabs get keyboard/ARIA parity, About gains a real heading and docs link, ProgressBar uses `button-info-fill`, and warn banners use warn-colored styling.
14
-
15
- ### Changed
16
-
17
- - Relax Docker preview seed/`run-preview.sh` so they accept the installed `@deepseek-ai/dsh` version instead of a hard-coded `0.1.0-rc.6` pin.
18
- - Extend `release.mjs` version checks to `INSTALL.md` and `README.zh-CN.md`.
19
- - Document npm Trusted Publishing binding steps in `CONTRIBUTING.md`.
20
-
21
- ## v0.5.7 - 2026-08-22
22
-
23
- ### Fixed
24
-
25
- - Make Settings primary CTAs, active step markers, and toggle thumbs follow DSH `button-primary-fill` + `label-primary-foreground` so dark theme (where brand-primary inverts to near-white) no longer renders white-on-white buttons (#13).
26
- - Use readable `label-tertiary` for neutral badges/status dots instead of near-invisible `label-dimmed`, and correct the warn token spelling to `state-warn-primary`.
27
-
28
- ## v0.5.6 - 2026-08-19
29
-
30
- ### Fixed
31
-
32
- - Relax Docker preview seed checks so `web-preview` images build against the current plugin version and installed DSH peer packages instead of hard-coded semver pins.
33
- - Improve the settings screenshot capture script so isolated DSH preview overlays (Continue, internal testing notice, modal masks) are dismissed before opening **Settings → Coding OAuth**.
34
-
35
- ### Documentation
36
-
37
- - Refresh Settings product screenshots under `media/` for the v0.5.5 UI redesign: segmented tabs with live hints, semantic status badges, sign-in step flow, toggle switches on Capabilities, and gateway quick-setup snippets on Gateway.
38
- - Record npm publication confirmation for `dsh-coding-subscription-oauth@0.5.5` and keep README install commands on the latest release.
39
-
40
- ## v0.5.5 - 2026-08-19
41
-
42
- ### Changed
43
-
44
- - Redesign the Coding OAuth Settings client: semantic status badges, segmented tabs with live hints, toggle switches for capabilities, sign-in step flow with copy actions, model search/filter controls, Codex usage progress bars, gateway quick-setup snippets (cURL / Python / IDE), skeleton pulse animations, and auto-dismiss success notices.
45
-
46
- ## v0.5.4 - 2026-08-19
47
-
48
- ### Changed
49
-
50
- - Improve remote/headless Settings UX: prefer device-code CTAs on non-loopback hosts, collapse noisy per-card CLI-missing hints into one neutral tip, shorten Capabilities copy, move Antigravity onto Accounts, and enrich About with remote-login help plus plugin version.
51
- - Load Gateway and Imagine status only when their tabs open; soft-fetch Capabilities when Codex is signed in so quota can still appear on Accounts.
52
- - Split the Settings client into tab/components modules with display/parser Vitest coverage, and make `promote-release` resilient to overlay `EXDEV` renames.
53
-
54
- ### Documentation
55
-
56
- - Refresh Settings product screenshots under `media/` for the remote-host Accounts tip, device-code-first CTAs, quieter CLI-missing banner, Gateway loopback hint, and shortened Capabilities copy; keep the three-column README gallery (Accounts / Gateway / Capabilities).
57
- - Record previously unreleased screenshot gallery work (Accounts / Gateway / Capabilities under `media/`, three-column README layout) in this release.
58
-
59
- ## v0.5.3 - 2026-08-19
60
-
61
- ### Changed
62
-
63
- - Raise the default OAuth route retry policy to 5 stacked exponential delays (5 s → 10 s → 20 s → 40 s → 80 s, ~155 s total, 10% jitter).
64
- - Remap xAI “at capacity / high demand / priority processing / overloaded” finish messages to `RATE_LIMIT` so harness retries run instead of failing as `PI_AI_ERROR` when upstream `error.code` is null.
65
-
66
- ## v0.5.2 - 2026-08-18
67
-
68
- ### Documentation
69
-
70
- - Make the published npm package the first installation path for normal users; keep GitHub and local-directory installs explicitly as development or fallback options.
71
-
72
- ## v0.5.1 - 2026-08-18
73
-
74
- ### Documentation
75
-
76
- - Sync the English and translated READMEs with the v0.5.0 Settings tabs, collapsed account cards, local gateway copy/reveal/rotation controls, persisted listen-port controls, and npm installation path.
77
-
78
- ## v0.5.0 - 2026-08-17
7
+ ## v0.6.0 - 2026-08-22
79
8
 
80
9
  ### Added
81
10
 
82
- - Add an opt-in local API gateway (`gateway.enabled`, default off) that binds loopback-only and serves `/healthz`, `/v1/models`, streaming `POST /v1/chat/completions`, `POST /v1/responses`, and `POST /v1/messages` from signed-in subscription sessions.
83
- - Let Settings copy the OpenAI/Anthropic base URLs and the current Bearer key. Loopback `POST /gateway/reveal` returns the current key without rotating it; rotate stays a confirmed destructive action.
84
- - Let Settings change the gateway listen port with Apply or Random (18100–18999). The chosen port is stored in the owner-only gateway document and the listener rebinds when it is already running.
11
+ - Add exact DSH BOM/client platform gates, host/client compatibility adapters, trusted remote owner policy, and shared `dsh-coding-oauth-core` owner election for standalone/Hub co-installation.
85
12
 
86
13
  ### Changed
87
14
 
88
- - Rebuild Settings as four top tabs (Accounts, Gateway, Capabilities, About). Signed-in account cards stay collapsed until expanded, CLI pull preview is full-width, and Imagine status sits on Capabilities.
89
-
90
- ## v0.4.1 - 2026-08-17
91
-
92
- ### Added
93
-
94
- - Add accessible live numeric controls for `searchResults`, `imageCount`, and video artifact retention (shown as 1–168 hours), using the same compare-and-swap conflict handling as capability switches. Lowering retention rewrites and cleans existing expiries; raising it affects only new artifacts.
95
- - Add a fast `check:next` Docker development gate (`lint` + `typecheck` + tests) before the full release build gate.
96
-
97
- ### Changed
98
-
99
- - Resolve the Codex search model at call time so sign-in, sign-out, and live catalog changes do not leave a stale model captured by an existing provider.
100
- - Clarify browser, device-code, and manual redirect/code sign-in guidance; use the profile-aware Antigravity command `dsh plugin --profile web exec dsh-agy login --headless`.
101
- - Raise the `undici` floor to `^7.24.8` so scoped `socks5://` proxies are supported.
102
- - Document the first public install path as `dsh plugin --profile web add dsh-coding-subscription-oauth@0.4.1`, matching other DSH plugins.
103
-
104
- ### Fixed
105
-
106
- - Declare image input on the Grok 4.5 and Grok 4.6 baseline descriptors so both fallback and live-derived catalog entries accept image attachments instead of failing locally as unsupported.
107
- - Resolve subscription requests from the refreshed access token persisted by each OAuth session. This prevents Kimi's header-only `Authorization: Bearer` auth result from being misclassified as “not signed in” merely because it has no `auth.apiKey` field.
108
- - Treat Kimi Code's HTTP 401 `authentication_error` that says a model `supports only 256K context` as `CONTEXT_WINDOW_EXCEEDED`. The previous AUTH classification invalidated a still-valid token and retried a request that cannot succeed.
109
- - Strip `user:pass@` from the CLI proxy line, and when a scoped proxy is installed append a `CODING_OAUTH_PROXY` reachability hint to Grok discovery, token, and live-catalog transport errors.
110
- - Preserve composition capability defaults before Settings is injected and after a Settings service is replaced or disposed; contain asynchronous settings-listener failures; keep empty PATCH writes revision-checked but side-effect free.
111
- - Make generated media download filenames safe for `Content-Disposition` while preserving opaque DSH attachment ids.
112
- - Dispose in-flight Grok Imagine API/download work before awaiting media cleanup, isolate caller-owned video-poll cancellation, and remove an artifact if cancellation wins during persistence.
113
- - Finish Settings disposal even when an injected watch disposer throws, while reporting the contained failure.
114
- - Reject owner-only or group/world-writable npm package entries and require the packed CLI to remain executable.
115
- - Close preview-proxy WebSocket halves when either side ends so isolated proxy tests and shutdown cannot hang on leftover upgrade pipes.
116
-
117
- ### Security
118
-
119
- - Require Grok discovery to declare the exact configured issuer identity, pin authorization/token endpoints to its approved origin, refuse redirects, bound discovery/token responses and pasted authorization codes, and redact every repeated opaque credential-shaped diagnostic.
120
- - Reject unknown, secret-shaped, mistyped, fractional, and out-of-range capability writes instead of silently coercing or clamping caller-authored values.
121
- - Add a 60-second Codex request ceiling that covers response streaming, plus cancellation-aware stream cleanup; strengthen Imagine request-id, prompt, base64, redirect, MIME, size, and cancellation boundaries.
122
-
123
- ## v0.4.0 - 2026-08-16
124
-
125
- ### Added
126
-
127
- - Add read-only Settings discovery of allowlisted official Grok / Codex / Kimi / Claude CLI OAuth files, plus an explicit one-way manual Pull: discover → preview → conflict/fingerprint check → overwrite confirmation. Official CLI files are never written.
128
- - Add default-off live optional capabilities: Codex search, usage/quota, image generation/edit, Fast, and Grok Imagine image/video. Limits: search results 1–20, image count 1–4, artifact TTL 1 hour–7 days. A secret-free `capabilities` composition base is optional; user settings override it.
129
- - Advertise `codex-oauth-fast` only after a fresh live catalog lists at least one `priority`-eligible model. Requests send `service_tier: priority` and a routing hint. The UI says **Fast requested** and does not guarantee latency or upstream honor.
130
- - Add opt-in Codex private `chatgpt.com/backend-api` endpoints. Image generation uses the fixed model `gpt-image-2`. Image edit requires current-session top-level attachment ownership.
131
- - Add Grok Imagine against official `https://api.x.ai` with `grok-imagine-image-2.0` and `grok-imagine-video-1.5`, using a separate DSH credential reference `XAI_API_KEY` (never Grok OAuth, never a process-env fallback).
132
- - Serve generated outputs on same-origin loopback routes under `/plugins/dsh-grok-build/imagine/*`. Remote downloads apply MIME / size / time / redirect / DNS controls from frozen hosts `imgen.x.ai`, `videogen.x.ai`, and `vidgen.x.ai`. The private artifact store hard-caps both one object and aggregate unique object bytes at 256 MiB, with retention capped at seven days.
133
-
134
- ### Changed
135
-
136
- - Add a tracked multi-stage Docker sandbox for networkless check/verify, generated artifact export, local candidate packaging, and a script-disabled isolated consumer install.
137
- - Settings CLI synchronization is a manual Pull, not auto-import. Discovery stays automatic and read-only; writing the dsh store still requires preview and an explicit confirm.
138
- - Capability switches apply live; turning one off withdraws the matching search provider, tools, or Fast route without a restart.
139
-
140
- ### Fixed
141
-
142
- - Bound in-memory Pull preview tickets to one-use, a five-minute TTL, and a process maximum of 32 so credential-bearing preview material cannot accumulate.
143
-
144
- ### Security
145
-
146
- - Harden official CLI reads: reject symlinks, non-regular files, non-owner files, group/other access, and oversized documents; open with `O_NOFOLLOW`; never write the official CLI path.
147
- - Keep Imagine media on frozen xAI output hosts with DNS pinning and blocked private/loopback addresses; never return a signed upstream URL to the client.
148
-
149
- ## v0.3.0
150
-
151
- ### Added
152
-
153
- - Add a provider retry policy for the four OAuth routes: transient failures (`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`) **and `AUTH`** now retry with exponential backoff (default 2 retries, 500 ms → 10 s, 10% jitter) instead of killing the turn.
154
- - Add AUTH-failure credential invalidation: when an upstream rejects a locally-valid token with 401/403, the stored credential's expiry is backdated so the retried step refreshes before reuse — recovering the stale-token 401 race without user-visible failure.
155
- - Add an optional `retryPolicy` plugin config (harness `RetryPolicySchema`) to override the built-in policy per deployment.
156
-
157
- ### Changed
158
-
159
- - Migrate the package toolchain from npm/tsdown to pnpm 11, TypeScript 6, Biome, and an esbuild multi-entry server/client build with declaration emit, promote/verify, and CI. Published package identity, dual CLI, Cordis/HTTP/credential identifiers, and `pi-ai` 0.84.2 stay unchanged.
160
- - Require Node.js 22.19+ (or 24+) for the TypeScript 6/esbuild release pipeline and runtime bundle.
161
- - Upgrade `@earendil-works/pi-ai` to `^0.84.2`: OAuth access tokens now refresh proactively five minutes before the stored expiry (previously only at the exact expiry instant, which raced server-side revocation on the Kimi/Codex routes), with a 15 s refresh timeout.
162
- - Request OAuth access tokens with an explicit minimum remaining validity (60 s); a refresh that returns an even-shorter-lived token hard-fails instead of being handed to a request.
163
- - Translate a rejected token refresh (revoked refresh token / dead grant) into `MISSING_CREDENTIAL` with a sign-in prompt rather than surfacing a bare upstream 401, and never retry it.
164
- - Quota exhaustion stays outside the retryable set so a billing-limit response fails fast with its real message instead of the generic "API key is invalid".
165
- - Expand README (all languages) with a searchable “problems this plugin solves” table covering SuperGrok vs `api.x.ai`, AUTH/`API key is invalid`, `INVALID_REPLAY_STATE`, grok-4.6 `xhigh`, Kimi Bearer vs `x-api-key`, remote device login and China-direct Kimi.
166
- - Rename the published project to **`dsh-coding-subscription-oauth`**. The old `dsh-grok-build` name only covered the first provider. Cordis id, HTTP `/plugins/dsh-grok-build/*` paths, credential files and the `dsh-grok-build` CLI alias stay compatible.
167
-
168
- ### Fixed
169
-
170
- - Fix the stale-token 401 turn failure (`API key is invalid` banner) observed on the Kimi Code OAuth route when an access token expired mid-session: the turn now refreshes and retries transparently.
171
- - Expose Grok 4.6 `xhigh` reasoning effort. Live `/models-v2` already returns `reasoning_efforts` including xhigh, but the plugin previously kept only model ids and materialized grok-4.6 from the grok-4.5 template. pi-ai hides xhigh unless that key is an explicit non-null mapping. The catalog now applies live effort lists; the baseline ships grok-4.6 with xhigh while grok-4.5 stays low/medium/high.
172
- - Invalidate credentials on an `AUTH` finish even when that same finish also carries replay state, then rewrite the replay provider without skipping the refresh path.
173
- - Bound OAuth JSON request bodies to 64 KiB (400 for malformed JSON, 413 for oversized bodies) and stream the live model catalog through a real 4 MiB ceiling.
174
- - Contain startup cache/catalog failures and redact token-like material from refresh diagnostics instead of retaining it in user-visible errors or error causes.
175
-
176
- ## v0.2.0
177
-
178
- ### Added
179
-
180
- - Add unified `/plugins/dsh-grok-build/oauth/*` API across Grok, Codex, Kimi and Claude.
181
- - Add `codex-oauth`, `kimi-code-oauth` and `claude-code-oauth` routes alongside the preserved Grok Build and native API-key routes.
182
- - Add the Coding OAuth settings page with per-provider sign-in, model selection and status cards.
183
- - Add pinned `dsh-agy@0.1.2` integration for Google Antigravity and a safe patch that hides unauthenticated models and labels the provider `(OAuth)`.
184
- - Add authentication-gated model discovery: unauthenticated OAuth routes expose no models, while authenticated providers are explicitly labelled `(OAuth)`.
185
- - Add `verify:deployed` and `smoke:deployed` scripts for live-deployment verification.
186
- - Add plugin-level scoped proxy configuration (`config.proxy`) and Kimi direct-connect default.
187
- - Add high-contrast settings actions and localized community README translations.
15
+ - Redesign Provider management around summaries, local model drafts with batch apply, in-card CLI Pull preview, real Gateway models, explicit confirmations, retryable loading states, and compact Hub-owned co-install UI.
16
+ - Keep OAuth/Web ownership independent from optional LLM services and wait for required Web routes before reporting the standalone runtime active.
188
17
 
189
18
  ### Fixed
190
19
 
191
- - Fix Kimi OAuth wire authentication so the final request uses `Authorization: Bearer` without an extra Anthropic `x-api-key`.
192
- - Fix OAuth catalog refresh so listeners cannot make a successful login/logout appear failed, and cleanup failures cannot leave stale models visible.
193
- - Fix OAuth route replay state so Codex/Kimi assistant messages keep the Harness route provider id and remain replayable across multi-turn conversations.
194
- - Heal older poisoned OAuth replay metadata at request time and strip replay state when switching between sibling OAuth routes.
195
- - Make deployment smoke require explicit `DSH_RESTORE_PROVIDER`/`DSH_RESTORE_MODEL`, then restore that default after testing.
196
-
197
- ### Security
198
-
199
- - Store all OAuth credential files as owner-only `0600` with atomic writes and cross-process locks.
200
- - Keep OAuth tokens out of HTTP status responses, logs and the settings UI.
201
- - Document disabling the unauthenticated `dsh-agy-web` dashboard on trusted-host deployments.
202
-
203
- ## v0.1.0
204
-
205
- - Initial release: Grok Build device OAuth, `import`, dynamic `/v1/models-v2` catalog and Responses streaming inference.
206
- - `dsh-grok-build` CLI with login/import/status/logout.
207
- - Web settings section for Grok Build account.
20
+ - Restore focus after CLI previews and logout confirmation, remove ARIA relationships to unmounted panels, and verify release client imports against the official DSH `PLATFORM_MODULES` contract.
21
+
22
+ ## v0.5.8 - 2026-08-22
23
+
24
+ ### Fixed
25
+
26
+ - Make the tag Release workflow idempotent for GitHub Releases (create or edit) and run npm provenance publish in a separate job so a pre-existing release no longer skips publishing.
27
+ - Skip npm publish when the exact version is already on the registry, then verify `npm view` matches the tag.
28
+ - Finish Settings theme polish: Gateway enable uses ToggleSwitch, OpenAI/Anthropic copy actions share CopyButton, snippet tabs get keyboard/ARIA parity, About gains a real heading and docs link, ProgressBar uses `button-info-fill`, and warn banners use warn-colored styling.
29
+
30
+ ### Changed
31
+
32
+ - Relax Docker preview seed/`run-preview.sh` so they accept the installed `@deepseek-ai/dsh` version instead of a hard-coded `0.1.0-rc.6` pin.
33
+ - Extend `release.mjs` version checks to `INSTALL.md` and `README.zh-CN.md`.
34
+ - Document npm Trusted Publishing binding steps in `CONTRIBUTING.md`.
35
+
36
+ ## v0.5.7 - 2026-08-22
37
+
38
+ ### Fixed
39
+
40
+ - Make Settings primary CTAs, active step markers, and toggle thumbs follow DSH `button-primary-fill` + `label-primary-foreground` so dark theme (where brand-primary inverts to near-white) no longer renders white-on-white buttons (#13).
41
+ - Use readable `label-tertiary` for neutral badges/status dots instead of near-invisible `label-dimmed`, and correct the warn token spelling to `state-warn-primary`.
42
+
43
+ ## v0.5.6 - 2026-08-19
44
+
45
+ ### Fixed
46
+
47
+ - Relax Docker preview seed checks so `web-preview` images build against the current plugin version and installed DSH peer packages instead of hard-coded semver pins.
48
+ - Improve the settings screenshot capture script so isolated DSH preview overlays (Continue, internal testing notice, modal masks) are dismissed before opening **Settings → Coding OAuth**.
49
+
50
+ ### Documentation
51
+
52
+ - Refresh Settings product screenshots under `media/` for the v0.5.5 UI redesign: segmented tabs with live hints, semantic status badges, sign-in step flow, toggle switches on Capabilities, and gateway quick-setup snippets on Gateway.
53
+ - Record npm publication confirmation for `dsh-coding-subscription-oauth@0.5.5` and keep README install commands on the latest release.
54
+
55
+ ## v0.5.5 - 2026-08-19
56
+
57
+ ### Changed
58
+
59
+ - Redesign the Coding OAuth Settings client: semantic status badges, segmented tabs with live hints, toggle switches for capabilities, sign-in step flow with copy actions, model search/filter controls, Codex usage progress bars, gateway quick-setup snippets (cURL / Python / IDE), skeleton pulse animations, and auto-dismiss success notices.
60
+
61
+ ## v0.5.4 - 2026-08-19
62
+
63
+ ### Changed
64
+
65
+ - Improve remote/headless Settings UX: prefer device-code CTAs on non-loopback hosts, collapse noisy per-card CLI-missing hints into one neutral tip, shorten Capabilities copy, move Antigravity onto Accounts, and enrich About with remote-login help plus plugin version.
66
+ - Load Gateway and Imagine status only when their tabs open; soft-fetch Capabilities when Codex is signed in so quota can still appear on Accounts.
67
+ - Split the Settings client into tab/components modules with display/parser Vitest coverage, and make `promote-release` resilient to overlay `EXDEV` renames.
68
+
69
+ ### Documentation
70
+
71
+ - Refresh Settings product screenshots under `media/` for the remote-host Accounts tip, device-code-first CTAs, quieter CLI-missing banner, Gateway loopback hint, and shortened Capabilities copy; keep the three-column README gallery (Accounts / Gateway / Capabilities).
72
+ - Record previously unreleased screenshot gallery work (Accounts / Gateway / Capabilities under `media/`, three-column README layout) in this release.
73
+
74
+ ## v0.5.3 - 2026-08-19
75
+
76
+ ### Changed
77
+
78
+ - Raise the default OAuth route retry policy to 5 stacked exponential delays (5 s → 10 s → 20 s → 40 s → 80 s, ~155 s total, 10% jitter).
79
+ - Remap xAI “at capacity / high demand / priority processing / overloaded” finish messages to `RATE_LIMIT` so harness retries run instead of failing as `PI_AI_ERROR` when upstream `error.code` is null.
80
+
81
+ ## v0.5.2 - 2026-08-18
82
+
83
+ ### Documentation
84
+
85
+ - Make the published npm package the first installation path for normal users; keep GitHub and local-directory installs explicitly as development or fallback options.
86
+
87
+ ## v0.5.1 - 2026-08-18
88
+
89
+ ### Documentation
90
+
91
+ - Sync the English and translated READMEs with the v0.5.0 Settings tabs, collapsed account cards, local gateway copy/reveal/rotation controls, persisted listen-port controls, and npm installation path.
92
+
93
+ ## v0.5.0 - 2026-08-17
94
+
95
+ ### Added
96
+
97
+ - Add an opt-in local API gateway (`gateway.enabled`, default off) that binds loopback-only and serves `/healthz`, `/v1/models`, streaming `POST /v1/chat/completions`, `POST /v1/responses`, and `POST /v1/messages` from signed-in subscription sessions.
98
+ - Let Settings copy the OpenAI/Anthropic base URLs and the current Bearer key. Loopback `POST /gateway/reveal` returns the current key without rotating it; rotate stays a confirmed destructive action.
99
+ - Let Settings change the gateway listen port with Apply or Random (18100–18999). The chosen port is stored in the owner-only gateway document and the listener rebinds when it is already running.
100
+
101
+ ### Changed
102
+
103
+ - Rebuild Settings as four top tabs (Accounts, Gateway, Capabilities, About). Signed-in account cards stay collapsed until expanded, CLI pull preview is full-width, and Imagine status sits on Capabilities.
104
+
105
+ ## v0.4.1 - 2026-08-17
106
+
107
+ ### Added
108
+
109
+ - Add accessible live numeric controls for `searchResults`, `imageCount`, and video artifact retention (shown as 1–168 hours), using the same compare-and-swap conflict handling as capability switches. Lowering retention rewrites and cleans existing expiries; raising it affects only new artifacts.
110
+ - Add a fast `check:next` Docker development gate (`lint` + `typecheck` + tests) before the full release build gate.
111
+
112
+ ### Changed
113
+
114
+ - Resolve the Codex search model at call time so sign-in, sign-out, and live catalog changes do not leave a stale model captured by an existing provider.
115
+ - Clarify browser, device-code, and manual redirect/code sign-in guidance; use the profile-aware Antigravity command `dsh plugin --profile web exec dsh-agy login --headless`.
116
+ - Raise the `undici` floor to `^7.24.8` so scoped `socks5://` proxies are supported.
117
+ - Document the first public install path as `dsh plugin --profile web add dsh-coding-subscription-oauth@0.4.1`, matching other DSH plugins.
118
+
119
+ ### Fixed
120
+
121
+ - Declare image input on the Grok 4.5 and Grok 4.6 baseline descriptors so both fallback and live-derived catalog entries accept image attachments instead of failing locally as unsupported.
122
+ - Resolve subscription requests from the refreshed access token persisted by each OAuth session. This prevents Kimi's header-only `Authorization: Bearer` auth result from being misclassified as “not signed in” merely because it has no `auth.apiKey` field.
123
+ - Treat Kimi Code's HTTP 401 `authentication_error` that says a model `supports only 256K context` as `CONTEXT_WINDOW_EXCEEDED`. The previous AUTH classification invalidated a still-valid token and retried a request that cannot succeed.
124
+ - Strip `user:pass@` from the CLI proxy line, and when a scoped proxy is installed append a `CODING_OAUTH_PROXY` reachability hint to Grok discovery, token, and live-catalog transport errors.
125
+ - Preserve composition capability defaults before Settings is injected and after a Settings service is replaced or disposed; contain asynchronous settings-listener failures; keep empty PATCH writes revision-checked but side-effect free.
126
+ - Make generated media download filenames safe for `Content-Disposition` while preserving opaque DSH attachment ids.
127
+ - Dispose in-flight Grok Imagine API/download work before awaiting media cleanup, isolate caller-owned video-poll cancellation, and remove an artifact if cancellation wins during persistence.
128
+ - Finish Settings disposal even when an injected watch disposer throws, while reporting the contained failure.
129
+ - Reject owner-only or group/world-writable npm package entries and require the packed CLI to remain executable.
130
+ - Close preview-proxy WebSocket halves when either side ends so isolated proxy tests and shutdown cannot hang on leftover upgrade pipes.
131
+
132
+ ### Security
133
+
134
+ - Require Grok discovery to declare the exact configured issuer identity, pin authorization/token endpoints to its approved origin, refuse redirects, bound discovery/token responses and pasted authorization codes, and redact every repeated opaque credential-shaped diagnostic.
135
+ - Reject unknown, secret-shaped, mistyped, fractional, and out-of-range capability writes instead of silently coercing or clamping caller-authored values.
136
+ - Add a 60-second Codex request ceiling that covers response streaming, plus cancellation-aware stream cleanup; strengthen Imagine request-id, prompt, base64, redirect, MIME, size, and cancellation boundaries.
137
+
138
+ ## v0.4.0 - 2026-08-16
139
+
140
+ ### Added
141
+
142
+ - Add read-only Settings discovery of allowlisted official Grok / Codex / Kimi / Claude CLI OAuth files, plus an explicit one-way manual Pull: discover → preview → conflict/fingerprint check → overwrite confirmation. Official CLI files are never written.
143
+ - Add default-off live optional capabilities: Codex search, usage/quota, image generation/edit, Fast, and Grok Imagine image/video. Limits: search results 1–20, image count 1–4, artifact TTL 1 hour–7 days. A secret-free `capabilities` composition base is optional; user settings override it.
144
+ - Advertise `codex-oauth-fast` only after a fresh live catalog lists at least one `priority`-eligible model. Requests send `service_tier: priority` and a routing hint. The UI says **Fast requested** and does not guarantee latency or upstream honor.
145
+ - Add opt-in Codex private `chatgpt.com/backend-api` endpoints. Image generation uses the fixed model `gpt-image-2`. Image edit requires current-session top-level attachment ownership.
146
+ - Add Grok Imagine against official `https://api.x.ai` with `grok-imagine-image-2.0` and `grok-imagine-video-1.5`, using a separate DSH credential reference `XAI_API_KEY` (never Grok OAuth, never a process-env fallback).
147
+ - Serve generated outputs on same-origin loopback routes under `/plugins/dsh-grok-build/imagine/*`. Remote downloads apply MIME / size / time / redirect / DNS controls from frozen hosts `imgen.x.ai`, `videogen.x.ai`, and `vidgen.x.ai`. The private artifact store hard-caps both one object and aggregate unique object bytes at 256 MiB, with retention capped at seven days.
148
+
149
+ ### Changed
150
+
151
+ - Add a tracked multi-stage Docker sandbox for networkless check/verify, generated artifact export, local candidate packaging, and a script-disabled isolated consumer install.
152
+ - Settings CLI synchronization is a manual Pull, not auto-import. Discovery stays automatic and read-only; writing the dsh store still requires preview and an explicit confirm.
153
+ - Capability switches apply live; turning one off withdraws the matching search provider, tools, or Fast route without a restart.
154
+
155
+ ### Fixed
156
+
157
+ - Bound in-memory Pull preview tickets to one-use, a five-minute TTL, and a process maximum of 32 so credential-bearing preview material cannot accumulate.
158
+
159
+ ### Security
160
+
161
+ - Harden official CLI reads: reject symlinks, non-regular files, non-owner files, group/other access, and oversized documents; open with `O_NOFOLLOW`; never write the official CLI path.
162
+ - Keep Imagine media on frozen xAI output hosts with DNS pinning and blocked private/loopback addresses; never return a signed upstream URL to the client.
163
+
164
+ ## v0.3.0
165
+
166
+ ### Added
167
+
168
+ - Add a provider retry policy for the four OAuth routes: transient failures (`RATE_LIMIT`/`SERVER`/`TIMEOUT`/`TRANSPORT`/`EMPTY_RESPONSE`) **and `AUTH`** now retry with exponential backoff (default 2 retries, 500 ms → 10 s, 10% jitter) instead of killing the turn.
169
+ - Add AUTH-failure credential invalidation: when an upstream rejects a locally-valid token with 401/403, the stored credential's expiry is backdated so the retried step refreshes before reuse — recovering the stale-token 401 race without user-visible failure.
170
+ - Add an optional `retryPolicy` plugin config (harness `RetryPolicySchema`) to override the built-in policy per deployment.
171
+
172
+ ### Changed
173
+
174
+ - Migrate the package toolchain from npm/tsdown to pnpm 11, TypeScript 6, Biome, and an esbuild multi-entry server/client build with declaration emit, promote/verify, and CI. Published package identity, dual CLI, Cordis/HTTP/credential identifiers, and `pi-ai` 0.84.2 stay unchanged.
175
+ - Require Node.js 22.19+ (or 24+) for the TypeScript 6/esbuild release pipeline and runtime bundle.
176
+ - Upgrade `@earendil-works/pi-ai` to `^0.84.2`: OAuth access tokens now refresh proactively five minutes before the stored expiry (previously only at the exact expiry instant, which raced server-side revocation on the Kimi/Codex routes), with a 15 s refresh timeout.
177
+ - Request OAuth access tokens with an explicit minimum remaining validity (60 s); a refresh that returns an even-shorter-lived token hard-fails instead of being handed to a request.
178
+ - Translate a rejected token refresh (revoked refresh token / dead grant) into `MISSING_CREDENTIAL` with a sign-in prompt rather than surfacing a bare upstream 401, and never retry it.
179
+ - Quota exhaustion stays outside the retryable set so a billing-limit response fails fast with its real message instead of the generic "API key is invalid".
180
+ - Expand README (all languages) with a searchable “problems this plugin solves” table covering SuperGrok vs `api.x.ai`, AUTH/`API key is invalid`, `INVALID_REPLAY_STATE`, grok-4.6 `xhigh`, Kimi Bearer vs `x-api-key`, remote device login and China-direct Kimi.
181
+ - Rename the published project to **`dsh-coding-subscription-oauth`**. The old `dsh-grok-build` name only covered the first provider. Cordis id, HTTP `/plugins/dsh-grok-build/*` paths, credential files and the `dsh-grok-build` CLI alias stay compatible.
182
+
183
+ ### Fixed
184
+
185
+ - Fix the stale-token 401 turn failure (`API key is invalid` banner) observed on the Kimi Code OAuth route when an access token expired mid-session: the turn now refreshes and retries transparently.
186
+ - Expose Grok 4.6 `xhigh` reasoning effort. Live `/models-v2` already returns `reasoning_efforts` including xhigh, but the plugin previously kept only model ids and materialized grok-4.6 from the grok-4.5 template. pi-ai hides xhigh unless that key is an explicit non-null mapping. The catalog now applies live effort lists; the baseline ships grok-4.6 with xhigh while grok-4.5 stays low/medium/high.
187
+ - Invalidate credentials on an `AUTH` finish even when that same finish also carries replay state, then rewrite the replay provider without skipping the refresh path.
188
+ - Bound OAuth JSON request bodies to 64 KiB (400 for malformed JSON, 413 for oversized bodies) and stream the live model catalog through a real 4 MiB ceiling.
189
+ - Contain startup cache/catalog failures and redact token-like material from refresh diagnostics instead of retaining it in user-visible errors or error causes.
190
+
191
+ ## v0.2.0
192
+
193
+ ### Added
194
+
195
+ - Add unified `/plugins/dsh-grok-build/oauth/*` API across Grok, Codex, Kimi and Claude.
196
+ - Add `codex-oauth`, `kimi-code-oauth` and `claude-code-oauth` routes alongside the preserved Grok Build and native API-key routes.
197
+ - Add the Coding OAuth settings page with per-provider sign-in, model selection and status cards.
198
+ - Add pinned `dsh-agy@0.1.2` integration for Google Antigravity and a safe patch that hides unauthenticated models and labels the provider `(OAuth)`.
199
+ - Add authentication-gated model discovery: unauthenticated OAuth routes expose no models, while authenticated providers are explicitly labelled `(OAuth)`.
200
+ - Add `verify:deployed` and `smoke:deployed` scripts for live-deployment verification.
201
+ - Add plugin-level scoped proxy configuration (`config.proxy`) and Kimi direct-connect default.
202
+ - Add high-contrast settings actions and localized community README translations.
203
+
204
+ ### Fixed
205
+
206
+ - Fix Kimi OAuth wire authentication so the final request uses `Authorization: Bearer` without an extra Anthropic `x-api-key`.
207
+ - Fix OAuth catalog refresh so listeners cannot make a successful login/logout appear failed, and cleanup failures cannot leave stale models visible.
208
+ - Fix OAuth route replay state so Codex/Kimi assistant messages keep the Harness route provider id and remain replayable across multi-turn conversations.
209
+ - Heal older poisoned OAuth replay metadata at request time and strip replay state when switching between sibling OAuth routes.
210
+ - Make deployment smoke require explicit `DSH_RESTORE_PROVIDER`/`DSH_RESTORE_MODEL`, then restore that default after testing.
211
+
212
+ ### Security
213
+
214
+ - Store all OAuth credential files as owner-only `0600` with atomic writes and cross-process locks.
215
+ - Keep OAuth tokens out of HTTP status responses, logs and the settings UI.
216
+ - Document disabling the unauthenticated `dsh-agy-web` dashboard on trusted-host deployments.
217
+
218
+ ## v0.1.0
219
+
220
+ - Initial release: Grok Build device OAuth, `import`, dynamic `/v1/models-v2` catalog and Responses streaming inference.
221
+ - `dsh-grok-build` CLI with login/import/status/logout.
222
+ - Web settings section for Grok Build account.