@edge-sky/dsh-oauth-adapter 0.1.2-rc.0 → 0.1.3-beta.3
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/README.i18n.yaml +2 -2
- package/README.md +21 -10
- package/README.zh.md +22 -10
- package/lib/client.js +581 -8
- package/lib/index.d.ts +12 -5
- package/lib/index.js +91 -78
- package/lib/model-auth.d.ts +8 -0
- package/lib/model-auth.js +48 -0
- package/lib/model-catalog.d.ts +27 -0
- package/lib/model-catalog.js +146 -0
- package/lib/model-discovery.d.ts +22 -0
- package/lib/model-discovery.js +147 -0
- package/lib/model-service.d.ts +66 -0
- package/lib/model-service.js +375 -0
- package/lib/model-types.d.ts +94 -0
- package/lib/model-types.js +25 -0
- package/lib/protocol.d.ts +3 -2
- package/lib/protocol.js +27 -0
- package/lib/types/client/OAuthModelsSection.d.ts +11 -0
- package/lib/types/client/index.d.ts +2 -2
- package/lib/types/client/locales.d.ts +35 -0
- package/lib/types/client/store.d.ts +17 -0
- package/lib/types/client/styles.d.ts +1 -1
- package/lib/types/model-types.d.ts +94 -0
- package/lib/types/protocol.d.ts +3 -2
- package/package.json +84 -36
package/README.i18n.yaml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# Bilingual-pair consistency record: the git blob hash of each side as of the
|
|
2
2
|
# last confirmed-consistent state. Both languages carry equal authority.
|
|
3
|
-
README.md:
|
|
4
|
-
README.zh.md:
|
|
3
|
+
README.md: 643064b672859791cce2551254d03f3154647f20
|
|
4
|
+
README.zh.md: d1f28dc87675dd408f84eb495a67da58a7065b33
|
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# dsh-oauth-adapter
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@edge-sky/dsh-oauth-adapter)
|
|
4
|
+
[](https://www.npmjs.com/package/@edge-sky/dsh-oauth-adapter)
|
|
5
|
+
[](https://www.npmjs.com/package/@edge-sky/dsh-oauth-adapter)
|
|
6
|
+
|
|
3
7
|
English | [中文](README.zh.md)
|
|
4
8
|
|
|
5
9
|
An OAuth account page for the DSH Web profile. It supports:
|
|
@@ -13,21 +17,19 @@ An OAuth account page for the DSH Web profile. It supports:
|
|
|
13
17
|
| OpenRouter | Browser PKCE callback |
|
|
14
18
|
| xAI | Device code |
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
The adapter has only been tested with DSH `0.1.1-rc.2`; compatibility with future versions is not guaranteed.
|
|
20
|
+
This checkout targets DSH `0.2.0-rc.2`. Once an adapter release with the DSH 0.2 peer range is published, install that release. Earlier DSH releases require an earlier adapter release.
|
|
19
21
|
|
|
20
22
|
## Install
|
|
21
23
|
|
|
24
|
+
For DSH `0.2.0-rc.2`, after the compatible adapter release is published:
|
|
25
|
+
|
|
22
26
|
```sh
|
|
23
27
|
dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
|
|
24
28
|
```
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
Or for the official desktop, use `@edge-sky/dsh-oauth-adapter`
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
npx @deepseek-ai/dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
|
|
30
|
-
```
|
|
32
|
+
For DSH `0.1.2-rc.1` through `0.1.5-rc.1`, use an adapter release from the `0.1.3` series. For DSH `0.1.1-rc.2`, use `@edge-sky/dsh-oauth-adapter@0.1.2-rc.0`.
|
|
31
33
|
|
|
32
34
|
Start DSH:
|
|
33
35
|
|
|
@@ -35,15 +37,24 @@ Start DSH:
|
|
|
35
37
|
npx @deepseek-ai/dsh web
|
|
36
38
|
```
|
|
37
39
|
|
|
38
|
-
<img width="
|
|
40
|
+
<img width="2940" height="1766" alt="image" src="https://github.com/user-attachments/assets/cbd98703-ee7a-491b-aa2f-02e42b99f6b9" />
|
|
41
|
+
|
|
42
|
+
|
|
39
43
|
|
|
40
44
|
<img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/e0cc6591-73a4-4e87-9ef6-68950126b290" />
|
|
41
45
|
|
|
46
|
+
For models not explicitly listed as supported by the built-in pi-ai, you can add them manually (availability needs to be verified on your own).
|
|
47
|
+
|
|
48
|
+
<img width="774" height="724" alt="PixPin_2026-09-10_11-08-26" src="https://github.com/user-attachments/assets/e3adc9fc-36e6-414f-ae5b-1748ff5e8f70" />
|
|
49
|
+
|
|
42
50
|
|
|
43
51
|
## How it works
|
|
44
52
|
|
|
45
53
|
DSH integrates pi-ai through the `@deepseek-ai/dsh-llm-pi-ai` adapter, but does not provide an OAuth entry point. `@edge-sky/dsh-oauth-adapter` exposes pi-ai's existing provider login flows through the DSH Authorization Service. Browser links, device codes, text and secret input, method selection, cancellation, and withdrawn prompts all use the same provider-neutral transport.
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
The profile patch mounts an authorization fallback when the host does not provide `ctx.authorization`.
|
|
56
|
+
|
|
57
|
+
DSH owns OAuth credentials and login state. This adapter stores model configuration in `dsh-oauth-adapter.modelStore`; see [model migration and recovery](docs/oauth-models.md).
|
|
58
|
+
|
|
59
|
+
If this plugins is has helped you, please give a star for me, or create issues if you have any suggestion~
|
|
48
60
|
|
|
49
|
-
The plugin itself does not manage OAuth credentials or maintain login state. Maybe DSH support this sign-in method in the future; but for now, this plugin lets you enjoy it.
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# dsh-oauth-adapter
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@edge-sky/dsh-oauth-adapter)
|
|
4
|
+
[](https://www.npmjs.com/package/@edge-sky/dsh-oauth-adapter)
|
|
5
|
+
[](https://www.npmjs.com/package/@edge-sky/dsh-oauth-adapter)
|
|
6
|
+
|
|
3
7
|
[English](README.md) | 中文
|
|
4
8
|
|
|
5
9
|
为 DSH Web profile 提供独立的 OAuth 账户页面。当前支持:
|
|
@@ -13,21 +17,20 @@
|
|
|
13
17
|
| OpenRouter | 浏览器 PKCE 回调 |
|
|
14
18
|
| xAI | 设备码 |
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
当前仅对 DSH`0.1.1-rc.2`进行了测试,不保证未来版本的兼容性
|
|
20
|
+
当前源码面向 DSH `0.2.0-rc.2`。发布声明 DSH 0.2 peer 依赖范围的适配器版本后,请安装该版本。较早的 DSH 版本需使用对应的适配器旧版本。
|
|
19
21
|
|
|
20
22
|
## 安装
|
|
21
23
|
|
|
24
|
+
对于 DSH `0.2.0-rc.2`:
|
|
25
|
+
|
|
22
26
|
```sh
|
|
23
27
|
dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
|
|
24
28
|
```
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
或使用于官方桌面端 `@edge-sky/dsh-oauth-adapter`
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
```
|
|
32
|
+
|
|
33
|
+
对于 DSH `0.1.2-rc.1` 至 `0.1.5-rc.1`,请使用适配器 `0.1.3` 系列;对于 DSH `0.1.1-rc.2`,请使用 `@edge-sky/dsh-oauth-adapter@0.1.2-rc.0`。
|
|
31
34
|
|
|
32
35
|
启动 DSH:
|
|
33
36
|
|
|
@@ -35,15 +38,24 @@ npx @deepseek-ai/dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
|
|
|
35
38
|
npx @deepseek-ai/dsh web
|
|
36
39
|
```
|
|
37
40
|
|
|
38
|
-
<img width="
|
|
41
|
+
<img width="2940" height="1766" alt="image" src="https://github.com/user-attachments/assets/7f1dc846-9cea-468c-8a1e-27f4fa34a4fe" />
|
|
42
|
+
|
|
39
43
|
|
|
40
44
|
<img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/8007002a-a036-4cf4-b015-d4e50eff25d9" />
|
|
41
45
|
|
|
42
46
|
|
|
47
|
+
对于内置 pi-ai 未写明支持的模型,支持手动添加(可用性需自行验证)
|
|
48
|
+
|
|
49
|
+
<img width="778" height="723" alt="PixPin_2026-09-10_11-02-42" src="https://github.com/user-attachments/assets/e6b10f86-591d-4801-a758-c8b56c83a18d" />
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
43
53
|
## 工作原理
|
|
44
54
|
|
|
45
55
|
DSH 通过 `@deepseek-ai/dsh-llm-pi-ai` 适配器接入 pi-ai,但并没有提供 OAuth 的入口。`@edge-sky/dsh-oauth-adapter` 通过 DSH Authorization Service 暴露 pi-ai 已有的 provider 登录流程。浏览器链接、设备码、文本与密码输入、登录方式选择、取消和撤回提示均通过同一套 provider-neutral 传输完成。
|
|
46
56
|
|
|
47
|
-
|
|
57
|
+
当宿主未提供 `ctx.authorization` 时,profile patch 会挂载授权服务后备实现。
|
|
58
|
+
|
|
59
|
+
OAuth 凭据和登录状态由 DSH 管理。适配器将模型配置保存在 `dsh-oauth-adapter.modelStore`;参见[模型迁移与恢复](docs/oauth-models.zh.md)。
|
|
48
60
|
|
|
49
|
-
|
|
61
|
+
如果这个插件帮到了你,还请留下你的小星星,如果有任何建议,欢迎 issues~
|