@gehennawu/dsh-service 2.0.9 → 2.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/README.en.md +29 -15
- package/README.md +29 -15
- package/client.js +1 -1
- package/icon.svg +5 -0
- package/index.js +34 -2
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/model-config-routes.js +15 -1
- package/model-smart-fill.js +253 -7
- package/package.json +7 -3
- package/quota-adapters.js +369 -0
- package/quota-routes.js +36 -1
package/README.en.md
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
<em>DeepSeek Harness (DSH) Web 服务控制与运维插件。</em>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
|
-
[](package.json)
|
|
13
13
|
[](LICENSE)
|
|
14
|
-
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
15
15
|
[](https://cordis.moe/)
|
|
16
16
|
[](https://github.com/gehennawu/dsh-service)
|
|
17
17
|
[](https://github.com/gehennawu/dsh-service/issues)
|
|
@@ -42,7 +42,7 @@ A service-control and operations plugin for DSH Web: safe restart, version manag
|
|
|
42
42
|
- [🚀 Features](#-features)
|
|
43
43
|
- [Version and updates](#version-and-updates) · [Safe restart](#safe-restart) · [Health diagnostics](#health-diagnostics) · [Model statistics](#model-statistics)
|
|
44
44
|
- [Quota lookup](#quota-lookup) · [Model configuration](#model-configuration) · [Backup management](#backup-management) · [Skills management](#skills-management) · [Subagent model](#subagent-model)
|
|
45
|
-
- [Task notifications](#task-notifications) · [Session manager](#session-manager) · [Mobile adaptation](#mobile-adaptation) · [Model provider icons](#model-provider-icons) · [Right-Sidebar file editing](#right-sidebar-file-editing) · [External liveness probe](#external-liveness-probe)
|
|
45
|
+
- [Task notifications](#task-notifications) · [Session manager](#session-manager) · [Mobile adaptation](#mobile-adaptation) · [Sidebar settings entry](#sidebar-settings-entry) · [Model provider icons](#model-provider-icons) · [Right-Sidebar file editing](#right-sidebar-file-editing) · [External liveness probe](#external-liveness-probe)
|
|
46
46
|
- [🏗️ Architecture](#-architecture)
|
|
47
47
|
- [⚡ Installation](#-installation) · [🔄 Automatic restart](#-automatic-restart) · [🖥️ Platform support](#-platform-support)
|
|
48
48
|
- [🔒 Security design](#-security-design) · [❓ FAQ](#-faq) · [🤝 Contributing](#-contributing) · [📄 License](#-license)
|
|
@@ -135,9 +135,15 @@ Under **Plugins → Plugin configuration**, thirteen host-level switches: **Heal
|
|
|
135
135
|
| StepFun Step Plan | Console BFF subscription quota (Oasis-Token console session; 5-hour/weekly windows vs Credit pool auto-detected) |
|
|
136
136
|
| Xiaomi MiMo Token Plan | Console-origin plan quota (web session cookie) |
|
|
137
137
|
| Command Code (command-goat) | Official account quota plane `api.commandcode.ai/alpha/*` (same key reused: balance + period spend + plan + 5-hour/weekly windows) |
|
|
138
|
+
| workbuddy2api panel usage (workbuddy) | **Targets the [workbuddy2api-panel](https://github.com/linguo2625469/workbuddy2api-panel) Go panel project only** (other workbuddy2api-style gateways expose different endpoints and are not supported); **manual adaptation only** (the baseURL is a relay address and never auto-detected); the endpoint is `GET /panel/api/usage?hours=24` on the selected provider's baseURL origin (gateway API key): **per-realm (cn / global) daily-volume gauges**, usage rolled up by account (including credits left), and the **rate-limit ledger** from the same origin's `GET /panel/api/overview` (limited models with their upstream reset wall clock, account-level cooldowns with recovery time) |
|
|
138
139
|
| CLIProxyAPI deployment | Official remaining quota of each OAuth upstream account |
|
|
139
140
|
|
|
140
141
|
- Credentials go into the DSH credential store (`$DSH_HOME/.credentials.yaml`, hot-effective): an API key, the CPA management key, the Xiaomi console cookie, or the StepFun Step Plan console token (Oasis-Token; the `Oasis-Webid` is derived from the token automatically — no manual entry); the Command Code quota plane reuses the inference key, so no extra credential is needed
|
|
142
|
+
- WorkBuddy2API reports **usage statistics, not a plan quota**: the top of the card is now the **rate-limit ledger** — per realm it lists the limited models with their **upstream reset time** (`reset_at`, the wall clock returned by upstream 6004, rendered in the browser timezone), and account-level cooldowns show their reason and recovery time; with nothing limited it reads “Rate limits —”. **The totals block (requests / errors / tokens / credits / latency / cache hit rate) is no longer on the card** (it stays visible on the panel page); the per-account rollup remains (up to 6, by tokens descending). **Account rows show requests / tokens / credits left**: the balance comes from the panel `overview` `credits` / `credits_total` (e.g. `1205 / 1305`, matched to the usage row by uid); when the balance ledger is unavailable (older panel, no panel access, or the account has no balance field) the row falls back to the window's consumed credits — unknown is never rendered as 0.
|
|
143
|
+
- **Limits of the limit ledger**: it comes from the panel's `/panel/api/overview` (`rate_limited_models`, account `cooling`) and only exists **while a limit is active** (the panel caps cooldowns at `soft_rate_max`, 2h by default, and drops the entry — including the reset time — when it expires; it is not a history log). Older panels without that endpoint, or keys without panel access, degrade silently — no limit rows are drawn and the usage/gauges keep working.
|
|
144
|
+
- **Realm gauges**: the cn and global rows are percentage windows scaled by each realm's **daily model volume** (cn 200M, global 100M tokens; the percentage clamps at 100 while the real figure stays visible). They draw progress bars in the card, and **the composer ring reads the gauge of the realm named by the selected model's prefix** (e.g. `cn:deepseek-v4.1-flash`; the popover header tags the realm and the matching row moves to the top), falling back to the tightest realm only when the model has no realm prefix. Realms without a registered cap fall back to text rows — no invented denominators.
|
|
145
|
+
- **The denominator is currently read-only**: the “Set daily volume” entry is hidden for now (observe for a few days with the defaults first). To adjust, edit the `realmCaps` block in `$DSH_HOME/dsh-service-quota.json` or the default constants in code; the host RPC and config plumbing stay in place, so restoring the entry is a single switch.
|
|
146
|
+
- The window is the **last 24 hours (`hours=24`)**. The panel defaults to 72h, but the two still disagreed in practice, so 24h is used as requested; the window is a single constant (`WORKBUDDY_USAGE_PATH`). It is **manual-adaptation only** (a relay baseURL never participates in auto-detection) and the panel endpoint is derived from the selected provider's baseURL origin (inference on `…/v1`, panel on `/panel/api/usage`), so changing relays needs no code change
|
|
141
147
|
- **Credentials can be changed at any time**: every adapted card keeps a credential entry in its **Config** area — unconfigured rows show the per-channel wording, configured rows show "Edit credential (configured)", where the stored value can be overwritten (key rotation, another account, a typo) or cleared; the value is only ever sent with the save request and is never echoed back
|
|
142
148
|
- Anti-rate-limit pacing: 60 s result cache, exponential backoff for transient network errors (30 s doubling, capped at 15 min); **deterministic failures switch to manual** — credential errors, 4xx, expired plans, management API disabled, unexpected response shapes and anything else only a config change can fix stop the automatic retries (the error line then reads "Auto-retry paused — retry manually"), and only a successful manual reconnect via the refresh button (5 s cooldown) returns the channel to automatic mode; querying is fully manual — a snapshot is fetched when you open the quota page, expand the ring, or hit refresh, and the client never arms a periodic poll (upstream throttling still lives entirely in the host)
|
|
143
149
|
- **CLIProxyAPI management-plane bans get their own notice**: five consecutive auth failures from one IP ban that IP for 30 minutes on the management plane; while banned the card reads "Temporarily banned by CLIProxyAPI" plus the upstream message (including the remaining time). That state offers no credential form (the key is fine) — wait for the ban to expire, or change the host's egress IP, then hit "Retry connection". The ban covers the management plane only; model inference through that CPA is unaffected
|
|
@@ -175,16 +181,16 @@ Under **Plugins → Plugin configuration**, thirteen host-level switches: **Heal
|
|
|
175
181
|
- Model configuration contains **Providers & models** and **Subagent routing**, separating built-in and custom providers.
|
|
176
182
|
- **Add custom providers** with an ID, display name, protocol, address, API key and model IDs. Creation never probes the endpoint automatically.
|
|
177
183
|
- **Mixed-protocol notice**: when a catalog mixes protocols (such as pi-ai's `azure` since 0.2.1-alpha.3), the template picker and provider editor explain that a route-level protocol overrides every model on the route, preventing Chat Completions models from being pinned to the Responses protocol.
|
|
178
|
-
- **Provider editing** covers display name, address and credentials. Custom protocols are editable; built-in protocols are read-only.
|
|
179
|
-
- **Model discovery** supports manual IDs or explicit Fetch online, with search and batch selection for OpenAI-compatible and Anthropic model lists. Discovery failure never blocks manual entry; a returned list does not prove calls work.
|
|
180
|
-
- **Model editing** covers ID, display name, context window, max output, image input and reasoning levels. Capacity accepts `256K` / `1M
|
|
181
|
-
- **Immediate toggles** block new main-chat and subagent calls while retaining configuration and keys; running calls are not cancelled. Unloading the plugin removes this policy.
|
|
182
|
-
- **Basic call tests may incur charges**.
|
|
184
|
+
- **Provider editing** covers display name, address and credentials. Custom protocols are editable; built-in protocols are read-only. The ordinary interface does not expose advanced provider parameters; unshown headers, timeouts and cache settings remain untouched — use the native DSH model settings to change them.
|
|
185
|
+
- **Model discovery** supports manual IDs or explicit Fetch online, with search and batch selection for OpenAI-compatible and Anthropic model lists. Discovery failure never blocks manual entry; a returned list does not prove calls work. "Select all" only adds currently visible candidates; selections outside the current list are counted separately and can be removed in one action.
|
|
186
|
+
- **Model editing** covers ID, display name, context window, max output, image input and reasoning levels. Capacity accepts `256K` / `1M`. Reasoning levels are a single click; **wire value mappings live in a collapsed "Wire value mapping (advanced)" section** — checking a level prefills its own name and the actual protocol value can be corrected after expanding — with distinct states for inherited/undeclared, explicitly unsupported and custom mappings. IDs must be unique per provider, and disabled models must be enabled before renaming.
|
|
187
|
+
- **Immediate toggles** block new main-chat and subagent calls while retaining configuration and keys; running calls are not cancelled. **When a provider is referenced by the default model or subagents, disabling first lists the affected references for confirmation**; unreferenced providers still disable in one click, and enabling is always immediate. Unloading the plugin removes this policy.
|
|
188
|
+
- **Basic call tests may incur charges**. Every test first shows the fixed content, token ceiling, timeout and billing notice, and only calls after confirmation. Tests use saved models and report elapsed time and sanitized errors; they do not verify images, capacity or every reasoning level, and failures never roll back configuration.
|
|
183
189
|
- **Smart fill starts disabled**. It queries local pi-ai, modelparams.dev and OpenRouter metadata by model ID, without provider discovery, inference or automatic saving. Suggestions are per parameter; confirming Fill all changes only the draft and still requires Save.
|
|
184
190
|
- **Check reasoning levels against the API**: selectable levels differ from the effort selected for a call. Missing metadata does not mean unsupported; unconfigured values inherit or use API defaults. Manually supplied mappings require verification.
|
|
185
191
|
- **Deletion checks references** to the main-chat default, subagent primary and fallback models, blocking deletion when referenced. A custom provider cannot lose its final model.
|
|
186
192
|
- **Restore and credentials**: provider deletion snapshots configuration and keeps credential references. Restore recovers configuration, never old key values. Replacement defaults to an independent reference; shared replacement first lists users.
|
|
187
|
-
- **Draft and concurrency protection**: failed saves retain drafts, leaving unsaved edits warns, and external changes prevent overwrite until reviewed again. Drafts do not persist across reloads.
|
|
193
|
+
- **Draft and concurrency protection**: failed saves retain drafts; after a dropped connection or host restart the action resets so it can be retried, leaving unsaved edits warns, and external changes prevent overwrite until reviewed again. Drafts do not persist across reloads.
|
|
188
194
|
|
|
189
195
|
#### URL and credential safety
|
|
190
196
|
|
|
@@ -225,6 +231,13 @@ Under **Plugins → Plugin configuration**, thirteen host-level switches: **Heal
|
|
|
225
231
|
- An up-arrow jumps through previous user messages, automatically loading earlier history as needed.
|
|
226
232
|
- Large conversation JSON responses are compressed, with safe-area and mobile input zoom handling.
|
|
227
233
|
|
|
234
|
+
### Sidebar settings entry
|
|
235
|
+
|
|
236
|
+
- A persistent **Settings** row sits at the sidebar foot, directly **above the account button**: one click opens the official settings panel — no need to open the account menu first.
|
|
237
|
+
- It stays visible whether signed in or signed out; the official “Settings” item in the account menu is untouched, so both routes work.
|
|
238
|
+
- Collapsed into the icon rail, the entry becomes a 36×36 gear button whose tooltip and accessible name stay “Settings”.
|
|
239
|
+
- Its copy follows the interface language; on hosts without the seat the row simply does not appear and nothing else changes.
|
|
240
|
+
|
|
228
241
|
### Session manager
|
|
229
242
|
|
|
230
243
|

|
|
@@ -247,6 +260,7 @@ Under **Plugins → Plugin configuration**, thirteen host-level switches: **Heal
|
|
|
247
260
|
- Unknown names can use the adapter type **manually chosen** on the quota page. Name matches take priority; CLIProxyAPI icons require manual adaptation.
|
|
248
261
|
- Icons are bundled, work offline and never send provider names to third parties. Toggle under Plugin configuration → Interaction, on by default.
|
|
249
262
|
- Sources: [LobeHub Icons](https://github.com/lobehub/lobe-icons) (MIT) and [Simple Icons](https://github.com/simple-icons/simple-icons) (CC0). Brand marks belong to their owners.
|
|
263
|
+
- Relay gateways such as WorkBuddy2API have no brand assets of their own; their icon is the official mark of the upstream WorkBuddy product (the vector favicon of `workbuddy.cn`, bundled locally). Channel names `workbuddy2api-panel` / `workbuddy2api` / `workbuddy` all match, and adapting a channel to that type on the quota page also resolves the mark by type.
|
|
250
264
|
- See the [icon catalog](docs/model-icons.html) for all marks and provider matching rules.
|
|
251
265
|
|
|
252
266
|
### Right-Sidebar file editing
|
|
@@ -317,7 +331,7 @@ Key contracts:
|
|
|
317
331
|
1. Open the **Plugins** page in the left sidebar.
|
|
318
332
|
2. Click the **+ Add plugin** button in the top-right corner.
|
|
319
333
|
3. In the dialog, fill in **one of the three** source forms (the same field accepts all three, and the hint below it follows what you type):
|
|
320
|
-
- **npm package name (recommended)**: `@gehennawu/dsh-service@2.0
|
|
334
|
+
- **npm package name (recommended)**: `@gehennawu/dsh-service@2.1.0` — **include the exact version** (written as `package@version`);
|
|
321
335
|
- **GitHub repository URL**: `https://github.com/gehennawu/dsh-service` (public repository, no token needed; the shorthand `github:gehennawu/dsh-service` works too);
|
|
322
336
|
- **Local plugin directory**: an absolute path on this machine, e.g. `/path/to/dsh-service` (for your own or pre-downloaded plugins).
|
|
323
337
|
4. Pick the **install source** for your network: the default **official npm registry**, or the **China mainland mirror** if fetching from npm is restricted there (it affects package-name installs only; GitHub URLs and local directories are unaffected).
|
|
@@ -328,17 +342,17 @@ Key contracts:
|
|
|
328
342
|
|
|
329
343
|
> Tip: all three forms go through the official installation path — no manual profile edits; entering a GitHub URL in the dialog is equivalent to the `github:` prefix on the command line.
|
|
330
344
|
|
|
331
|
-
> **Why the npm form wants a version**: pnpm 11 enables a supply-chain release cooldown by default (`minimumReleaseAge`, 1440 minutes). **Without a version** (including `@latest`), a release published less than the cooldown period ago is not installed automatically, so the package manager falls back to the newest version that has cleared it — which is why the plugin page may report that it installed x.y.z instead of the latest a.b.c. Writing an **exact version** (e.g. `@gehennawu/dsh-service@2.0
|
|
345
|
+
> **Why the npm form wants a version**: pnpm 11 enables a supply-chain release cooldown by default (`minimumReleaseAge`, 1440 minutes). **Without a version** (including `@latest`), a release published less than the cooldown period ago is not installed automatically, so the package manager falls back to the newest version that has cleared it — which is why the plugin page may report that it installed x.y.z instead of the latest a.b.c. Writing an **exact version** (e.g. `@gehennawu/dsh-service@2.1.0`) installs exactly the release you name. The cooldown is a supply-chain safety policy, not a sign that the new release is broken; if you are not in a hurry, installing without a version after the 24 hours have passed also reaches the new release.
|
|
332
346
|
|
|
333
347
|
### Option 2: Command line
|
|
334
348
|
|
|
335
349
|
| Method | Command |
|
|
336
350
|
| --- | --- |
|
|
337
|
-
| npm (recommended) | `dsh plugin --profile web add @gehennawu/dsh-service@2.0
|
|
351
|
+
| npm (recommended) | `dsh plugin --profile web add @gehennawu/dsh-service@2.1.0` |
|
|
338
352
|
| GitHub | `dsh plugin --profile web add github:gehennawu/dsh-service` |
|
|
339
353
|
| Local development | `dsh plugin --profile web add link:/path/to/dsh-service` |
|
|
340
354
|
|
|
341
|
-
The command line uses the default npm / pnpm registry; if you need a mirror, point npm / pnpm's registry at one the usual way first, then run the command above. The npm method is subject to the same pnpm release cooldown: without a version it installs the newest release that has cleared the cooldown, while an exact version (`@gehennawu/dsh-service@2.0
|
|
355
|
+
The command line uses the default npm / pnpm registry; if you need a mirror, point npm / pnpm's registry at one the usual way first, then run the command above. The npm method is subject to the same pnpm release cooldown: without a version it installs the newest release that has cleared the cooldown, while an exact version (`@gehennawu/dsh-service@2.1.0`) installs that release (see the note under Option 1).
|
|
342
356
|
|
|
343
357
|
Restart DSH Web after installing or updating:
|
|
344
358
|
|
|
@@ -390,7 +404,7 @@ pm2 start "dsh web --host 127.0.0.1" --name dsh-web
|
|
|
390
404
|
|
|
391
405
|
Requirements: Node.js `>=22`, and a DSH Web installation capable of loading both Host and Client plugin halves. Update checks require access to `registry.npmjs.org`; network failures do not affect other features.
|
|
392
406
|
|
|
393
|
-
**DSH compatibility**: `>=0.1.1-rc.2
|
|
407
|
+
**DSH compatibility**: `>=0.1.1-rc.2` (**no upper bound**), verified through `0.2.1-alpha.5`. Why no upper bound: since `0.2.1-alpha.4` the host gates plugin compatibility on a declared `engines.dsh` alone, so any pinned ceiling blocks the whole plugin on each new DSH release (**and the plugin's own one-click upgrade is blocked by that same gate, leaving no self-recovery path**). An open range keeps the plugin loading on newer versions; individual features may lag, but nothing breaks and no release is needed just to move the ceiling. Older DSH cannot read newer session formats; **backups cannot be restored across a downgrade**.
|
|
394
408
|
|
|
395
409
|
|
|
396
410
|
**DSH Desktop**: restart and post-restore restart require quitting and reopening the app; upgrade through its own plugin manager. Notifications require system permission, and clicking one may not restore a hidden window—use the tray. Other platforms are best-effort, without compatibility guarantees.
|
|
@@ -483,7 +497,7 @@ Concurrency protection kicked in: SKILL.md was just modified by an external edit
|
|
|
483
497
|
<details>
|
|
484
498
|
<summary><strong>The plugin page installed the plugin, but the version is an older one?</strong></summary>
|
|
485
499
|
|
|
486
|
-
pnpm 11 enables a supply-chain release cooldown by default (`minimumReleaseAge`, 1440 minutes): **installing without a version** (including `@latest`) only selects the newest release that has already cleared the cooldown, so a freshly published release is skipped and the official plugin page reports that it installed x.y.z instead of the latest a.b.c. To get the new version right away: uninstall it in the plugin page and reinstall with `package@version` (e.g. `@gehennawu/dsh-service@2.0
|
|
500
|
+
pnpm 11 enables a supply-chain release cooldown by default (`minimumReleaseAge`, 1440 minutes): **installing without a version** (including `@latest`) only selects the newest release that has already cleared the cooldown, so a freshly published release is skipped and the official plugin page reports that it installed x.y.z instead of the latest a.b.c. To get the new version right away: uninstall it in the plugin page and reinstall with `package@version` (e.g. `@gehennawu/dsh-service@2.1.0`), or use this plugin's **Service Control → Upgrade** — it installs an exact version and is not subject to the cooldown. The cooldown is a supply-chain policy (a fresh release may contain defects that are not known yet); after the 24 hours have passed, installing without a version also reaches the new release.
|
|
487
501
|
</details>
|
|
488
502
|
|
|
489
503
|
<details>
|
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
<em>A service-control & operations plugin for DeepSeek Harness (DSH) Web.</em>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
|
-
[](package.json)
|
|
13
13
|
[](LICENSE)
|
|
14
|
-
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
15
15
|
[](https://cordis.moe/)
|
|
16
16
|
[](https://github.com/gehennawu/dsh-service)
|
|
17
17
|
[](https://github.com/gehennawu/dsh-service/issues)
|
|
@@ -42,7 +42,7 @@ DSH Web 服务控制与运维插件:安全重启、版本管理与一键升级
|
|
|
42
42
|
- [🚀 功能](#-功能)
|
|
43
43
|
- [版本与更新](#版本与更新) · [安全重启](#安全重启) · [健康诊断](#健康诊断) · [模型统计](#模型统计)
|
|
44
44
|
- [额度查询](#额度查询) · [模型配置](#模型配置) · [备份管理](#备份管理) · [技能管理](#技能管理) · [子代理模型](#子代理模型)
|
|
45
|
-
- [任务通知](#任务通知) · [会话管理](#会话管理) · [移动端适配](#移动端适配) · [模型厂家图标](#模型厂家图标) · [右栏文件编辑](#右栏文件编辑) · [外部探活](#外部探活)
|
|
45
|
+
- [任务通知](#任务通知) · [会话管理](#会话管理) · [移动端适配](#移动端适配) · [侧栏设置入口](#侧栏设置入口) · [模型厂家图标](#模型厂家图标) · [右栏文件编辑](#右栏文件编辑) · [外部探活](#外部探活)
|
|
46
46
|
- [🏗️ 架构](#-架构)
|
|
47
47
|
- [⚡ 安装](#-安装) · [🔄 自动重启配置](#-自动重启配置) · [🖥️ 平台支持](#-平台支持)
|
|
48
48
|
- [🔒 安全设计](#-安全设计) · [❓ 常见问题 FAQ](#-常见问题-faq) · [🤝 参与贡献](#-参与贡献) · [📄 许可证](#-许可证)
|
|
@@ -137,9 +137,15 @@ DSH Web 服务控制与运维插件:安全重启、版本管理与一键升级
|
|
|
137
137
|
| StepFun Step Plan | 控制台 BFF 订阅额度(Oasis-Token 登录令牌;5 小时/周窗口与 Credit 月池自动识别) |
|
|
138
138
|
| 小米 MiMo Token Plan | 控制台同源套餐额度(网页登录态 Cookie) |
|
|
139
139
|
| Command Code(command-goat) | 官方账号额度面 `api.commandcode.ai/alpha/*`(同 key 复用:余额 + 本周期花费 + 套餐 + 5 小时/周窗口) |
|
|
140
|
+
| workbuddy2api panel 用量(workbuddy) | **只对接 [workbuddy2api-panel](https://github.com/linguo2625469/workbuddy2api-panel) 这个 Go 面板项目**(其他 workbuddy2api 系网关接口不同,不适用);**手动适配**(baseURL 是中转地址,不参与自动识别);端点取所选渠道 baseURL 同源的 `GET /panel/api/usage?hours=24`(网关 API Key):**按区域(cn / global)的每日模型量油表**、按账号汇总的用量(含剩余积分),以及同源 `GET /panel/api/overview` 的**限流台账**(被限流的模型 + 上游重置墙钟、账号级冷却的恢复时刻) |
|
|
140
141
|
| CLIProxyAPI 部署 | 各 OAuth 上游账号官方剩余额度 |
|
|
141
142
|
|
|
142
143
|
- 凭据写入 DSH 凭据库(`$DSH_HOME/.credentials.yaml`,热生效):普通适配填 API key,CLIProxyAPI 填管理密钥,小米填控制台 Cookie,StepFun Step Plan 填控制台令牌(Oasis-Token,`Oasis-Webid` 由令牌自动派生无需手填);Command Code 额度面与推理面同一把 key,无需另配
|
|
144
|
+
- WorkBuddy2API 是**用量统计**而非套餐额度:卡片顶部改成**限流台账**——按区域列出被限流的模型与**上游重置时间**(`reset_at`,由上游 6004 带回的墙钟,客户端按浏览器时区显示),账号级冷却显示原因与恢复时刻;没有限流时显示「限流状态 —」。**总量统计(请求/错误/Token/积分/延迟/缓存命中率)不再上卡**(面板网页可见),保留按账号汇总的用量(最多 6 个,按 Token 降序)。**账号行显示请求 / Token / 剩余积分**:余额取面板 `overview` 的 `credits` / `credits_total`(形如 `1205 / 1305`,按 uid 与用量行对齐);余额台账不可用(旧面板/无权限/该账号无余额字段)时回落为本窗口消耗积分,不把未知渲染成 0。
|
|
145
|
+
- **限流台账的边界**:来自面板 `/panel/api/overview` 的 `rate_limited_models` / 账号 `cooling`,只在**正在限流**时存在(面板 `soft_rate_max` 默认 2h,到期条目连同重置时间一起消失,不是历史台账);旧面板没有该端点或无权限时静默降级——卡片不出限流行,用量与油表照常显示。
|
|
146
|
+
- **区域油表**:cn / global 两行按**每日模型量**画成百分比窗口(默认分母 cn 200M、global 100M tokens;超上限时百分比截 100、仍显示真实用量),额度卡带进度条;**对话圆环按当前所选模型的区域前缀(如 `cn:deepseek-v4.1-flash`)读该区域的油表**(弹层头部标出区域码、所选区域行排在最前),模型不带前缀时才回退「最紧区域」;未登记上限的区域只出文字行,不编分母。
|
|
147
|
+
- **分母目前只读**:额度页的「设置每日模型量」入口暂时下线(先按默认分母观察几天),需要调整时改 `$DSH_HOME/dsh-service-quota.json` 的 `realmCaps` 区块或代码里的默认常量;宿主 RPC 与配置链路保留,恢复入口只需打开一个开关。
|
|
148
|
+
- 时间窗取**近 24 小时(`hours=24`)**:面板默认档是 72h,但实测两边口径仍有出入,按用户要求用 24h(窗口是单一常量,改档只动 `WORKBUDDY_USAGE_PATH`)。该类型只走**手动适配**(中转 baseURL 不参与自动识别),面板端点取所选渠道 baseURL 的同源根路径(推理 `…/v1`、面板 `/panel/api/usage`),换中转域名无需改代码
|
|
143
149
|
- **凭据可随时修改**:每张已适配卡片的「配置」区常驻凭据入口——未配置时显示各渠道的填写文案,已配置后显示「修改凭据(已配置)」,可直接覆盖(密钥轮换、换账号、填错想改)或清除已存值;凭据值只随保存请求发出,绝不回显
|
|
144
150
|
- 防风控:结果缓存 60 秒、瞬时网络错误指数退避(30 秒 ×2、封顶 15 分钟);**确定性失败转手动**——凭据类、4xx、套餐失效、管理面未启用、响应格式异常等「换配置才可能恢复」的错误,宿主停止自动重试(错误行改报「自动重试已暂停,请手动重试」),只有点刷新手动重连(带 5 秒冷却)且成功后,才回到自动模式;查询为纯手动——打开额度页/展开圆环/点刷新才拉取,客户端不排任何周期轮询(上游节流仍全部在宿主侧)
|
|
145
151
|
- **CLIProxyAPI 管理面封禁有专属提示**:管理面对同一 IP 连续认证失败 5 次封 30 分钟,被封时卡片显示「已被 CLIProxyAPI 暂时封禁」+ 上游原话(含剩余时间);该状态不提供重填密钥的入口(密钥没错),等封禁解除或更换出口 IP 后点「重试连接」即可;封禁只作用于管理面,走该 CPA 的模型推理不受影响
|
|
@@ -177,16 +183,16 @@ DSH Web 服务控制与运维插件:安全重启、版本管理与一键升级
|
|
|
177
183
|
- 「模型配置」包含**渠道与模型**、**子代理路由**两个子页,区分内置与自定义渠道。
|
|
178
184
|
- **添加自定义渠道**:填写标识、显示名、协议、地址、API Key 与模型 ID;创建不会自动探测接口。
|
|
179
185
|
- **混合协议渠道提示**:渠道目录同时含多种协议(如 0.2.1-alpha.3 起 pi-ai 的 `azure`)时,模板选择与渠道编辑会提示「路由级协议覆盖该路由全部模型」,避免把 Chat Completions 模型钉到 Responses 协议。
|
|
180
|
-
-
|
|
181
|
-
- **模型获取**:可手填 ID,也可点击「在线获取」搜索、勾选并批量添加;支持 OpenAI 兼容与 Anthropic
|
|
182
|
-
- **模型编辑**:修改 ID
|
|
183
|
-
-
|
|
184
|
-
-
|
|
186
|
+
- **渠道编辑**:只修改显示名、地址与凭据,自定义渠道可修改协议,内置协议只读。普通用户界面不提供高级渠道参数;未展示的 headers、超时、缓存等字段原样保留,需要时请在 DSH 原生模型设置中修改。
|
|
187
|
+
- **模型获取**:可手填 ID,也可点击「在线获取」搜索、勾选并批量添加;支持 OpenAI 兼容与 Anthropic 模型列表。获取失败不影响手动添加,拿到列表不等于调用成功。搜索后「全选」只并集当前可见候选,之前已勾选但不在当前列表的项会单独计数并可一键移除。
|
|
188
|
+
- **模型编辑**:修改 ID、显示名、上下文窗口、最大输出、图片输入与思考等级;容量支持 `256K`、`1M`。思考档位直接勾选即可;**协议值映射收在「协议值映射(高级)」折叠区**(勾选档位时同名预填,展开后可改成渠道实际 wire 值),并区分「继承 / 未声明」「明确不支持思考」与「自定义映射」。同渠道 ID 不得重复,已停用模型需启用后改名。
|
|
189
|
+
- **即时启停**:停用后主对话与子代理不能发起新调用,配置和密钥保留,已运行请求不强行取消。**渠道被默认模型或子代理引用时,停用前先列出受影响引用再确认**;无引用时保持一键停用,启用始终一键。该策略随插件卸载撤去。
|
|
190
|
+
- **基础调用测试可能计费**:每次测试先展示固定内容、token 上限、超时与计费提示,确认后才发起调用;使用已保存模型,显示耗时和脱敏错误;只验证文本调用,不验证图片、容量或全部思考档位,失败不会回滚配置。
|
|
185
191
|
- **智能填充默认关闭**:开启后按模型 ID 查询本机 pi-ai、modelparams.dev 和 OpenRouter 资料;不探测渠道、不发推理、不自动保存。建议按参数展示,「一键填入」确认后只更新草稿,仍需保存。
|
|
186
192
|
- **思考等级需核对**:可选档位声明与调用时选择不同;缺少资料不等于不支持,未配置时沿用继承值或接口默认行为。手动填写的档位参数需与实际接口核对。
|
|
187
193
|
- **删除引用检查**:先列出主对话默认模型、子代理主模型和回退模型引用,存在引用则阻止删除;自定义渠道不能删到零模型。
|
|
188
194
|
- **恢复与凭据**:删除渠道前保存配置快照,删除保留凭据引用;可恢复配置,但不恢复旧密钥值。换密钥默认建立独立引用,替换共享凭据前列出使用者。
|
|
189
|
-
-
|
|
195
|
+
- **草稿与并发保护**:保存失败保留草稿,连接中断或宿主重启后按钮会复位并可重试;离开未保存编辑前提醒;配置发生外部变动时拒绝覆盖,重新核对后再保存。草稿不跨刷新保存。
|
|
190
196
|
|
|
191
197
|
#### URL 与密钥安全机制
|
|
192
198
|
|
|
@@ -241,6 +247,13 @@ DSH Web 服务控制与运维插件:安全重启、版本管理与一键升级
|
|
|
241
247
|
- 上箭头可逐条跳到上一条用户消息,未加载历史时自动补齐。
|
|
242
248
|
- 长会话 JSON 响应自动压缩,并处理安全区与手机输入框聚焦缩放。
|
|
243
249
|
|
|
250
|
+
### 侧栏设置入口
|
|
251
|
+
|
|
252
|
+
- 侧栏底部、账号按钮**正上方**常驻一行「设置」:点击直接打开官方设置面板,不必再先点开账号按钮、再从弹出菜单里选「设置」。
|
|
253
|
+
- 已登录与未登录都常驻;账号按钮菜单里的「设置」项保持原样,两条路径都能进设置。
|
|
254
|
+
- 侧栏收起成图标条时,入口变成 36×36 的齿轮按钮,悬停提示与无障碍名仍为「设置」。
|
|
255
|
+
- 跟随界面语言切换文案;宿主没有该槽位时整行不出现,其余功能不受影响。
|
|
256
|
+
|
|
244
257
|
### 模型厂家图标
|
|
245
258
|
|
|
246
259
|
- 模型按钮、模型选择列表与额度卡片显示渠道厂家图标;未识别渠道保留官方默认图标。
|
|
@@ -249,6 +262,7 @@ DSH Web 服务控制与运维插件:安全重启、版本管理与一键升级
|
|
|
249
262
|
- 名称无法识别时,可按额度页**手动选择的适配类型**匹配;名称匹配优先,CLIProxyAPI 图标需手动适配后显示。
|
|
250
263
|
- 图标内置,离线可用,不向第三方发送渠道名称;开关在插件配置 → 交互,默认开启。
|
|
251
264
|
- 来源:[LobeHub Icons](https://github.com/lobehub/lobe-icons)(MIT)与 [Simple Icons](https://github.com/simple-icons/simple-icons)(CC0)。品牌图形归各厂商所有。
|
|
265
|
+
- WorkBuddy2API 一类中转网关没有自家品牌资产,其图标取自上游产品 WorkBuddy 的官方标(`workbuddy.cn` 站点 favicon 的矢量版,本地手绘入库);渠道名 `workbuddy2api-panel` / `workbuddy2api` / `workbuddy` 均命中,也可在额度页把渠道手动适配成该类型后按类型取图标。
|
|
252
266
|
- 全部图标与渠道匹配规则见[图标目录](docs/model-icons.html)。
|
|
253
267
|
|
|
254
268
|
### 右栏文件编辑
|
|
@@ -319,7 +333,7 @@ flowchart TB
|
|
|
319
333
|
1. 打开左侧边栏的「**插件**」页。
|
|
320
334
|
2. 点右上角的「**+ 添加插件**」按钮。
|
|
321
335
|
3. 在弹窗里按来源**三选一**填写(同一个输入框接受三种形式,底部提示会随填写内容变化):
|
|
322
|
-
- **npm 包名(推荐)**:`@gehennawu/dsh-service@2.0
|
|
336
|
+
- **npm 包名(推荐)**:`@gehennawu/dsh-service@2.1.0`——**带上精确版本号**(写法 `包名@版本号`);
|
|
323
337
|
- **GitHub 仓库地址**:`https://github.com/gehennawu/dsh-service`(公开仓库,无需令牌;`github:gehennawu/dsh-service` 简写同样可用);
|
|
324
338
|
- **本地插件目录**:本机上的绝对路径,例如 `/path/to/dsh-service`(自研或已下载的插件)。
|
|
325
339
|
4. 「**安装源**」按网络情况选择:默认「**npm 官方源**」;国内网络拉取受限时可选「**中国大陆镜像源**」(影响走包名安装时的拉取源,GitHub 地址与本地目录不受其影响)。
|
|
@@ -330,17 +344,17 @@ flowchart TB
|
|
|
330
344
|
|
|
331
345
|
> 提示:三种形式都走官方安装链路,无需手动改 profile 文件;图形界面填 GitHub 地址与命令行 `github:` 前缀等价。
|
|
332
346
|
|
|
333
|
-
> **npm 方式为什么建议带版本号**:pnpm 11 默认启用供应链发布观察期(`minimumReleaseAge`,1440 分钟)。**不带版本号**(含 `@latest`)时,发布时间未满观察期的版本不会被自动安装,包管理器会退到「最近的、已过观察期的那一版」——插件页因此可能提示「本次安装的是 x.y.z,而非最新版本 a.b.c」;**写精确版本号**(如 `@gehennawu/dsh-service@2.0
|
|
347
|
+
> **npm 方式为什么建议带版本号**:pnpm 11 默认启用供应链发布观察期(`minimumReleaseAge`,1440 分钟)。**不带版本号**(含 `@latest`)时,发布时间未满观察期的版本不会被自动安装,包管理器会退到「最近的、已过观察期的那一版」——插件页因此可能提示「本次安装的是 x.y.z,而非最新版本 a.b.c」;**写精确版本号**(如 `@gehennawu/dsh-service@2.1.0`)才会安装你点名的那一版。观察期属供应链安全策略,不代表新版有问题;不着急时等满 24 小时,不带版本号安装同样会装到新版。
|
|
334
348
|
|
|
335
349
|
### 方式二:命令行
|
|
336
350
|
|
|
337
351
|
| 方式 | 命令 |
|
|
338
352
|
| --- | --- |
|
|
339
|
-
| npm(推荐) | `dsh plugin --profile web add @gehennawu/dsh-service@2.0
|
|
353
|
+
| npm(推荐) | `dsh plugin --profile web add @gehennawu/dsh-service@2.1.0` |
|
|
340
354
|
| GitHub | `dsh plugin --profile web add github:gehennawu/dsh-service` |
|
|
341
355
|
| 本地开发 | `dsh plugin --profile web add link:/path/to/dsh-service` |
|
|
342
356
|
|
|
343
|
-
命令行走 npm / pnpm 的默认源;需要镜像时,请先按 npm / pnpm 的常规做法把 registry 指到镜像站,再执行上面的命令。npm 方式同样受 pnpm 发布观察期影响:不带版本号会装到最近的、已过观察期的版本,写精确版本号(`@gehennawu/dsh-service@2.0
|
|
357
|
+
命令行走 npm / pnpm 的默认源;需要镜像时,请先按 npm / pnpm 的常规做法把 registry 指到镜像站,再执行上面的命令。npm 方式同样受 pnpm 发布观察期影响:不带版本号会装到最近的、已过观察期的版本,写精确版本号(`@gehennawu/dsh-service@2.1.0`)才会装该版(原因见「方式一」的提示)。
|
|
344
358
|
|
|
345
359
|
安装或更新后重启 DSH Web:
|
|
346
360
|
|
|
@@ -392,7 +406,7 @@ pm2 start "dsh web --host 127.0.0.1" --name dsh-web
|
|
|
392
406
|
|
|
393
407
|
运行要求:Node.js `>=22`,DSH Web 能加载 Host 与 Client 两半插件。更新检查需访问 `registry.npmjs.org`;网络失败不影响其他功能。
|
|
394
408
|
|
|
395
|
-
**DSH 兼容范围**:`>=0.1.1-rc.2
|
|
409
|
+
**DSH 兼容范围**:`>=0.1.1-rc.2`(**无上界**),已验证至 `0.2.1-alpha.5`。不设上界的理由:`0.2.1-alpha.4` 起宿主门禁改为「插件声明了 `engines.dsh` 就由它单独裁决」,一旦上界写死,每次 DSH 发新版都会把插件整包挡掉(**且插件的一键升级会被同一门禁挡死,无法自救**);改用开区间后新版本插件照常加载,个别新功能可能尚未适配,但不阻断使用,也无需为 `engines.dsh` 单独发版。新版会话格式不能由旧版 DSH 读取,**备份不可跨版本降级恢复**。
|
|
396
410
|
|
|
397
411
|
|
|
398
412
|
**DSH Desktop**:重启与恢复后的重启改为提示退出应用后重新打开;一键升级使用桌面应用自带的插件管理页。通知需授予系统权限,点击通知可能无法唤回隐藏窗口,请用托盘打开。其他平台尽力而为,不承诺兼容。
|
|
@@ -485,7 +499,7 @@ Step Plan 订阅没有 API-key 形态的查询接口,需要网页登录态令
|
|
|
485
499
|
<details>
|
|
486
500
|
<summary><strong>插件管理页装了插件,版本却停在旧版?</strong></summary>
|
|
487
501
|
|
|
488
|
-
pnpm 11 默认启用供应链发布观察期(`minimumReleaseAge`,1440 分钟):安装时**不带版本号**(含 `@latest`)只会选「发布时间已满观察期的最新版」,刚发布的新版会被跳过,官方插件页会提示「本次安装的是 x.y.z,而非最新版本 a.b.c」。要立刻装上新版:在插件管理页卸载后按 `包名@版本号` 重装(例如 `@gehennawu/dsh-service@2.0
|
|
502
|
+
pnpm 11 默认启用供应链发布观察期(`minimumReleaseAge`,1440 分钟):安装时**不带版本号**(含 `@latest`)只会选「发布时间已满观察期的最新版」,刚发布的新版会被跳过,官方插件页会提示「本次安装的是 x.y.z,而非最新版本 a.b.c」。要立刻装上新版:在插件管理页卸载后按 `包名@版本号` 重装(例如 `@gehennawu/dsh-service@2.1.0`),或直接用本插件的「**服务控制 → 一键升级**」——它按精确版本安装,不受观察期影响。观察期属供应链安全策略(新发布版本可能含尚未被发现的缺陷),等满 24 小时后不带版本号安装也会自然装到新版。
|
|
489
503
|
</details>
|
|
490
504
|
|
|
491
505
|
<details>
|