dsh-opencode-go 0.1.22 → 0.1.24
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 +1 -0
- package/README.en.md +70 -147
- package/README.md +70 -145
- package/THIRD_PARTY_NOTICES.md +6 -2
- package/docs/advanced.en.md +137 -0
- package/docs/advanced.md +135 -0
- package/docs/assets/accounts.png +0 -0
- package/docs/assets/advanced-settings.png +0 -0
- package/docs/assets/model-settings.png +0 -0
- package/docs/assets/usage-panel.png +0 -0
- package/docs/development.md +17 -3
- package/docs/verification.md +183 -0
- package/lib/build-info.json +1 -1
- package/lib/client.js +456 -410
- package/lib/index.js +50626 -5092
- package/lib/types/account-manager.d.ts +2 -0
- package/lib/types/accounts.d.ts +3 -1
- package/lib/types/adapter.d.ts +5 -3
- package/lib/types/catalog.d.ts +1 -1
- package/lib/types/client/accounts-controller.d.ts +2 -0
- package/lib/types/client/hint-mark.d.ts +17 -0
- package/lib/types/client/host-primitives.d.ts +11 -0
- package/lib/types/client/locales.d.ts +5 -3
- package/lib/types/client/section-controller.d.ts +0 -2
- package/lib/types/config-contract.d.ts +3 -2
- package/lib/types/config.d.ts +1 -1
- package/lib/types/conversion/stream.d.ts +2 -1
- package/lib/types/gateway-diagnostics.d.ts +1 -0
- package/lib/types/gateway-url.d.ts +6 -0
- package/lib/types/google-fetch.d.ts +6 -0
- package/lib/types/google-generative-ai.d.ts +3 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/model-metadata.d.ts +2 -2
- package/lib/types/request-budget.d.ts +12 -0
- package/lib/types/sdk-types.d.ts +1893 -305
- package/lib/vendor-licenses.txt +1760 -2
- package/package.json +3 -2
package/LICENSE
CHANGED
package/README.en.md
CHANGED
|
@@ -2,204 +2,128 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](README.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**OpenCode Go subscription usage and multiple-account management** for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness), with convenient access to quotas, reset times, and account switching.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
DSH already supports OpenCode Go natively. This plugin focuses on usage inside conversations, managing multiple accounts, and dedicated model and settings controls.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- **Usage at a glance**: see usage beside the conversation input, then open the panel for five-hour, weekly, and monthly percentages and reset times.
|
|
10
|
+
- **Accounts in one place**: inspect each account's quota and key status, drag to reorder, switch inside a conversation, or enable automatic fallback.
|
|
11
|
+
- **Clearer model and settings controls**: search and filter models, adjust visibility, limits, and thinking budgets; advanced settings are grouped by purpose, with hints and a reset action.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
Supports Chinese and English, following DSH's interface language. The screenshots below show the Chinese interface.
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
## View subscription usage
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
2. Enter `dsh-opencode-go` and click **Install**.
|
|
17
|
-
3. Click **Enable now** after installation.
|
|
18
|
-
|
|
19
|
-

|
|
20
|
-
|
|
21
|
-
You can also enter the Git repository URL when adding the plugin:
|
|
22
|
-
|
|
23
|
-
```text
|
|
24
|
-
https://github.com/Duskriver/dsh-opencode-go
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### From the command line
|
|
28
|
-
|
|
29
|
-
```sh
|
|
30
|
-
dsh plugin --profile web add dsh-opencode-go
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Start or restart `dsh web` after installation. Web and Headless use separate profiles; install and update each profile individually.
|
|
34
|
-
|
|
35
|
-
## Get started
|
|
36
|
-
|
|
37
|
-
1. Open **Settings → OpenCode Go**, enter your API key and save, or add an account in **Accounts**.
|
|
38
|
-
2. Select a model under **DSH OpenCode Go** in the conversation model picker.
|
|
39
|
-
3. Start chatting. Choose a reasoning level when offered, or attach images to a model that supports them.
|
|
40
|
-
|
|
41
|
-
Refresh the model list in Settings to synchronize the catalog. The switch beside each model controls its visibility in the picker and takes effect immediately. Context windows and output limits use catalog values by default; edit and save individual model limits as needed.
|
|
42
|
-
|
|
43
|
-
**Default** leaves reasoning to the service; **Off** explicitly disables it. Models with a switch show **On / Off**, models with adjustable effort show their supported levels, and budget-based models show token values.
|
|
17
|
+
Click the usage pill beside the conversation input to open the current account's subscription usage. Bars show the **percentage used**, turn amber near the limit, and red when exhausted. Each quota window shows its reset time.
|
|
44
18
|
|
|
45
|
-
|
|
19
|
+

