@gehennawu/dsh-service 0.26.0 → 0.28.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 +24 -6
- package/README.md +24 -6
- package/client.js +261 -18
- package/index.js +392 -24
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -8,9 +8,9 @@ A service-control and operations plugin for self-hosted DSH Web. Provides safe r
|
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
The Settings panel "Service Control" page has
|
|
11
|
+
The Settings panel "Service Control" page has nine top-level tabs: **Overview, Notifications, Health, Model stats, Quota lookup, Backups, Skills, Subagents, Restart**; the Restart, Quota lookup, Skills, and Subagents tabs can each enable a quick entry at the bottom of the settings left navigation (off by default).
|
|
12
12
|
|
|
13
|
-
The plugin also appears under **Plugins → Plugin configuration**, with
|
|
13
|
+
The plugin also appears under **Plugins → Plugin configuration**, with eight host-level switches enabled by default: **Health diagnostics, Model statistics, Quota lookup, Backup maintenance, Task notifications, Skill manager, Subagent model, and the `/healthz` liveness endpoint**. Disabling one hides its UI, stops the associated polling/subscriptions, and makes the Host reject that capability; Overview and Restart remain available. All eight switches are live settings: disabling or re-enabling them requires neither a page reload nor a DSH Web restart. Statistics refreshes, quota requests, or backup operations already in flight are allowed to finish; quota re-enablement preserves existing cache, TTL, and backoff state, so its UI and calls return immediately but a new upstream request is not guaranteed at once.
|
|
14
14
|
|
|
15
15
|
### Version and updates
|
|
16
16
|
|
|
@@ -33,9 +33,12 @@ The plugin also appears under **Plugins → Plugin configuration**, with six hos
|
|
|
33
33
|
- Full diagnostics check session storage, workspace registry, backup storage, tar availability, file permissions, runtime environment, and Node runtime version; a manual launch is marked with a yellow inline caution (no restart assurance) that does not trigger the health alert banner, the service-control reminder, or the tab ⚠; an unrecognized environment and an empty backup list are informational only — all can be declared explicitly via `DSH_SERVICE_RUNTIME_ENV`
|
|
34
34
|
- Having no backups is an informational note, not a warning, and does not light the Health tab ⚠
|
|
35
35
|
- File-permission deep scan and repair: checks whether the Agent can read/write DSH_HOME and workspaces; repair requires two-step confirmation
|
|
36
|
+
- The **Health diagnostics** switch under Plugins → Plugin configuration hides this whole tab: full diagnostics and file-permission requests stop immediately and the Host rejects the corresponding RPCs; the overview metrics (5-second polling) are unaffected
|
|
36
37
|
|
|
37
38
|
### Model statistics
|
|
38
39
|
|
|
40
|
+

