@gehennawu/dsh-service 0.39.0 → 0.41.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.
Files changed (35) hide show
  1. package/README.en.md +35 -15
  2. package/README.md +36 -14
  3. package/backup-integrity.js +577 -0
  4. package/client.js +576 -206
  5. package/index.js +462 -116
  6. package/package.json +3 -2
  7. package/screenshots/README.md +3 -1
  8. package/screenshots/backup-management.png +0 -0
  9. package/screenshots/backup-management_en.png +0 -0
  10. package/screenshots/configuration.png +0 -0
  11. package/screenshots/configuration_en.png +0 -0
  12. package/screenshots/health-diagnostics.png +0 -0
  13. package/screenshots/health-diagnostics_en.png +0 -0
  14. package/screenshots/maintenance.png +0 -0
  15. package/screenshots/maintenance_en.png +0 -0
  16. package/screenshots/mobile-adaptation.png +0 -0
  17. package/screenshots/mobile-adaptation_en.png +0 -0
  18. package/screenshots/model-usage.png +0 -0
  19. package/screenshots/model-usage_en.png +0 -0
  20. package/screenshots/overview.png +0 -0
  21. package/screenshots/overview_en.png +0 -0
  22. package/screenshots/plugin-config.png +0 -0
  23. package/screenshots/plugin-config_en.png +0 -0
  24. package/screenshots/quota-lookup.png +0 -0
  25. package/screenshots/quota-lookup_en.png +0 -0
  26. package/screenshots/restart.png +0 -0
  27. package/screenshots/restart_en.png +0 -0
  28. package/screenshots/session-manager.png +0 -0
  29. package/screenshots/session-manager_en.png +0 -0
  30. package/screenshots/skill-manager.png +0 -0
  31. package/screenshots/skill-manager_en.png +0 -0
  32. package/screenshots/subagent-model.png +0 -0
  33. package/screenshots/subagent-model_en.png +0 -0
  34. package/screenshots/task-notifications.png +0 -0
  35. package/screenshots/task-notifications_en.png +0 -0
package/README.en.md CHANGED
@@ -5,16 +5,17 @@
5
5
  # 🛠️ dsh-service
6
6
 
7
7
  <p align="center">
8
- <strong>A service-control &amp; operations plugin for self-hosted DeepSeek Harness (DSH) Web.</strong><br>
9
- <em>面向自托管 DeepSeek Harness (DSH) Web 的服务控制与运维插件。</em>
8
+ <strong>A service-control &amp; operations plugin for DeepSeek Harness (DSH) Web.</strong><br>
9
+ <em>DeepSeek Harness (DSH) Web 服务控制与运维插件。</em>
10
10
  </p>
11
11
 
