dsh-keys-manager 0.2.5 → 0.2.8

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 CHANGED
@@ -2,6 +2,61 @@
2
2
 
3
3
  All notable changes to dsh-keys-manager are documented here. Assembled from `.changes/unreleased/` fragments by the release-prep workflow.
4
4
 
5
+ ## [0.2.8] - 2026-10-24
6
+
7
+ ### Changed
8
+
9
+ - Name all seven transport routes in the known limits, and stop describing `factory-droid` as deferred.
10
+ - Restructure both READMEs into grouped capability areas with comparison tables for accounts, transport routes and failure policy; the extra-provider catalog stays as a folded list.
11
+ - Regroup provider coverage into four groups — DSH built-in, plugin extra built-in, OAuth accounts and transport routes — with the supported and not-pooled lists folded into two details blocks; `kilo` and `zai` are OAuth accounts signed in by the plugin's bundled clients, not a separate category.
12
+ - Bump the `@oh-my-pi/*` build-time pin from 18.12.3 to 18.12.6 (whole cohort: pi-ai, pi-catalog, pi-utils, pi-natives, pi-wire, omptype) and regenerate the pi-ai patch; the cursor exec-frame handoff patch body is unchanged.
13
+
14
+ ### Fixed
15
+
16
+ - Restore the `legacy-tier` case in the Google transport note — the README now names both `legacy-tier` and paid accounts that must set `GOOGLE_CLOUD_PROJECT` / `GOOGLE_CLOUD_PROJECT_ID`.
17
+ - Cursor route: native `shell` (batch and streamed), `mini_swe_agent_bash`,
18
+ - The handoff translation into DSH's tool schemas is lossy: every `GrepArgs`
19
+ - The pinned `@oh-my-pi/pi-ai@18.12.3` is now patched via
20
+ - A transport route with no stored credential no longer appears in DSH's model picker or the Settings → Models provider list; the route's provider card and sign-in entry stay on the Keys Manager page.
21
+
22
+ ### Added
23
+
24
+ - Show each managed account's plan usage on its provider card: a compact one-line hint when collapsed, and an expanded strip with one thin bar per window (session and weekly), the used percentage and the reset countdown.
25
+ - Quota reads are pull-only, cached in memory with TTL jitter and failure backoff, and never touch key selection or cooldown; a provider whose plan cannot be read shows "not reported" (or "sign in again" on a stale OAuth account) instead of a zero bar.
26
+
27
+ ## [0.2.7] - 2026-10-24
28
+
29
+ ### Changed
30
+
31
+ - The published transport package's API docs and the root README (EN/ZH) now name every route the transport registers — all seven (`cursor`, `devin`, the two Google routes, `factory-droid` and the two GitLab Duo routes) — instead of claiming a Cursor-only plugin or four routes, so a reader sees the surface the package actually serves.
32
+ - An unmanaged extra provider's account button now shows a "signing in" label instead of "Adopting…" while it starts a sign-in, matching a path that never adopts.
33
+ - The static-bearer transport docs (README and known limits, EN/ZH) now say a grant with no expiry shows no expiry time and no countdown, matching the blank expiry cell instead of claiming there is no expiry line.
34
+ - A concurrent credential refresh no longer reports a missing credential for a healthy GitLab or Factory Droid account: the losing request now reads the refresh the winner already committed instead of failing.
35
+ - The model picker now projects the `gitlab-duo` (16 rows) and `gitlab-duo-agent` (1 row) catalogs: this plugin's route-to-accessor table was missing the two GitLab entries, so both routes reported a missing catalog and offered no models even though the transport package ships them.
36
+ - Bump the `@deepseek-ai/dsh-*` peer cohort to `^0.2.1-rc.3` (corridor `dsh-v0.2.1-rc.2` → `dsh-v0.2.1-rc.3`: More menus for browsing/creating plugins; New Session draft fix after switching sessions; DeepSeek API-key adapter model-list updates aligned with account sign-in). Session format v4 unchanged. README DSH badges follow.
37
+
38
+ ### Added
39
+
40
+ - Add the bundled `factory-droid` transport (`lib/omp/factory-droid.mjs`, 200 modules / ~2.0 MB) with a 62-row catalog generated from the pinned KDL registry seed, a WorkOS device-code sign-in, a refreshing credential record and a configurable `providers.factory-droid` allow-list. Three entry-scoped build substitutions (empty catalog data, a verbatim lean provider registry, a lean env-key map) keep the artifact small; the stripped env-key map is documented in `packages/llm-omp/docs/known-limits.md`.
41
+ - Add the bundled `gitlab-duo` proxy transport (`lib/omp/gitlab-duo.mjs`, 231 modules / 2.65 MB) over GitLab's AI gateway, with a 16-row alias catalog (upstream id + wire + compat per row), OAuth sign-in with PKCE on a loopback `localhost:8080/callback` (no port fallback, paste as the fallback path), and a refreshing credential record. `GITLAB_CLIENT_ID`/`GITLAB_REDIRECT_URI` register a custom app and `GITLAB_TOKEN` works as the bearer.
42
+ - Add the bundled `gitlab-duo-agent` Duo Workflow transport (`lib/omp/gitlab-duo-agent.mjs`, 118 modules / ~1.0 MB) with a one-row static catalog, paste-only `vscode://` sign-in, and a fresh per-request workflow seed so each turn replays the goal transcript through DSH's native tool loop.
43
+ - Register all three routes with their five sibling-shaped surfaces: a Models-page entry (`declared: false`, `providers.<route>`), a catalog projection for host pickers (`factoryDroidCatalogModels()`, `gitlabDuoCatalogModels()`, `gitlabDuoAgentCatalogModels()`), a lazy artifact load (`TRANSPORT_UNAVAILABLE` at request time), and one credential record per route at `llm-omp-transports/<route>`. Factory Droid also forwards the stored account scope to the transport as `oauthIdentity`.
44
+
45
+ ## [0.2.6] - 2026-10-24
46
+
47
+ ### Added
48
+
49
+ - Add the bundled `lib/omp/google.mjs` artifact: omp's Gemini Cloud Code Assist provider, shared by the `google-gemini-cli` and `google-antigravity` routes and dispatching on `model.provider`, with a manifest entry, pinned source hashes and a calibrated size ceiling.
50
+ - Add the generated Google model tables (`google-gemini-cli`, `google-antigravity`) and their `googleGeminiCliCatalogModels()` / `googleAntigravityCatalogModels()` projections for host-side model pickers.
51
+ - Add the `google-gemini-cli` and `google-antigravity` sign-in flows: a loopback listener on `127.0.0.1` (port fallback to an ephemeral port, five-minute bounded wait, abort-safe), a paste fallback, Cloud Code Assist project discovery and a single-window token refresh that preserves the project and an un-rotated refresh token.
52
+ - Register both Google routes: configurable `providers.google-gemini-cli` / `providers.google-antigravity` allow-lists, catalog-model exports for host pickers, and lazy loading of the shared `lib/omp/google.mjs` artifact (a missing build reaches the request as `TRANSPORT_UNAVAILABLE`, never a failed start).
53
+ - Project the transport package's model catalogs into the Keys Manager model picker for the `google-gemini-cli`, `google-antigravity` and `factory-droid` routes, each from its own catalog export.
54
+ - A transport build that registers one of these routes without shipping its catalog reports the missing catalog in the picker's response instead of showing an unexplained empty model list.
55
+
56
+ ### Fixed
57
+
58
+ - Fix the Cursor route's file and shell tools: DSH tools whose names collide with Cursor's native exec channel (`read`, `bash`, `write`, `delete`, `ls`, `grep`, `todo`) are advertised as `dsh_<name>` so the transport keeps them in its MCP tool list; the event stream restores the DSH name on the tool call, while history replay keeps the advertised `dsh_<name>` alias so the follow-up request matches. The seven `dsh_<native>` names are reserved: declaring a DSH tool under one fails the request with `TOOL_ALIAS_COLLISION` instead of being silently resolved.
59
+
5
60
  ## [0.2.5] - 2026-10-23
