dsh-provider-qoder 0.1.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/LICENSE +21 -0
- package/README.md +115 -0
- package/README_CN.md +115 -0
- package/cordis.patch.yml +4 -0
- package/lib/client.js +944 -0
- package/lib/index.d.ts +398 -0
- package/lib/index.js +1778 -0
- package/lib/invariant.d.ts +15 -0
- package/lib/invariant.js +15 -0
- package/package.json +103 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 mo-n
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# DSH Qoder Subscription Plugin
|
|
2
|
+
|
|
3
|
+
English | [简体中文](./README_CN.md)
|
|
4
|
+
|
|
5
|
+
`dsh-provider-qoder` integrates your Qoder subscription into DeepSeek Harness (DSH), supporting streaming text, reasoning content, and tool calls, with support for both Global and China Qoder services.
|
|
6
|
+
|
|
7
|
+
The plugin handles authentication and model communication, while tool execution, workspace operations, and permission management are handled by DSH.
|
|
8
|
+
This project is a community adapter plugin.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- Configure subscription access via Qoder Personal Access Token (PAT).
|
|
13
|
+
- Supports both Global (`global`) and China (`china`) services.
|
|
14
|
+
- Discovers available models for your account, allows selecting enabled models, and displays pricing multipliers and reasoning effort options when reported by the service.
|
|
15
|
+
- Supports streaming responses, reasoning content, tool calls, and multi-turn interactions with text-based tool results.
|
|
16
|
+
- View account information, personal quota, organization resource packs, and reset dates in Settings.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
### Prerequisites
|
|
21
|
+
|
|
22
|
+
You will need a running DSH Web environment, an active Qoder subscription, and a PAT matching the selected service region. The DSH profile running the plugin must provide a managed credentials service; when configuring via the settings page, the credential storage must also be writable.
|
|
23
|
+
|
|
24
|
+
This package declares peer/dependency ranges of DSH packages `>=0.1.2-rc.1 <0.2`, Cordis `>=4.0.2 <5`, and React `^18.2.0`. The settings UI also depends on the host providing remote credential endpoints and settings slots—please use a DSH version equipped with these interfaces; the ranges above do not imply that every version has been tested.
|
|
25
|
+
|
|
26
|
+
### Install from npm
|
|
27
|
+
|
|
28
|
+
Once published to npm, run the following in your terminal:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
dsh plugin --profile web add dsh-provider-qoder
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Configuration & Usage
|
|
35
|
+
|
|
36
|
+
### 1. Save Service Region and PAT
|
|
37
|
+
|
|
38
|
+
Open DSH Web, navigate to **Settings → Models**, locate the **Qoder Credentials** card at the bottom of the page, and click **Edit**.
|
|
39
|
+
|
|
40
|
+
| Service Region | Account Domain |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| Global (default) | `qoder.com` |
|
|
43
|
+
| China (CN) | `qoder.com.cn` |
|
|
44
|
+
|
|
45
|
+
Select the region matching your account, enter your Qoder PAT into the input box labeled **API Key**, and click **Save**. Note that a Qoder PAT is required here, not an API key from other model providers.
|
|
46
|
+
|
|
47
|
+
### 2. Fetch and Select Models
|
|
48
|
+
|
|
49
|
+
1. After saving the PAT and service region, click **Edit** again.
|
|
50
|
+
2. Expand **Custom Settings** and click **Fetch Available Models**.
|
|
51
|
+
3. Select the models you want to enable (keep at least one), then click **Save**.
|
|
52
|
+
4. Select a Qoder model in the DSH model picker to start chatting.
|
|
53
|
+
|
|
54
|
+
Fetching models uses the **saved PAT and service region**. If you switch accounts or regions, save your changes first before fetching models again. The initial model catalog is only a candidate reference; actual available models are subject to account query results. Model multipliers and reasoning effort options are provided by Qoder and may not be available for all models.
|
|
55
|
+
|
|
56
|
+
### 3. View Account & Quota
|
|
57
|
+
|
|
58
|
+
Open **Settings → Qoder** to view account and quota details, and click **Refresh** to query again. The absence of quota information does not mean zero quota; displayed content depends on data currently returned by Qoder.
|
|
59
|
+
|
|
60
|
+
## FAQ
|
|
61
|
+
|
|
62
|
+
### The plugin fails to start, or credentials cannot be saved
|
|
63
|
+
|
|
64
|
+
Ensure you have restarted the profile where the plugin was installed, and that the profile provides the DSH managed credentials service. If prompted that the storage is not writable, a writable credential store needs to be configured on the host side. The plugin does not read PATs from environment variables.
|
|
65
|
+
|
|
66
|
+
### PAT is saved, but model fetching or requests fail
|
|
67
|
+
|
|
68
|
+
Verify that the PAT is valid and matches the saved service region. If modified, save first before fetching models. The save action itself does not validate the token. If your account quota is exhausted, you will need to resolve your subscription quota first.
|
|
69
|
+
|
|
70
|
+
### Models remain unavailable after switching regions
|
|
71
|
+
|
|
72
|
+
Switching regions does not automatically update your PAT or refetch models. After saving the PAT for the corresponding region, refetch available models, save your selection, and choose an available Qoder model in your conversation.
|
|
73
|
+
|
|
74
|
+
### Are requests automatically retried?
|
|
75
|
+
|
|
76
|
+
Automatic retries are managed by DSH. To enable retries, the running profile should include `@deepseek-ai/dsh-llm-retry`. The plugin reports empty responses, rate limits, server errors, timeouts, and transport errors using DSH's default retry policy; authentication, invalid requests, cancellations, quota issues, and protocol formatting errors are not retried by default.
|
|
77
|
+
|
|
78
|
+
## Install from Source & Development
|
|
79
|
+
|
|
80
|
+
Run in an environment with Git, Node.js, and pnpm installed. Node.js must support the `--experimental-strip-types` and `--test-isolation=none` flags used by the project's test scripts.
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
git clone https://github.com/mo-n/dsh-provider-qoder.git
|
|
84
|
+
cd dsh-provider-qoder
|
|
85
|
+
pnpm install --frozen-lockfile
|
|
86
|
+
pnpm run build
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Install the built repository directory into your DSH profile. The path below is a placeholder example; replace it with the actual absolute path:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
dsh plugin --profile web add /absolute/path/to/dsh-provider-qoder
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
After restarting the profile, follow the configuration steps above. If running the CLI within a DSH source workspace, you can use `pnpm dsh` from that workspace.
|
|
96
|
+
|
|
97
|
+
For development, run watch mode in the plugin directory:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
pnpm run dev
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Before committing changes, run:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
pnpm run check
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
This command runs non-UI mocked tests, builds the ESM package and type declarations, checks build artifacts, and previews the package tarball without sending real Qoder model requests or publishing npm packages.
|
|
110
|
+
|
|
111
|
+
## Feedback
|
|
112
|
+
|
|
113
|
+
Please report issues via [GitHub Issues](https://github.com/mo-n/dsh-provider-qoder/issues) with the plugin and DSH versions, selected service region, reproduction steps, and sanitized error messages. Do not submit PATs, short-lived tokens, or personal account information.
|
|
114
|
+
|
|
115
|
+
This project is licensed under the MIT License.
|
package/README_CN.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# DSH Qoder 订阅插件
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | 简体中文
|
|
4
|
+
|
|
5
|
+
`dsh-provider-qoder` 将你的 Qoder 订阅接入 DeepSeek Harness(DSH),支持流式文本、推理内容和工具调用,可选择国际版或中国区 Qoder 服务。
|
|
6
|
+
|
|
7
|
+
插件负责认证和模型通信,工具执行、工作区操作及权限管理由 DSH 负责。
|
|
8
|
+
本项目是社区适配插件。
|
|
9
|
+
|
|
10
|
+
## 功能
|
|
11
|
+
|
|
12
|
+
- 通过 Qoder Personal Access Token(PAT,个人访问令牌)配置订阅访问。
|
|
13
|
+
- 支持国际版(`global`)和中国区(`china`)服务。
|
|
14
|
+
- 获取账号可用模型,选择启用的模型,并在服务返回相关信息时显示价格倍率和推理强度选项。
|
|
15
|
+
- 支持流式回答、推理内容、工具调用及文本工具结果的多轮交互。
|
|
16
|
+
- 在设置中查看账号信息、个人额度、组织资源包和重置时间。
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
### 使用前提
|
|
21
|
+
|
|
22
|
+
你需要可运行的 DSH Web 环境、可用的 Qoder 订阅,以及与所选服务区域匹配的 PAT。运行插件的 DSH profile 必须提供托管凭据服务;通过设置页面配置时,凭据存储还需可写。
|
|
23
|
+
|
|
24
|
+
本包声明的依赖范围为 DSH 相关包 `>=0.1.2-rc.1 <0.2`、Cordis `>=4.0.2 <5` 和 React `^18.2.0`。设置界面还依赖宿主提供凭据远程接口和设置插槽,请使用具备这些接口的 DSH 版本;上述范围不代表每个版本都经过实测。
|
|
25
|
+
|
|
26
|
+
### 从 npm 安装
|
|
27
|
+
|
|
28
|
+
发布到 npm 后,在终端执行:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
dsh plugin --profile web add dsh-provider-qoder
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 配置与使用
|
|
35
|
+
|
|
36
|
+
### 1. 保存服务区域和 PAT
|
|
37
|
+
|
|
38
|
+
打开 DSH Web 的 **设置 → 模型**,找到页面底部的 **Qoder 凭据** 卡片,点击 **编辑**。
|
|
39
|
+
|
|
40
|
+
| 服务区域 | 对应账号 |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| 国际版(Global,默认) | `qoder.com` |
|
|
43
|
+
| 中国区(CN) | `qoder.com.cn` |
|
|
44
|
+
|
|
45
|
+
选择与账号一致的区域,将 Qoder PAT 填入界面标为 **API 密钥** 的输入框,然后点击 **保存**。这里需要的是 Qoder PAT,不是其他模型服务的 API Key。
|
|
46
|
+
|
|
47
|
+
### 2. 获取并选择模型
|
|
48
|
+
|
|
49
|
+
1. 保存 PAT 和服务区域后,再次点击 **编辑**。
|
|
50
|
+
2. 展开 **自定义设置**,点击 **获取可用模型**。
|
|
51
|
+
3. 选择需要启用的模型,至少保留一个,然后点击 **保存**。
|
|
52
|
+
4. 在 DSH 的模型选择器中选择 Qoder 模型,开始对话。
|
|
53
|
+
|
|
54
|
+
获取模型使用的是**已保存的 PAT 和服务区域**。更换账号或区域后,请先保存,再重新获取模型。初始模型目录仅供候选参考,实际可用模型以账号查询结果为准。模型倍率及推理强度选项由 Qoder 提供,并非所有模型都有这些信息。
|
|
55
|
+
|
|
56
|
+
### 3. 查看账号与额度
|
|
57
|
+
|
|
58
|
+
打开 **设置 → Qoder** 查看账号和额度,点击 **刷新** 重新查询。没有额度信息不代表额度为零;显示内容取决于 Qoder 当前返回的数据。
|
|
59
|
+
|
|
60
|
+
## 常见问题
|
|
61
|
+
|
|
62
|
+
### 插件无法启动,或凭据无法保存
|
|
63
|
+
|
|
64
|
+
确认已重启安装插件的 profile,且该 profile 提供 DSH 托管凭据服务。如果提示存储不可写,需要在宿主侧配置可写的凭据存储。插件不会从环境变量读取 PAT。
|
|
65
|
+
|
|
66
|
+
### 已保存 PAT,但获取模型或请求失败
|
|
67
|
+
|
|
68
|
+
确认 PAT 有效且与已保存的服务区域匹配。修改后先保存,再获取模型。保存操作本身不会验证令牌。若账号额度已用尽,需先处理订阅额度问题。
|
|
69
|
+
|
|
70
|
+
### 切换区域后,模型仍不可用
|
|
71
|
+
|
|
72
|
+
切换区域不会自动替换 PAT 或重新获取模型。保存对应区域的 PAT 后,重新获取可用模型、保存选择,并在对话中选择可用的 Qoder 模型。
|
|
73
|
+
|
|
74
|
+
### 请求是否会自动重试?
|
|
75
|
+
|
|
76
|
+
自动重试由 DSH 管理。需要重试时,运行中的 profile 应包含 `@deepseek-ai/dsh-llm-retry`。插件使用 DSH 默认重试策略报告空响应、限流、服务端、超时和传输错误;认证、无效请求、取消、额度及协议格式错误默认不重试。
|
|
77
|
+
|
|
78
|
+
## 从源码安装与开发
|
|
79
|
+
|
|
80
|
+
在已安装 Git、Node.js 和 pnpm 的环境中执行。Node.js 需支持项目测试脚本使用的 `--experimental-strip-types` 和 `--test-isolation=none` 参数。
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
git clone https://github.com/mo-n/dsh-provider-qoder.git
|
|
84
|
+
cd dsh-provider-qoder
|
|
85
|
+
pnpm install --frozen-lockfile
|
|
86
|
+
pnpm run build
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
将构建后的仓库目录安装到 DSH profile。以下路径为占位示例,请替换为实际绝对路径:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
dsh plugin --profile web add /absolute/path/to/dsh-provider-qoder
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
重启 profile 后,按前文完成配置。若在 DSH 源码工作区中运行 CLI,可使用该工作区的 `pnpm dsh` 命令。
|
|
96
|
+
|
|
97
|
+
开发时,在插件目录运行监听构建:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
pnpm run dev
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
提交修改前运行:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
pnpm run check
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
该命令运行模拟网络的非 UI 测试、构建 ESM 包与类型声明、检查构建产物并预览打包内容,不会发起真实 Qoder 模型请求或发布 npm 包。
|
|
110
|
+
|
|
111
|
+
## 反馈
|
|
112
|
+
|
|
113
|
+
请通过 [GitHub Issues](https://github.com/mo-n/dsh-provider-qoder/issues) 提交问题,附上插件和 DSH 版本、所选服务区域、复现步骤及脱敏后的错误信息。不要提交 PAT、短期令牌或个人账号信息。
|
|
114
|
+
|
|
115
|
+
本项目采用 MIT 许可证。
|
package/cordis.patch.yml
ADDED