|
|
46
20
|
|
|
47
|
-
|
|
21
|
+
While visible, usage refreshes every minute. Periodic queries pause while the page is hidden and resume with a refresh when it becomes visible. Temporary failures show a warning; retained readings are marked as previous data. Click **Retry now** after a failure, or **Refresh accounts** in the Settings account card.
|
|
48
22
|
|
|
49
|
-
|
|
23
|
+
Under **Settings → OpenCode Go → Advanced settings → Usage display**, choose:
|
|
50
24
|
|
|
51
|
-
|
|
25
|
+
| Mode | Behavior |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| Auto (default) | Show while a **DSH OpenCode Go** model is selected |
|
|
28
|
+
| Always | Also show configured OpenCode Go account usage while using other models |
|
|
29
|
+
| Off | Hide the conversation pill and stop its polling |
|
|
52
30
|
|
|
53
|
-
|
|
31
|
+
## Manage multiple accounts
|
|
54
32
|
|
|
55
|
-
|
|
56
|
-
- **Always**: also show usage while using other models.
|
|
57
|
-
- **Off**: hide usage and stop polling.
|
|
33
|
+
Open **Settings → OpenCode Go → Accounts** to manage accounts:
|
|
58
34
|
|
|
59
|
-

|
|
60
36
|
|
|
61
|
-
|
|
37
|
+
- Add, rename, replace keys, or remove accounts; up to 20 accounts are supported.
|
|
38
|
+
- See key status, five-hour usage, and a reset countdown in each row; expand it for full usage and account actions.
|
|
39
|
+
- Drag a row's handle to reorder accounts. The first row becomes current, and the order determines automatic fallback priority.
|
|
40
|
+
- Click **Switch** in the conversation usage panel to move the selected account first for subsequent requests in this profile. The other accounts keep their relative order.
|
|
62
41
|
|
|
63
|
-
|
|
42
|
+
With **Automatic fallback** enabled, an exhausted quota or unusable key causes the plugin to try other accounts in order before output begins. A fallback account that starts producing output moves first and becomes current, and the usage panel shows a switch notice. Requests that have already produced output, recorded token usage, or been canceled are not automatically resent through another account.
|
|
64
43
|
|
|
65
|
-
|
|
44
|
+
Keys are saved through DSH's credential service. Settings never displays an already saved key.
|
|
66
45
|
|
|
67
|
-
|
|
46
|
+
## Install and get started
|
|
68
47
|
|
|
69
|
-
|
|
48
|
+
Requires DSH `0.1.5-rc.1` or later. See the [compatibility matrix](docs/development.md#installed-package-matrix) for verified host versions.
|
|
70
49
|
|
|
71
|
-
###
|
|
50
|
+
### Install from DSH
|
|
72
51
|
|
|
73
|
-
|
|
52
|
+
1. Open **Plugins → Add plugin**.
|
|
53
|
+
2. Enter `dsh-opencode-go` and click **Install**.
|
|
54
|
+
3. Click **Enable now** after installation.
|
|
74
55
|
|
|
75
|
-
|
|
76
|
-
dsh plugin --profile headless add dsh-opencode-go
|
|
77
|
-
```
|
|
56
|
+

|
|
78
57
|
|
|
79
|
-
|
|
58
|
+
You can also enter the repository URL:
|
|
80
59
|
|
|
81
|
-
```
|
|
82
|
-
-
|
|
83
|
-
config:
|
|
84
|
-
provider: dsh-opencode-go
|
|
85
|
-
model: deepseek-v4.1-flash
|
|
60
|
+
```text
|
|
61
|
+
https://github.com/Duskriver/dsh-opencode-go
|
|
86
62
|
```
|
|
87
63
|
|
|
88
|
-
|
|
64
|
+
Command-line installation:
|
|
89
65
|
|
|
90
66
|
```sh
|
|
91
|
-
|
|
92
|
-
export OPENCODE_API_KEY
|
|
93
|
-
dsh --profile headless --patch ./headless.patch.yml "Hello"
|
|
67
|
+
dsh plugin --profile web add dsh-opencode-go
|
|
94
68
|
```
|
|
95
69
|
|
|
96
|
-
|
|
70
|
+
Start or restart `dsh web` after command-line installation. Web and Headless use separate profiles; install and update each individually.
|
|
97
71
|
|
|
98
|
-
###
|
|
72
|
+
### Get started
|
|
99
73
|
|
|
100
|
-
Open **Settings → OpenCode Go
|
|
74
|
+
1. Open **Settings → OpenCode Go**, enter your OpenCode Go subscription API key and save, or add an account in **Accounts**.
|
|
75
|
+
2. Select a model under **DSH OpenCode Go** in the conversation model picker.
|
|
76
|
+
3. Start chatting and check usage beside the input. With multiple accounts, open the panel to switch.
|
|
101
77
|
|
|
102
|
-
|
|
103
|
-
http://127.0.0.1:7890
|
|
104
|
-
socks5://127.0.0.1:1080
|
|
105
|
-
```
|
|
78
|
+
The plugin registers its own **DSH OpenCode Go** model provider. Selecting a native DSH provider does not automatically use this plugin's account switching. **Always** mode can still show usage for accounts configured in this plugin.
|
|
106
79
|
|
|
107
|
-
|
|
80
|
+
## Models and settings
|
|
108
81
|
|
|
109
|
-
###
|
|
82
|
+
### Select models and adjust parameters
|
|
110
83
|
|
|
111
|
-
|
|
84
|
+
Search **Available models** by name or ID, or filter by **New in 7 days**, **Customized**, or **Deprecated**. Click **Refresh** to check the latest catalog.
|
|
112
85
|
|
|
113
|
-
|
|
86
|
+

|
|
114
87
|
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
protocolOverrides:
|
|
119
|
-
deepseek-v4.1-flash: openai-responses
|
|
120
|
-
```
|
|
88
|
+
- Each model's switch controls its visibility in the conversation picker and takes effect immediately.
|
|
89
|
+
- Select a model to inspect its catalog context window, maximum output, and input modalities. Save limit overrides to apply them; empty values use defaults.
|
|
90
|
+
- Reasoning models offer the applicable switch, effort, or token budget options. Budget-based models also accept custom budgets that become available after saving.
|
|
121
91
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
### Manual configuration
|
|
125
|
-
|
|
126
|
-
Add an `opencode-go` configuration block to a patch file. It can be combined with the default-model configuration above:
|
|
127
|
-
|
|
128
|
-
```yaml
|
|
129
|
-
- id: opencode-go
|
|
130
|
-
config:
|
|
131
|
-
apiKeyEnv: OPENCODE_API_KEY
|
|
132
|
-
accounts:
|
|
133
|
-
- id: primary
|
|
134
|
-
name: Primary
|
|
135
|
-
apiKeyEnv: OPENCODE_API_KEY
|
|
136
|
-
- id: backup
|
|
137
|
-
name: Backup
|
|
138
|
-
apiKeyEnv: OPENCODE_GO_BACKUP_KEY
|
|
139
|
-
autoSwitch: true
|
|
140
|
-
proxyURL: http://127.0.0.1:7890
|
|
141
|
-
refreshMinutes: 60
|
|
142
|
-
modelVisibility:
|
|
143
|
-
deepseek-v4-pro: false
|
|
144
|
-
modelLimits:
|
|
145
|
-
deepseek-v4.1-flash:
|
|
146
|
-
maxTokens: 8192
|
|
147
|
-
qwen3.7-plus:
|
|
148
|
-
thinkingBudgets: [4096, 6000]
|
|
149
|
-
maxImages: 30
|
|
150
|
-
```
|
|
92
|
+
Requests to `deepseek-v4.1-flash` default to a **64k (65,536-token)** output allowance, bounded by the model's output capacity. The same default is reported to DSH for compaction budgeting. This rule applies only to that model; other models retain their SDK output defaults. Set a model's **Max output** override when a longer answer is needed.
|
|
151
93
|
|
|
152
|
-
|
|
94
|
+
Streaming, reasoning, tool calls, and image input depend on model capabilities. Input modalities shown in Settings come from online model metadata; this plugin currently converts and forwards only image attachments.
|
|
153
95
|
|
|
154
|
-
|
|
155
|
-
| --- | --- |
|
|
156
|
-
| `baseURL` | OpenCode Go gateway URL; defaults to `https://opencode.ai/zen/go/v1` |
|
|
157
|
-
| `usageDisplay` | Usage display mode: `auto`, `always`, or `off` |
|
|
158
|
-
| `proxyURL` | Network proxy; an empty string uses the default network settings |
|
|
159
|
-
| `refreshMinutes` | Model catalog cache lifetime; defaults to 60 minutes, with manual refresh available in Settings |
|
|
160
|
-
| `modelVisibility` | Control model picker visibility by model ID |
|
|
161
|
-
| `protocolOverrides` | Experimental `deepseek-v4.1-flash: openai-responses`; unset or null follows the gateway |
|
|
162
|
-
| `modelLimits` | Per-model `contextWindow` and `maxTokens` overrides, plus additional `thinkingBudgets` options; null uses defaults |
|
|
163
|
-
| `maxImages` | Maximum images in one request's history; unset by default, with oldest images offloaded when exceeded |
|
|
164
|
-
| `streamIdleTimeoutMs` | Maximum wait for the next stream event; defaults to 300000 milliseconds |
|
|
165
|
-
| `requestPreparationTimeoutMs` | Deadline for discovery and each attempt's credential/image preparation; defaults to 60000 milliseconds |
|
|
166
|
-
| `requestTimeoutMs` | Whole dispatch deadline, including discovery, account fallback and streaming; defaults to 1800000 milliseconds. Prepared calls start this timer at dispatch |
|
|
96
|
+
### Grouped advanced settings
|
|
167
97
|
|
|
168
|
-
|
|
98
|
+
Advanced settings are grouped into **Usage and protocol**, **Connection**, **Cache and timeouts**, and **Image handling**. Hover over a question mark for help. **Reset all to defaults** clears the card's custom overrides; save to apply the reset. The current account selection is preserved.
|
|
169
99
|
|
|
170
|
-
|
|
100
|
+

|
|
171
101
|
|
|
172
|
-
|
|
102
|
+
HTTP, HTTPS, and SOCKS5 proxies are supported. After saving, subsequent conversations, catalog updates, and usage queries use the proxy. Connections originate from the machine running DSH; on a remote deployment, `127.0.0.1` refers to that server.
|
|
173
103
|
|
|
174
|
-
|
|
104
|
+
The DeepSeek V4.1 Flash Responses option is experimental, applies only to new requests, and does not promise lower latency. See the [advanced guide](docs/advanced.en.md) for full configuration and usage instructions.
|
|
175
105
|
|
|
176
|
-
|
|
106
|
+
Screenshots illustrate the interface. Actual models, quotas, and timestamps depend on your account and the current online catalog.
|
|
177
107
|
|
|
178
|
-
|
|
179
|
-
export DSH_OPENCODE_GO_DEBUG_DIR=/tmp/dsh-opencode-go-debug
|
|
180
|
-
dsh web
|
|
181
|
-
```
|
|
108
|
+
## Updates and common questions
|
|
182
109
|
|
|
183
|
-
|
|
110
|
+
Update to the latest npm release:
|
|
184
111
|
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
dsh web
|
|
112
|
+
```sh
|
|
113
|
+
dsh plugin --profile web update dsh-opencode-go --latest
|
|
188
114
|
```
|
|
189
115
|
|
|
190
|
-
|
|
116
|
+
Restart `dsh web` and reload the page afterward. For desktop DSH, quit and reopen the application. Headless users should replace `web` with `headless`. The repository's default branch may contain changes not yet released to npm.
|
|
191
117
|
|
|
192
|
-
|
|
118
|
+
**Why is usage hidden?** Auto mode shows it only for **DSH OpenCode Go** models. Check that the plugin is enabled, a key is configured, and the display mode is appropriate. Choose Always to show usage with other providers.
|
|
193
119
|
|
|
194
|
-
|
|
120
|
+
**What if usage queries or account additions fail?** Retry in the usage panel or refresh usage in the account card. An added account whose key was not saved can be repaired with a key or removed. See [account operations and saving](docs/advanced.en.md#account-operations-and-saving) for recovery behavior.
|
|
195
121
|
|
|
196
|
-
|
|
122
|
+
**What if a long conversation keeps returning 400?** Check the output allowance and context window in the error, then run `/compact` or lower that model's **Max output** before retrying. Explicit context overflow is passed to DSH's recovery mechanism; an unexplained 400 keeps its classification and includes troubleshooting guidance. Failed attempts without measured tokens omit zero usage so they do not report an empty context.
|
|
197
123
|
|
|
198
|
-
|
|
199
|
-
dsh plugin --profile web update dsh-opencode-go --latest
|
|
200
|
-
```
|
|
124
|
+
**Why does an old conversation need its model selected again?** When upgrading from `0.1.16` or earlier, select **DSH OpenCode Go** again in existing conversations or Agent presets. Manual configurations use `provider: dsh-opencode-go`.
|
|
201
125
|
|
|
202
|
-
|
|
126
|
+
**Which hosts are verified?** Installed compatibility covers ten host versions from `0.1.5-rc.1` through `0.2.1-alpha.1`. Later versions need verification. Developer messages, dynamic tool additions/removals, and deferred tool loading are explicitly rejected; see [development and compatibility](docs/development.md).
|
|
203
127
|
|
|
204
128
|
Uninstall:
|
|
205
129
|
|
|
@@ -207,10 +131,9 @@ Uninstall:
|
|
|
207
131
|
dsh plugin --profile web remove dsh-opencode-go
|
|
208
132
|
```
|
|
209
133
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
## More
|
|
134
|
+
## More documentation
|
|
213
135
|
|
|
136
|
+
- [Advanced guide: Headless, proxies, manual configuration, and error diagnostics](docs/advanced.en.md)
|
|
214
137
|
- [Development and testing](docs/development.md)
|
|
215
138
|
- [Verification notes](docs/verification.md)
|
|
216
139
|
- [Issues and suggestions](https://github.com/Duskriver/dsh-opencode-go/issues)
|
package/README.md
CHANGED
|
@@ -2,202 +2,128 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 提供 **OpenCode Go 订阅用量查看与多账号管理**,让额度、重置时间和账号切换更方便。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
DSH 已支持原生接入 OpenCode Go。本插件重点提供会话内用量查看、多账号管理,以及独立的模型与设置界面。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- **用量随手可查**:在会话输入区查看用量,展开查看 5 小时、每周、每月已用百分比与重置时间。
|
|
10
|
+
- **多个账号集中管理**:查看各账号额度和 Key 状态,拖动排序,在会话中手动切换,也可开启自动使用备用账号。
|
|
11
|
+
- **模型与设置更直观**:搜索和筛选模型,调整显示、容量与思考预算;高级设置按用途分组,提供提示与恢复默认操作。
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
支持中文和英文,跟随 DSH 的界面语言。
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
1. 打开 **插件 → 添加插件**。
|
|
16
|
-
2. 输入 `dsh-opencode-go`,点击 **安装**。
|
|
17
|
-
3. 安装完成后点击 **立即启用**。
|
|
18
|
-
|
|
19
|
-

|
|
20
|
-
|
|
21
|
-
也可以在添加插件时输入 Git 仓库地址:
|
|
22
|
-
|
|
23
|
-
```text
|
|
24
|
-
https://github.com/Duskriver/dsh-opencode-go
|
|
25
|
-
```
|
|
15
|
+
## 查看订阅用量
|
|
26
16
|
|
|
27
|
-
|
|
17
|
+
点击会话输入区旁的用量胶囊,展开当前账号的订阅用量。进度条显示**已用百分比**,接近上限时变为黄色,耗尽时变为红色;每个额度窗口都显示重置时间。
|
|
28
18
|
|
|
29
|
-
|
|
30
|
-
dsh plugin --profile web add dsh-opencode-go
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
安装后启动或重启 `dsh web`。Web 和 Headless 使用各自的 profile,分别安装和更新。
|
|
34
|
-
|
|
35
|
-
## 开始使用
|
|
36
|
-
|
|
37
|
-
1. 打开 **设置 → OpenCode Go**,填入 API Key 并保存,或在「账号」中添加账号。
|
|
38
|
-
2. 在会话模型选择器中选择 **DSH OpenCode Go** 下的模型。
|
|
39
|
-
3. 开始对话;支持思考的模型可选择其提供的思考档位,支持图片的模型可直接接收图片。
|
|
40
|
-
|
|
41
|
-
在设置页刷新模型列表即可同步最新目录。每个模型旁的开关控制它是否出现在选择器中,修改后立即生效。模型的上下文窗口和最大输出默认使用目录配置,也可逐个修改并保存。
|
|
42
|
-
|
|
43
|
-
思考选项中的 **默认** 使用服务商设置;**Off** 明确关闭思考。只有开关的模型显示 **On / Off**,支持强度的模型显示其可用档位,预算式模型显示具体的 token 数值。
|
|
19
|
+

|
|
44
20
|
|
|
45
|
-
|
|
21
|
+
显示用量时每分钟自动刷新;页面进入后台时暂停周期查询,回到前台后刷新。暂时查询失败时,面板会提示失败,并在可保留上次数据时标明“上次数据”,可点击“立即重试”。也可以在设置页的账号卡片中点击 **刷新额度**。
|
|
46
22
|
|
|
47
|
-
|
|
23
|
+
在 **设置 → OpenCode Go → 高级设置 → 额度显示** 中选择:
|
|
48
24
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
25
|
+
| 模式 | 行为 |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| 自动(默认) | 选中 **DSH OpenCode Go** 模型时显示 |
|
|
28
|
+
| 常驻 | 使用其他模型时也显示已配置的 OpenCode Go 账号用量 |
|
|
29
|
+
| 关闭 | 隐藏会话用量胶囊并停止其轮询 |
|
|
52
30
|
|
|
53
|
-
|
|
31
|
+
## 管理多个账号
|
|
54
32
|
|
|
55
|
-
|
|
56
|
-
- **常驻**:使用其他模型时也显示。
|
|
57
|
-
- **关闭**:隐藏用量显示并停止轮询。
|
|
33
|
+
在 **设置 → OpenCode Go → 账号** 中集中管理账号:
|
|
58
34
|
|
|
59
|
-

|
|
60
36
|
|
|
61
|
-
|
|
37
|
+
- 添加账号、重命名、替换 Key 或删除账号;最多支持 20 个账号。
|
|
38
|
+
- 每行查看 Key 状态、5 小时已用百分比和重置倒计时,展开查看完整用量与账号操作。
|
|
39
|
+
- 拖动行首手柄调整顺序,第一行成为当前账号;顺序也决定自动尝试备用账号的次序。
|
|
40
|
+
- 在会话用量面板中点击 **切换**,将所选账号移至首位,供本 profile 后续请求使用;其他账号的相对顺序保持不变。
|
|
62
41
|
|
|
63
|
-
|
|
42
|
+
开启 **自动使用备用账号** 后,当前账号额度耗尽或 Key 不可用时,插件会在开始输出前按顺序尝试其他账号。开始正常输出的备用账号会移至首位并成为当前账号,用量面板会显示切换提示。请求已经输出、产生 token 用量或被取消后,不会自动切换账号重发。
|
|
64
43
|
|
|
65
|
-
|
|
44
|
+
Key 通过 DSH 凭据服务保存,设置页不会回显已保存的密钥。
|
|
66
45
|
|
|
67
|
-
|
|
46
|
+
## 安装与快速开始
|
|
68
47
|
|
|
69
|
-
|
|
48
|
+
适用于 DSH `0.1.5-rc.1` 及以上版本。已验证的宿主版本见[兼容矩阵](docs/development.md#installed-package-matrix)。
|
|
70
49
|
|
|
71
|
-
###
|
|
50
|
+
### 在 DSH 中安装
|
|
72
51
|
|
|
73
|
-
|
|
52
|
+
1. 打开 **插件 → 添加插件**。
|
|
53
|
+
2. 输入 `dsh-opencode-go`,点击 **安装**。
|
|
54
|
+
3. 安装完成后点击 **立即启用**。
|
|
74
55
|
|
|
75
|
-
|
|
76
|
-
dsh plugin --profile headless add dsh-opencode-go
|
|
77
|
-
```
|
|
56
|
+

|
|
78
57
|
|
|
79
|
-
|
|
58
|
+
也可以在添加插件时输入仓库地址:
|
|
80
59
|
|
|
81
|
-
```
|
|
82
|
-
-
|
|
83
|
-
config:
|
|
84
|
-
provider: dsh-opencode-go
|
|
85
|
-
model: deepseek-v4.1-flash
|
|
60
|
+
```text
|
|
61
|
+
https://github.com/Duskriver/dsh-opencode-go
|
|
86
62
|
```
|
|
87
63
|
|
|
88
|
-
|
|
64
|
+
命令行安装:
|
|
89
65
|
|
|
90
66
|
```sh
|
|
91
|
-
|
|
92
|
-
export OPENCODE_API_KEY
|
|
93
|
-
dsh --profile headless --patch ./headless.patch.yml "你好"
|
|
67
|
+
dsh plugin --profile web add dsh-opencode-go
|
|
94
68
|
```
|
|
95
69
|
|
|
96
|
-
|
|
70
|
+
命令行安装后启动或重启 `dsh web`。Web 和 Headless 使用各自的 profile,分别安装和更新。
|
|
97
71
|
|
|
98
|
-
###
|
|
72
|
+
### 开始使用
|
|
99
73
|
|
|
100
|
-
|
|
74
|
+
1. 打开 **设置 → OpenCode Go**,填入 OpenCode Go 订阅的 API Key 并保存,或在 **账号** 中添加账号。
|
|
75
|
+
2. 在会话模型选择器中选择 **DSH OpenCode Go** 下的模型。
|
|
76
|
+
3. 开始对话,在输入区旁查看用量;有多个账号时可展开面板切换。
|
|
101
77
|
|
|
102
|
-
|
|
103
|
-
http://127.0.0.1:7890
|
|
104
|
-
socks5://127.0.0.1:1080
|
|
105
|
-
```
|
|
78
|
+
插件使用独立的模型提供方 **DSH OpenCode Go**。选择 DSH 原生提供的模型不会自动使用本插件的账号切换功能;“常驻”模式仍可展示本插件已配置账号的用量。
|
|
106
79
|
|
|
107
|
-
|
|
80
|
+
## 模型与设置
|
|
108
81
|
|
|
109
|
-
###
|
|
82
|
+
### 选择模型与调整参数
|
|
110
83
|
|
|
111
|
-
在
|
|
84
|
+
在 **可用模型** 中按名称或 ID 搜索,也可以筛选 **近 7 天发布**、**已自定义** 或 **过时模型**。点击 **刷新** 核对最新模型目录。
|
|
112
85
|
|
|
113
|
-
|
|
86
|
+

|
|
114
87
|
|
|
115
|
-
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
protocolOverrides:
|
|
119
|
-
deepseek-v4.1-flash: openai-responses
|
|
120
|
-
```
|
|
88
|
+
- 模型开关控制它是否出现在会话选择器中,修改立即生效。
|
|
89
|
+
- 选中模型可查看目录提供的上下文窗口、最大输出和输入模态,容量覆盖保存后生效,留空使用默认值。
|
|
90
|
+
- 支持思考的模型提供相应开关、强度或 token 预算选项;预算式模型还可添加自定义预算并保存。
|
|
121
91
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
在 patch 文件中添加 `opencode-go` 配置块,可与上面的默认模型配置一起使用:
|
|
125
|
-
|
|
126
|
-
```yaml
|
|
127
|
-
- id: opencode-go
|
|
128
|
-
config:
|
|
129
|
-
apiKeyEnv: OPENCODE_API_KEY
|
|
130
|
-
accounts:
|
|
131
|
-
- id: primary
|
|
132
|
-
name: 主账号
|
|
133
|
-
apiKeyEnv: OPENCODE_API_KEY
|
|
134
|
-
- id: backup
|
|
135
|
-
name: 备用账号
|
|
136
|
-
apiKeyEnv: OPENCODE_GO_BACKUP_KEY
|
|
137
|
-
autoSwitch: true
|
|
138
|
-
proxyURL: http://127.0.0.1:7890
|
|
139
|
-
refreshMinutes: 60
|
|
140
|
-
modelVisibility:
|
|
141
|
-
deepseek-v4-pro: false
|
|
142
|
-
modelLimits:
|
|
143
|
-
deepseek-v4.1-flash:
|
|
144
|
-
maxTokens: 8192
|
|
145
|
-
qwen3.7-plus:
|
|
146
|
-
thinkingBudgets: [4096, 6000]
|
|
147
|
-
maxImages: 30
|
|
148
|
-
```
|
|
92
|
+
`deepseek-v4.1-flash` 每次请求默认使用 **64k(65,536 tokens)** 的输出预算,模型输出上限更小时取较小值,并将该默认值告知 DSH 用于计算压缩时机。该规则只应用于此模型;其他模型沿用 SDK 的默认输出行为。需要更长回答时,可在模型容量覆盖中设置「最大输出」。
|
|
149
93
|
|
|
150
|
-
|
|
94
|
+
流式回复、思考、工具调用和图片输入取决于模型能力。界面中的输入模态来自在线模型配置;本插件目前仅转换并转发图像附件。
|
|
151
95
|
|
|
152
|
-
|
|
153
|
-
| --- | --- |
|
|
154
|
-
| `baseURL` | OpenCode Go 网关地址,默认 `https://opencode.ai/zen/go/v1` |
|
|
155
|
-
| `usageDisplay` | 额度显示模式:`auto`、`always` 或 `off` |
|
|
156
|
-
| `proxyURL` | 网络代理;空字符串使用默认网络设置 |
|
|
157
|
-
| `refreshMinutes` | 模型目录缓存时长,默认 60 分钟;设置页可随时手动刷新 |
|
|
158
|
-
| `modelVisibility` | 按模型 ID 控制选择器中的显示状态 |
|
|
159
|
-
| `protocolOverrides` | 实验性协议覆盖;目前仅支持 `deepseek-v4.1-flash: openai-responses`,省略或模型值为 `null` 时自动跟随目录 |
|
|
160
|
-
| `modelLimits` | 按模型覆盖 `contextWindow`、`maxTokens`,或用 `thinkingBudgets` 添加思考预算选项;空值使用默认设置 |
|
|
161
|
-
| `maxImages` | 单次请求历史中的图片数量上限,默认不设上限;超过时先卸载最旧图片 |
|
|
162
|
-
| `streamIdleTimeoutMs` | 等待下一个流事件的最长时间,默认 300000 毫秒 |
|
|
163
|
-
| `requestPreparationTimeoutMs` | 目录查询及每次尝试的凭据、图片准备时限,默认 60000 毫秒 |
|
|
164
|
-
| `requestTimeoutMs` | 一次发送的完整时限,包含目录查询、账号切换和流式输出,默认 1800000 毫秒;预先准备的调用从发送时计时 |
|
|
96
|
+
### 分组高级设置
|
|
165
97
|
|
|
166
|
-
|
|
98
|
+
高级设置按 **用量与协议**、**连接**、**缓存与超时**、**图片处理** 分组。悬停问号查看说明,可通过 **全部恢复默认** 清除该卡片的自定义覆盖,再保存修改;当前账号选择保持不变。
|
|
167
99
|
|
|
168
|
-
|
|
100
|
+

|
|
169
101
|
|
|
170
|
-
|
|
102
|
+
支持 HTTP、HTTPS 和 SOCKS5 代理,保存后用于后续对话、模型目录更新与用量查询。代理运行在 DSH 所在的机器上;远程部署中的 `127.0.0.1` 指服务器自身。
|
|
171
103
|
|
|
172
|
-
|
|
104
|
+
DeepSeek V4.1 Flash 的 Responses 协议选项为实验性,仅影响新请求,不承诺更低延迟。完整配置与使用说明见[高级使用指南](docs/advanced.md)。
|
|
173
105
|
|
|
174
|
-
|
|
106
|
+
截图用于展示界面,具体模型、额度和时间以当前账号与在线目录为准。
|
|
175
107
|
|
|
176
|
-
|
|
177
|
-
export DSH_OPENCODE_GO_DEBUG_DIR=/tmp/dsh-opencode-go-debug
|
|
178
|
-
dsh web
|
|
179
|
-
```
|
|
108
|
+
## 更新与常见问题
|
|
180
109
|
|
|
181
|
-
|
|
110
|
+
更新到 npm 最新发布版本:
|
|
182
111
|
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
dsh web
|
|
112
|
+
```sh
|
|
113
|
+
dsh plugin --profile web update dsh-opencode-go --latest
|
|
186
114
|
```
|
|
187
115
|
|
|
188
|
-
|
|
116
|
+
更新后重启 `dsh web` 并刷新页面;桌面版完全退出后重新打开。Headless 用户将 `web` 换成 `headless`。仓库默认分支可能包含尚未发布到 npm 的修改。
|
|
189
117
|
|
|
190
|
-
|
|
118
|
+
**为什么没有显示用量?** 默认“自动”模式仅在选择 **DSH OpenCode Go** 模型时显示。请检查插件是否启用、Key 是否配置,以及额度显示模式;使用其他提供方时可选择“常驻”。
|
|
191
119
|
|
|
192
|
-
|
|
120
|
+
**查询失败或添加账号中断怎么办?** 用量查询可在面板中重试,或在账号卡片中刷新额度。未成功保存 Key 的新增账号可补填 Key 或删除;账号操作的恢复机制见[高级使用指南](docs/advanced.md#账号操作与保存)。
|
|
193
121
|
|
|
194
|
-
|
|
122
|
+
**长会话持续报 400 怎么办?** 检查错误中的输出预算与上下文窗口,可执行 `/compact` 或调低该模型的「最大输出」后重试。明确的上下文超限会交给 DSH 的恢复机制;原因不明的 400 会保留原分类并给出排查建议。失败且未取得 token 用量时,插件不发送全零用量,避免将上下文占用误报为 0%。
|
|
195
123
|
|
|
196
|
-
|
|
197
|
-
dsh plugin --profile web update dsh-opencode-go --latest
|
|
198
|
-
```
|
|
124
|
+
**升级后旧会话找不到模型?** 从 `0.1.16` 及更早版本升级时,在旧会话或 Agent 预设中重新选择 **DSH OpenCode Go**;手动配置使用 `provider: dsh-opencode-go`。
|
|
199
125
|
|
|
200
|
-
|
|
126
|
+
**兼容性范围是什么?** 安装兼容性覆盖十个宿主版本,从 `0.1.5-rc.1` 到 `0.2.1-alpha.1`,后续版本仍需验证。目前明确拒绝 developer 消息、动态工具增删和延迟工具加载,详见[开发与兼容性说明](docs/development.md)。
|
|
201
127
|
|
|
202
128
|
卸载:
|
|
203
129
|
|
|
@@ -205,10 +131,9 @@ dsh plugin --profile web update dsh-opencode-go --latest
|
|
|
205
131
|
dsh plugin --profile web remove dsh-opencode-go
|
|
206
132
|
```
|
|
207
133
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
## 更多
|
|
134
|
+
## 更多文档
|
|
211
135
|
|
|
136
|
+
- [高级使用指南:Headless、代理、手动配置与错误诊断](docs/advanced.md)
|
|
212
137
|
- [开发与测试](docs/development.md)
|
|
213
138
|
- [验证记录](docs/verification.md)
|
|
214
139
|
- [问题与建议](https://github.com/Duskriver/dsh-opencode-go/issues)
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# Third-party notices
|
|
2
2
|
|
|
3
|
-
The adapter, settings UI, and `src/conversion/{context,stream,replay}.ts`
|
|
3
|
+
The initial adapter, settings UI, and `src/conversion/{context,stream,replay}.ts` were derived from DeepSeek Harness, copyright (c) 2026 DeepSeek, under the MIT license included in LICENSE. The original DeepSeek copyright notice is retained for these derived portions. The conversion modules are maintained in this package because the published DSH pi-ai package does not export its conversion helpers.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Original additions and subsequent modifications made in this project are copyright (c) 2026 dsh-opencode-go contributors and are also licensed under MIT. LICENSE records both the upstream attribution and this project's contributor attribution.
|
|
6
|
+
|
|
7
|
+
The host bundle includes the required portions of `@earendil-works/pi-ai@1.2.0`, `@google/genai@2.21.0` and their bundled dependencies; SDK declarations include pi-ai, pi-telemetry and TypeBox types. Their original licenses are reproduced in `lib/vendor-licenses.txt`, including the Google SDK's Apache-2.0 license and data-uri-to-buffer's MIT license from its published README. The pi packages' license comes from the [upstream v1.2.0 license](https://github.com/earendil-works/pi/blob/v1.2.0/LICENSE), which their npm distributions omit. OpenAI and Anthropic transport SDKs remain separate runtime dependencies.
|
|
8
|
+
|
|
9
|
+
The bundled Google SDK's HTTP fetch call is modified at build time to use the plugin's request-scoped fetch binding. Its message serialization and stream parser remain upstream implementations.
|
|
6
10
|
|
|
7
11
|
The GitHub icon in the settings footer comes from Simple Icons, distributed under CC0 1.0 Universal.
|