6
61
 
7
62
  ### Added
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm downloads](https://img.shields.io/npm/dm/dsh-keys-manager)](https://www.npmjs.com/package/dsh-keys-manager)
4
4
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
5
5
  [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-339933)](https://www.npmjs.com/package/dsh-keys-manager)
6
- [![DSH](https://img.shields.io/badge/DSH-%5E0.2.1--rc.2-0969DA)](https://www.npmjs.com/package/@deepseek-ai/dsh-llm)
6
+ [![DSH](https://img.shields.io/badge/DSH-%5E0.2.1--rc.3-0969DA)](https://www.npmjs.com/package/@deepseek-ai/dsh-llm)
7
7
 
8
8
  **English** | [简体中文](README.zh-CN.md)
9
9
 
@@ -12,98 +12,50 @@ It extends the Models page rather than replacing it: providers, models, and the
12
12
  model picker stay where they are; only the API-key source moves behind the
13
13
  manager.
14
14
 
15
- ## Features
15
+ ## What it does
16
16
 
17
- - Several keys per provider, each with an alias and health state.
18
- - One key pinned to a session, with round-robin selection for new sessions.
19
- - Bounded retry on the same key, then automatic failover to another key.
20
- - Exponential cooldown recovery, capped at seven days.
21
- - A search-driven Keys Manager page on the plugin's own detail page.
22
- - A "managed by Keys Manager" badge inside the existing Models provider cards.
23
- - Extra built-in providers installed as ordinary `llm-pi-ai` routes.
24
- - OAuth account sign-in for seven pi-ai-backed providers, stored beside
25
- the API keys.
26
- - A companion transport component for providers the vendored pi-ai cannot
27
- speak — Cursor (`cursor`) and Devin (`devin`) — installed with the plugin.
28
-
29
- ### Extra providers
17
+ **Pool and routing**
30
18
 
31
- This catalog of 35 extra providers comes from
32
- [oh-my-pi](https://github.com/can1357/oh-my-pi)'s provider catalog (MIT).
33
-
34
- <details>
35
- <summary>All 35 extra providers</summary>
19
+ - Several keys per provider, each with an alias and a health state.
20
+ - One key pinned to a session, round-robin for new sessions; a failing request
21
+ is retried on its key, then moved to another key.
22
+ - Exponential cooldown recovery, capped at seven days.
36
23
 
37
- | Provider | Route id | API key env |
38
- |---|---|---|
39
- | DeepInfra | `deepinfra` | `DEEPINFRA_API_KEY` |
40
- | Novita | `novita` | `NOVITA_API_KEY` |
41
- | StepFun | `stepfun` | `STEPFUN_API_KEY` |
42
- | SambaNova | `sambanova` | `SAMBANOVA_API_KEY` |
43
- | Qianfan | `qianfan` | `QIANFAN_API_KEY` |
44
- | GMI Cloud | `gmi-cloud` | `GMI_API_KEY` |
45
- | Synthetic | `synthetic` | `SYNTHETIC_API_KEY` |
46
- | ZenMux | `zenmux` | `ZENMUX_API_KEY` |
47
- | Kilo Gateway | `kilo` | `KILO_API_KEY` |
48
- | NanoGPT | `nanogpt` | `NANO_GPT_API_KEY` |
49
- | Venice AI | `venice` | `VENICE_API_KEY` |
50
- | AIML API | `aimlapi` | `AIMLAPI_API_KEY` |
51
- | AI& | `aiand` | `AIAND_API_KEY` |
52
- | Helmcode | `helmcode` | `HELMCODE_API_KEY` |
53
- | Alibaba Coding Plan | `alibaba-coding-plan` | `ALIBABA_CODING_PLAN_API_KEY` |
54
- | MiniMax Coding (Global) | `minimax-code` | `MINIMAX_CODE_API_KEY` |
55
- | MiniMax Coding (CN) | `minimax-code-cn` | `MINIMAX_CODE_CN_API_KEY` |
56
- | Umans AI Coding Plan | `umans` | `UMANS_AI_CODING_PLAN_API_KEY` |
57
- | Sakana AI | `sakana` | `SAKANA_API_KEY` |
58
- | CoralBricks | `coralbricks` | `CORAL_API_KEY` |
59
- | Wafer Serverless | `wafer-serverless` | `WAFER_SERVERLESS_API_KEY` |
60
- | Alibaba Token Plan | `alibaba-token-plan` | `ALIBABA_TOKEN_PLAN_API_KEY` |
61
- | Alibaba Token Plan (CN) | `alibaba-token-plan-cn` | `BAILIAN_TOKEN_PLAN_API_KEY` |
62
- | Charm Hyper | `charm-hyper` | `CHARM_HYPER_API_KEY`, `HYPER_API_KEY` |
63
- | LiteLLM Proxy | `litellm` | `LITELLM_API_KEY` |
64
- | SiliconFlow | `siliconflow` | `SILICONFLOW_API_KEY` |
65
- | SiliconFlow (CN) | `siliconflow-cn` | `SILICONFLOW_CN_API_KEY` |
66
- | Zhipu Coding Plan | `zhipu-coding-plan` | `ZHIPU_API_KEY` |
67
- | Abliteration | `abliteration` | `ABLITERATION_API_KEY`, `ABLIT_KEY` |
68
- | ClinePass | `cline-pass` | `CLINE_API_KEY` |
69
- | Command Code | `commandcode` | `COMMAND_CODE_API_KEY`, `COMMANDCODE_API_KEY` |
70
- | CoreWeave Serverless Inference | `coreweave` | `COREWEAVE_API_KEY` |
71
- | Fire Pass | `firepass` | `FIREPASS_API_KEY` |
72
- | Ollama Cloud | `ollama-cloud` | `OLLAMA_CLOUD_API_KEY` |
73
- | Yolo Auto | `yolo-auto` | `YOLO_AUTO_API_KEY` |
24
+ **Accounts and sign-in**
74
25
 
75
- Where two variables are listed, either is accepted; the first is the primary.
26
+ - Seven pi-ai OAuth providers can join the pool as an account instead of a
27
+ pasted key.
28
+ - Two more sign in through the plugin's own bundled clients: Kilo and Z.AI
29
+ Coding Plan.
30
+ - Seven companion transport routes for providers the vendored pi-ai cannot
31
+ speak: Cursor, Devin, the two Google routes, Factory Droid, and the two
32
+ GitLab Duo routes.
76
33
 
77
- CoreWeave Serverless Inference also needs `COREWEAVE_PROJECT=<team>/<project>` in the DSH process environment before it is added.
34
+ **Interface**
78
35
 
79
- </details>
36
+ - A search-driven Keys Manager page on the plugin's own detail page.
37
+ - A "managed by Keys Manager" badge inside the existing Models provider cards.
38
+ - Extra built-in providers installed as ordinary `llm-pi-ai` routes — 35 of
39
+ them, listed under [Provider coverage](#provider-coverage).
80
40
 
81
41
  ## Quick start
82
42
 
83
- ### Install — DeepSeek Harness Desktop / Web
84
-
85
- In the DeepSeek Harness Desktop or Web app, open **Plugins**, click
86
- **Add plugin**, enter `dsh-keys-manager` in the package field, and click
87
- **Install**. When the install finishes, choose **Enable now** so the plugin is
88
- switched on.
43
+ ### Install
89
44
 
90
- Through the wizard, the app installs the same published npm package as the
91
- CLI path below, already carrying its built bundle. Refresh the DeepSeek
92
- Harness page afterwards so the browser half is fetched.
93
-
94
- ### Install — published package
45
+ In the Desktop or Web app, open **Plugins → Add plugin**, enter `dsh-keys-manager`,
46
+ click **Install**, then **Enable now**. This installs the same published package
47
+ as the CLI path, already carrying its built bundle.
95
48
 
96
49
  ```sh
97
50
  dsh plugin --profile web add dsh-keys-manager
98
51
  ```
99
52
 
100
- Installing `dsh-keys-manager` installs two bundle components. The published
101
- package depends on `dsh-llm-omp-transports`, so one install resolves both npm
102
- packages, and the plugin page lists both `dsh-keys-manager` and
103
- `llm-omp-transports`. Enable both: the manager owns credentials and routing,
104
- the transport component owns the Cursor and Devin wire protocols.
53
+ One install yields both bundles, `dsh-keys-manager` and `llm-omp-transports`;
54
+ enable both — the manager owns credentials and routing, the transport the seven
55
+ routes' wire protocols. Refresh the Web page afterwards for the browser half.
105
56
 
106
- ### Install — local checkout
57
+ <details>
58
+ <summary>Install from a local checkout</summary>
107
59
 
108
60
  ```sh
109
61
  git clone https://github.com/btspoony/dsh-keys-manager
@@ -112,25 +64,19 @@ pnpm i
112
64
  dsh plugin --profile web link .
113
65
  ```
114
66
 
115
- The two CLI paths differ in where the build output comes from: `dsh plugin
116
- --profile web add dsh-keys-manager` installs the published npm tarball, which
117
- ships the built `lib/` and the client bundle. The local
118
- `dsh plugin --profile web link .` path runs `prepare` during `pnpm i`, which
119
- builds `lib/` and the client bundle, so the clone flow above includes that
120
- build step; `prepack` builds the same output when the package is packed or
121
- published.
67
+ `add` installs the published tarball with its built `lib/` and client bundle;
68
+ `link .` builds them via `prepare` during `pnpm i`, as does `prepack` when packing.
122
69
 
123
- Refresh the Web page after installing so the browser half is fetched.
70
+ </details>
124
71
 
125
- ## Usage
72
+ ## Use it
126
73
 
127
- Open **Plugins → Keys Manager → View** (rendered as
128
- `Plugins → 密钥管理 → 查看` in the Chinese locale). The manager renders on the
129
- plugin's detail page, between its description and its included rows, matching
130
- the shipped plugin configuration cards.
74
+ ### Take over a provider and add keys
131
75
 
132
- 1. Search for a provider. Existing DSH providers appear first; the plugin also
133
- ships the curated extra catalog described above.
76
+ 1. Search for a provider. Open **Plugins → Keys Manager → View** (`Plugins →
77
+ 密钥管理 → 查看` in the Chinese locale); the manager renders on the plugin's
78
+ detail page. Existing DSH providers appear first; the plugin also ships the
79
+ curated extra catalog described under [Provider coverage](#provider-coverage).
134
80
  2. Adopt a provider. For an existing provider the manager imports the
135
81
  currently resolved credential, writes a broker reference into the provider
136
82
  profile, and leaves the original key in the credential store so release can
@@ -143,118 +89,90 @@ the shipped plugin configuration cards.
143
89
  5. Tune retry count (1–3), base cooldown, and recovery grace in the settings
144
90
  card.
145
91
 
146
- ### OAuth accounts
92
+ ### Accounts and sign-in
147
93
 
148
94
  Providers that ship a native OAuth sign-in offer two ways to join the pool:
149
- **Add key** stores a static API key, while **Add account** runs the
150
- provider's OAuth sign-in flow and stores the resulting grant as an account
151
- row in the same pool.
152
-
153
- Supported providers — the seven whose OAuth flows `llm-pi-ai` implements:
154
- Anthropic, GitHub Copilot, Kimi Coding, OpenAI Codex, OpenRouter, Radius,
155
- and xAI.
156
-
157
- The increment-1 model is honest about scope: **API keys form the selection
158
- ring** — sticky sessions, round-robin, retry failover, and cooldowns
159
- operate across the provider's API keys — while **one projected OAuth grant
160
- serves its provider**: the account whose grant is projected answers
161
- requests directly, and one active grant per provider is kept. Per-account
162
- ranking (rotating or load-balancing between accounts) is future work. An
163
- account row's counters reflect that account's own successes and failures,
164
- not a per-account traffic split. When the projected grant fails (expired
165
- or refresh rejected), the account cools down. On a key-capable route the
166
- pool falls back to the provider's key pool; an OAuth-only route has no
167
- API-key pool and stops serving requests until an account is signed in
168
- again. Recovery is a manual re-login from the account menu.
169
-
170
- Adding an account stores only the provider-issued grant in the Harness
171
- credential store, behind the account's `grantRef`; the manager state keeps
172
- the reference plus non-sensitive metadata (email, account id, expiry) — the
173
- same secret-free layout as API keys.
174
-
175
- ### Sign-in providers (Kilo, Z.AI Coding Plan)
176
-
177
- Two more routes sign in from Keys Manager through this plugin's own bundled
178
- clients instead of the `llm-pi-ai` seam:
179
-
180
- - **Kilo** (`kilo`, installed as a plugin extra route): a device-code page
181
- plus a poll. The first successful sign-in creates the route and its first
182
- pool row; later sign-ins append rows.
183
- - **Z.AI (GLM Coding Plan)** (`zai`, a shipped pi-ai route): adopt it first.
184
- The flow opens a browser page and asks you to paste the final redirect URL
185
- (a `zcode://` URL) or just the authorization code back into the dialog.
186
-
187
- Both mint a **static** credential — a token or an `id.secret` key — stored as
188
- an ordinary pool row tagged `signin:kilo` / `signin:zai-coding-plan`. They are
189
- not refreshable grants, so the row menu's **Sign in again** is the only way to
190
- renew one; it replaces that row's literal in place and keeps its id and
191
- position. Nothing is written to `llm-pi-ai/<provider>` for these routes.
192
-
193
- **A login flow is not a transport.** These two routes serve through the normal
194
- pi-ai key pool and take part in sticky selection, round-robin, retry failover
195
- and cooldowns. The `llm-omp-transports` surface described below is the other
196
- thing entirely: one grant per route, each with its own section.
197
-
198
- ### Cursor transport
199
-
200
- Cursor is served by the companion `dsh-llm-omp-transports` component on its
201
- own `cursor` route. It does not run through the pi-ai key pool: the route
202
- keeps exactly one grant at `llm-omp-transports/cursor`, refreshed
203
- automatically on the credential seam.
204
-
205
- - Models come from the pinned `@oh-my-pi/pi-catalog@18.12.3` table (123 rows),
206
- generated into the transport at build time. The route streams text and
207
- reasoning, and hands tool calls to DSH's tool loop.
208
- - Sign in from the **Transport accounts** section of the Keys Manager page: a
209
- browser page plus a poll. The row shows identity, expiry and status; after an
210
- expired or rejected grant, re-login is manual.
211
- - Images are not forwarded yet. The route advertises text-only input and
212
- refuses image blocks with a typed error instead of dropping them.
213
- - The client is unofficial and presents Cursor's vendor-internal OAuth
214
- identity. Read the [transports package docs](packages/llm-omp/README.md)
215
- before relying on it; the risks and limits are listed there.
216
-
217
- ### Devin transport
218
-
219
- Devin is the second route served by the same `dsh-llm-omp-transports`
220
- component, on its own `devin` route with the same one-grant record at
221
- `llm-omp-transports/devin`.
222
-
223
- - Sign in from the **Transport accounts** section. omp finishes this login
224
- through a loopback listener that only Bun provides, so this plugin opens the
225
- authorize page and asks you to paste back the address the browser landed on
226
- (the full URL or `code#state`). Nothing listens on the redirect port, so the
227
- page itself fails to load and the code stays in the address bar.
228
- - **There is no refresh.** The record is a static bearer whose expiry is
229
- derived from the token (JWT `exp` minus five minutes, else one year). A
230
- grant with no `expires` is served as a static bearer and reported `active`
231
- with no expiry cell; once a readable expiry passes, sign in again by hand.
232
- - Models come from the pinned catalog (two rows, `swe-1-6` and `swe-1-6-fast`)
233
- generated into the transport at build time.
234
- - The client is unofficial and presents the released Devin CLI identity; the
235
- real endpoints and protocol behavior are unverified. Read the
236
- [transports package known limits](packages/llm-omp/docs/known-limits.md)
237
- before relying on it.
95
+ **Add key** stores a static API key, while **Add account** runs the provider's
96
+ OAuth sign-in flow and stores the result as an account row in the same pool.
97
+ Nine routes join as an **account**: seven through pi-ai's own flows, `kilo` and
98
+ `zai` through the plugin's bundled clients (device code, pasted `zcode://`
99
+ redirect), which mint a **static** credential renewed only by **Sign in again**.
100
+
101
+ | Route group | How it joins | Refresh / renew |
102
+ |---|---|---|
103
+ | 9 OAuth accounts | **Add account** — seven pi-ai flows, two plugin clients | provider-managed for the seven; **Sign in again** for the two static credentials |
104
+ | 7 transport routes | **Transport accounts** — one grant per route | see [Transport routes](#transport-routes) |
105
+
106
+ **API keys form the selection ring** — sticky sessions, round-robin, retry
107
+ failover and cooldowns operate across the provider's keys — while **one
108
+ projected OAuth grant serves its provider**, and an account row's counters
109
+ reflect only that account's own successes and failures. Per-account ranking is
110
+ future work. When the projected grant fails, the account cools down and the
111
+ pool falls back to its keys, or stops serving on an OAuth-only route until a
112
+ manual re-login.
113
+
114
+ **`muse-code` needs no transport or account row of its own**: the vendored pi-ai
115
+ `meta` route (`openai-responses` on `https://api.meta.ai/v1`) serves it, the
116
+ agreement check was static, and the first live call is a manual smoke check per
117
+ [Known limits](docs/known-limits.md).
118
+
119
+ ### Transport routes
120
+
121
+ Providers the vendored pi-ai cannot speak are served by the companion
122
+ `dsh-llm-omp-transports` component:
123
+
124
+ - One grant per route, at `llm-omp-transports/<route>` — no key pool and no
125
+ per-account rotation. Sign-in happens in the **Transport accounts** section of
126
+ the Keys Manager page.
127
+ - Models are generated from the pinned `@oh-my-pi/pi-catalog@18.12.3` table when
128
+ the transport is built, and the clients are unofficial: read the
129
+ [transports package docs](packages/llm-omp/README.md) and its
130
+ [known limits](packages/llm-omp/docs/known-limits.md) before relying on them.
131
+
132
+ | Route | Sign-in | Refresh | Model rows |
133
+ |---|---|---|---|
134
+ | `cursor` | browser page + poll | on the credential seam | 123 |
135
+ | `devin` | paste the landed callback URL | none — sign in again | 2 |
136
+ | `google-gemini-cli` | loopback `8085` + paste fallback | on the credential seam | 7 |
137
+ | `google-antigravity` | loopback `51121` + paste fallback | on the credential seam | 22 |
138
+ | `factory-droid` | WorkOS device code (URL + user code) | one refresh in a 60 s window, keeps `orgId`/`region` | 62 |
139
+ | `gitlab-duo` | PKCE loopback `localhost:8080/callback`, no port fallback, paste fallback | one refresh in a 60 s window | 16 |
140
+ | `gitlab-duo-agent` | paste the `vscode://` URL | one refresh, echoes the `vscode` redirect | 1 |
141
+
142
+ <details>
143
+ <summary>Per-route notes</summary>
144
+
145
+ - **Cursor** — streams text and reasoning and hands tool calls to DSH's tool
146
+ loop; images are refused with a typed error. The client presents Cursor's
147
+ vendor-internal OAuth identity.
148
+ - **Devin** — no refresh: a static bearer whose expiry is derived from the token
149
+ (JWT `exp` minus five minutes, else one year), and without a readable expiry
150
+ the row shows `active` with a blank countdown column.
151
+ - **Google routes** — both share one generated `lib/omp/google.mjs` artifact yet
152
+ keep separate grants, account rows and catalogs. The grant is
153
+ `{access, refresh, expires, projectId, email?}`; sign-in resolves the Cloud
154
+ project the route bills, and a `legacy-tier` or paid account whose project
155
+ cannot be discovered fails `AUTH_FAILED` until `GOOGLE_CLOUD_PROJECT` (or
156
+ `GOOGLE_CLOUD_PROJECT_ID`) is set.
157
+ - **Factory Droid** — four wires behind one proxy, chosen by model id inside the
158
+ artifact; rows carry no base URL and the account's residency
159
+ (`orgId`/`region`) survives refresh.
160
+ - **GitLab Duo pair** — `gitlab-duo`'s direct-access token cache is keyed on the
161
+ GitLab token, so a rotated token misses it; `gitlab-duo-agent` re-seeds a
162
+ workflow per request and replays the transcript rather than resuming a socket.
163
+
164
+ </details>
238
165
 
239
166
  ### Selection and failure policy
240
167
 
241
- - **Sticky session**: the first request of a session selects a key and binds
242
- it for that session/provider pair. Later requests reuse it.
243
- - **Round robin**: a new session advances the provider cursor and takes the
244
- next healthy key.
245
- - **Retry**: a failing request is retried on the same key `retryCount` times.
246
- - **Switch**: after the retry budget is spent, the failing key is marked
247
- cooling, and the session is rebound to another healthy key.
248
- - **Cooldown**: the first failure cools a key for `baseCooldownMs`. A failure
249
- while cooling, or within `recoveryGraceMs` after recovery, doubles the
250
- next cooldown. A long healthy gap resets the escalation. The hard cap is
251
- seven days.
252
- - **Recovery**: the key is automatically selectable again when its cooldown
253
- expires; no manual reset is required.
254
- - **Delegation**: request-shaped failures such as
255
- `CONTEXT_WINDOW_EXCEEDED` and cancellation never cool a key. When no
256
- alternate key exists, the manager delegates to the composition's normal
257
- retry/fallback policy.
168
+ | Mechanism | Behaviour |
169
+ |---|---|
170
+ | Sticky session | The first request of a session selects a key and binds it for that session/provider pair. Later requests reuse it. |
171
+ | Round robin | A new session advances the provider cursor and takes the next healthy key. |
172
+ | Retry | A failing request is retried on the same key `retryCount` times. Request-shaped failures such as `CONTEXT_WINDOW_EXCEEDED` and cancellation never cool a key. |
173
+ | Switch | After the retry budget is spent, the failing key is marked cooling, and the session is rebound to another healthy key. When no alternate key exists, the manager delegates to the composition's normal retry/fallback policy. |
174
+ | Cooldown | The first failure cools a key for `baseCooldownMs`. A failure while cooling, or within `recoveryGraceMs` after recovery, doubles the next cooldown; a long healthy gap resets the escalation. The hard cap is seven days. |
175
+ | Recovery | The key is automatically selectable again when its cooldown expires; no manual reset is required. |
258
176
 
259
177
  ## Configuration & data
260
178
 
@@ -266,8 +184,10 @@ $DSH_HOME/keys-manager/state.json
266
184
 
267
185
  with owner-only permissions. It contains aliases, credential references,
268
186
  health counters, session bindings, and provider adoption facts. API key
269
- literals live only in the Harness credential store. The file is written
270
- atomically through a temporary file and a rename.
187
+ literals live only in the Harness credential store; an account row follows the
188
+ same rule behind its `grantRef`, with only non-sensitive metadata (email,
189
+ account id, expiry) in the state. The file is written atomically through a
190
+ temporary file and a rename.
271
191
 
272
192
  Each managed provider profile points its `apiKeyEnv` at a broker reference
273
193
  such as `KEYSMGR_ZAI_CODING_CN_3FA2C1`. The Host credential layer answers that
@@ -275,7 +195,8 @@ reference per request with the session's selected key. The Models page sees
275
195
  the profile as configured; writing directly to the broker reference is
276
196
  refused with a pointer to the manager.
277
197
 
278
- ### OAuth2 extension point
198
+ <details>
199
+ <summary>OAuth2 extension point</summary>
279
200
 
280
201
  The state shape already distinguishes `kind: "api-key"` from `kind: "oauth"`
281
202
  and keeps a nullable `oauth` object beside the credential reference. A future
@@ -284,42 +205,111 @@ rewriting existing rows. Providers whose only authentication is OAuth are
284
205
  reported as unsupported in this version rather than being treated as API-key
285
206
  providers.
286
207
 
287
- ## Provider classification
208
+ </details>
209
+
210
+ ## Provider coverage
288
211
 
289
- Every provider card carries its origin:
212
+ Four groups, one pool:
290
213
 
291
- - **DSH built-in** (`DSH 内置`) — a route from the shipped DSH pi-ai catalog.
292
- - **Plugin built-in** (`插件内置`) — a route from this plugin's extra catalog
293
- in `src/providers.ts`.
294
- - **Custom** (`自定义`) — a hand-declared route in the active profile.
214
+ - **DSH built-in** — routes from the shipped DSH pi-ai catalog. The set follows
215
+ your installed DSH version, so the Models page is the authoritative list; four
216
+ of them are outside single-key pooling (below).
217
+ - **Plugin extra built-in** — 35 routes this plugin adds as ordinary
218
+ `llm-pi-ai` routes.
219
+ - **OAuth accounts** — 9 routes that join as an account instead of a pasted key:
220
+ seven use pi-ai's own flows, `kilo` and `zai` are signed in by the plugin's
221
+ bundled clients.
222
+ - **Transport routes** — 7 routes the vendored pi-ai cannot speak, served by
223
+ `dsh-llm-omp-transports`.
295
224
 
296
- The following DSH built-ins are explicitly outside single-key pool management:
225
+ <details>
226
+ <summary>Supported — every plugin extra, OAuth account and transport route</summary>
227
+
228
+ **Plugin extra built-in — 35** — from
229
+ [oh-my-pi](https://github.com/can1357/oh-my-pi)'s provider catalog (MIT):
230
+
231
+ | Provider | Route id | API key env |
232
+ |---|---|---|
233
+ | DeepInfra | `deepinfra` | `DEEPINFRA_API_KEY` |
234
+ | Novita | `novita` | `NOVITA_API_KEY` |
235
+ | StepFun | `stepfun` | `STEPFUN_API_KEY` |
236
+ | SambaNova | `sambanova` | `SAMBANOVA_API_KEY` |
237
+ | Qianfan | `qianfan` | `QIANFAN_API_KEY` |
238
+ | GMI Cloud | `gmi-cloud` | `GMI_API_KEY` |
239
+ | Synthetic | `synthetic` | `SYNTHETIC_API_KEY` |
240
+ | ZenMux | `zenmux` | `ZENMUX_API_KEY` |
241
+ | Kilo Gateway | `kilo` | `KILO_API_KEY` |
242
+ | NanoGPT | `nanogpt` | `NANO_GPT_API_KEY` |
243
+ | Venice AI | `venice` | `VENICE_API_KEY` |
244
+ | AIML API | `aimlapi` | `AIMLAPI_API_KEY` |
245
+ | AI& | `aiand` | `AIAND_API_KEY` |
246
+ | Helmcode | `helmcode` | `HELMCODE_API_KEY` |
247
+ | Alibaba Coding Plan | `alibaba-coding-plan` | `ALIBABA_CODING_PLAN_API_KEY` |
248
+ | MiniMax Coding (Global) | `minimax-code` | `MINIMAX_CODE_API_KEY` |
249
+ | MiniMax Coding (CN) | `minimax-code-cn` | `MINIMAX_CODE_CN_API_KEY` |
250
+ | Umans AI Coding Plan | `umans` | `UMANS_AI_CODING_PLAN_API_KEY` |
251
+ | Sakana AI | `sakana` | `SAKANA_API_KEY` |
252
+ | CoralBricks | `coralbricks` | `CORAL_API_KEY` |
253
+ | Wafer Serverless | `wafer-serverless` | `WAFER_SERVERLESS_API_KEY` |
254
+ | Alibaba Token Plan | `alibaba-token-plan` | `ALIBABA_TOKEN_PLAN_API_KEY` |
255
+ | Alibaba Token Plan (CN) | `alibaba-token-plan-cn` | `BAILIAN_TOKEN_PLAN_API_KEY` |
256
+ | Charm Hyper | `charm-hyper` | `CHARM_HYPER_API_KEY`, `HYPER_API_KEY` |
257
+ | LiteLLM Proxy | `litellm` | `LITELLM_API_KEY` |
258
+ | SiliconFlow | `siliconflow` | `SILICONFLOW_API_KEY` |
259
+ | SiliconFlow (CN) | `siliconflow-cn` | `SILICONFLOW_CN_API_KEY` |
260
+ | Zhipu Coding Plan | `zhipu-coding-plan` | `ZHIPU_API_KEY` |
261
+ | Abliteration | `abliteration` | `ABLITERATION_API_KEY`, `ABLIT_KEY` |
262
+ | ClinePass | `cline-pass` | `CLINE_API_KEY` |
263
+ | Command Code | `commandcode` | `COMMAND_CODE_API_KEY`, `COMMANDCODE_API_KEY` |
264
+ | CoreWeave Serverless Inference | `coreweave` | `COREWEAVE_API_KEY` |
265
+ | Fire Pass | `firepass` | `FIREPASS_API_KEY` |
266
+ | Ollama Cloud | `ollama-cloud` | `OLLAMA_CLOUD_API_KEY` |
267
+ | Yolo Auto | `yolo-auto` | `YOLO_AUTO_API_KEY` |
268
+
269
+ Where two variables are listed, either is accepted; the first is the primary.
270
+ CoreWeave Serverless Inference also needs `COREWEAVE_PROJECT=<team>/<project>` in
271
+ the DSH process environment before it is added.
272
+
273
+ **OAuth accounts — 9**
274
+
275
+ | Provider | Route | Sign-in client |
276
+ |---|---|---|
277
+ | Anthropic | `anthropic` | pi-ai |
278
+ | GitHub Copilot | `github-copilot` | pi-ai |
279
+ | Kimi Coding | `kimi-coding` | pi-ai |
280
+ | OpenAI Codex | `openai-codex` | pi-ai |
281
+ | OpenRouter | `openrouter` | pi-ai |
282
+ | Radius | `radius` | pi-ai |
283
+ | xAI | `xai` | pi-ai |
284
+ | Kilo | `kilo` | plugin bundled client — device code + poll |
285
+ | Z.AI Coding Plan | `zai` | plugin bundled client — pasted `zcode://` redirect |
286
+
287
+ The two plugin-signed credentials are static, tagged `signin:kilo` /
288
+ `signin:zai-coding-plan`, and nothing is written to `llm-pi-ai/<provider>`; the
289
+ seven pi-ai rows are the provider's own grants. `kilo` is listed twice on
290
+ purpose: the same route takes an API key as an extra built-in and an account
291
+ through its bundled client.
292
+
293
+ **Transport routes — 7** — `cursor`, `devin`, `google-gemini-cli`,
294
+ `google-antigravity`, `factory-droid`, `gitlab-duo`, `gitlab-duo-agent`; sign-in,
295
+ refresh and model detail live in [Transport routes](#transport-routes).
296
+
297
+ </details>
298
+
299
+ <details>
300
+ <summary>Not pooled — 4 DSH built-ins</summary>
297
301
 
298
302
  | Provider | Why |
299
303
  |---|---|
300
304
  | `amazon-bedrock` | AWS credential chain (profile, IAM keys, ECS/IRSA/EC2), not one API key |
301
305
  | `cloudflare-ai-gateway` | API key plus a Cloudflare account ID and gateway ID |
302
306
  | `cloudflare-workers-ai` | API key plus a Cloudflare account ID |
303
- | `openai-codex` | ChatGPT OAuth sign-in only; no API-key credential — usable as an [OAuth account](#oauth-accounts) instead of a key |
304
-
305
- All other DSH catalog routes expose an API-key credential. Providers that
306
- also support OAuth (Anthropic, GitHub Copilot, Kimi Coding, OpenAI Codex,
307
- OpenRouter, Radius, xAI) remain manageable through their API-key path, and
308
- their OAuth sign-in is available as [OAuth accounts](#oauth-accounts).
309
-
310
- ## Repository layout
311
-
312
- This repository is a pnpm workspace with two published packages:
307
+ | `openai-codex` | ChatGPT OAuth sign-in only; no API-key credential — usable as an [OAuth account](#accounts-and-sign-in) instead of a key |
313
308
 
314
- | Path | npm package | Role |
315
- |---|---|---|
316
- | root | `dsh-keys-manager` | Host plugin, Keys Manager Web client, bundle patch |
317
- | `packages/llm-omp` | `dsh-llm-omp-transports` | Cursor and Devin transport component |
309
+ </details>
318
310
 
319
- The root package declares the transports package as a dependency, so the
320
- published Keys Manager tarball pulls the transport in rather than vendoring
321
- it. Both packages are released together and carry the same version; see
322
- [Release](docs/release.md).
311
+ Every other DSH catalog route exposes an API-key credential; a route you declare
312
+ yourself in the profile (`自定义` / Custom) is pooled like any built-in.
323
313
 
324
314
  ## Documentation
325
315
 
@@ -327,14 +317,11 @@ it. Both packages are released together and carry the same version; see
327
317
  |---|---|
328
318
  | [Development](docs/development.md) | build and dev workflow, repository layout |
329
319
  | [Release](docs/release.md) | CI checks and the npm release flow |
330
- | [Known limits](docs/known-limits.md) | current design boundaries, including deferred providers |
331
- | [Transports package](packages/llm-omp/README.md) | Cursor and Devin transports: support status, risks, build/test, release |
320
+ | [Known limits](docs/known-limits.md) | current design boundaries, including the seven transport routes |
321
+ | [Transports package](packages/llm-omp/README.md) | Transport routes: support status, risks, build/test, release |
332
322
 
333
- Chinese versions: [README.zh-CN.md](README.zh-CN.md) and the `*.zh-CN.md`
334
- files in `docs/` — [开发](docs/development.zh-CN.md) ·
323
+ Chinese: [README.zh-CN.md](README.zh-CN.md) · [开发](docs/development.zh-CN.md) ·
335
324
  [发布](docs/release.zh-CN.md) · [已知限制](docs/known-limits.zh-CN.md).
336
- Current design boundaries at a glance:
337
- [Known limits](docs/known-limits.md).
338
325
 
339
326
  ## License
340
327