dsh-keys-manager 0.2.0 → 0.2.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 ADDED
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ All notable changes to dsh-keys-manager are documented here. Generated from
4
+ git log by the release-prep workflow.
5
+
6
+ ## [0.2.2] - 2026-10-21
7
+
8
+ - 838fb85 Merge pull request #31 from btspoony/feat/unified-release-version
9
+ - ed5baaa Merge pull request #26 from btspoony/fix/oauth-binding-and-key-test
10
+ - 2981bd5 Merge pull request #29 from btspoony/fix/retry-step-regressions
11
+ - 25d7fc8 Merge pull request #28 from btspoony/feat/omp-transport-cursor
12
+ - 03352c5 Merge pull request #27 from btspoony/docs/readme-extra-providers
13
+ - 1d498e8 Merge pull request #23 from btspoony/fix/issue-18-harvest-abort-compensation
14
+ - be938f0 Merge pull request #25 from btspoony/feat/issue-11-coreweave-header-carrier
15
+ - 175e827 Merge pull request #24 from btspoony/docs/readme-desktop-web-install
16
+
17
+ ## [0.2.1] - 2026-10-20
18
+
19
+ - 83c11e1 Merge pull request #20 from btspoony/fix/authorization-inject
20
+
21
+ ## [0.2.0] - 2026-10-20
22
+
23
+ - 74defd3 Merge pull request #17 from btspoony/feat/issue-2-phase2-oauth-pool
24
+ - 7e7e356 Merge pull request #14 from btspoony/docs/post-merge-followups
25
+
26
+ ## [0.1.0] - 2026-10-19
27
+
28
+ - b1380c9 Merge pull request #12 from btspoony/feat/issue-2-phase1-providers
29
+ - 14e57ae Merge pull request #8 from btspoony/fix/post-merge-review
30
+ - 8300083 Merge pull request #10 from btspoony/chore/initial-version-0.0.1
31
+ - 8076b79 docs: record generated-CHANGELOG rule in AGENTS.md (#9)
32
+ - 39d409b Merge pull request #1 from btspoony/feat/keys-manager-plugin
33
+ - bbfcccb Initial commit
package/README.md CHANGED
@@ -23,27 +23,86 @@ manager.
23
23
  - Extra built-in providers installed as ordinary `llm-pi-ai` routes.
24
24
  - OAuth account sign-in for seven pi-ai-backed providers, stored beside
25
25
  the API keys.
26
+ - A companion transport component for providers the vendored pi-ai cannot
27
+ speak — Cursor (`cursor`) today — installed with the plugin.
26
28
 
27
29
  ### Extra providers
28
30
 
29
- `src/providers.ts` contains a curated catalog of 34 extra providers (21 from
30
- the original catalog plus 13 added in this release, for example SiliconFlow,
31
- Zhipu coding plan, Cline Pass, Ollama Cloud, and Alibaba Token Plan (CN)),
32
- derived from
31
+ This catalog of 35 extra providers comes from
33
32
  [oh-my-pi](https://github.com/can1357/oh-my-pi)'s provider catalog (MIT).
34
- An extra id is added only when the shipped DSH catalog does not already
35
- declare that route id (for example, `meta` and `typesafe` are not
36
- duplicated); same-endpoint providers with distinct credential identities
37
- are kept by design.
33
+
34
+ <details>
35
+ <summary>All 35 extra providers</summary>
36
+
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` |
74
+
75
+ Where two variables are listed, either is accepted; the first is the primary.
76
+
77
+ CoreWeave Serverless Inference also needs `COREWEAVE_PROJECT=<team>/<project>` in the DSH process environment before it is added.
78
+
79
+ </details>
38
80
 
39
81
  ## Quick start
40
82
 
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.
89
+
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
+
41
94
  ### Install — published package
42
95
 
43
96
  ```sh
44
97
  dsh plugin --profile web add dsh-keys-manager
45
98
  ```
46
99
 
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 wire protocol.
105
+
47
106
  ### Install — local checkout
48
107
 
49
108
  ```sh
@@ -53,13 +112,13 @@ pnpm i
53
112
  dsh plugin --profile web link .
54
113
  ```
55
114
 
56
- Only the published-package path avoids a local build: `dsh plugin --profile web add dsh-keys-manager` installs the npm
57
- tarball as-is — package lifecycle scripts (`prepare` / `prepack`) do not run
58
- for registry installs, and the tarball already ships the built `lib/` and
59
- the client bundle. The local `dsh plugin --profile web link .` path is
60
- different — installing a local directory runs `prepare` during `pnpm i`,
61
- which builds `lib/` and the client bundle, so the clone flow above needs no
62
- manual build step.
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.
63
122
 
64
123
  Refresh the Web page after installing so the browser half is fetched.
65
124
 
@@ -113,6 +172,25 @@ credential store, behind the account's `grantRef`; the manager state keeps
113
172
  the reference plus non-sensitive metadata (email, account id, expiry) — the
114
173
  same secret-free layout as API keys.
115
174
 
175
+ ### Cursor transport
176
+
177
+ Cursor is served by the companion `dsh-llm-omp-transports` component on its
178
+ own `cursor` route. It does not run through the pi-ai key pool: the route
179
+ keeps exactly one grant at `llm-omp-transports/cursor`, refreshed
180
+ automatically on the credential seam.
181
+
182
+ - Models come from the pinned `@oh-my-pi/pi-catalog@18.12.3` table (123 rows),
183
+ generated into the transport at build time. The route streams text and
184
+ reasoning, and hands tool calls to DSH's tool loop.
185
+ - Sign in from the **Transport accounts** section of the Keys Manager page: a
186
+ browser page plus a poll. The row shows identity, expiry and status; after an
187
+ expired or rejected grant, re-login is manual.
188
+ - Images are not forwarded yet. The route advertises text-only input and
189
+ refuses image blocks with a typed error instead of dropping them.
190
+ - The client is unofficial and presents Cursor's vendor-internal OAuth
191
+ identity. Read the [transports package docs](packages/llm-omp/README.md)
192
+ before relying on it; the risks and limits are listed there.
193
+
116
194
  ### Selection and failure policy
117
195
 
118
196
  - **Sticky session**: the first request of a session selects a key and binds
@@ -184,6 +262,20 @@ also support OAuth (Anthropic, GitHub Copilot, Kimi Coding, OpenAI Codex,
184
262
  OpenRouter, Radius, xAI) remain manageable through their API-key path, and
185
263
  their OAuth sign-in is available as [OAuth accounts](#oauth-accounts).
186
264
 
265
+ ## Repository layout
266
+
267
+ This repository is a pnpm workspace with two published packages:
268
+
269
+ | Path | npm package | Role |
270
+ |---|---|---|
271
+ | root | `dsh-keys-manager` | Host plugin, Keys Manager Web client, bundle patch |
272
+ | `packages/llm-omp` | `dsh-llm-omp-transports` | Cursor (and future) transport component |
273
+
274
+ The root package declares the transports package as a dependency, so the
275
+ published Keys Manager tarball pulls the transport in rather than vendoring
276
+ it. Both packages are released together and carry the same version; see
277
+ [Release](docs/release.md).
278
+
187
279
  ## Documentation
188
280
 
189
281
  | Doc | Content |
@@ -191,6 +283,7 @@ their OAuth sign-in is available as [OAuth accounts](#oauth-accounts).
191
283
  | [Development](docs/development.md) | build and dev workflow, repository layout |
192
284
  | [Release](docs/release.md) | CI checks and the npm release flow |
193
285
  | [Known limits](docs/known-limits.md) | current design boundaries, including deferred providers |
286
+ | [Transports package](packages/llm-omp/README.md) | Cursor transport: support status, risks, build/test, release |
194
287
 
195
288
  Chinese versions: [README.zh-CN.md](README.zh-CN.md) and the `*.zh-CN.md`
196
289
  files in `docs/` — [开发](docs/development.zh-CN.md) ·
package/README.zh-CN.md CHANGED
@@ -19,19 +19,76 @@ DSH Keys Manager 是一个 DeepSeek Harness 插件,把一个提供商 API key
19
19
  - 既有 Models 提供商卡片内出现"由 Keys Manager 托管"徽标。
20
20
  - 额外内置提供商以普通 `llm-pi-ai` 路由安装。
21
21
  - 七家 pi-ai 覆盖的提供商支持 OAuth 账户登录,凭据与 API key 并存管理。
22
+ - 随插件附带一个传输组件,服务随附 pi-ai 无法支持的提供商——目前是 Cursor(`cursor`)。
22
23
 
23
24
  ### 额外提供商
24
25
 
25
- `src/providers.ts` 收录 34 个精选提供商(原有 21 个加本次发布新增 13 个,例如 SiliconFlow、智谱编码套餐、Cline Pass、Ollama Cloud、Alibaba Token Plan (CN)),目录源自 [oh-my-pi](https://github.com/can1357/oh-my-pi)(MIT)。只有当随附 DSH 目录尚未声明该 route id 时才会新增条目(例如 `meta`、`typesafe` 不会重复提供);与既有端点共享 base URL、但凭据身份不同的提供商会按设计保留。
26
+ 这 35 个额外提供商收录自
27
+ [oh-my-pi](https://github.com/can1357/oh-my-pi) 的提供商目录(MIT)。
28
+
29
+ <details>
30
+ <summary>全部 35 个额外提供商</summary>
31
+
32
+ | 提供商 | Route id | API key 环境变量 |
33
+ |---|---|---|
34
+ | DeepInfra | `deepinfra` | `DEEPINFRA_API_KEY` |
35
+ | Novita | `novita` | `NOVITA_API_KEY` |
36
+ | StepFun | `stepfun` | `STEPFUN_API_KEY` |
37
+ | SambaNova | `sambanova` | `SAMBANOVA_API_KEY` |
38
+ | Qianfan | `qianfan` | `QIANFAN_API_KEY` |
39
+ | GMI Cloud | `gmi-cloud` | `GMI_API_KEY` |
40
+ | Synthetic | `synthetic` | `SYNTHETIC_API_KEY` |
41
+ | ZenMux | `zenmux` | `ZENMUX_API_KEY` |
42
+ | Kilo Gateway | `kilo` | `KILO_API_KEY` |
43
+ | NanoGPT | `nanogpt` | `NANO_GPT_API_KEY` |
44
+ | Venice AI | `venice` | `VENICE_API_KEY` |
45
+ | AIML API | `aimlapi` | `AIMLAPI_API_KEY` |
46
+ | AI& | `aiand` | `AIAND_API_KEY` |
47
+ | Helmcode | `helmcode` | `HELMCODE_API_KEY` |
48
+ | Alibaba Coding Plan | `alibaba-coding-plan` | `ALIBABA_CODING_PLAN_API_KEY` |
49
+ | MiniMax Coding (Global) | `minimax-code` | `MINIMAX_CODE_API_KEY` |
50
+ | MiniMax Coding (CN) | `minimax-code-cn` | `MINIMAX_CODE_CN_API_KEY` |
51
+ | Umans AI Coding Plan | `umans` | `UMANS_AI_CODING_PLAN_API_KEY` |
52
+ | Sakana AI | `sakana` | `SAKANA_API_KEY` |
53
+ | CoralBricks | `coralbricks` | `CORAL_API_KEY` |
54
+ | Wafer Serverless | `wafer-serverless` | `WAFER_SERVERLESS_API_KEY` |
55
+ | Alibaba Token Plan | `alibaba-token-plan` | `ALIBABA_TOKEN_PLAN_API_KEY` |
56
+ | Alibaba Token Plan (CN) | `alibaba-token-plan-cn` | `BAILIAN_TOKEN_PLAN_API_KEY` |
57
+ | Charm Hyper | `charm-hyper` | `CHARM_HYPER_API_KEY`, `HYPER_API_KEY` |
58
+ | LiteLLM Proxy | `litellm` | `LITELLM_API_KEY` |
59
+ | SiliconFlow | `siliconflow` | `SILICONFLOW_API_KEY` |
60
+ | SiliconFlow (CN) | `siliconflow-cn` | `SILICONFLOW_CN_API_KEY` |
61
+ | Zhipu Coding Plan | `zhipu-coding-plan` | `ZHIPU_API_KEY` |
62
+ | Abliteration | `abliteration` | `ABLITERATION_API_KEY`, `ABLIT_KEY` |
63
+ | ClinePass | `cline-pass` | `CLINE_API_KEY` |
64
+ | Command Code | `commandcode` | `COMMAND_CODE_API_KEY`, `COMMANDCODE_API_KEY` |
65
+ | CoreWeave Serverless Inference | `coreweave` | `COREWEAVE_API_KEY` |
66
+ | Fire Pass | `firepass` | `FIREPASS_API_KEY` |
67
+ | Ollama Cloud | `ollama-cloud` | `OLLAMA_CLOUD_API_KEY` |
68
+ | Yolo Auto | `yolo-auto` | `YOLO_AUTO_API_KEY` |
69
+
70
+ 列出两个变量时二者皆可接受,第一个为主变量。
71
+
72
+ CoreWeave Serverless Inference 还需在添加前把 `COREWEAVE_PROJECT=<team>/<project>` 设置到 DSH 进程环境中。
73
+
74
+ </details>
26
75
 
27
76
  ## 快速开始
28
77
 
78
+ ### 安装 —— DeepSeek Harness 桌面版 / Web 版
79
+
80
+ 桌面版或 Web 版打开 **插件** 页面,点击 **添加插件**,在包名输入框中填入 `dsh-keys-manager` 并点击 **安装**;安装完成后选择 **立即启用** 启用插件。
81
+
82
+ 通过向导安装时,应用会下载与下面 CLI 路径相同的已发布 npm 包,包内已包含构建好的产物。安装完成后刷新页面,让插件的浏览器侧代码被加载。
83
+
29
84
  ### 安装 —— 已发布包
30
85
 
31
86
  ```sh
32
87
  dsh plugin --profile web add dsh-keys-manager
33
88
  ```
34
89
 
90
+ 安装 `dsh-keys-manager` 会安装两个 bundle 组件。已发布包依赖 `dsh-llm-omp-transports`,因此一次安装会解析两个 npm 包,插件页面会同时列出 `dsh-keys-manager` 与 `llm-omp-transports`。两者都要启用:管理器负责凭据与路由,传输组件负责 Cursor 的线协议。
91
+
35
92
  ### 安装 —— 本地检出
36
93
 
37
94
  ```sh
@@ -41,7 +98,7 @@ pnpm i
41
98
  dsh plugin --profile web link .
42
99
  ```
43
100
 
44
- 只有已发布包的安装路径不会在本地执行构建:`dsh plugin --profile web add dsh-keys-manager` 按原样安装 npm tarball——注册表安装不会运行包生命周期脚本(`prepare` / `prepack`),tarball 内已带构建好的 `lib/` 与客户端 bundle。本地 `dsh plugin --profile web link .` 路径不同——安装本地目录会在 `pnpm i` 期间运行 `prepare`,构建 `lib/` 与客户端 bundle,因此上面的克隆流程不需要手动构建步骤。
101
+ 两条 CLI 安装路径的区别在于构建产物的来源:`dsh plugin --profile web add dsh-keys-manager` 安装的已发布 npm tarball 中已包含构建好的 `lib/` 与客户端 bundle。本地 `dsh plugin --profile web link .` 路径会在 `pnpm i` 期间运行 `prepare`,构建 `lib/` 与客户端 bundle,因此上面的克隆流程包含这一步构建;`prepack` 则在打包或发布时生成同样的产物。
45
102
 
46
103
  安装完成后刷新 Web 页面,让浏览器侧代码被取到。
47
104
 
@@ -65,6 +122,15 @@ dsh plugin --profile web link .
65
122
 
66
123
  添加账户只把提供商签发的授权存进 Harness 凭据存储(挂在账户的 `grantRef` 之下);管理器状态里只存引用与非敏感元数据(邮箱、账户 ID、过期时间)——与 API key 相同的无明文布局。
67
124
 
125
+ ### Cursor 传输
126
+
127
+ Cursor 由随附的 `dsh-llm-omp-transports` 组件在独立 `cursor` 路由上提供。它不经过 pi-ai key 池:该路由在 `llm-omp-transports/cursor` 只保留一条授权,并在凭据 seam 上自动刷新。
128
+
129
+ - 模型来自固定的 `@oh-my-pi/pi-catalog@18.12.3` 表(123 行),构建时生成进传输包。路由支持文本与推理流,并把工具调用交给 DSH 的工具循环。
130
+ - 在 Keys Manager 页面的 **传输账户**(`Transport accounts`)区块登录:浏览器页面加轮询。账户行显示身份、有效期与状态;授权过期或被拒后需要手动重新登录。
131
+ - 暂不转发图片。路由按纯文本宣告输入,遇到图片块以类型化错误拒绝,而不是静默丢弃。
132
+ - 该客户端是非官方实现,会呈现 Cursor 厂商内部的 OAuth 身份。依赖它之前请阅读[传输包文档](packages/llm-omp/README.md),风险与限制列在那里。
133
+
68
134
  ### 选择与故障策略
69
135
 
70
136
  - **会话粘滞**:会话的首次请求选出一把 key 并为该会话/提供商对绑定,后续请求复用。
@@ -110,6 +176,17 @@ $DSH_HOME/keys-manager/state.json
110
176
 
111
177
  其余 DSH 目录路由都提供 API key 凭据。同时支持 OAuth 的提供商(Anthropic、GitHub Copilot、Kimi Coding、OpenAI Codex、OpenRouter、Radius、xAI)仍可经其 API key 路径管理,其 OAuth 登录则以 [OAuth 账户](#oauth-账户)形式提供。
112
178
 
179
+ ## 仓库布局
180
+
181
+ 本仓库是 pnpm workspace,包含两个已发布包:
182
+
183
+ | 路径 | npm 包 | 职责 |
184
+ |---|---|---|
185
+ | 根目录 | `dsh-keys-manager` | Host 插件、Keys Manager Web 客户端、bundle patch |
186
+ | `packages/llm-omp` | `dsh-llm-omp-transports` | Cursor(及后续)传输组件 |
187
+
188
+ 根包把传输包声明为依赖,因此已发布的 Keys Manager tarball 会拉取传输包,而不是把它 vendor 进来。两个包一起发布且版本号一致,详见[发布](docs/release.zh-CN.md)。
189
+
113
190
  ## 文档
114
191
 
115
192
  | 文档 | 内容 |
@@ -117,6 +194,7 @@ $DSH_HOME/keys-manager/state.json
117
194
  | [开发](docs/development.zh-CN.md) | 构建与开发工作流、仓库布局 |
118
195
  | [发布](docs/release.zh-CN.md) | CI 检查与 npm 发布流程 |
119
196
  | [已知限制](docs/known-limits.zh-CN.md) | 当前设计边界,含延后提供商 |
197
+ | [传输包(英文)](packages/llm-omp/README.md) | Cursor 传输:支持状态、风险、构建/测试与发布 |
120
198
 
121
199
  英文版本:[README.md](README.md) 及 `docs/` 下的 `*.md` —— [Development](docs/development.md) · [Release](docs/release.md) · [Known limits](docs/known-limits.md)。当前设计边界速览:[已知限制](docs/known-limits.zh-CN.md)。
122
200
 
@@ -1,5 +1,8 @@
1
- # Mounts the Keys Manager Host plugin. The Client half is declared by
2
- # package.json#dsh.client and is served from lib/client.js.
1
+ # Mounts the Keys Manager Host plugin plus its second component, the
2
+ # llm-omp-transports transport package. The Client half is declared by package.json#dsh.client and
3
+ # is served from lib/client.js.
3
4
  - insert:
4
5
  - id: dsh-keys-manager
5
6
  name: 'dsh-keys-manager'
7
+ - id: llm-omp-transports
8
+ name: 'dsh-llm-omp-transports'
@@ -1,7 +1,7 @@
1
1
  /** Browser-half domain and service contracts for the Keys Manager. */
2
2
  import type * as React from 'react';
3
- import type { AccountAttemptNotice, AccountAttemptPrompt, AccountAttemptView, KeyStatus, KeyView, ManagerSettings, OAuthAccountView, ProviderStatus, ProviderView, StateView } from '../domain';
4
- export type { AccountAttemptNotice, AccountAttemptPrompt, AccountAttemptView, KeyStatus, KeyView, ManagerSettings, OAuthAccountView, ProviderStatus, ProviderView, StateView, };
3
+ import type { AccountAttemptNotice, AccountAttemptPrompt, AccountAttemptView, KeyStatus, KeyTestResult, KeyView, ManagerSettings, OAuthAccountView, ProviderStatus, ProviderView, StateView, TransportAccountStatus, TransportAccountView } from '../domain';
4
+ export type { AccountAttemptNotice, AccountAttemptPrompt, AccountAttemptView, KeyStatus, KeyTestResult, KeyView, ManagerSettings, OAuthAccountView, ProviderStatus, ProviderView, StateView, TransportAccountStatus, TransportAccountView, };
5
5
  /** Locale dictionaries registered under the plugin namespace. */
6
6
  export interface LocaleDicts {
7
7
  zh: Record<string, string>;
@@ -52,6 +52,17 @@ export type AckResult = {
52
52
  ok: false;
53
53
  error: string;
54
54
  };
55
+ /**
56
+ * Result of the per-row connection test. The payload is a `KeyTestResult`,
57
+ * not a `StateView`, so it has its own mapper instead of `call`.
58
+ */
59
+ export type KeyTestOutcome = {
60
+ ok: true;
61
+ value: KeyTestResult;
62
+ } | {
63
+ ok: false;
64
+ error: string;
65
+ };
55
66
  /** Immutable UI snapshot. */
56
67
  export interface ClientSnapshot {
57
68
  status: 'idle' | 'loading' | 'ready' | 'error';
@@ -84,6 +95,20 @@ export interface ClientStore {
84
95
  activateAccount(provider: string, accountId: string): Promise<ActionOutcome>;
85
96
  /** Drop one account row and its stored grant payload. */
86
97
  removeAccount(provider: string, accountId: string): Promise<ActionOutcome>;
98
+ /**
99
+ * Send one minimal request with the selected key or account row. The host
100
+ * never changes health state; the answer only reports the outcome.
101
+ */
102
+ testKey(provider: string, keyId: string): Promise<KeyTestOutcome>;
103
+ /**
104
+ * Start the `llm-omp-transports/<route>` sign-in; resolves with the attempt
105
+ * view, which the login dialog polls through {@link accountAttempt}.
106
+ */
107
+ beginTransportLogin(route: string): Promise<AccountAttemptResult>;
108
+ /** Re-read one transport route's stored grant (activation writes nothing). */
109
+ activateTransportAccount(route: string): Promise<ActionOutcome>;
110
+ /** Delete one transport route's grant record. */
111
+ removeTransportAccount(route: string): Promise<ActionOutcome>;
87
112
  tick(): void;
88
113
  dismissError(): void;
89
114
  }