dsh-plugin 1.1.2 → 1.2.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 (110) hide show
  1. package/client/client.js +4469 -1445
  2. package/client/client.js.map +1 -1
  3. package/lib/http/routes.js +438 -22
  4. package/lib/index.js +1 -1
  5. package/lib/services/install/install.js +4 -0
  6. package/lib/services/install/npm-check.js +55 -0
  7. package/lib/services/{npm-resolve.js → install/npm-resolve.js} +7 -5
  8. package/lib/services/{preflight.js → install/preflight.js} +15 -4
  9. package/lib/services/{task-queue.js → install/task-queue.js} +155 -66
  10. package/lib/services/loader.js +56 -1
  11. package/lib/services/log.js +138 -0
  12. package/lib/services/probe.js +157 -0
  13. package/lib/services/{profile.js → profile/profile.js} +29 -1
  14. package/lib/services/settings.js +60 -0
  15. package/lib/types/http/routes.d.ts +1 -1
  16. package/lib/types/index.d.ts +1 -1
  17. package/lib/types/services/{install-types.d.ts → install/install-types.d.ts} +3 -0
  18. package/lib/types/services/{install.d.ts → install/install.d.ts} +5 -5
  19. package/lib/types/services/install/npm-check.d.ts +12 -0
  20. package/lib/types/services/{npm-resolve.d.ts → install/npm-resolve.d.ts} +2 -1
  21. package/lib/types/services/{task-queue.d.ts → install/task-queue.d.ts} +5 -1
  22. package/lib/types/services/loader.d.ts +14 -8
  23. package/lib/types/services/log.d.ts +49 -0
  24. package/lib/types/services/probe.d.ts +30 -0
  25. package/lib/types/services/{pending-restart.d.ts → profile/pending-restart.d.ts} +1 -1
  26. package/lib/types/services/{profile.d.ts → profile/profile.d.ts} +2 -0
  27. package/lib/types/services/settings.d.ts +24 -0
  28. package/package.json +1 -1
  29. package/src/client/components/PluginHubSection.tsx +341 -120
  30. package/src/client/components/{CatalogList.tsx → catalog/CatalogList.tsx} +11 -7
  31. package/src/client/components/{PluginCard.tsx → catalog/PluginCard.tsx} +5 -4
  32. package/src/client/components/layout/CatalogControls.tsx +80 -0
  33. package/src/client/components/{CatalogHeader.tsx → layout/CatalogHeader.tsx} +4 -4
  34. package/src/client/components/{CategoryTabs.tsx → layout/CategoryTabs.tsx} +3 -3
  35. package/src/client/components/layout/SectionTabs.tsx +60 -0
  36. package/src/client/components/{AboutModal.tsx → modals/AboutModal.tsx} +7 -7
  37. package/src/client/components/{HubUpdateModal.tsx → modals/HubUpdateModal.tsx} +5 -5
  38. package/src/client/components/modals/InstalledDetailModal.tsx +193 -0
  39. package/src/client/components/modals/LogsModal.tsx +301 -0
  40. package/src/client/components/modals/LogsPathModal.tsx +161 -0
  41. package/src/client/components/{NotificationsModal.tsx → modals/NotificationsModal.tsx} +47 -20
  42. package/src/client/components/{ProgressView.tsx → modals/ProgressView.tsx} +2 -2
  43. package/src/client/components/{modals.tsx → modals/modals.tsx} +117 -40
  44. package/src/client/components/{Dropdown.tsx → ui/Dropdown.tsx} +14 -6
  45. package/src/client/components/ui/Toggle.tsx +28 -0
  46. package/src/client/components/ui/icons.tsx +343 -0
  47. package/src/client/components/views/CustomInstallView.tsx +250 -0
  48. package/src/client/components/views/DiagnosticsView.tsx +172 -0
  49. package/src/client/components/views/InstalledView.tsx +328 -0
  50. package/src/client/components/views/LogsView.tsx +150 -0
  51. package/src/client/components/views/MarketView.tsx +66 -0
  52. package/src/client/components/views/SettingsView.tsx +273 -0
  53. package/src/client/data/catalog.ts +38 -0
  54. package/src/client/data/host.ts +107 -0
  55. package/src/client/data/hub.ts +41 -0
  56. package/src/client/hooks/useCatalog.ts +71 -115
  57. package/src/client/hooks/useIncrementalList.ts +46 -0
  58. package/src/client/hooks/useLanguage.ts +40 -0
  59. package/src/client/hooks/useSettings.ts +90 -0
  60. package/src/client/hooks/useTaskQueue.ts +156 -39
  61. package/src/client/locales.ts +358 -38
  62. package/src/client/logic/constants.ts +87 -0
  63. package/src/client/{lib → logic}/failures.ts +95 -74
  64. package/src/client/logic/install-command.ts +56 -0
  65. package/src/client/logic/installed.ts +207 -0
  66. package/src/client/logic/normalize.ts +52 -0
  67. package/src/client/logic/urls.ts +125 -0
  68. package/src/client/styles/CustomInstallView.module.css +191 -0
  69. package/src/client/styles/DiagnosticsView.module.css +231 -0
  70. package/src/client/styles/Dropdown.module.css +42 -41
  71. package/src/client/styles/Header.module.css +100 -132
  72. package/src/client/styles/InstalledView.module.css +447 -0
  73. package/src/client/styles/List.module.css +6 -0
  74. package/src/client/styles/LogsView.module.css +503 -0
  75. package/src/client/styles/Modal.module.css +352 -70
  76. package/src/client/styles/SectionTabs.module.css +142 -0
  77. package/src/client/styles/SettingsView.module.css +232 -0
  78. package/src/client/styles/Toggle.module.css +60 -0
  79. package/src/client/styles/tokens.module.css +1 -0
  80. package/src/client/types.ts +23 -3
  81. package/src/server/http/routes.ts +414 -22
  82. package/src/server/index.ts +1 -1
  83. package/src/server/services/{install-types.ts → install/install-types.ts} +3 -1
  84. package/src/server/services/{install.ts → install/install.ts} +5 -5
  85. package/src/server/services/install/npm-check.ts +53 -0
  86. package/src/server/services/{npm-resolve.ts → install/npm-resolve.ts} +7 -5
  87. package/src/server/services/{preflight.ts → install/preflight.ts} +16 -4
  88. package/src/server/services/{task-queue.ts → install/task-queue.ts} +157 -63
  89. package/src/server/services/loader.ts +55 -1
  90. package/src/server/services/log.ts +167 -0
  91. package/src/server/services/probe.ts +157 -0
  92. package/src/server/services/{pending-restart.ts → profile/pending-restart.ts} +1 -1
  93. package/src/server/services/{profile.ts → profile/profile.ts} +31 -1
  94. package/src/server/services/settings.ts +79 -0
  95. package/lib/services/install.js +0 -4
  96. package/src/client/components/CatalogControls.tsx +0 -108
  97. package/src/client/components/icons.tsx +0 -129
  98. package/src/client/lib/catalog.ts +0 -293
  99. package/src/client/lib/env.ts +0 -20
  100. /package/lib/services/{install-types.js → install/install-types.js} +0 -0
  101. /package/lib/services/{installed-versions.js → profile/installed-versions.js} +0 -0
  102. /package/lib/services/{pending-restart.js → profile/pending-restart.js} +0 -0
  103. /package/lib/services/{progress.js → profile/progress.js} +0 -0
  104. /package/lib/types/services/{preflight.d.ts → install/preflight.d.ts} +0 -0
  105. /package/lib/types/services/{installed-versions.d.ts → profile/installed-versions.d.ts} +0 -0
  106. /package/lib/types/services/{progress.d.ts → profile/progress.d.ts} +0 -0
  107. /package/src/client/{lib → logic}/format.ts +0 -0
  108. /package/src/client/{lib → logic}/renderMarkdown.ts +0 -0
  109. /package/src/server/services/{installed-versions.ts → profile/installed-versions.ts} +0 -0
  110. /package/src/server/services/{progress.ts → profile/progress.ts} +0 -0
