@edge-sky/dsh-oauth-adapter 0.1.1-rc.10

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 edge-sky
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ # Bilingual-pair consistency record: the git blob hash of each side as of the
2
+ # last confirmed-consistent state. Both languages carry equal authority.
3
+ README.md: a39895b8270728ff304536ba2df6d927e21f6f20
4
+ README.zh.md: b2d5ac29a0087cf4df1f7a7ce7757acbe780fc3c
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # dsh-oauth-adapter
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ An OAuth account page for the DSH Web profile. It supports:
6
+
7
+ - [x] OpenAI Codex
8
+ - [x] GitHub Copilot
9
+
10
+ The adapter has only been tested with DSH `0.1.1-rc.2`; compatibility with future versions is not guaranteed.
11
+
12
+ ## Install
13
+
14
+ ```sh
15
+ dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
16
+ ```
17
+
18
+ or
19
+
20
+ ```sh
21
+ npx @deepseek-ai/dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
22
+ ```
23
+
24
+ Start DSH:
25
+
26
+ ```sh
27
+ npx @deepseek-ai/dsh web
28
+ ```
29
+
30
+ <img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/78a59190-8029-4c60-bc50-b763312540f7" />
31
+
32
+ <img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/e0cc6591-73a4-4e87-9ef6-68950126b290" />
33
+
34
+
35
+ ## How it works
36
+
37
+ 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` registers pi-ai's existing Codex and Copilot login flows with the DSH Authorization Service.
38
+
39
+ Because DSH does not currently mount the `ctx.authorization` service, this plugin also mounts it manually.
40
+
41
+ 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 ADDED
@@ -0,0 +1,41 @@
1
+ # dsh-oauth-adapter
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 为 DSH Web profile 提供独立的 OAuth 账户页面。当前支持:
6
+
7
+ - [x] OpenAI Codex
8
+ - [x] GitHub Copilot
9
+
10
+ 当前仅对 DSH`0.1.1-rc.2`进行了测试,不保证未来版本的兼容性
11
+
12
+ ## 安装
13
+
14
+ ```sh
15
+ dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
16
+ ```
17
+
18
+ 或
19
+
20
+ ```sh
21
+ npx @deepseek-ai/dsh plugin --profile web add @edge-sky/dsh-oauth-adapter
22
+ ```
23
+
24
+ 启动 DSH:
25
+
26
+ ```sh
27
+ npx @deepseek-ai/dsh web
28
+ ```
29
+
30
+ <img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/134ec856-e17b-4800-bb87-069851986d3e" />
31
+
32
+ <img width="2270" height="1524" alt="image" src="https://github.com/user-attachments/assets/8007002a-a036-4cf4-b015-d4e50eff25d9" />
33
+
34
+
35
+ ## 工作原理
36
+
37
+ DSH 通过 `@deepseek-ai/dsh-llm-pi-ai` 适配器接入 pi-ai,但并没有提供 OAuth 的入口。`@edge-sky/dsh-oauth-adapter` 将 pi-ai 已有的 Codex 与 Copilot 登录流程注册到 DSH Authorization Service。
38
+
39
+ 由于 DSH 目前并没有挂载`ctx.authorization`服务,因此该插件同时手动对其进行了挂载
40
+
41
+ 插件本身并不承担 OAuth 凭证管理与维持登录态的职责,或许将来 DSH 会官方支持这一登录方式,但至少现在你可以通过这个插件体验它
@@ -0,0 +1,6 @@
1
+ - insert:
2
+ - id: dsh-oauth-authorization
3
+ name: '@edge-sky/dsh-oauth-adapter/authorization-fallback'
4
+
5
+ - id: dsh-oauth-adapter
6
+ name: '@edge-sky/dsh-oauth-adapter'
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Best-effort authorization provider for DSH Web profiles that do not mount
3
+ * the official service themselves.
4
+ * @module @edge-sky/dsh-oauth-adapter/authorization-fallback
5
+ */
6
+ import type { Context } from '@deepseek-ai/cordis';
7
+ /** Cordis plugin name. */
8
+ export declare const name = "dsh-oauth-authorization-fallback";
9
+ /**
10
+ * Reuse a Host-provided authorization service or mount the official fallback.
11
+ *
12
+ * The microtask yield lets earlier Profile Bundle rows publish their services
13
+ * before this out-of-tree bundle decides whether a fallback is necessary.
14
+ *
15
+ * @param ctx - Loader context used to inspect and extend the Host service set.
16
+ * @returns A promise that settles after the fallback has been mounted or skipped.
17
+ */
18
+ export declare function apply(ctx: Context): Promise<void>;
19
+ //# sourceMappingURL=authorization-fallback.d.ts.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Best-effort authorization provider for DSH Web profiles that do not mount
3
+ * the official service themselves.
4
+ * @module @edge-sky/dsh-oauth-adapter/authorization-fallback
5
+ */
6
+ import AuthorizationService from '@deepseek-ai/dsh-authorization';
7
+ /** Cordis plugin name. */
8
+ export const name = 'dsh-oauth-authorization-fallback';
9
+ /**
10
+ * Reuse a Host-provided authorization service or mount the official fallback.
11
+ *
12
+ * The microtask yield lets earlier Profile Bundle rows publish their services
13
+ * before this out-of-tree bundle decides whether a fallback is necessary.
14
+ *
15
+ * @param ctx - Loader context used to inspect and extend the Host service set.
16
+ * @returns A promise that settles after the fallback has been mounted or skipped.
17
+ */
18
+ export async function apply(ctx) {
19
+ await Promise.resolve();
20
+ if (ctx.get('authorization') !== undefined)
21
+ return;
22
+ await ctx.plugin(AuthorizationService);
23
+ }
24
+ //# sourceMappingURL=authorization-fallback.js.map