@edge-sky/dsh-oauth-adapter 0.1.2-dev.1 → 0.1.2-rc.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.
- package/README.i18n.yaml +2 -2
- package/README.md +28 -37
- package/README.zh.md +28 -37
- package/package.json +34 -60
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: 6e18cc90e25e581abecfbf502af2022922b408d8
|
|
4
|
+
README.zh.md: 807ae07ac4b6d42bee91ceac3c874406ecc32ab0
|
package/README.md
CHANGED
|
@@ -2,57 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
OAuth
|
|
5
|
+
An OAuth account page for the DSH Web profile. It supports:
|
|
6
|
+
|
|
7
|
+
| Provider | pi-ai sign-in path |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| OpenAI Codex | Browser callback or device code |
|
|
10
|
+
| GitHub Copilot | GitHub or GitHub Enterprise device code |
|
|
11
|
+
| Anthropic | Browser callback with manual code/redirect fallback |
|
|
12
|
+
| Kimi For Coding | Device code |
|
|
13
|
+
| OpenRouter | Browser PKCE callback |
|
|
14
|
+
| xAI | Device code |
|
|
15
|
+
|
|
16
|
+
Each account is shown only as available when the installed `@deepseek-ai/dsh-llm-pi-ai` actually registers its OAuth flow. This keeps older or differently bundled pi-ai versions fail-closed instead of exposing a login button that cannot work.
|
|
17
|
+
|
|
18
|
+
The adapter has only been tested with DSH `0.1.1-rc.2`; compatibility with future versions is not guaranteed.
|
|
6
19
|
|
|
7
20
|
## Install
|
|
8
21
|
|
|
9
22
|
```sh
|
|
10
23
|
dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
|
|
11
|
-
dsh web
|
|
12
24
|
```
|
|
13
25
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Use the **OAuth models** area of **Settings → Models** to synchronize an existing connection, configure unmatched models, and add, edit or delete manual entries. This area occupies the public `settings.models.footer` slot. No additional model settings page is installed.
|
|
17
|
-
|
|
18
|
-
| Provider | Model protocol |
|
|
19
|
-
| --- | --- |
|
|
20
|
-
| GitHub Copilot | Select Chat Completions, Responses or Anthropic Messages per model |
|
|
21
|
-
| OpenRouter | Select Chat Completions or Anthropic Messages per model |
|
|
22
|
-
| OpenAI Codex | Codex Responses |
|
|
23
|
-
| xAI | OpenAI Responses |
|
|
24
|
-
| Anthropic, Kimi Coding | Anthropic Messages |
|
|
25
|
-
|
|
26
|
-
Model ID is required; a blank display name uses the ID. Fixed-protocol providers have no protocol selector and reject protocol overrides on the server. An unknown model receives the provider's configured default capacities, text input and no inferred reasoning capability. Saving permits an attempted request; it does not prove the model exists, that the account can call it, or that all capabilities are known.
|
|
26
|
+
or
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
```sh
|
|
29
|
+
npx @deepseek-ai/dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
|
|
30
|
+
```
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Start DSH:
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
```sh
|
|
35
|
+
npx @deepseek-ai/dsh web
|
|
36
|
+
```
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
<img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/78a59190-8029-4c60-bc50-b763312540f7" />
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
<img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/e0cc6591-73a4-4e87-9ef6-68950126b290" />
|
|
39
41
|
|
|
40
|
-
The optional Host plugin configuration accepts:
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
| --- | --- | --- |
|
|
44
|
-
| `debug` | `false` | Transport lifecycle diagnostics |
|
|
45
|
-
| `modelSyncTimeoutMs` | `30000` | Discovery and route-release timeout |
|
|
46
|
-
| `modelSyncMaxResponseBytes` | `4194304` | Maximum bytes per remote page |
|
|
47
|
-
| `modelSyncMaxPages` | `100` | Maximum pages per synchronization |
|
|
48
|
-
| `codexClientVersion` | `0.149.0` | Version sent to the Codex discovery endpoint |
|
|
43
|
+
## How it works
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
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.
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
pnpm install
|
|
54
|
-
pnpm run typecheck
|
|
55
|
-
pnpm test
|
|
56
|
-
```
|
|
47
|
+
Because DSH does not currently mount the `ctx.authorization` service, this plugin also mounts it manually.
|
|
57
48
|
|
|
58
|
-
|
|
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
|
@@ -2,57 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
-
为 DSH Web profile
|
|
5
|
+
为 DSH Web profile 提供独立的 OAuth 账户页面。当前支持:
|
|
6
|
+
|
|
7
|
+
| 提供商 | pi-ai 登录路径 |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| OpenAI Codex | 浏览器回调或设备码 |
|
|
10
|
+
| GitHub Copilot | GitHub 或 GitHub Enterprise 设备码 |
|
|
11
|
+
| Anthropic | 浏览器回调,并支持手工粘贴授权码/重定向地址 |
|
|
12
|
+
| Kimi For Coding | 设备码 |
|
|
13
|
+
| OpenRouter | 浏览器 PKCE 回调 |
|
|
14
|
+
| xAI | 设备码 |
|
|
15
|
+
|
|
16
|
+
只有当当前安装的 `@deepseek-ai/dsh-llm-pi-ai` 确实注册了对应 OAuth 流程时,账户才会显示为可用。这样旧版或采用不同 pi-ai bundle 的 DSH 会安全地禁用登录按钮,而不会暴露无法完成的流程。
|
|
17
|
+
|
|
18
|
+
当前仅对 DSH`0.1.1-rc.2`进行了测试,不保证未来版本的兼容性
|
|
6
19
|
|
|
7
20
|
## 安装
|
|
8
21
|
|
|
9
22
|
```sh
|
|
10
23
|
dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
|
|
11
|
-
dsh web
|
|
12
24
|
```
|
|
13
25
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
在 **设置 → 模型** 的 **OAuth 模型** 区域同步已连接账号、补充待配置模型,以及添加、编辑或删除手动模型。该区域使用公开的 `settings.models.footer` 插槽,不增加独立模型设置页面。
|
|
17
|
-
|
|
18
|
-
| 供应商 | 模型协议 |
|
|
19
|
-
| --- | --- |
|
|
20
|
-
| GitHub Copilot | 每个模型选择 Chat Completions、Responses 或 Anthropic Messages |
|
|
21
|
-
| OpenRouter | 每个模型选择 Chat Completions 或 Anthropic Messages |
|
|
22
|
-
| OpenAI Codex | Codex Responses |
|
|
23
|
-
| xAI | OpenAI Responses |
|
|
24
|
-
| Anthropic、Kimi Coding | Anthropic Messages |
|
|
25
|
-
|
|
26
|
-
模型 ID 必填,显示名称留空时使用 ID。固定协议供应商不显示协议选择器,后端也拒绝协议覆盖。未知模型采用供应商配置的默认容量、文本输入,不根据名称推断思考能力。保存后可尝试发送请求,但不代表已验证模型存在、账号可调用或全部模型能力。
|
|
26
|
+
或
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
```sh
|
|
29
|
+
npx @deepseek-ai/dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
|
|
30
|
+
```
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
启动 DSH:
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
```sh
|
|
35
|
+
npx @deepseek-ai/dsh web
|
|
36
|
+
```
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
<img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/134ec856-e17b-4800-bb87-069851986d3e" />
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
<img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/8007002a-a036-4cf4-b015-d4e50eff25d9" />
|
|
39
41
|
|
|
40
|
-
Host 插件接受以下可选配置:
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
| --- | --- | --- |
|
|
44
|
-
| `debug` | `false` | 连接生命周期诊断 |
|
|
45
|
-
| `modelSyncTimeoutMs` | `30000` | 模型发现及旧路由释放的超时 |
|
|
46
|
-
| `modelSyncMaxResponseBytes` | `4194304` | 每页远端响应的最大字节数 |
|
|
47
|
-
| `modelSyncMaxPages` | `100` | 一次同步的最大页数 |
|
|
48
|
-
| `codexClientVersion` | `0.149.0` | Codex 发现端点所接收的客户端版本 |
|
|
43
|
+
## 工作原理
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
DSH 通过 `@deepseek-ai/dsh-llm-pi-ai` 适配器接入 pi-ai,但并没有提供 OAuth 的入口。`@edge-sky/dsh-oauth-adapter` 通过 DSH Authorization Service 暴露 pi-ai 已有的 provider 登录流程。浏览器链接、设备码、文本与密码输入、登录方式选择、取消和撤回提示均通过同一套 provider-neutral 传输完成。
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
pnpm install
|
|
54
|
-
pnpm run typecheck
|
|
55
|
-
pnpm test
|
|
56
|
-
```
|
|
47
|
+
由于 DSH 目前并没有挂载`ctx.authorization`服务,因此该插件同时手动对其进行了挂载
|
|
57
48
|
|
|
58
|
-
|
|
49
|
+
插件本身并不承担 OAuth 凭证管理与维持登录态的职责,或许将来 DSH 会官方支持这一登录方式,但至少现在你可以通过这个插件体验它
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edge-sky/dsh-oauth-adapter",
|
|
3
3
|
"description": "Web OAuth account surface for official DSH authorization flows",
|
|
4
|
-
"version": "0.1.2-
|
|
4
|
+
"version": "0.1.2-rc.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "edge-sky",
|
|
7
7
|
"url": "https://github.com/edge-sky"
|
|
@@ -59,30 +59,27 @@
|
|
|
59
59
|
},
|
|
60
60
|
"client": {
|
|
61
61
|
"inject": [
|
|
62
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
62
63
|
"@deepseek-ai/dsh-client-ui-settings",
|
|
63
|
-
"@deepseek-ai/dsh-client-locale"
|
|
64
|
-
"@deepseek-ai/dsh-client-ui-settings-models"
|
|
64
|
+
"@deepseek-ai/dsh-client-locale"
|
|
65
65
|
],
|
|
66
66
|
"platform": "web"
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@deepseek-ai/cordis": ">=4.0.
|
|
71
|
-
"@deepseek-ai/dsh-authorization": ">=0.1.
|
|
72
|
-
"@deepseek-ai/dsh-client-locale": ">=0.1.
|
|
73
|
-
"@deepseek-ai/dsh-client-
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-
|
|
75
|
-
"@deepseek-ai/dsh-
|
|
76
|
-
"@deepseek-ai/dsh-
|
|
77
|
-
"@deepseek-ai/dsh-
|
|
78
|
-
"@deepseek-ai/dsh-
|
|
79
|
-
"@deepseek-ai/dsh-llm
|
|
80
|
-
"@deepseek-ai/dsh-
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"@deepseek-ai/dsh-attachment": ">=0.1.2-rc.1 <0.2.0-0",
|
|
84
|
-
"@deepseek-ai/dsh-fs": ">=0.1.2-rc.1 <0.2.0-0",
|
|
85
|
-
"@deepseek-ai/dsh-client-ui-renderer": ">=0.1.2-rc.1 <0.2.0-0"
|
|
70
|
+
"@deepseek-ai/cordis": ">=4.0.1",
|
|
71
|
+
"@deepseek-ai/dsh-authorization": ">=0.1.1-rc.2 <0.2.0-0",
|
|
72
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.1-rc.2 <0.2.0-0",
|
|
73
|
+
"@deepseek-ai/dsh-client-runtime": ">=0.1.1-rc.2 <0.2.0-0",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.1-rc.2 <0.2.0-0",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-slots": ">=0.1.1-rc.2 <0.2.0-0",
|
|
76
|
+
"@deepseek-ai/dsh-credentials": ">=0.1.1-rc.2 <0.2.0-0",
|
|
77
|
+
"@deepseek-ai/dsh-host-webserver": ">=0.1.1-rc.2 <0.2.0-0",
|
|
78
|
+
"@deepseek-ai/dsh-invariants": ">=0.1.1-rc.2 <0.2.0-0",
|
|
79
|
+
"@deepseek-ai/dsh-llm": ">=0.1.1-rc.2 <0.2.0-0",
|
|
80
|
+
"@deepseek-ai/dsh-llm-pi-ai": ">=0.1.1-rc.2 <0.2.0-0",
|
|
81
|
+
"@deepseek-ai/dsh-settings": ">=0.1.1-rc.2 <0.2.0-0",
|
|
82
|
+
"react": ">=18.2.0"
|
|
86
83
|
},
|
|
87
84
|
"peerDependenciesMeta": {
|
|
88
85
|
"@deepseek-ai/cordis": {
|
|
@@ -91,6 +88,9 @@
|
|
|
91
88
|
"@deepseek-ai/dsh-client-locale": {
|
|
92
89
|
"optional": true
|
|
93
90
|
},
|
|
91
|
+
"@deepseek-ai/dsh-client-runtime": {
|
|
92
|
+
"optional": true
|
|
93
|
+
},
|
|
94
94
|
"@deepseek-ai/dsh-client-ui-settings": {
|
|
95
95
|
"optional": true
|
|
96
96
|
},
|
|
@@ -117,37 +117,25 @@
|
|
|
117
117
|
},
|
|
118
118
|
"react": {
|
|
119
119
|
"optional": true
|
|
120
|
-
},
|
|
121
|
-
"@deepseek-ai/dsh-client-ui-settings-models": {
|
|
122
|
-
"optional": true
|
|
123
|
-
},
|
|
124
|
-
"@deepseek-ai/dsh-attachment": {
|
|
125
|
-
"optional": true
|
|
126
|
-
},
|
|
127
|
-
"@deepseek-ai/dsh-fs": {
|
|
128
|
-
"optional": true
|
|
129
|
-
},
|
|
130
|
-
"@deepseek-ai/dsh-client-ui-renderer": {
|
|
131
|
-
"optional": true
|
|
132
120
|
}
|
|
133
121
|
},
|
|
134
122
|
"dependencies": {
|
|
135
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
136
|
-
"ws": "^8.18.3"
|
|
137
|
-
"@earendil-works/pi-ai": "0.84.4"
|
|
123
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
124
|
+
"ws": "^8.18.3"
|
|
138
125
|
},
|
|
139
126
|
"devDependencies": {
|
|
140
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
141
|
-
"@deepseek-ai/dsh-authorization": "0.1.
|
|
142
|
-
"@deepseek-ai/dsh-client-locale": "0.1.
|
|
143
|
-
"@deepseek-ai/dsh-client-
|
|
144
|
-
"@deepseek-ai/dsh-client-ui-
|
|
145
|
-
"@deepseek-ai/dsh-
|
|
146
|
-
"@deepseek-ai/dsh-
|
|
147
|
-
"@deepseek-ai/dsh-
|
|
148
|
-
"@deepseek-ai/dsh-
|
|
149
|
-
"@deepseek-ai/dsh-llm
|
|
150
|
-
"@deepseek-ai/dsh-
|
|
127
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
128
|
+
"@deepseek-ai/dsh-authorization": "0.1.1-rc.2",
|
|
129
|
+
"@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
|
|
130
|
+
"@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
|
|
131
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
|
|
132
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
|
|
133
|
+
"@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
|
|
134
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.1-rc.2",
|
|
135
|
+
"@deepseek-ai/dsh-invariants": "0.1.1-rc.2",
|
|
136
|
+
"@deepseek-ai/dsh-llm": "0.1.1-rc.2",
|
|
137
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.1.1-rc.2",
|
|
138
|
+
"@deepseek-ai/dsh-settings": "0.1.1-rc.2",
|
|
151
139
|
"@types/node": "^22.20.0",
|
|
152
140
|
"@types/react": "~18.3.1",
|
|
153
141
|
"@types/react-dom": "~18.3.1",
|
|
@@ -156,20 +144,6 @@
|
|
|
156
144
|
"react-dom": "^18.2.0",
|
|
157
145
|
"tsdown": "^0.22.2",
|
|
158
146
|
"typescript": "^6.0.3",
|
|
159
|
-
"vitest": "^4.1.8"
|
|
160
|
-
"@deepseek-ai/dsh-client-ui-settings-models": "0.1.2-rc.1",
|
|
161
|
-
"@deepseek-ai/dsh-attachment": "0.1.2-rc.1",
|
|
162
|
-
"@deepseek-ai/dsh-fs": "0.1.2-rc.1",
|
|
163
|
-
"@deepseek-ai/dsh-settings-file": "0.1.2-rc.1",
|
|
164
|
-
"@deepseek-ai/dsh-credentials-local": "0.1.2-rc.1",
|
|
165
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.1.2-rc.1",
|
|
166
|
-
"jsdom": "^26.1.0",
|
|
167
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
|
|
168
|
-
"@deepseek-ai/dsh-client-store": "0.1.2-rc.1",
|
|
169
|
-
"@deepseek-ai/dsh-atomic-write": "0.1.2-rc.1",
|
|
170
|
-
"@deepseek-ai/dsh-home-paths": "0.1.2-rc.1",
|
|
171
|
-
"@deepseek-ai/dsh-launch-environment": "0.1.2-rc.1",
|
|
172
|
-
"@deepseek-ai/dsh-session": "0.1.2-rc.1",
|
|
173
|
-
"@deepseek-ai/dsh-scope": "0.1.2-rc.1"
|
|
147
|
+
"vitest": "^4.1.8"
|
|
174
148
|
}
|
|
175
149
|
}
|