@@ -0,0 +1,232 @@
1
+ /* DSH-Plugin Hub — the community plugin marketplace for DeepSeek Harness.
2
+ * Website: https://dsh-plugin.org
3
+ * GitHub: https://github.com/dshplugin/dsh-plugin-hub
4
+ *
5
+ * Settings view: desktop-settings navigation — a fixed left sidebar lists
6
+ * the sections (icon + label, click to switch), the right pane shows one
7
+ * card per active section (rows: label left, control right, hairline
8
+ * separators). High density, no whitespace waste: rows are 12px padding,
9
+ * 28px controls, 11px descriptions. */
10
+
11
+ /* 整体:占满剩余高度,左导航右内容两栏 */
12
+ .root {
13
+ flex: 1;
14
+ min-width: 0;
15
+ min-height: 0;
16
+ display: flex;
17
+ align-items: stretch;
18
+ }
19
+
20
+ /* —— 左侧导航:宽度自适应文字,不加背景,仅用右侧细边框与内容区分 ——
21
+ 导航独立滚动,内容区域可独立滚动 */
22
+
23
+ .sidebar {
24
+ flex: none;
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: 2px;
28
+ padding: 8px 6px;
29
+ border-right: 1px solid var(--hub-border-1);
30
+ overflow-y: auto;
31
+ }
32
+
33
+ .navItem,
34
+ .navItemActive {
35
+ display: flex;
36
+ align-items: center;
37
+ gap: 8px;
38
+ width: 100%;
39
+ box-sizing: border-box;
40
+ padding: 7px 10px;
41
+ border: none;
42
+ border-radius: 7px;
43
+ font-size: 12.5px;
44
+ line-height: 18px;
45
+ text-align: left;
46
+ cursor: pointer;
47
+ user-select: none;
48
+ transition: color 120ms ease, background-color 120ms ease;
49
+ }
50
+
51
+ .navItem {
52
+ color: var(--hub-text-secondary);
53
+ background: transparent;
54
+ }
55
+
56
+ .navItem:hover {
57
+ color: var(--hub-text-primary);
58
+ background: var(--hub-bg-hover);
59
+ }
60
+
61
+ .navItemActive {
62
+ color: var(--hub-brand);
63
+ background: var(--hub-brand-tint);
64
+ font-weight: 600;
65
+ }
66
+
67
+ .navIcon {
68
+ flex: none;
69
+ display: inline-flex;
70
+ }
71
+
72
+ /* —— 右侧内容:只渲染当前分组,独立滚动 —— */
73
+
74
+ .content {
75
+ flex: 1;
76
+ min-width: 0;
77
+ min-height: 0;
78
+ display: flex;
79
+ flex-direction: column;
80
+ padding: 14px 16px 18px;
81
+ overflow-y: auto;
82
+ }
83
+
84
+ /* 页面标题 + 副标题:桌面设置质感的一行说明 */
85
+ .pageHeader {
86
+ margin-bottom: 12px;
87
+ }
88
+
89
+ .pageTitle {
90
+ font-size: 14px;
91
+ line-height: 20px;
92
+ font-weight: 600;
93
+ color: var(--hub-text-primary);
94
+ }
95
+
96
+ .pageDesc {
97
+ margin-top: 3px;
98
+ font-size: 11.5px;
99
+ line-height: 16px;
100
+ color: var(--hub-text-tertiary);
101
+ }
102
+
103
+ /* 设置卡片:一页一个,内部一行一设置 */
104
+ .card {
105
+ display: flex;
106
+ flex-direction: column;
107
+ min-width: 0;
108
+ border: 1px solid var(--hub-border-1);
109
+ border-radius: 8px;
110
+ background: var(--hub-bg-1);
111
+ /* 不裁切:镜像源下拉浮层绝对定位在卡片内,overflow:hidden 会把浮层截掉 */
112
+ }
113
+
114
+ /* 设置行:标签(标题 + 说明)左、控件右,hairline 分隔,最后一行无分隔线 */
115
+ .settingRow {
116
+ display: flex;
117
+ align-items: center;
118
+ justify-content: space-between;
119
+ gap: 16px;
120
+ padding: 10px 12px;
121
+ min-width: 0;
122
+ border-bottom: 1px solid var(--hub-border-1);
123
+ }
124
+
125
+ .settingRow:last-child {
126
+ border-bottom: none;
127
+ }
128
+
129
+ .settingLabel {
130
+ flex: 1;
131
+ min-width: 0;
132
+ }
133
+
134
+ .settingTitle {
135
+ font-size: 12.5px;
136
+ line-height: 18px;
137
+ font-weight: 500;
138
+ color: var(--hub-text-primary);
139
+ white-space: nowrap;
140
+ overflow: hidden;
141
+ text-overflow: ellipsis;
142
+ }
143
+
144
+ .settingDesc {
145
+ margin-top: 2px;
146
+ font-size: 11px;
147
+ line-height: 15px;
148
+ color: var(--hub-text-tertiary);
149
+ }
150
+
151
+ .settingControl {
152
+ flex: none;
153
+ display: flex;
154
+ align-items: center;
155
+ }
156
+
157
+ /* 文本框独占一行的变体:标签在上、输入框在下整行展开(代理地址、自定义镜像源) */
158
+ .settingRowStack {
159
+ display: flex;
160
+ flex-direction: column;
161
+ align-items: stretch;
162
+ gap: 8px;
163
+ padding: 10px 12px;
164
+ min-width: 0;
165
+ border-bottom: 1px solid var(--hub-border-1);
166
+ }
167
+
168
+ .settingRowStack:last-child {
169
+ border-bottom: none;
170
+ }
171
+
172
+ .settingControlStack {
173
+ display: flex;
174
+ align-items: center;
175
+ }
176
+
177
+ .settingControlStack .textInput {
178
+ width: 100%;
179
+ }
180
+
181
+ /* 下拉控件:行内固定宽度,与输入框等高 */
182
+ .controlDropdown {
183
+ min-width: 180px;
184
+ }
185
+
186
+ /* 文本输入(镜像源 / 代理):28px 高,与全局搜索框一致,右边距紧凑 */
187
+ .textInput {
188
+ width: 240px;
189
+ height: 28px;
190
+ padding: 0 9px;
191
+ font-size: 12px;
192
+ font-family: inherit;
193
+ color: var(--hub-text-primary);
194
+ background: var(--hub-bg-1);
195
+ border: 1px solid var(--hub-border-input);
196
+ border-radius: 6px;
197
+ outline: none;
198
+ transition: border-color 0.15s ease;
199
+ }
200
+
201
+ .textInput:focus {
202
+ border-color: var(--hub-brand-border);
203
+ }
204
+
205
+ .textInput::placeholder {
206
+ color: var(--hub-text-disabled);
207
+ }
208
+
209
+ /* —— 恢复默认:独立设置卡片内的危险按钮 —— */
210
+
211
+ /* 恢复默认按钮:红字描边次级按钮,点击弹出确认窗后再真正重置 */
212
+ .resetBtn {
213
+ flex: none;
214
+ height: 28px;
215
+ padding: 0 14px;
216
+ font-size: 12px;
217
+ font-weight: 500;
218
+ border-radius: 6px;
219
+ cursor: pointer;
220
+ transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
221
+ }
222
+
223
+ .resetBtn {
224
+ color: var(--hub-danger-text);
225
+ background: transparent;
226
+ border: 1px solid var(--hub-danger-border);
227
+ }
228
+
229
+ .resetBtn:hover {
230
+ background: var(--hub-danger-tint);
231
+ border-color: var(--hub-danger-text);
232
+ }
@@ -0,0 +1,60 @@
1
+ /* DSH-Plugin Hub — the community plugin marketplace for DeepSeek Harness.
2
+ * Website: https://dsh-plugin.org
3
+ * GitHub: https://github.com/dshplugin/dsh-plugin-hub
4
+ *
5
+ * Toggle switch for settings rows: a small 34×18 track with a sliding
6
+ * knob. Off = neutral hairline track; on = brand fill. Sized for the
7
+ * compact settings row height (18px vs the 28px input rows), so labels
8
+ * stay vertically centered without extra whitespace. */
9
+
10
+ .toggle,
11
+ .toggleOn {
12
+ display: inline-flex;
13
+ align-items: center;
14
+ flex: none;
15
+ width: 34px;
16
+ height: 18px;
17
+ padding: 0;
18
+ border: none;
19
+ border-radius: 999px;
20
+ cursor: pointer;
21
+ transition: background-color 0.15s ease;
22
+ }
23
+
24
+ .toggle {
25
+ background: var(--hub-bg-3);
26
+ box-shadow: inset 0 0 0 1px var(--hub-border-2);
27
+ }
28
+
29
+ .toggle:hover {
30
+ background: var(--hub-bg-hover);
31
+ }
32
+
33
+ .toggleOn {
34
+ background: var(--hub-brand);
35
+ }
36
+
37
+ .toggleOn:hover {
38
+ background: var(--hub-brand-hover);
39
+ }
40
+
41
+ .toggle:disabled,
42
+ .toggleOn:disabled {
43
+ opacity: 0.5;
44
+ cursor: not-allowed;
45
+ }
46
+
47
+ .knob {
48
+ display: block;
49
+ width: 14px;
50
+ height: 14px;
51
+ border-radius: 999px;
52
+ background: #ffffff;
53
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
54
+ transition: transform 0.15s ease;
55
+ transform: translateX(2px);
56
+ }
57
+
58
+ .toggleOn .knob {
59
+ transform: translateX(18px);
60
+ }
@@ -69,6 +69,7 @@ body[data-ds-dark-theme] {
69
69
 
70
70
  /* warning (deep amber) */
71
71
  --hub-warning: var(--dsw-alias-state-warning-primary, #b45309);
72
+ --hub-warning-hover: #92400e;
72
73
  --hub-warning-tint: rgba(180, 83, 9, 0.08);
73
74
  --hub-warning-border: rgba(180, 83, 9, 0.3);
74
75
 
@@ -51,8 +51,11 @@ export interface HubPlugin {
51
51
  features?: string[]
52
52
  description?: string
53
53
  source?: { repo?: string; npmPackage?: string }
54
- /** 能否网页一键安装:false = 仅支持命令行/git/本地构建安装(缺省视为 true 可安装) */
55
- install?: { webInstallable?: boolean }
54
+ /** 安装信息:能否网页一键安装(false = 仅支持命令行/专属 profile,缺省视为 true);
55
+ * command/githubCommand = 目录下发的权威安装命令(npm/git 通道各一条),
56
+ * 仅供展示/复制 —— CLI-only 插件(如 dsh-tui)需专属 profile(--profile dsh-tui),
57
+ * 无法从 repo/npm 包名推断,必须用目录命令。 */
58
+ install?: { webInstallable?: boolean; command?: string; githubCommand?: string }
56
59
  compatibility?: { status?: string }
57
60
  dates?: { repoUpdatedAt?: string; addedAt?: string }
58
61
  stats?: { stargazers_count?: number; forks_count?: number }
@@ -67,11 +70,13 @@ export interface TaskState {
67
70
  lines: string[]
68
71
  }
69
72
 
70
- export type ToastKind = 'copied' | 'errCopied' | 'done' | 'fail' | 'removed' | 'removeFail'
73
+ export type ToastKind = 'copied' | 'errCopied' | 'done' | 'fail' | 'removed' | 'removeFail' | 'revealFail' | 'updates'
71
74
 
72
75
  export interface ToastState {
73
76
  id: number
74
77
  kind: ToastKind
78
+ /** 「发现更新」类提示的插件数量(按 kind 语义使用) */
79
+ n?: number
75
80
  }
76
81
 
77
82
  /** 宿主机器环境快照(后端 /dsh-plugin-hub/env):提交 bug 时拼进 issue 正文,便于作者复现。 */
@@ -84,3 +89,18 @@ export interface EnvInfo {
84
89
  profile: string
85
90
  dshHome: string
86
91
  }
92
+
93
+ /** Worker 版本控制中心返回的 Hub 自我更新信息(notes 为 Markdown 变更记录)。 */
94
+ export interface HubUpdateInfo {
95
+ version: string
96
+ publishedAt?: string | null
97
+ /** Markdown 变更记录;可传字符串,或 { zh, en } 双语言对象按界面语言取 */
98
+ notes?: string | Record<string, string> | null
99
+ }
100
+
101
+ /** Worker 返回的「关注我们」内容(content 为 Markdown,可字符串或 {zh,en} 双语言对象)。 */
102
+ export interface HubAboutInfo {
103
+ /** Markdown 平台介绍 + 反馈群二维码;可传字符串,或 { zh, en } 双语言对象按界面语言取 */
104
+ content?: string | Record<string, string> | null
105
+ updatedAt?: string | null
106
+ }