12
- [![Version](https://img.shields.io/badge/version-0.39.0-3b82f6.svg?style=flat-square)](package.json)
12
+ [![Version](https://img.shields.io/badge/version-0.41.0-3b82f6.svg?style=flat-square)](package.json)
13
13
  [![License: MIT](https://img.shields.io/badge/License-MIT-10b981.svg?style=flat-square)](LICENSE)
14
14
  [![DSH Compatibility](https://img.shields.io/badge/DSH-%E2%89%A50.1.1--rc.2-6366f1.svg?style=flat-square)](https://github.com/deepseek-ai/deepseek-harness)
15
15
  [![Cordis](https://img.shields.io/badge/Cordis-v4.x-f59e0b.svg?style=flat-square)](https://cordis.moe/)
16
16
  [![Platform](https://img.shields.io/badge/platform-DSH%20Web-ec4899.svg?style=flat-square)](https://github.com/gehennawu/dsh-service)
17
17
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/gehennawu/dsh-service/issues)
18
+ [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
18
19
 
19
20
  <p align="center">
20
21
  <a href="#-features">Features</a> •
@@ -32,7 +33,7 @@
32
33
 
33
34
  </div>
34
35
 
35
- A service-control and operations plugin for self-hosted DSH Web: safe restart, version management and one-click upgrade, health diagnostics, model-usage statistics, quota lookup, backup management, task notifications, skills management, session management, and Linux file-permission maintenance.
36
+ A service-control and operations plugin for DSH Web: safe restart, version management and one-click upgrade, health diagnostics, model-usage statistics, quota lookup, backup management, task notifications, skills management, session management, and Linux file-permission maintenance.
36
37
 
37
38
  ![Overview](./screenshots/overview_en.png)
38
39
 
@@ -54,6 +55,20 @@ Under **Plugins → Plugin configuration**, ten host-level switches: **Health di
54
55
 
55
56
  ![Plugin configuration](./screenshots/plugin-config_en.png)
56
57
 
58
+ ### Overview (six sections)
59
+
60
+ - Status summary (error → warning → info → normal aggregation with a status dot) → actionable items (only when present) → version and runtime → metrics grid → fixed core actions (health check / quota lookup / create backup, gated by feature switches) → recent errors (rendered only when non-empty, collapsed by default)
61
+ - Aggregation rules: any health/diagnostics/backup/statistics/quota/restart failure is error; permission issues, non-advisory diagnostic warnings, and quota windows at ≥80% usage are warning; available updates, manual-start runtime, and no backups yet are info
62
+
63
+ ### Maintenance and Configuration pages
64
+
65
+ ![Maintenance page](./screenshots/maintenance_en.png)
66
+
67
+ ![Configuration page](./screenshots/configuration_en.png)
68
+
69
+ - Maintenance groups Sessions, Skills, Subagents, Backups, and Restart; it remembers the most recent subpage and falls back to an available item when a feature is disabled
70
+ - Configuration groups feature switches and task notifications; switches are grouped and apply live, while the Notifications entry stays visible but disabled when that feature is off
71
+
57
72
  ### Version and updates
58
73
 
59
74
  - Shows the current DSH and plugin versions, linking to GitHub Releases
@@ -75,24 +90,24 @@ Under **Plugins → Plugin configuration**, ten host-level switches: **Health di
75
90
  ![Health diagnostics](./screenshots/health-diagnostics_en.png)
76
91
 
77
92
  - Uptime, memory, session count, active agents, and background jobs; a "Process and runtime" card shows platform, architecture, and Node version
78
- - Full diagnostics: session storage, workspace registry, backup storage, tar availability, file permissions, runtime environment, and Node version
79
- - File-permission deep scan and repair (two-step confirmation)
93
+ - Full diagnostics: session storage, workspace registry, backup storage, tar availability, file permissions, runtime environment, and Node version — rendered as a two-line check list (name + status dot / detail) with abnormal rows locally emphasized
94
+ - File-permission deep scan and repair (two-step confirmation) behind a collapsed "Permissions & repair" section
80
95
  - Suspected manual launch → yellow "no restart assurance" caution; no backups is informational only and never lights the ⚠
81
96
 
82
97
  ### Model statistics
83
98
 
84
99
  ![Model statistics](./screenshots/model-usage_en.png)
85
100
 
86
- - 7-day stacked bar chart of input / output / cache tokens; filter by project, hover for exact values
101
+ - 7-day stacked bar chart of input / output / cache tokens; filter by project, hover for exact values; legend and refresh live in a unified region header; an accessible text summary accompanies the chart
87
102
  - Per-model horizontal bars with a "Today / Last 7 days / All time" toggle
88
- - Last-24-hour model/tool errors (collapsed by default)
103
+ - Last-24-hour model/tool errors (collapsed by default, rendered only when present)
89
104
  - Steps whose provider reports no token usage are excluded
90
105
 
91
106
  ### Quota lookup
92
107
 
93
108
  ![Quota lookup](./screenshots/quota-lookup_en.png)
94
109
 
95
- - Provider cards: per-window percentage, independent bar, and reset countdown; force refresh, official usage-page links, and card reordering
110
+ - Provider cards keep the existing window presentation (label + percent / independent bar / reset countdown); **advanced configuration** (credentials, kind switching, manual reset entries) is collapsed per card by default
96
111
  - A **quota ring** in the conversation composer follows the current session's model provider and shows the tightest budget window (<80% green, ≥80% amber); clicking opens a detail panel that becomes a centered overlay on narrow screens
97
112
  - Built-in adaptations:
98
113
 
@@ -116,9 +131,13 @@ Under **Plugins → Plugin configuration**, ten host-level switches: **Health di
116
131
 
117
132
  ![Backup management](./screenshots/backup-management_en.png)
118
133
 
119
- - Creates `.tar.gz` archives of sessions, configuration, and plugin-profile manifests
120
- - Export download / import upload / delete (two-step confirmation); unlimited, never auto-pruned
121
- - Restore: extract and overwrite to the corresponding paths, then restarts automatically after confirmation
134
+ - Backup records use light two-line rows (name on the first line, size · time on the second, separator layout; same style as the session list)
135
+
136
+ - Creates `.tar.gz` archives of sessions, configuration, and plugin-profile manifests; sessions are snapshotted through the persistence layer's stable-read seam (active-agent writes no longer fail creation), and creation shows one continuous phase progress bar (copy / pack / verify / publish, step counter 1/4–4/4, real percentage during copy)
137
+ - Export download / import upload / delete (two-step confirmation); unlimited, never auto-pruned; imported archives must pass the same integrity inspection used by restore
138
+ - **Integrity inspection** validates gzip/tar structure, paths, and entry types. Only `sessions`, the three allowlisted config files, and `profiles/<name>/package.json` are accepted; traversal, links, special files, unknown content, corrupt archives, and invalid profile manifests are rejected
139
+ - **Restore preflight** produces a single-use five-minute plan showing the full sessions replacement, config replacements/removals, and profile-manifest updates. Final commit rechecks the archive SHA-256 and current-target fingerprint; any drift rejects the restore
140
+ - Restore uses a transaction journal and rollback directory: sessions are replaced in full, config is made exact to the snapshot, and profiles update package.json only while keeping node_modules, credentials, and attachments. Managed runtimes restart automatically; manual launches receive hand-restart instructions
122
141
 
123
142
  ### Skills management
124
143
 
@@ -127,7 +146,7 @@ Under **Plugins → Plugin configuration**, ten host-level switches: **Health di
127
146
  - Lists local skills in three sections — **auto-loaded / manual-only / fully disabled**; same-name shadowing marks both copies, bundled directories are read-only
128
147
  - Two switches edit the SKILL.md frontmatter directly (`disable-model-invocation` / `user-invocable`); changes go live within ~200 ms
129
148
  - Entries with legacy camelCase keys are dropped by the official parser: ⚠ warning + one-click canonical fix
130
- - ✨ Fill with AI: pick a model to draft a description (follows the UI language), saved to a plugin sidecar index — **SKILL.md is never modified**; one-click batch fill runs in the host background and can be cancelled
149
+ - ✨ Fill with AI: pick a model to draft a description (follows the UI language), saved to a plugin sidecar index — **SKILL.md is never modified**; one-click batch fill runs in the host background and can be cancelled. Already-annotated skills are listed separately in the plan and are only overwritten after a "Confirm forced refill" second confirmation (annotating no longer blocks future batch fills forever); completion-log timestamps use your local timezone
131
150
 
132
151
  ### Subagent model
133
152
 
@@ -144,7 +163,8 @@ Under **Plugins → Plugin configuration**, ten host-level switches: **Health di
144
163
 
145
164
  ![Task notifications](./screenshots/task-notifications_en.png)
146
165
 
147
- - Browser notification when a session finishes its turn or your approval / plan review / answer is needed; clicking focuses the page
166
+ - Browser notification when a root session finishes its turn or any session needs approval / plan review / an answer; subagent completion is silent; clicking focuses the page
167
+ - Subagent approval / plan-review / question requests still notify
148
168
  - Four independent toggles: master, task completion, approvals & questions, composer-bell visibility
149
169
  - The composer bell toggles the master switch quickly; all toggles persist across reloads
150
170
 
@@ -329,7 +349,7 @@ The token expired (the official `oasis-token is embezzled` error means the token
329
349
  <details>
330
350
  <summary><strong>What does restoring a backup do?</strong></summary>
331
351
 
332
- It extracts and overwrites the corresponding paths (sessions, config, plugin profiles) and restarts automatically after the two-step confirmation. Deleting a backup also requires two-step confirmation.
352
+ The host first runs an integrity inspection and presents a restore-preflight plan for final confirmation. Immediately before commit it rechecks the backup SHA-256, current-target fingerprint, and running work; any change aborts without a partial overwrite or restart. A successful commit replaces sessions in full, makes the allowlisted config files exact to the snapshot, and updates only each profile's package.json (node_modules, credentials, and attachments stay untouched). Docker/systemd/pm2-style managed runtimes restart automatically; likely terminal-launched instances show manual-restart instructions. Deleting a backup also requires two-step confirmation.
333
353
  </details>
334
354
 
335
355
  <details>
package/README.md CHANGED
@@ -5,16 +5,17 @@
5
5
  # 🛠️ dsh-service
6
6
 
7
7
  <p align="center">
8
- <strong>面向自托管 DeepSeek Harness (DSH) Web 的服务控制与运维插件</strong><br>
9
- <em>A service-control &amp; operations plugin for self-hosted DeepSeek Harness (DSH) Web.</em>
8
+ <strong>DeepSeek Harness (DSH) Web 服务控制与运维插件</strong><br>
9
+ <em>A service-control &amp; operations plugin for DeepSeek Harness (DSH) Web.</em>
10
10
  </p>
11
11
 
12
- [![Version](https://img.shields.io/badge/version-0.39.0-3b82f6.svg?style=flat-square)](package.json)
12
+ [![Version](https://img.shields.io/badge/version-0.41.0-3b82f6.svg?style=flat-square)](package.json)
13
13
  [![License: MIT](https://img.shields.io/badge/License-MIT-10b981.svg?style=flat-square)](LICENSE)
14
14
  [![DSH Compatibility](https://img.shields.io/badge/DSH-%E2%89%A50.1.1--rc.2-6366f1.svg?style=flat-square)](https://github.com/deepseek-ai/deepseek-harness)
15
15
  [![Cordis](https://img.shields.io/badge/Cordis-v4.x-f59e0b.svg?style=flat-square)](https://cordis.moe/)
16
16
  [![Platform](https://img.shields.io/badge/platform-DSH%20Web-ec4899.svg?style=flat-square)](https://github.com/gehennawu/dsh-service)
17
17
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/gehennawu/dsh-service/issues)
18
+ [![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com)
18
19
 
19
20
  <p align="center">
20
21
  <a href="#-功能">功能</a> •
@@ -32,7 +33,7 @@
32
33
 
33
34
  </div>
34
35
 
35
- 面向自托管 DSH Web 的服务控制与运维插件:安全重启、版本管理与一键升级、健康诊断、模型用量统计、额度查询、备份管理、任务通知、技能管理、会话管理与 Linux 文件权限维护。
36
+ DSH Web 服务控制与运维插件:安全重启、版本管理与一键升级、健康诊断、模型用量统计、额度查询、备份管理、任务通知、技能管理、会话管理与 Linux 文件权限维护。
36
37
 
37
38
  ![概览](./screenshots/overview.png)
38
39
 
@@ -54,6 +55,20 @@
54
55
 
55
56
  ![插件配置](./screenshots/plugin-config.png)
56
57
 
58
+ ### 概览(六段式)
59
+
60
+ - 状态摘要(error → warning → info → normal 聚合,带状态点)→ 可行动项(仅在存在时)→ 版本与运行环境 → 指标格 → 固定核心操作(健康检查 / 额度查询 / 创建备份,随功能开关门控)→ 近期报错(仅非空时渲染,默认折叠)
61
+ - 状态聚合规则:健康/诊断/备份/统计/额度/重启任一失败即 error;权限异常、非咨询性诊断警告、额度窗口使用率 ≥80% 为 warning;可更新、手动启动环境、尚无备份为 info
62
+
63
+ ### 维护与配置聚合页
64
+
65
+ ![维护页](./screenshots/maintenance.png)
66
+
67
+ ![配置页](./screenshots/configuration.png)
68
+
69
+ - 「维护」集中会话管理、技能、子代理、备份维护与重启;记住最近使用的子页,关闭对应功能后自动回退到仍可用的项目
70
+ - 「配置」集中功能开关与任务通知;开关按功能组展示并热生效,任务通知关闭时保留入口但显示置灰状态
71
+
57
72
  ### 版本与更新
58
73
 
59
74
  - 显示当前 DSH 与插件版本,链接 GitHub Releases
@@ -75,21 +90,23 @@
75
90
  ![健康诊断](./screenshots/health-diagnostics.png)
76
91
 
77
92
  - 运行时间、内存、会话数、活跃 Agent 与后台任务;「进程与运行环境」卡显示平台、架构与 Node 版本
78
- - 完整诊断:会话存储、工作区注册表、备份目录、tar 可用性、文件权限、运行环境与 Node 版本
79
- - 文件权限深检与修复(两段式确认)
93
+ - 完整诊断:会话存储、工作区注册表、备份目录、tar 可用性、文件权限、运行环境与 Node 版本——**两行检查清单**(检查名+状态点 / 详情),异常行局部淡染强调、正常行低对比
94
+ - 文件权限深检与修复(两段式确认)收敛在**默认折叠**的「权限与修复」区(有异常时按钮显示计数)
80
95
  - 疑似手动启动 → 黄色警示「重启无保障」;无备份属信息级提示,不点亮 ⚠
81
96
 
82
97
  ### 模型统计
83
98
 
84
99
  ![模型统计](./screenshots/model-usage.png)
85
100
 
86
- - 近 7 天输入 / 输出 / 缓存 token 堆叠柱图,按项目筛选、悬停显示精确值
101
+ - 近 7 天输入 / 输出 / 缓存 token 堆叠柱图,按项目筛选、悬停显示精确值;**图例与刷新统一收进统计区头部行**,图表带可访问的文本摘要
87
102
  - 模型明细横条,列表头部「今日 / 近 7 天 / 累计」切换
88
- - 最近 24 小时模型 / 工具报错统计(默认折叠)
103
+ - 最近 24 小时模型 / 工具报错统计(默认折叠、仅非空渲染)
89
104
  - 提供方未上报 token 用量的步骤不纳入统计
90
105
 
91
106
  ### 额度查询
92
107
 
108
+ - 供应商卡片保留既有窗口展示(标签+百分比 / 独立进度条 / 重置倒计时);**高级配置**(凭据填写、类型切换、手动重置录入)默认折叠,按卡展开
109
+
93
110
  ![额度查询](./screenshots/quota-lookup.png)
94
111
 
95
112
  - 卡片分区展示各供应商:窗口百分比、独立进度条、重置时间;支持强制刷新、官网用量页链接与卡片排序
@@ -116,9 +133,13 @@
116
133
 
117
134
  ![备份管理](./screenshots/backup-management.png)
118
135
 
119
- - 创建会话、配置与插件 profile 清单的 `.tar.gz` 归档
120
- - 导出下载 / 导入上传 / 删除(两段式确认);不限份数、不自动清理
121
- - 恢复:解压覆盖对应路径,确认后自动重启
136
+ - 备份记录列表为两行轻行(文件名主行 + 体积 · 时间次行,分隔线布局;会话管理列表同款)
137
+
138
+ - 创建会话、配置与插件 profile 清单的 `.tar.gz` 归档;会话经持久化层稳定快照(活跃 agent 写入不再导致失败),创建过程以单条连续进度条分阶段显示(复制/打包/校验/发布,带步骤号 1/4–4/4,复制阶段为真实百分比)
139
+ - 导出下载 / 导入上传 / 删除(两段式确认);不限份数、不自动清理;导入归档必须先通过与恢复相同的完整性检查
140
+ - **完整性检查**:恢复前校验 gzip/tar、路径与条目类型,只接受 `sessions`、三份允许配置和 `profiles/<name>/package.json`;拒绝越界路径、链接、特殊文件、未知内容、损坏归档与非法 profile 清单
141
+ - **恢复预检**:先生成 5 分钟有效的一次性计划,展示会话整体替换、配置覆盖/移除和 profile manifest 覆盖清单;最终确认前再次校验归档 SHA-256 与当前目标指纹,发生漂移则拒绝执行
142
+ - 恢复提交使用事务日志和回滚目录:会话整体替换,配置按快照精确替换,profile 只更新 package.json 并保留 node_modules/凭据/附件;成功后托管环境自动重启,手动启动环境提示用户手动重启
122
143
 
123
144
  ### 技能管理
124
145
 
@@ -127,7 +148,7 @@
127
148
  - 按 **自动加载 / 仅手动调用 / 完全停用** 三区展示本地技能;同名遮蔽与被遮蔽副本均有标注,内置目录只读
128
149
  - 双开关直接改写 SKILL.md frontmatter(`disable-model-invocation` / `user-invocable`),约 200ms 热生效
129
150
  - 带 camelCase 旧版键的条目会被官方解析器剔除:⚠ 提示 + 一键修复
130
- - ✨ AI 补全说明:选模型生成描述草稿(跟随界面语言),确认后存入插件侧车索引——**绝不改写 SKILL.md**;支持一键批量补全(宿主后台运行、可取消)
151
+ - ✨ AI 补全说明:选模型生成描述草稿(跟随界面语言),确认后存入插件侧车索引——**绝不改写 SKILL.md**;支持一键批量补全(宿主后台运行、可取消)。已注释技能会在计划中单列,经「确认强制补全」二次确认后才会被覆盖(不再是一旦注释就永远无法再次补全);补全日志时间按本机时区显示
131
152
 
132
153
  ### 子代理模型
133
154
 
@@ -144,7 +165,8 @@
144
165
 
145
166
  ![任务通知](./screenshots/task-notifications.png)
146
167
 
147
- - 会话完成一轮任务、或需要授权 / 审阅计划 / 回答问题时发送浏览器通知;点击通知聚焦页面
168
+ - 主会话完成一轮任务、或会话需要授权 / 审阅计划 / 回答问题时发送浏览器通知;子代理完成任务不发送完成通知;点击通知聚焦页面
169
+ - 子代理触发授权 / 审阅计划 / 回答问题时仍发送浏览器通知
148
170
  - 四档独立开关:总开关、任务完成、授权与提问、输入框铃铛显隐
149
171
  - 对话栏铃铛一键开关总通知;所有开关刷新后保持
150
172
 
@@ -329,7 +351,7 @@ Step Plan 订阅没有 API-key 形态的查询接口,需要网页登录态令
329
351
  <details>
330
352
  <summary><strong>恢复备份会怎样?</strong></summary>
331
353
 
332
- 解压并覆盖到对应路径(会话、配置、插件 profile),两段式确认后自动重启生效。删除备份同样需要两段式确认。
354
+ 先做完整性检查并展示恢复预检计划,再由用户最终确认。提交前宿主会复检备份 SHA-256、当前目标指纹与运行中工作;任何变化都会中止,不会部分覆盖或重启。提交成功后会话目录整体替换,允许的配置文件按快照精确替换,profile 只覆盖 package.json(node_modules、凭据、附件不动)。受 Docker/systemd/pm2 等托管时自动重启;疑似终端手动启动时显示手动重启指引。删除备份同样需要两段式确认。
333
355
  </details>
334
356
 
335
357
  <details>