|
|
41
|
+
|
|
39
42
|
- 7-day stacked bar chart of input/output/cache tokens with blue/orange/teal legend
|
|
40
43
|
- Filter by project; hover for exact values
|
|
41
44
|
- Model breakdown as horizontal stacked bars (same legend colors) with a "Today / Last 7 days / All time" toggle on the right of the list header (default: last 7 days): Today aggregates only the current day, Last 7 days ranks within the chart's window, and All time covers every date in the index (bounded by session retention); each row keeps `x times · Cache hit x% · Input xM token · Output xM token`
|
|
@@ -44,13 +47,16 @@ The plugin also appears under **Plugins → Plugin configuration**, with six hos
|
|
|
44
47
|
|
|
45
48
|
### Quota lookup
|
|
46
49
|
|
|
47
|
-
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
- A dedicated "Quota lookup" tab shows adapted providers as separate cards, each window rendered as a percentage with its own bar and a reset countdown on its own line, plus a refresh icon beside the updated time that force-refreshes that provider on click (bypassing the poll interval); adapted card titles link to the provider's official usage page (DeepSeek Platform, Zhipu GLM Coding Plan, OpenCode Go, Xiaomi MiMo console usage page) in a new tab; a "Reorder" toggle at the top-right of the card list (shown with two or more cards) reveals ↑/↓ buttons on each card header (auto-disabled at the ends), and clicking it again hides them; the order is remembered in this browser and newly seen providers append at the end; unadapted providers take no space — a "Manual adapt" row at the bottom enables one by picking its type, and each card's footer can switch type, fall back to auto-detect, or disable lookup at any time
|
|
48
53
|
- A quota ring inside the conversation composer follows the provider selected by the current session and shows the tightest budget window as a percentage (green below 80%, amber at or above); clicking opens a panel headed by the provider name, with a bar and used percentage for each window and reset times on their own lines; on narrow viewports (phones) the panel switches to a viewport-centered floating layer — fully visible, scrolling internally when too tall — and rotates or resizing wider flips it back to the anchored placement above the ring
|
|
49
54
|
- A "Show a remote quota entry in the settings left navigation" switch lives in the Quota lookup tab (off by default), mirroring the Restart entry
|
|
50
|
-
- Built-in adaptations: **OpenCode Go** (`{baseURL}/usage`), **Zhipu GLM Coding Plan / zai-coding-cn** (official monitor `quota/limit` endpoint with three windows — 5-hour rolling tokens, weekly tokens, monthly MCP quota; an idle 5-hour window hides its reset time, matching the official console), **OpenRouter** (credits used %), **Kimi/Moonshot** and **SiliconFlow** (CNY balance text), **DeepSeek Platform** (official balance, see next bullet); dialects that natively report remaining percentage flip the panel word to "Remaining" and invert the warn threshold; transient network errors retry automatically and the Zhipu dual-domain candidate chain switches automatically; the provider-to-kind mapping lives in `DSH_HOME/dsh-service-quota.json`, and known services are auto-detected from their baseURL (e.g. opencode.ai, bigmodel.cn, api.deepseek.com) with no manual picking; no upstream request is ever made for unadapted or disabled providers; disabling can be done via "Disable" in a card's footer or by writing `"<provider>": null` in the config file (both are equivalent). Zhipu reset cards have no API-key-queryable endpoint yet — you can add any number of them via each provider card's "Add reset card" button on the tab (name plus expiry time, down to the minute), and remove each one independently — the ring panel shows them too (stored in the same config file); expired cards are flagged automatically
|
|
55
|
+
- Built-in adaptations: **OpenCode Go** (`{baseURL}/usage`), **Zhipu GLM Coding Plan / zai-coding-cn** (official monitor `quota/limit` endpoint with three windows — 5-hour rolling tokens, weekly tokens, monthly MCP quota; an idle 5-hour window hides its reset time, matching the official console), **OpenRouter** (credits used %), **Kimi/Moonshot** and **SiliconFlow** (CNY balance text), **DeepSeek Platform** (official balance, see next bullet), **Xiaomi MiMo Token Plan** (subscription plan quota, see below); dialects that natively report remaining percentage flip the panel word to "Remaining" and invert the warn threshold; transient network errors retry automatically and the Zhipu dual-domain candidate chain switches automatically; the provider-to-kind mapping lives in `DSH_HOME/dsh-service-quota.json`, and known services are auto-detected from their baseURL (e.g. opencode.ai, bigmodel.cn, api.deepseek.com, token-plan-cn.xiaomimimo.com) with no manual picking; no upstream request is ever made for unadapted or disabled providers; disabling can be done via "Disable" in a card's footer or by writing `"<provider>": null` in the config file (both are equivalent). Zhipu reset cards have no API-key-queryable endpoint yet — you can add any number of them via each provider card's "Add reset card" button on the tab (name plus expiry time, down to the minute), and remove each one independently — the ring panel shows them too (stored in the same config file); expired cards are flagged automatically
|
|
51
56
|
- **DeepSeek official balance with peak/off-peak hint (deepseek)**: calls DeepSeek Platform's official `GET /user/balance` and shows the total balance per currency (CNY→¥, USD→$), plus a separate "Granted balance" line whenever unexpired granted credit is positive; each DeepSeek card embeds a **peak/off-peak block** — a status badge on top (orange = "Peak now · standard price", green = "Off-peak now · half price") with a countdown to the next switch in Beijing time (e.g. "Peak pricing from 09:00 (in 12 h 41 min)", correctly spanning weekends to Monday's morning peak), below it a two-segment ribbon: the first block is the remainder of the current period and the second is the next opposite period (spanning days when needed — e.g. Friday evening draws straight to Monday's morning peak), widths proportional to actual durations with the left edge marking "now"; blocks are tagged inline as Peak / Off-peak, advancing every 30 seconds, and a caption stating the official rule "off-peak price is half the peak price"; the ring panel shows a compact version without the caption. Credentials resolve via the `DEEPSEEK_API_KEY` hint from the DSH credential store or environment variables, or can be written directly through the card's credential form. DSH's built-in `@deepseek-ai/dsh-llm-deepseek` official channel (the DeepSeek V4 models in the model picker, route id `deepseek-official`) needs **no extra settings route** — the quota lookup merges that runtime channel automatically and adapts it to the official balance endpoint, so the ring also appears when you switch to one of its models
|
|
52
57
|
- **CLIProxyAPI accounts (cliproxy)**: queries the **official remaining quota** of each OAuth upstream account inside a CLIProxyAPI (CPA) deployment (Codex 5-hour/weekly windows, per-model quotas for GeminiCLI and Antigravity) — not proxy-key usage. Prerequisites: CPA's `remote-management.secret-key` must be set (the whole management API is unavailable without it), remote access requires `allow-remote-management`, and the management secret goes into the DSH credential store as `CPA_MANAGEMENT_KEY` or an environment variable of the same name — it is independent of the proxy API key, and the plugin never sends the proxy key to the management plane. When you save the "CLIProxyAPI accounts" adaptation, the plugin pins the hostname of that provider's settings baseURL into the config file and afterwards only sends requests to that pinned domain (re-save the adaptation after changing baseURL); a single refresh queries at most 8 accounts (disabled accounts and account types without a supported quota endpoint are skipped automatically), and failures on some accounts do not affect the rest. Note that CPA's management plane has built-in key throttling — 5 wrong attempts ban your IP for 30 minutes — so make sure the secret is correct before testing
|
|
53
|
-
-
|
|
58
|
+
- **Xiaomi MiMo Token Plan quota (xiaomi-token-plan-cn)**: queries the "plan usage" of a Xiaomi MiMo Open Platform Token Plan subscription — plan total quota, compensation credits and other buckets, straight from the same source as the console; each row shows used percentage, an absolute figure abbreviation (e.g. `12% · 1.4B / 11B`) and a subscription-validity countdown. Xiaomi has no API-key-based quota endpoint (the inference gateway serves `/v1` inference paths only); the data lives behind console-origin APIs, so the credential is your **web session cookie**: log into platform.xiaomimimo.com in your browser, open DevTools, copy the full `Cookie:` request header from any `/api/v1/tokenPlan/` call, then click **"Set console cookie (web session)"** on the card and paste it (stored in the DSH credential store under `XIAOMI_MIMO_CONSOLE_COOKIE` or an environment variable of the same name; the `Cookie:` prefix is optional). The cookie is sent only to two fixed endpoints, `platform.xiaomimimo.com/api/v1/tokenPlan/detail` and `/usage`; the `tp-…` inference key is never sent to the console plane. When the cookie expires (logout or session expiry) the card shows "Console cookie expired" — copy it again. Providers auto-detect from baseURL (token-plan-cn.xiaomimimo.com); when you reach MiMo through a relay domain, pick "Xiaomi MiMo Token Plan" in "Manual adapt" instead (the queried plane is fixed and unaffected by baseURL). Note that a web cookie grants full console access — it is stored only in your local credential store and sent only to those two fixed endpoints; never hand it to environments you do not trust
|
|
59
|
+
- Credential fill-in form: when an adapted provider shows "credential missing", its card offers an inline form — regular adaptations show **"Set API credential"**, the CLIProxyAPI adaptation shows **"Set management key (web login key)"** (the remote-management secret you use to log into CPA's web management UI — not the proxy API key, which the management plane bans wrong attempts for), and the Xiaomi Token Plan adaptation shows **"Set console cookie (web session)"**; the credential name comes from a host-derived whitelist per adaptation type (CLIProxyAPI only ever offers `CPA_MANAGEMENT_KEY`/`CLIPROXY_MANAGEMENT_KEY` — these are **alias slots for the same secret; storing one is enough**, discovery takes the first configured value in order; Xiaomi likewise offers `XIAOMI_MIMO_CONSOLE_COOKIE`/`MIMO_CONSOLE_COOKIE`; the primary name is marked and the form defaults to a configured slot. Never the proxy key or the tp-… inference key); saving writes the value into the DSH credential provider (the `refs:` section of `$DSH_HOME/.credentials.yaml`, hot-effective without restarts) and then force-refreshes that provider; the form can also clear a stored file-layer credential in one click. If a process environment variable is currently shadowing that name, the host refuses the write (credential-store contract) — change the environment variable itself instead
|
|
54
60
|
- Anti-rate-limit pacing is enforced by the host: successful results are cached for 60 seconds (shared across tabs), failures back off exponentially (30 s doubling, capped at 15 minutes), upstream timeout is 15 s; the panel can set auto query to manual only / 1 / 2 / 5 / 10 minutes (manual only by default), paused automatically while the page is hidden
|
|
55
61
|
- API keys are resolved and used only inside the host process — the browser receives normalized window data (percentages or balance text) only; data flows through the plugin's own loopback RPC with no webServer routes exposed
|
|
56
62
|
|
|
@@ -64,15 +70,27 @@ The plugin also appears under **Plugins → Plugin configuration**, with six hos
|
|
|
64
70
|
|
|
65
71
|
### Skills management
|
|
66
72
|
|
|
73
|
+

|
|
74
|
+
|
|
67
75
|
- The "Skills" tab lists every local skill under three sections — **auto-loaded / manual-only / fully disabled** — scanning project `.dsh`, project `.agents`, user `~/.dsh/skills`, `$DSH_AGENTS_HOME`, and `$DSH_BUNDLED_SKILL_DIR` roots one level deep, with a name filter and source badges; same-name shadowing (lower rank wins) marks both winner and loser copies, bundled directories are shown read-only, and a physical directory hit by multiple root rules is counted once
|
|
68
76
|
- Two per-entry switches edit the SKILL.md frontmatter directly: `disable-model-invocation` for "visible to model", `user-invocable` for "invocable via /"; switches use a two-click confirmation, changes go live within ~200 ms, active sessions receive a catalog-update notice on their next step, and toggling back and forth leaves no residue in the file
|
|
69
77
|
- Entries carrying legacy camelCase invocation keys (e.g. `disableModelInvocation`) are dropped entirely by the official parser: the panel shows a ⚠ warning and a two-click confirmed fix that converts them to canonical keys semantically
|
|
70
|
-
- "Fill with AI" (✨): pick any configured model (last choice remembered); the Host calls it with a fixed template to draft description and usage **in Simplified Chinese
|
|
78
|
+
- "Fill with AI" (✨): pick any configured model (last choice remembered); the Host calls it with a fixed template to draft description and usage **in the DSH UI language** (Simplified Chinese in Chinese environments, English in English ones); the draft is previewed old-vs-new and saved after explicit confirmation as an "AI note". Notes live only in the plugin sidecar index `DSH_HOME/dsh-service-skills-index.json` and **never modify SKILL.md** — they render under their entry on the Skills tab only (with a remove button); a body change marks the note stale for refilling
|
|
71
79
|
- One-click batch fill: automatically collects unannotated skills or ones whose body changed (read-only roots included; invalid entries and shadowed copies are skipped), shows candidate count / estimated payload and an expandable per-entry skip list first, then runs sequentially with live progress; individual failures never block the batch, and cancelling immediately interrupts the in-flight model call. Zero file modifications throughout, and the plugin never issues model calls autonomously
|
|
72
80
|
- Batch runs in the Host background: switching tabs, closing the settings panel, or even refreshing the page never interrupts it; returning to the Skills tab restores progress and the cancel button, the Skills tab title shows a live `⟳done/total` badge while running, and planning a second batch mid-run is explicitly rejected
|
|
73
81
|
|
|
82
|
+
### Subagent model
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
- The "Subagents" tab controls routing for delegations that **did not explicitly specify a model**, with three modes: **Default (no override)** injects nothing and preserves DSH's native inheritance; **Follow main model** reads the provider/model actually used by the main conversation's latest request at delegation time; **Custom** pins every unspecified subagent to the selected provider and model
|
|
87
|
+
- A provider or model explicitly carried by the delegation always wins, so the plugin never overrides a pinned preset, call arguments, or a route already injected by another plugin. Custom choices come exclusively from the Host's live model catalog; if that provider is later removed, delegation safely falls back to native inheritance instead of failing
|
|
88
|
+
- Configuration is stored in `$DSH_HOME/dsh-service-subagent-route.json` (atomic writes, file mode `0600`); "Reset to default" clears the custom route and restores zero intervention. An optional "Subagents" quick entry can be enabled for the settings left navigation (off by default)
|
|
89
|
+
|
|
74
90
|
### Task notifications
|
|
75
91
|
|
|
92
|
+

|
|
93
|
+
|
|
76
94
|
- Notification settings live in the top-level Notifications tab: browser notification when a session finishes its turn, or when your approval, plan review, or answer is needed
|
|
77
95
|
- Clicking a notification focuses the DSH page and closes the popup
|
|
78
96
|
- Three toggle switches: master switch, task completion, and approvals & questions, each controlled independently
|
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
## 功能
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
设置页「服务控制」面板包含九个顶部标签:**概览、通知、健康诊断、模型统计、额度查询、备份维护、技能、子代理、重启**;重启、额度查询、技能与子代理标签还可在设置页左侧标签列底部开启快捷入口(默认关闭)。
|
|
12
12
|
|
|
13
|
-
插件同时出现在「插件 →
|
|
13
|
+
插件同时出现在「插件 → 插件配置」,提供八个默认开启的宿主级开关:**健康诊断、模型统计、额度查询、备份维护、任务通知、技能管理、子代理模型、`/healthz` 探活端点**。关闭后不仅隐藏对应界面,也会停止相关轮询/订阅并由宿主拒绝对应能力;概览与重启固定保留。设置写入 DSH settings,八项均为热生效:关闭或重新开启都无需刷新页面或重启 DSH Web。已在途的统计刷新、额度请求或备份操作允许完成;额度重新开启时保留既有缓存、TTL 与退避状态,因此可立即恢复界面和调用,但不保证立刻重新请求上游。
|
|
14
14
|
|
|
15
15
|
### 版本与更新
|
|
16
16
|
|
|
@@ -33,9 +33,12 @@
|
|
|
33
33
|
- 完整诊断检查会话存储、工作区注册表、备份目录、tar 可用性、文件权限、运行环境和 Node 运行时版本;手动启动环境以黄色行内警示标注重启无保障(不触发健康提醒横幅、服务控制提醒和标签 ⚠),未识别环境与空备份为信息级提示(不算警告),均可通过 `DSH_SERVICE_RUNTIME_ENV` 显式声明
|
|
34
34
|
- 没有备份属于信息级提示,不算警告,也不点亮健康诊断标签的 ⚠
|
|
35
35
|
- 文件权限深检与修复:检查 Agent 是否能读写 DSH_HOME 和工作区,修复需两段式确认
|
|
36
|
+
- 「插件 → 插件配置」的「健康诊断」开关可整体关闭本标签:关闭后完整诊断与文件权限请求立即停止、宿主拒绝对应 RPC;概览的运行指标(5 秒轮询)不受影响
|
|
36
37
|
|
|
37
38
|
### 模型统计
|
|
38
39
|
|
|
40
|
+

|
|
41
|
+
|
|
39
42
|
- 近 7 天输入/输出/缓存 token 堆叠柱图,蓝/橙/青图例
|
|
40
43
|
- 按项目筛选,鼠标悬停显示精确数值
|
|
41
44
|
- 模型明细为横向堆叠柱形图(沿用主图图例配色),列表头部右侧提供「今日 / 近 7 天 / 累计」切换标签(默认近 7 天):今日只聚合当天,近 7 天按主图同窗口排序,累计覆盖索引内全部日期(受会话持久化留存范围限制);每行附「x次 · 缓存命中 x% · 输入 xM token · 输出 xM token」明细
|
|
@@ -44,13 +47,16 @@
|
|
|
44
47
|
|
|
45
48
|
### 额度查询
|
|
46
49
|
|
|
47
|
-
-
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
- 独立的「额度查询」标签:以卡片分区展示已适配的供应商,每个窗口显示百分比、独立进度条,重置时间单独一行;卡片头部更新时间旁有刷新图标,点击即强制重拉该供应商(不受轮询间隔限制);已适配卡片的标题链接到对应官网用量页(DeepSeek 平台、智谱 GLM Coding Plan、OpenCode Go、小米 MiMo 控制台用量页),点击新标签页打开;卡片列表右上角有「调整排序」开关(至少两张卡时显示),点击后各卡头部出现 ↑/↓ 按钮(首末卡对应方向自动禁用),再点一次收起;顺序记忆在本浏览器,新出现的供应商排在末尾;未适配的不占位置,统一收进底部「手动适配」行选择类型启用,卡片脚部可随时切换适配类型、回退自动识别或停用查询
|
|
48
53
|
- 对话输入框内一枚额度圆环,跟随当前会话所选模型的供应商,显示最紧预算窗口的已用百分比(<80% 绿色、≥80% 黄色);点击弹出面板——头部标明供应商,各窗口带独立进度条与已用百分比、重置时间单独一行;手机等窄屏上面板自动切换为视口居中的浮层(完整可见、超高时内部滚动),旋转或拖宽窗口即时切回圆环上方锚定
|
|
49
54
|
- 可在「额度查询」标签开启「设置页左列显示入口」开关(默认关闭),开启后在设置页左侧标签列底部显示「额度查询」快捷入口(与「重启」入口同模式)
|
|
50
|
-
- 内置适配:**OpenCode Go**(`{baseURL}/usage`)、**智谱 GLM Coding Plan / zai-coding-cn**(官方监控端点 `quota/limit`,含 5 小时滚动 Token、每周 Token、MCP 月度配额三个窗口,5 小时窗口空闲时与官网一致地不显示重置时间)、**OpenRouter**(credits 已用%)、**Kimi/Moonshot** 与 **硅基流动**(人民币余额)、**DeepSeek
|
|
55
|
+
- 内置适配:**OpenCode Go**(`{baseURL}/usage`)、**智谱 GLM Coding Plan / zai-coding-cn**(官方监控端点 `quota/limit`,含 5 小时滚动 Token、每周 Token、MCP 月度配额三个窗口,5 小时窗口空闲时与官网一致地不显示重置时间)、**OpenRouter**(credits 已用%)、**Kimi/Moonshot** 与 **硅基流动**(人民币余额)、**DeepSeek 开放平台**(官方余额,见下一条)、**小米 MiMo Token Plan**(订阅套餐额度,见下一条);原生报「剩余百分比」的方言会自动把面板头部切换为「剩余」并把预警阈值反向;上游瞬时网络错误自动重试,智谱双域候选链自动切换;供应商与适配类型的对应关系保存在 `DSH_HOME/dsh-service-quota.json`,已知服务商按 baseURL 自动识别适配(如 opencode.ai、bigmodel.cn、api.deepseek.com、token-plan-cn.xiaomimimo.com),无需手选;未适配或已停用的供应商不会被发起任何上游请求,停用可在卡片脚部选「停用查询」或在配置文件写 `"<provider>": null`(两者等价)。智谱的重置卡暂无 API Key 可查的接口,可在「额度查询」标签内点各供应商卡片的「添加重置卡」填写名称与到期时间(可精确到分钟),可连续添加多条、每条独立移除;圆环面板同步显示(数据存入同一配置文件),过期自动标注
|
|
51
56
|
- **DeepSeek 官方余额与峰谷提示(deepseek)**:调用 DeepSeek 开放平台官方 `GET /user/balance`,按币种显示总额余额(CNY→¥、USD→$),未过期赠金大于 0 时追加一行「赠送余额」;卡片内嵌**峰谷时段提示块**——顶部为当前状态徽标(橙=「当前高峰时段 · 标准价」、绿=「当前空闲时段 · 半价计费」)和下一次换挡的北京时间倒计时(如「09:00 转高峰(12 小时 41 分钟后)」,跨周末也能算到周一早高峰),下方是一条**两段式**峰谷色带:第一段是当前时段的剩余部分,第二段是下一个相反时段(可跨天,如周五晚直接画到周一早高峰),宽度按实际时长比例、左缘细标线即当前时刻;段内只标「忙时 / 闲时」,每 30 秒自动前进,底部说明行写明官方规则「空闲时段价格为高峰时段的一半」;圆环面板内同步显示紧凑版(无说明行)。凭据按 `DEEPSEEK_API_KEY` 线索从 DSH 凭据库或环境变量解析,也可直接在卡片上用「填写 API 密钥」表单写入。DSH 内置的 `@deepseek-ai/dsh-llm-deepseek` 官方渠道(模型选择器里的 DeepSeek V4 系列,路由名 `deepseek-official`)**无需在 settings 另建路由**——额度查询会自动并入这个运行时渠道并按官方余额适配,切换到它的模型时圆环同样出现
|
|
52
57
|
- **CLIProxyAPI 账号额度(cliproxy)**:查询 CLIProxyAPI(CPA)部署内各 OAuth 上游账号的**官方剩余额度**(Codex 的 5 小时/本周窗口、GeminiCLI 与 Antigravity 的各模型配额),而不是代理 key 的用量。前置条件:CPA 配置 `remote-management.secret-key` 非空(为空时管理面整体不可用)、远程访问需开启 `allow-remote-management`;管理密钥放入 DSH 凭据库 `CPA_MANAGEMENT_KEY` 或同名环境变量——它与代理用的 API key 相互独立,插件绝不会把代理 key 发往管理面。在「手动适配」中选择「CLIProxyAPI 账号额度」保存时,插件会把该供应商 settings baseURL 的域名钉进配置文件,此后外呼只发往这个域(修改 baseURL 后需重新保存适配);单次刷新最多查询 8 个账号(已禁用或无受支持配额端点的账号自动跳过),部分账号失败不影响其余账号的结果。请注意 CPA 管理面对错误密钥有内建封禁(连续错 5 次封 IP 30 分钟),务必填对再测
|
|
53
|
-
-
|
|
58
|
+
- **小米 MiMo Token Plan 额度(xiaomi-token-plan-cn)**:查询小米 MiMo 开放平台 Token Plan 订阅的「套餐使用情况」——套餐总额度、补偿积分等额度桶,与控制台同源,每行显示已用百分比、绝对数缩写(如 `12% · 1.4B / 11B`)和订阅有效期倒计时。小米没有可用 API Key 查询额度的接口(推理网关只有 `/v1` 推理路径),数据来自控制台同源 API,凭据是**网页登录态 Cookie**:浏览器登录 platform.xiaomimimo.com 后打开开发者工具,从任意 `/api/v1/tokenPlan/` 请求复制完整 `Cookie:` 请求头的值,点卡片上的**「填写控制台 Cookie(网页登录态)」**粘贴保存(写入 DSH 凭据库 `XIAOMI_MIMO_CONSOLE_COOKIE` 或同名环境变量;带不带 `Cookie:` 前缀都行)。Cookie 只发往 `platform.xiaomimimo.com/api/v1/tokenPlan/detail` 与 `/usage` 两个固定端点;`tp-` 开头的推理密钥绝不会发往控制台平面。Cookie 失效(退出登录或过期)时卡片显示「控制台 Cookie 已失效」,重新复制一次即可。供应商按 baseURL 自动识别(token-plan-cn.xiaomimimo.com);经中转域接入推理时在「手动适配」中选择「小米 MiMo Token Plan」即可(查询平面固定、不受 baseURL 影响)。请注意网页 Cookie 等同整个控制台的访问权限——它只保存在本机凭据库、只用于上述两个固定端点,请不要把 Cookie 交给不信任的环境
|
|
59
|
+
- 凭据填写窗口:已适配供应商因缺凭据显示「凭据未配置」时,卡片上会出现内联表单——普通适配显示**「填写 API 密钥」**,CLIProxyAPI 适配显示**「填写管理密钥(网页登录的 key)」**(即登录 CPA 网页管理面所用的 remote-management 密钥,不是代理 API key——管理面对错密钥有封禁,别填错),小米 Token Plan 适配显示**「填写控制台 Cookie(网页登录态)」**;凭据名称由宿主按适配类型派生白名单(CLIProxyAPI 只会出现 `CPA_MANAGEMENT_KEY`/`CLIPROXY_MANAGEMENT_KEY`——两者是同一密钥的**别名存放槽,二选一即可**,查找按顺序取第一个已配置的值;小米只出现 `XIAOMI_MIMO_CONSOLE_COOKIE`/`MIMO_CONSOLE_COOKIE`,同理二选一;主名带「主名」标记且表单默认选中已配置的槽位。绝不混入代理 key 或 tp- 推理密钥),输入密钥值保存即写入 DSH 凭据提供方(`$DSH_HOME/.credentials.yaml` 的 `refs:` 分节,热生效无需重启),随后自动强制重拉该供应商;表单里还能一键清除已存的文件层凭据。进程环境变量正在遮蔽该名字时宿主会拒绝写入(凭据库契约),此时请改环境变量本身
|
|
54
60
|
- 防风控节律由宿主统一控制:成功结果缓存 60 秒(多标签共享)、失败指数退避(30 秒起 ×2、封顶 15 分钟)、上游超时 15 秒;面板可把自动查询调成仅手动 / 1 / 2 / 5 / 10 分钟(默认仅手动),页面不可见时自动暂停
|
|
55
61
|
- API key 只在宿主进程内解析使用,浏览器只会收到归一化后的窗口数据(百分比或余额文本);数据走插件自有 loopback RPC,不在 webServer 上暴露任何路由
|
|
56
62
|
|
|
@@ -64,15 +70,27 @@
|
|
|
64
70
|
|
|
65
71
|
### 技能管理
|
|
66
72
|
|
|
73
|
+

|
|
74
|
+
|
|
67
75
|
- 「技能」标签按**自动加载 / 仅手动调用 / 完全停用**三区展示全部本地技能(项目 `.dsh`、项目 `.agents`、用户 `~/.dsh/skills`、`$DSH_AGENTS_HOME` 与 `$DSH_BUNDLED_SKILL_DIR` 根,一层深度),支持名称过滤与来源徽标;同名遮蔽(低 rank 优先)与被遮蔽副本均有标注,内置目录只读展示;同一物理目录被多条规则命中时只计一次
|
|
68
76
|
- 每条目双开关直接改写 SKILL.md frontmatter:`disable-model-invocation` 控制「对模型可见」,`user-invocable` 控制「可被 / 调用」;开关采用两段式点击确认,改动约 200ms 内热生效,活跃会话下一步自动收到目录更新提示;往返切换不会在文件中累积残留
|
|
69
77
|
- 带 camelCase 旧版调用键(如 `disableModelInvocation`)的条目会被官方解析器整条剔除:面板给出 ⚠ 提示,两段式确认后按语义换算修复为规范键
|
|
70
|
-
- ✨「AI
|
|
78
|
+
- ✨「AI 补全说明」:从已配置模型中任选一个(记住上次选择),宿主用固定模板调用该模型生成描述与用法草稿,**输出语言跟随 DSH 设置的界面语言**(中文环境出简体中文、英文环境出英文);草稿以新旧对照预览,显式确认后保存为「AI 注释」。注释**只存在插件的侧车索引 `DSH_HOME/dsh-service-skills-index.json` 里、绝不改写 SKILL.md**,仅在技能标签页该条目下方单独展示(带移除按钮);正文变更后注释自动标记过期,重新补全即可刷新
|
|
71
79
|
- 一键批量补全:自动圈出未注释或正文有变的技能(含只读目录,跳过无效与被遮蔽副本),先展示候选数/预计发送量与可展开的逐条跳过清单,确认后顺序执行并显示进度,单条失败不影响批次,可随时取消(取消会立即中断在途模型调用);全程零文件改动,也绝不自动发起任何模型调用
|
|
72
80
|
- 批量任务在宿主后台持续运行:切换标签、关闭设置面板甚至刷新页面都不会中断;回到技能页自动恢复进度与取消按钮,批量进行中「技能」标签标题实时显示 `⟳已完成/总数` 角标,运行中重复生成计划会被明确拒绝
|
|
73
81
|
|
|
82
|
+
### 子代理模型
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
- 「子代理」标签控制**未显式指定模型**的子代理委派路由,支持三种模式:**初始(不干预)**不注入任何配置并完整保留 DSH 原生继承;**跟随主模型**在每次派生时读取主对话最近一次请求实际使用的 provider/model;**自定义**把所有未指定路由的子代理固定到所选供应商与模型
|
|
87
|
+
- 派生请求自身显式指定 provider 或 model 时始终优先,插件不会覆盖预设钉死、调用参数或其他插件已经注入的路由。自定义模型只能从宿主实时模型清单中选择;已配置供应商后来被卸载时安全回落原生继承,不会让子代理创建失败
|
|
88
|
+
- 配置保存在 `$DSH_HOME/dsh-service-subagent-route.json`(原子写入、文件权限 `0600`);「重置回初始配置」会清除自定义路由并恢复零干预。可在该标签开启设置页左列「子代理」快捷入口(默认关闭)
|
|
89
|
+
|
|
74
90
|
### 任务通知
|
|
75
91
|
|
|
92
|
+

|
|
93
|
+
|
|
76
94
|
- 通知设置位于服务控制顶部的「通知」标签:会话完成一轮任务、或需要你授权/审阅计划/选择答案时发送浏览器通知
|
|
77
95
|
- 点击系统通知弹窗会聚焦到 DSH 页面并关闭该通知
|
|
78
96
|
- 三档开关条:总开关、任务结束通知、授权与提问通知,各自独立控制
|