dsh-plugin 1.1.1 → 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 (113) hide show
  1. package/README.en.md +5 -5
  2. package/README.md +5 -5
  3. package/client/client.js +4772 -1659
  4. package/client/client.js.map +1 -1
  5. package/lib/http/routes.js +451 -28
  6. package/lib/index.js +5 -1
  7. package/lib/services/{install-types.js → install/install-types.js} +8 -2
  8. package/lib/services/install/install.js +4 -0
  9. package/lib/services/install/npm-check.js +55 -0
  10. package/lib/services/{npm-resolve.js → install/npm-resolve.js} +11 -5
  11. package/lib/services/{preflight.js → install/preflight.js} +23 -7
  12. package/lib/services/{task-queue.js → install/task-queue.js} +166 -71
  13. package/lib/services/loader.js +60 -1
  14. package/lib/services/log.js +138 -0
  15. package/lib/services/probe.js +157 -0
  16. package/lib/services/{installed-versions.js → profile/installed-versions.js} +5 -1
  17. package/lib/services/{pending-restart.js → profile/pending-restart.js} +1 -1
  18. package/lib/services/{profile.js → profile/profile.js} +59 -4
  19. package/lib/services/{progress.js → profile/progress.js} +4 -0
  20. package/lib/services/settings.js +60 -0
  21. package/lib/types/http/routes.d.ts +1 -1
  22. package/lib/types/index.d.ts +5 -1
  23. package/lib/types/services/{install-types.d.ts → install/install-types.d.ts} +13 -4
  24. package/lib/types/services/{install.d.ts → install/install.d.ts} +9 -5
  25. package/lib/types/services/install/npm-check.d.ts +12 -0
  26. package/lib/types/services/{npm-resolve.d.ts → install/npm-resolve.d.ts} +2 -1
  27. package/lib/types/services/{task-queue.d.ts → install/task-queue.d.ts} +5 -1
  28. package/lib/types/services/loader.d.ts +14 -4
  29. package/lib/types/services/log.d.ts +49 -0
  30. package/lib/types/services/probe.d.ts +30 -0
  31. package/lib/types/services/{pending-restart.d.ts → profile/pending-restart.d.ts} +9 -3
  32. package/lib/types/services/{profile.d.ts → profile/profile.d.ts} +6 -2
  33. package/lib/types/services/{progress.d.ts → profile/progress.d.ts} +4 -0
  34. package/lib/types/services/settings.d.ts +24 -0
  35. package/package.json +1 -1
  36. package/src/client/components/PluginHubSection.tsx +346 -121
  37. package/src/client/components/{CatalogList.tsx → catalog/CatalogList.tsx} +15 -7
  38. package/src/client/components/{PluginCard.tsx → catalog/PluginCard.tsx} +10 -5
  39. package/src/client/components/layout/CatalogControls.tsx +80 -0
  40. package/src/client/components/{CatalogHeader.tsx → layout/CatalogHeader.tsx} +8 -4
  41. package/src/client/components/{CategoryTabs.tsx → layout/CategoryTabs.tsx} +7 -3
  42. package/src/client/components/layout/SectionTabs.tsx +60 -0
  43. package/src/client/components/{AboutModal.tsx → modals/AboutModal.tsx} +11 -7
  44. package/src/client/components/{HubUpdateModal.tsx → modals/HubUpdateModal.tsx} +9 -5
  45. package/src/client/components/modals/InstalledDetailModal.tsx +193 -0
  46. package/src/client/components/modals/LogsModal.tsx +301 -0
  47. package/src/client/components/modals/LogsPathModal.tsx +161 -0
  48. package/src/client/components/{NotificationsModal.tsx → modals/NotificationsModal.tsx} +51 -20
  49. package/src/client/components/{ProgressView.tsx → modals/ProgressView.tsx} +6 -2
  50. package/src/client/components/{modals.tsx → modals/modals.tsx} +121 -40
  51. package/src/client/components/{Dropdown.tsx → ui/Dropdown.tsx} +18 -6
  52. package/src/client/components/ui/Toggle.tsx +28 -0
  53. package/src/client/components/ui/icons.tsx +343 -0
  54. package/src/client/components/views/CustomInstallView.tsx +250 -0
  55. package/src/client/components/views/DiagnosticsView.tsx +172 -0
  56. package/src/client/components/views/InstalledView.tsx +328 -0
  57. package/src/client/components/views/LogsView.tsx +150 -0
  58. package/src/client/components/views/MarketView.tsx +66 -0
  59. package/src/client/components/views/SettingsView.tsx +273 -0
  60. package/src/client/data/catalog.ts +38 -0
  61. package/src/client/data/host.ts +107 -0
  62. package/src/client/data/hub.ts +41 -0
  63. package/src/client/hooks/useCatalog.ts +77 -117
  64. package/src/client/hooks/useIncrementalList.ts +46 -0
  65. package/src/client/hooks/useLanguage.ts +40 -0
  66. package/src/client/hooks/useSettings.ts +90 -0
  67. package/src/client/hooks/useTaskQueue.ts +168 -47
  68. package/src/client/index.tsx +4 -0
  69. package/src/client/locales.ts +365 -39
  70. package/src/client/logic/constants.ts +87 -0
  71. package/src/client/{lib → logic}/failures.ts +99 -74
  72. package/src/client/{lib → logic}/format.ts +4 -0
  73. package/src/client/logic/install-command.ts +56 -0
  74. package/src/client/logic/installed.ts +207 -0
  75. package/src/client/logic/normalize.ts +52 -0
  76. package/src/client/{lib → logic}/renderMarkdown.ts +4 -0
  77. package/src/client/logic/urls.ts +125 -0
  78. package/src/client/styles/CustomInstallView.module.css +191 -0
  79. package/src/client/styles/DiagnosticsView.module.css +231 -0
  80. package/src/client/styles/Dropdown.module.css +46 -41
  81. package/src/client/styles/Header.module.css +105 -133
  82. package/src/client/styles/InstalledView.module.css +447 -0
  83. package/src/client/styles/List.module.css +11 -1
  84. package/src/client/styles/LogsView.module.css +503 -0
  85. package/src/client/styles/Modal.module.css +357 -71
  86. package/src/client/styles/SectionTabs.module.css +142 -0
  87. package/src/client/styles/SettingsView.module.css +232 -0
  88. package/src/client/styles/Toggle.module.css +60 -0
  89. package/src/client/styles/tokens.module.css +6 -1
  90. package/src/client/types.ts +28 -4
  91. package/src/server/http/routes.ts +426 -28
  92. package/src/server/index.ts +5 -1
  93. package/src/server/services/{install-types.ts → install/install-types.ts} +13 -5
  94. package/src/server/services/{install.ts → install/install.ts} +9 -5
  95. package/src/server/services/install/npm-check.ts +53 -0
  96. package/src/server/services/{npm-resolve.ts → install/npm-resolve.ts} +11 -5
  97. package/src/server/services/{preflight.ts → install/preflight.ts} +24 -7
  98. package/src/server/services/{task-queue.ts → install/task-queue.ts} +168 -68
  99. package/src/server/services/loader.ts +59 -1
  100. package/src/server/services/log.ts +167 -0
  101. package/src/server/services/probe.ts +157 -0
  102. package/src/server/services/{installed-versions.ts → profile/installed-versions.ts} +5 -1
  103. package/src/server/services/{pending-restart.ts → profile/pending-restart.ts} +9 -3
  104. package/src/server/services/{profile.ts → profile/profile.ts} +58 -4
  105. package/src/server/services/{progress.ts → profile/progress.ts} +4 -0
  106. package/src/server/services/settings.ts +79 -0
  107. package/lib/services/install.js +0 -4
  108. package/src/client/components/CatalogControls.tsx +0 -104
  109. package/src/client/components/icons.tsx +0 -125
  110. package/src/client/lib/catalog.ts +0 -272
  111. package/src/client/lib/env.ts +0 -16
  112. /package/lib/types/services/{preflight.d.ts → install/preflight.d.ts} +0 -0
  113. /package/lib/types/services/{installed-versions.d.ts → profile/installed-versions.d.ts} +0 -0
@@ -1,4 +1,10 @@
1
- /** zh/en dictionaries for the DSH-Plugin Hub settings section. */
1
+ /**
2
+ * DSH-Plugin Hub — the community plugin marketplace for DeepSeek Harness.
3
+ * Website: https://dsh-plugin.org
4
+ * GitHub: https://github.com/dshplugin/dsh-plugin-hub
5
+ *
6
+ * zh/en dictionaries for the DSH-Plugin Hub settings section.
7
+ */
2
8
  export const zh = {
3
9
  nav: '插件中心',
4
10
  title: 'DSH-Plugin Hub',
@@ -9,10 +15,11 @@ export const zh = {
9
15
  ad: 'DSH-Plugin 插件中心:收录 {total} 款插件,{verified} 款人工精选验证,每日更新',
10
16
  search: '搜索插件名称、描述、标签…',
11
17
  all: '全部',
12
- sortStars: 'Star 最多',
13
- sortForks: 'Fork 最多',
18
+ sortStars: 'Star',
19
+ sortForks: 'Fork',
14
20
  sortUpdated: '最近更新',
15
21
  sortNewest: '最新收录',
22
+ sortAria: '插件排序方式',
16
23
  openHint: '打开 dsh-plugin.org',
17
24
  toggleLangHint: '切换界面语言',
18
25
  fork: 'Fork',
@@ -26,15 +33,169 @@ export const zh = {
26
33
  failedCopyHint: '安装失败。请复制上方安装命令到 dsh 终端手动执行(原生依赖构建脚本可能需要人工放行,如 pnpm approve-builds)',
27
34
  toastCopied: '安装命令已复制,去 dsh 终端粘贴即可安装',
28
35
  installed: '已安装',
29
- notInstalled: '未安装',
30
- filterAllHint: '显示全部插件',
31
- filterInstalledHint: '筛选当前分类下的已安装插件',
32
- filterNotInstalledHint: '筛选当前分类下的未安装插件',
33
- filterInstalledNone: '当前分类下没有已安装插件',
34
- filterNotInstalledNone: '当前分类下没有未安装插件',
36
+ // 一级导航:插件中心 / 已安装 / 自定义安装 / 设置
37
+ viewMarket: '插件中心',
38
+ viewInstalled: '已安装',
39
+ viewCustom: '自定义安装',
40
+ viewSettings: '设置',
41
+ viewMarketHint: '浏览与发现插件',
42
+ viewInstalledHint: '管理已安装插件',
43
+ viewCustomHint: '手动安装 NPM 包或 GitHub 源码',
44
+ viewSettingsHint: '网络通道与偏好设置',
45
+ // 已安装视图
46
+ installedEmpty: '还没有安装插件',
47
+ installedEmptyDesc: '可以去「自定义安装」,手动安装 NPM 包或 GitHub 源码',
48
+ npmInstallLabel: 'NPM 包',
49
+ npmInstallPlaceholder: '输入 npm 包名',
50
+ npmInstallExample: '例如:lodash、@scope/pkg',
51
+ npmInstallInvalid: '请输入 npm 包名,例如:lodash、@scope/pkg',
52
+ gitInstallLabel: 'GitHub 源码',
53
+ gitInstallPlaceholder: '输入仓库地址',
54
+ gitInstallExample: '例如:owner/repo 或 https://github.com/owner/repo',
55
+ gitInstallInvalid: '请输入 GitHub 仓库地址,例如:owner/repo 或 https://github.com/owner/repo',
56
+ dshCmdLabel: 'DeepSeek Harness 命令',
57
+ dshCmdPlaceholder: '粘贴安装命令(npm install -g 或 dsh plugin add)',
58
+ dshCmdExample: '例如:npm install -g @scope/cli 或 dsh plugin add github:owner/repo',
59
+ dshCmdInvalid: '支持 npm install -g <包名> 全局安装,或完整 dsh plugin 命令。例如:npm install -g @scope/cli',
60
+ globalNpmHint: '将全局安装 CLI 工具(npm install -g),不会出现在「已安装」列表,无需重启宿主',
61
+ installCliBtn: '安装',
62
+ // 安装通道关闭(安全信任开关关掉后,对应卡片禁用并引导去设置打开)
63
+ channelDisabledHint: '该安装通道已关闭,请在「设置 → 安全信任」中打开开关',
64
+ goToSettings: '前往设置',
65
+ // 自定义安装视图:独立一级导航,说明文字
66
+ customViewDesc: '手动安装目录外的 NPM 包、GitHub 源码,或粘贴官方安装命令(npm install -g / dsh plugin add)。装完的条目会出现在「已安装」列表,并标记为自定义安装。',
67
+ customLabel: '自定义安装',
68
+ installedSearch: '搜索已安装的插件…',
69
+ installedFilterCatalog: '目录插件',
70
+ hubInstall: '插件中心',
71
+ hubInstallHint: '来自插件中心收录的目录插件',
72
+ manualInstall: '手动安装',
73
+ manualInstallHint: '非目录收录,通过命令行手动安装',
74
+ filterByLabel: '来源',
75
+ sortByLabel: '排序',
76
+ sortName: '名称',
77
+ sortInstalledAt: '最近',
78
+ detailTitle: '插件详情',
79
+ detailCategory: '分类',
80
+ detailStats: '仓库统计',
81
+ statusLabel: '安装状态',
82
+ statusRunning: '运行中',
83
+ statusPending: '待重启',
84
+ exampleLabel: 'DeepSeek Harness 内置示例项目',
85
+ exampleHint: 'DeepSeek Harness 内置示例项目:不是插件市场的 dsh 插件,宿主不会加载它,无需重启',
86
+ restart: '重启',
87
+ installedVersionLabel: '已安装版本',
88
+ catalogLatest: '目录最新',
89
+ installPath: '安装路径',
90
+ copyPath: '复制路径',
91
+ openFolder: '在文件夹中显示',
92
+ openFolderFail: '无法打开文件夹,请复制路径手动打开',
93
+ revealFolder: '在 Finder 中显示',
94
+ installedAtLabel: '安装时间',
95
+ lastUpdatedLabel: '最后更新',
96
+ detailCatalog: '查看详情',
97
+ packageName: '包名',
98
+ versionUpHint: '发现新版本 v{from} → v{to},点击「更新」原位覆盖重装',
99
+ // 设置视图:更新与通道 / 安全与信任 / 诊断 / 系统日志
100
+ settingsUpdate: '更新设置',
101
+ settingsUpdateDesc: '更新检查方式与安装走到的网络通道',
102
+ settingsCheckOnStart: '启动时检查更新',
103
+ settingsCheckOnStartDesc: '打开插件中心时检查已安装插件是否有新版,发现更新会提示',
104
+ settingsMirror: 'npm 镜像源',
105
+ settingsMirrorDesc: 'npm 安装与版本反查走自定义镜像,网络不佳时更稳定;留空使用官方源',
106
+ mirrorOfficial: '官方源 registry.npmjs.org',
107
+ mirrorNpmmirror: '阿里云 npmmirror',
108
+ mirrorTencent: '腾讯云镜像',
109
+ mirrorCustom: '自定义镜像源',
110
+ settingsProxy: 'HTTP 代理',
111
+ settingsProxyDesc: 'npm / git / 目录数据请求统一走该代理;留空直连',
112
+ settingsSecurity: '安全信任',
113
+ settingsSecurityDesc: '命令行安装的三个通道开关:NPM 包、GitHub 源码与 DSH 命令',
114
+ settingsEnableNpm: '启用 NPM 安装',
115
+ settingsEnableNpmDesc: '允许通过命令行安装 npm 包;关闭后输入包名安装会被拦截',
116
+ settingsEnableGit: '启用 GitHub 源码安装',
117
+ settingsEnableGitDesc: '允许通过命令行安装 GitHub 源码;关闭后输入仓库地址安装会被拦截',
118
+ settingsEnableDsh: '启用 DSH 命令安装',
119
+ settingsEnableDshDesc: '允许通过命令行粘贴 dsh plugin 命令安装;关闭后命令输入会被禁用',
120
+ settingsDiagnostics: '系统诊断',
121
+ settingsDiagnosticsDesc: '检测 npm 源 / GitHub / 目录站点等安装通道的连通状态',
122
+ settingsLogs: '系统日志',
123
+ settingsLogsDesc: '本地记录的安装 / 卸载 / 设置变更与诊断结果,可导出全文排查问题',
124
+ logsHeadHint: '记录安装、卸载、设置变更与诊断结果,保留最近 2000 条',
125
+ logsRefresh: '刷新日志',
126
+ logsExport: '导出日志',
127
+ logsLoading: '正在读取日志…',
128
+ logsEmpty: '暂无日志记录',
129
+ logsLoadFail: '读取日志失败,请稍后重试',
130
+ // 系统日志查看器弹窗:内置窗口分页加载,按类别 × 级别筛选
131
+ logModalTitle: '日志查看器',
132
+ logViewerOpen: '打开日志查看器',
133
+ logViewerDesc: '内置窗口直接查看本地日志,按类型与级别筛选,可定位安装 / 卸载 / 更新时的不兼容点',
134
+ logPathLabel: '日志文件',
135
+ logOpenFile: '打开文件',
136
+ logOpenFileTip: '在系统文件管理器中定位日志文件',
137
+ logOpenFileFail: '打开失败,请在文件管理器中手动定位',
138
+ logPathSettingTitle: '日志存放位置',
139
+ logPathSettingDesc: '默认存于宿主配置目录,可填目录或 .log 文件路径改存别处',
140
+ logPathPlaceholder: '留空恢复默认',
141
+ logPathReset: '恢复默认',
142
+ logPathResetHint: '文本框显示当前生效位置',
143
+ logPathSave: '保存',
144
+ logPathSaving: '保存中…',
145
+ logPathSaved: '已保存,新日志将写入该位置',
146
+ logPathSaveFail: '保存失败:该位置不可写或不可用',
147
+ logPathChange: '修改',
148
+ logPathBrowse: '选择目录…',
149
+ logPathBrowseFail: '选择目录不可用,请手动输入路径',
150
+ logCatAll: '全部类型',
151
+ logCatInstall: '安装',
152
+ logCatUninstall: '卸载',
153
+ logCatUpdate: '更新',
154
+ logCatDiagnostics: '诊断',
155
+ logCatSettings: '设置',
156
+ logCatSystem: '系统',
157
+ logLvAll: '全部级别',
158
+ logLvError: '错误',
159
+ logLvWarn: '警告',
160
+ logLvSuccess: '成功',
161
+ logLvInfo: '信息',
162
+ logLvDebug: '调试',
163
+ logSearchPlaceholder: '搜索事件或描述…',
164
+ logLoadMore: '加载更多',
165
+ logNoMore: '已加载全部,共 {n} 条',
166
+ logCount: '共 {n} 条',
167
+ logEmptyFilter: '没有符合条件的日志',
168
+ settingsDiagFail: '不可达',
169
+ // 系统诊断通道列表:一键全量诊断 + 一行一个,可点重测
170
+ diagNpm: 'npm 源',
171
+ diagGithub: 'GitHub',
172
+ diagCatalog: '目录站点',
173
+ diagOk: 'OK',
174
+ diagChecking: '检测中…',
175
+ diagIdle: '未检测',
176
+ diagRecheck: '点击重测该通道',
177
+ diagRunAll: '立即诊断',
178
+ diagHeadHint: '共 {n} 个通道,点击任意一行可单独重测',
179
+ diagSummaryRunning: '正在检测通道…',
180
+ diagSummaryOk: '全部通道正常',
181
+ diagSummaryFail: '存在不可达通道,点击对应行可重测',
182
+ settingsEnvSnapshot: '系统版本',
183
+ settingsEnvSnapshotDesc: '复制宿主版本与系统信息,提交 Issue 时粘贴到正文便于复现',
184
+ settingsEnvCopy: '复制',
185
+ // 恢复默认:一级菜单 + 独立设置卡片
186
+ settingsReset: '恢复默认',
187
+ settingsResetDesc: '更新策略、镜像源、代理与安全限制一次性恢复为出厂默认值',
188
+ settingsResetDetail: '恢复更新策略、镜像源、代理与安全限制为出厂默认值',
189
+ settingsResetRun: '恢复默认',
190
+ settingsResetConfirm: '确认恢复',
191
+ settingsResetConfirmDetail: '确定要恢复默认设置吗?更新策略、镜像源、代理与安全限制将全部回到出厂默认值。',
192
+ // 启动更新策略提示
193
+ updatesFound: '发现 {n} 个插件可更新,已加入通知中心',
194
+ updateNoticeTitle: '发现新版本',
195
+ updateNoticeGo: '去更新',
35
196
  uninstall: '卸载',
36
197
  uninstalling: '卸载中…',
37
- uninstallTitle: '确认卸载',
198
+ uninstallTitle: '确认卸载?',
38
199
  uninstallDesc: '将从当前环境卸载该插件。',
39
200
  uninstallDone: '卸载成功',
40
201
  uninstallFail: '卸载失败,请稍后重试',
@@ -48,6 +209,8 @@ export const zh = {
48
209
  copyInstallCommand: '复制安装命令',
49
210
  copyCmdLabel: '复制',
50
211
  copyUninstallCommand: '复制卸载命令',
212
+ cancelUninstall: '取消卸载',
213
+ uninstallConfirm: '确认卸载',
51
214
  installNow: '直接安装',
52
215
  installing: '安装中…',
53
216
  installDone: '安装成功',
@@ -61,6 +224,7 @@ export const zh = {
61
224
  updateResultTitle: '更新完成',
62
225
  updateResultDesc: '插件已更新到最新版本。',
63
226
  installFail: '安装失败',
227
+ requestTimeout: '请求超时:无法访问 GitHub 或网络不稳定,请稍后重试',
64
228
  confirmCancel: '取消',
65
229
  doneBtn: '完成',
66
230
  // 结果视图:部分插件需重启后才挂载,提供「立即重启 / 稍后重启」选择
@@ -74,6 +238,13 @@ export const zh = {
74
238
  restartPendingHintUninstall: '卸载成功,重启后移除',
75
239
  sectionPendingRestart: '待重启',
76
240
  sectionInProgress: '进行中',
241
+ // 通知中心:安装/卸载任务成败的持久记录(工具栏铃铛入口按钮打开)
242
+ notifications: '通知',
243
+ notificationsHint: '查看安装/卸载/更新通知',
244
+ notificationsDesc: '安装、卸载任务与更新提醒都会记录在这里,即使错过提示也能随时回来查看。',
245
+ notificationsEmpty: '暂无通知记录',
246
+ notificationsClear: '清空通知',
247
+ removeNotification: '删除这条通知',
77
248
  // 串行队列:安装/卸载弹窗内可后台关闭,排队任务自动串行执行
78
249
  queuedTitle: '已加入安装排队',
79
250
  queuedUninstallTitle: '已加入卸载排队',
@@ -87,15 +258,6 @@ export const zh = {
87
258
  errorClose: '知道了',
88
259
  errorCopy: '复制错误信息',
89
260
  errCopied: '错误信息已复制',
90
- // 任务通知中心:安装/卸载的成败自动落盘,随时可回来查看
91
- notifications: '通知',
92
- // 通知入口按钮文字:工具栏空间有限,与弹窗标题(notifications)区分,短文案不截断
93
- notificationsBtn: '通知',
94
- notificationsHint: '查看安装/卸载通知(含失败记录)',
95
- notificationsDesc: '安装、卸载任务的成败都会记录在这里,即使错过提示也能随时回来查看。',
96
- notificationsEmpty: '暂无通知记录',
97
- notificationsClear: '清空通知',
98
- removeNotification: '删除这条通知',
99
261
  failCopy: '复制完整错误信息',
100
262
  failIssueHint: '带着错误日志去作者仓库一键提交 Issue(正文含官网收录链接)',
101
263
  failIssueBig: '一键提交 BUG 到 GitHub Issue 为开源作贡献',
@@ -105,6 +267,9 @@ export const zh = {
105
267
  failPackagingHint: '该插件不支持官方默认安装方式:其 git 分发缺少构建产物(package.json 声明的入口文件在仓库中不存在),说明作者未适配官方安装流程。请到作者仓库提交 Issue 反馈,请其提交构建产物或发布 npm 版。',
106
268
  // 原生依赖构建脚本被 pnpm 默认拦截(如 node-pty 的 ERR_PNPM_IGNORED_BUILDS):只影响带原生模块的插件,属插件依赖打包问题,应提 Issue
107
269
  failIgnoredBuild: '该插件依赖了需要编译的原生模块(如 node-pty),pnpm 默认拦截这类构建脚本导致安装失败 —— 其他插件不受影响,属该插件的依赖/打包问题。建议向作者仓库一键反馈,请作者改用预编译版本(如 node-pty-prebuilt-multiarch)。',
270
+ // npm arborist 内部崩溃(edgesOut)+ 本机 npm 版本过低:npm 自身已知缺陷,不是插件问题,升级 npm 即可
271
+ failNpmTooLow: '怀疑本机 npm 版本过低:npm 解析插件依赖时内部崩溃(这是 npm 自身的已知缺陷,不是插件问题)。请升级 npm 后重试:npm install -g npm@latest',
272
+ failNpmTooLowV: '本机 npm 版本过低(当前 v{v}):npm 解析插件依赖时内部崩溃(这是 npm 自身的已知缺陷,不是插件问题)。请升级 npm 后重试:npm install -g npm@latest',
108
273
  reportIssue: '去插件仓库提交 Issue',
109
274
  detail: '打开详情',
110
275
  noResult: '没有找到匹配的插件',
@@ -141,7 +306,7 @@ export const zh = {
141
306
  aboutEmpty: '内容暂未发布,敬请期待。',
142
307
  aboutUpdated: '更新于',
143
308
  empty: '该分类暂无插件',
144
- dataFrom: '数据源 dsh-plugin.org · 每日人工更新',
309
+ dataFrom: '数据源 api.dsh-plugin.org · 每日人工更新',
145
310
  }
146
311
 
147
312
  export const en = {
@@ -153,10 +318,11 @@ export const en = {
153
318
  ad: 'DSH-Plugin Hub: {total} plugins indexed, {verified} human-verified, updated daily',
154
319
  search: 'Search plugins by name, description, tags…',
155
320
  all: 'All',
156
- sortStars: 'Most stars',
157
- sortForks: 'Most forks',
321
+ sortStars: 'Stars',
322
+ sortForks: 'Forks',
158
323
  sortUpdated: 'Recently updated',
159
324
  sortNewest: 'Newest added',
325
+ sortAria: 'Plugin sort order',
160
326
  openHint: 'Open dsh-plugin.org',
161
327
  toggleLangHint: 'Switch language',
162
328
  githubHint: 'View source on GitHub',
@@ -172,15 +338,171 @@ export const en = {
172
338
  failedCopyHint: 'Install failed. Copy the command above and run it manually in your dsh terminal (native build scripts may need manual approval, e.g. pnpm approve-builds)',
173
339
  toastCopied: 'Install command copied — paste it in your dsh terminal',
174
340
  installed: 'Installed',
175
- notInstalled: 'Not installed',
176
- filterAllHint: 'Show all plugins',
177
- filterInstalledHint: 'Filter to installed plugins in this category',
178
- filterNotInstalledHint: 'Filter to uninstalled plugins in this category',
179
- filterInstalledNone: 'No installed plugins in this category',
180
- filterNotInstalledNone: 'No uninstalled plugins in this category',
341
+ // Primary navigation: Market / Installed / Custom / Settings
342
+ viewMarket: 'Market',
343
+ viewInstalled: 'Installed',
344
+ viewCustom: 'Custom',
345
+ viewSettings: 'Settings',
346
+ viewMarketHint: 'Browse and discover plugins',
347
+ viewInstalledHint: 'Manage installed plugins',
348
+ viewCustomHint: 'Install npm packages or GitHub sources manually',
349
+ viewSettingsHint: 'Network sources and preferences',
350
+ // Installed view
351
+ installedEmpty: 'No plugins installed yet',
352
+ installedEmptyDesc: 'Go to Custom to add an npm package or GitHub source manually',
353
+ npmInstallLabel: 'npm package',
354
+ npmInstallPlaceholder: 'npm package name',
355
+ npmInstallExample: 'e.g. lodash or @scope/pkg',
356
+ npmInstallInvalid: 'Enter an npm package name, e.g. lodash or @scope/pkg',
357
+ gitInstallLabel: 'GitHub source',
358
+ gitInstallPlaceholder: 'Repository address',
359
+ gitInstallExample: 'e.g. owner/repo or https://github.com/owner/repo',
360
+ gitInstallInvalid: 'Enter a GitHub repository address, e.g. owner/repo or https://github.com/owner/repo',
361
+ dshCmdLabel: 'DeepSeek Harness command',
362
+ dshCmdPlaceholder: 'Paste an install command (npm install -g or dsh plugin add)',
363
+ dshCmdExample: 'e.g. npm install -g @scope/cli or dsh plugin add github:owner/repo',
364
+ dshCmdInvalid: 'Paste a global npm install (npm install -g <pkgs>) or a full dsh plugin command, e.g. npm install -g @scope/cli',
365
+ globalNpmHint: 'This installs CLI tools globally (npm install -g). They won\'t appear in Installed and no host restart is needed.',
366
+ installCliBtn: 'Install',
367
+ // Install channel disabled (security-trust toggle off → card disabled, guides to settings)
368
+ channelDisabledHint: 'This install channel is disabled — enable it in Settings → Security & Trust',
369
+ goToSettings: 'Go to Settings',
370
+ // Custom install view: standalone top-level section, description text
371
+ customViewDesc: 'Manually install an npm package, a GitHub source, or paste an official install command (npm install -g / dsh plugin add). Finished installs appear in Installed, marked as custom.',
372
+ customLabel: 'Custom install',
373
+ installedSearch: 'Search installed plugins…',
374
+ installedFilterCatalog: 'Catalog',
375
+ hubInstall: 'Hub',
376
+ hubInstallHint: 'From the plugin hub catalog',
377
+ manualInstall: 'Manual',
378
+ manualInstallHint: 'Not from the catalog — installed via the command line',
379
+ filterByLabel: 'Source',
380
+ sortByLabel: 'Sort',
381
+ sortName: 'Name',
382
+ sortInstalledAt: 'Recent',
383
+ detailTitle: 'Plugin details',
384
+ detailCategory: 'Category',
385
+ detailStats: 'Repo stats',
386
+ statusLabel: 'Status',
387
+ statusRunning: 'Running',
388
+ statusPending: 'Restart pending',
389
+ exampleLabel: 'DeepSeek Harness built-in example',
390
+ exampleHint: 'DeepSeek Harness built-in example — not a marketplace dsh plugin, the host does not load it, no restart needed',
391
+ restart: 'Restart',
392
+ installedVersionLabel: 'Installed version',
393
+ catalogLatest: 'latest in catalog',
394
+ installPath: 'Install path',
395
+ copyPath: 'Copy path',
396
+ openFolder: 'Show in folder',
397
+ openFolderFail: 'Could not open the folder — copy the path instead',
398
+ revealFolder: 'Show in Finder',
399
+ installedAtLabel: 'Installed at',
400
+ lastUpdatedLabel: 'Last updated',
401
+ detailCatalog: 'View details',
402
+ packageName: 'Package',
403
+ versionUpHint: 'v{from} → v{to} available — Update reinstalls in place',
404
+ // Settings view: Updates & Sources / Security & Trust / Diagnostics / System Logs
405
+ settingsUpdate: 'Update Settings',
406
+ settingsUpdateDesc: 'Update checks and the network channels used for installs',
407
+ settingsCheckOnStart: 'Check for updates on startup',
408
+ settingsCheckOnStartDesc: 'Check installed plugins for new versions when the hub opens; you will be notified when updates are found',
409
+ settingsAutoInstall: 'Auto-install updates',
410
+ settingsAutoInstallDesc: 'Install detected updates in the background without asking (a host restart applies them)',
411
+ settingsMirror: 'npm registry mirror',
412
+ settingsMirrorDesc: 'Route npm installs and lookups through a mirror for unstable networks; leave empty for the official registry',
413
+ mirrorOfficial: 'Official registry.npmjs.org',
414
+ mirrorNpmmirror: 'Alibaba npmmirror',
415
+ mirrorTencent: 'Tencent Cloud mirror',
416
+ mirrorCustom: 'Custom mirror',
417
+ settingsProxy: 'HTTP proxy',
418
+ settingsProxyDesc: 'Route npm, git and catalog requests through this proxy; leave empty to connect directly',
419
+ settingsSecurity: 'Security & Trust',
420
+ settingsSecurityDesc: 'Toggles for the three command-line install channels: npm packages, GitHub sources and DSH commands',
421
+ settingsEnableNpm: 'Enable npm installs',
422
+ settingsEnableNpmDesc: 'Allow installing npm packages from the command line; turning this off rejects package-name installs',
423
+ settingsEnableGit: 'Enable GitHub source installs',
424
+ settingsEnableGitDesc: 'Allow installing from GitHub sources on the command line; turning this off rejects repository-address installs',
425
+ settingsEnableDsh: 'Enable DSH command installs',
426
+ settingsEnableDshDesc: 'Allow pasting a dsh plugin command to install; turning this off disables the command input',
427
+ settingsDiagnostics: 'System Diagnostics',
428
+ settingsDiagnosticsDesc: 'Check the connectivity of install channels: npm registry, GitHub and the catalog site',
429
+ settingsLogs: 'System Logs',
430
+ settingsLogsDesc: 'Local record of installs / uninstalls, settings changes and diagnostics — export the full log to troubleshoot',
431
+ logsHeadHint: 'Records installs, uninstalls, settings changes and diagnostics; keeps the latest 2,000 entries',
432
+ logsRefresh: 'Refresh log',
433
+ logsExport: 'Export log',
434
+ logsLoading: 'Reading log…',
435
+ logsEmpty: 'No log entries yet',
436
+ logsLoadFail: 'Failed to read the log; try again later',
437
+ // Log-viewer dialog: a built-in window that loads the log in pages, filterable by type × level
438
+ logModalTitle: 'Log viewer',
439
+ logViewerOpen: 'Open log viewer',
440
+ logViewerDesc: 'View the local log in a built-in window; filter by type and level to pinpoint install / uninstall / update incompatibilities',
441
+ logPathLabel: 'Log file',
442
+ logOpenFile: 'Reveal',
443
+ logOpenFileTip: 'Reveal the log file in your system file manager',
444
+ logOpenFileFail: 'Could not open; locate the file manually',
445
+ logPathSettingTitle: 'Log Location',
446
+ logPathSettingDesc: 'Stored in the host config directory by default — set a directory or a .log file path to store elsewhere',
447
+ logPathPlaceholder: 'Leave empty for default',
448
+ logPathReset: 'Reset to default',
449
+ logPathResetHint: 'The field shows the location currently in use',
450
+ logPathSave: 'Save',
451
+ logPathSaving: 'Saving…',
452
+ logPathSaved: 'Saved — new logs will be written there',
453
+ logPathSaveFail: 'Could not save: the location is not writable',
454
+ logPathChange: 'Change',
455
+ logPathBrowse: 'Browse…',
456
+ logPathBrowseFail: 'Folder picker unavailable — type the path manually',
457
+ logCatAll: 'All types',
458
+ logCatInstall: 'Install',
459
+ logCatUninstall: 'Uninstall',
460
+ logCatUpdate: 'Update',
461
+ logCatDiagnostics: 'Diagnostics',
462
+ logCatSettings: 'Settings',
463
+ logCatSystem: 'System',
464
+ logLvAll: 'All levels',
465
+ logLvError: 'Error',
466
+ logLvWarn: 'Warn',
467
+ logLvSuccess: 'Success',
468
+ logLvInfo: 'Info',
469
+ logLvDebug: 'Debug',
470
+ logSearchPlaceholder: 'Search event or message…',
471
+ logLoadMore: 'Load more',
472
+ logNoMore: 'All loaded · {n} total',
473
+ logCount: '{n} entries',
474
+ logEmptyFilter: 'No matching log entries',
475
+ settingsDiagFail: 'Unreachable',
476
+ // System diagnostics channel list: one-click full check + one row per channel, click to re-probe
477
+ diagNpm: 'npm registry',
478
+ diagGithub: 'GitHub',
479
+ diagCatalog: 'Catalog site',
480
+ diagOk: 'OK',
481
+ diagChecking: 'Checking…',
482
+ diagIdle: 'Not checked',
483
+ diagRecheck: 'Click to re-check this channel',
484
+ diagRunAll: 'Run diagnostics',
485
+ diagHeadHint: '{n} channels — click any row to re-check it alone',
486
+ diagSummaryRunning: 'Checking channels…',
487
+ diagSummaryOk: 'All channels reachable',
488
+ diagSummaryFail: 'Unreachable channel(s) — click a row to re-check',
489
+ settingsEnvSnapshot: 'System version',
490
+ settingsEnvSnapshotDesc: 'Copy host version and system info for pasting into issue reports',
491
+ settingsEnvCopy: 'Copy',
492
+ // Restore defaults: first-level menu + its own settings card
493
+ settingsReset: 'Restore Defaults',
494
+ settingsResetDesc: 'Restore update policy, npm mirror, proxy and security restrictions to factory defaults in one go',
495
+ settingsResetDetail: 'Reset update policy, npm mirror, proxy and security restrictions to factory defaults',
496
+ settingsResetRun: 'Restore Defaults',
497
+ settingsResetConfirm: 'Restore Defaults',
498
+ settingsResetConfirmDetail: 'Reset all settings to factory defaults? Update policy, npm mirror, proxy and security restrictions will be cleared.',
499
+ // Startup update policy hints
500
+ updatesFound: '{n} plugin(s) have updates — check the notification center',
501
+ updateNoticeTitle: 'Update available',
502
+ updateNoticeGo: 'Update',
181
503
  uninstall: 'Uninstall',
182
504
  uninstalling: 'Removing…',
183
- uninstallTitle: 'Confirm uninstall',
505
+ uninstallTitle: 'Confirm uninstall?',
184
506
  uninstallDesc: 'The plugin will be removed from this environment.',
185
507
  uninstallDone: 'Uninstalled',
186
508
  uninstallFail: 'Removal failed — try again',
@@ -194,6 +516,8 @@ export const en = {
194
516
  copyInstallCommand: 'Copy install command',
195
517
  copyCmdLabel: 'Copy',
196
518
  copyUninstallCommand: 'Copy uninstall command',
519
+ cancelUninstall: 'Cancel uninstall',
520
+ uninstallConfirm: 'Confirm uninstall',
197
521
  installNow: 'Install',
198
522
  installing: 'Installing…',
199
523
  installDone: 'Installed',
@@ -207,6 +531,7 @@ export const en = {
207
531
  updateResultTitle: 'Updated',
208
532
  updateResultDesc: 'The plugin has been updated to the latest version.',
209
533
  installFail: 'Install failed — copy the command instead',
534
+ requestTimeout: 'Request timed out: GitHub may be unreachable or the network is unstable — try again later',
210
535
  confirmCancel: 'Cancel',
211
536
  doneBtn: 'Done',
212
537
  // Result view: some plugins need a restart to mount — offer restart now / later
@@ -219,10 +544,18 @@ export const en = {
219
544
  restartPendingHintUninstall: 'Removed — cleaned up after restart',
220
545
  sectionPendingRestart: 'Pending restart',
221
546
  sectionInProgress: 'In progress',
547
+ // 通知中心:安装/卸载任务成败的持久记录(工具栏铃铛入口按钮打开)
548
+ notifications: 'Notifications',
549
+ notificationsHint: 'View install/remove/update notifications',
550
+ notificationsDesc: 'Every install, remove and update notice is logged here — even if you missed the prompt, you can always check back.',
551
+ notificationsEmpty: 'No notifications yet',
552
+ notificationsClear: 'Clear notifications',
553
+ removeNotification: 'Remove this notification',
222
554
  queuedTitle: 'Queued…',
223
555
  queuedUninstallTitle: 'Queued for removal…',
224
556
  queuedHint: 'Queued — starts automatically after earlier tasks finish. You may close this window.',
225
557
  cancelTask: 'Cancel task',
558
+ cancel: 'Cancel',
226
559
  cancelling: 'Cancelling…',
227
560
  errorTitle: 'Operation failed',
228
561
  errorTitleInstall: 'Install failed',
@@ -231,15 +564,6 @@ export const en = {
231
564
  errorClose: 'Got it',
232
565
  errorCopy: 'Copy error',
233
566
  errCopied: 'Error copied',
234
- // Task notification center: install/remove results are auto-logged, viewable later
235
- notifications: 'Notifications',
236
- // Entry button label: toolbar space is tight, keep it short so it never truncates; the modal title stays full
237
- notificationsBtn: 'Notice',
238
- notificationsHint: 'View install/remove notifications (including failures)',
239
- notificationsDesc: 'Every install and remove result is logged here — even if you missed the prompt, you can always check back.',
240
- notificationsEmpty: 'No notifications yet',
241
- notificationsClear: 'Clear notifications',
242
- removeNotification: 'Remove this notification',
243
567
  failCopy: 'Copy full log',
244
568
  failIssueHint: 'Open a pre-filled issue on the author repo with this error log (includes catalog links)',
245
569
  failIssueBig: 'Report this bug to GitHub — contribute to open source',
@@ -249,6 +573,8 @@ export const en = {
249
573
  failPackagingHint: 'This plugin does not support the official default install method: its git distribution lacks the build output (the entry file declared in package.json is not in the repository), so it has not been adapted to the official install flow. Please file an Issue on the author\'s repo asking for committed build output or an npm release.',
250
574
  // native-module build scripts ignored by pnpm by default (e.g. node-pty, ERR_PNPM_IGNORED_BUILDS): only affects plugins with native deps — a dependency/packaging issue of the plugin itself, file an issue
251
575
  failIgnoredBuild: 'This plugin depends on a native module (e.g. node-pty) whose build script pnpm blocks by default, so the install fails — other plugins are unaffected. This is a dependency/packaging issue of the plugin itself. Please report it to the author repository and ask the author to switch to a prebuilt variant (e.g. node-pty-prebuilt-multiarch).',
576
+ failNpmTooLow: 'Your local npm may be too old: npm crashed internally while resolving the plugin\'s dependencies (a known npm bug — not a plugin issue). Please upgrade npm and retry: npm install -g npm@latest',
577
+ failNpmTooLowV: 'Your local npm is too old (v{v}): npm crashed internally while resolving the plugin\'s dependencies (a known npm bug — not a plugin issue). Please upgrade npm and retry: npm install -g npm@latest',
252
578
  reportIssue: 'Report an Issue to the plugin repo',
253
579
  detail: 'Open details',
254
580
  noResult: 'No plugins match your search',
@@ -285,5 +611,5 @@ export const en = {
285
611
  aboutEmpty: 'Content not published yet — stay tuned.',
286
612
  aboutUpdated: 'Updated',
287
613
  empty: 'No plugins in this category yet',
288
- dataFrom: 'Data from dsh-plugin.org · curated daily',
614
+ dataFrom: 'Data from api.dsh-plugin.org · curated daily',
289
615
  }
@@ -0,0 +1,87 @@
1
+ /**
2
+ * DSH-Plugin Hub — the community plugin marketplace for DeepSeek Harness.
3
+ * Website: https://dsh-plugin.org
4
+ * GitHub: https://github.com/dshplugin/dsh-plugin-hub
5
+ *
6
+ * Constants: site URLs, category metadata and sort keys. Pure data — no
7
+ * side effects, no network — so every consumer shares one definition.
8
+ */
9
+ import type { LocaleId } from '../types.ts'
10
+
11
+ /** 插件中心官网地址。 */
12
+ export const SITE_URL = 'https://dsh-plugin.org/'
13
+
14
+ /** 插件中心源码仓库:头部右上角 GitHub 图标的跳转地址 */
15
+ export const GITHUB_URL = 'https://github.com/dshplugin/dsh-plugin-hub'
16
+
17
+ /** Hub 自身在目录数据里的仓库标识:头部版本号旁的「可更新」徽标按它定位自己。 */
18
+ export const HUB_REPO = 'dshplugin/dsh-plugin-hub'
19
+
20
+ /**
21
+ * Hub 自我更新版本控制中心(接口中心 Pages:api.dsh-plugin.org,原 dsh-update Worker)。
22
+ * 发新版后向接口中心管理接口写入最新版本 + Markdown 变更记录(见
23
+ * api-center 的 POST /admin/hub),所有已装用户的「可更新」徽标即时出现,
24
+ * 不再依赖主站目录数据管道(每日刷新 + 重建站点)。
25
+ * 响应:{ version: string | null, publishedAt: string | null, notes: string | {zh,en} | null }
26
+ */
27
+ export const HUB_UPDATE_URL = 'https://api.dsh-plugin.org/hub'
28
+
29
+ /** 接口中心「关注我们」内容接口(同项目 Pages,key = hub:about,Markdown 推送非写死)。 */
30
+ export const HUB_ABOUT_URL = 'https://api.dsh-plugin.org/about'
31
+
32
+ /** 构建时由 tsdown 从 package.json 注入的插件版本号(见 tsdown.config.ts define)。 */
33
+ declare const __PLUGIN_VERSION__: string
34
+
35
+ /**
36
+ * 插件当前版本号,供头部标题展示「DSH-Plugin Hub v0.1.1」。
37
+ * tsdown 构建时用 define 把 __PLUGIN_VERSION__ 替换成 package.json 的版本号;
38
+ * node --test 直接 import 本模块时该标识符不存在,typeof 守卫兜底为空串。
39
+ */
40
+ export const PLUGIN_VERSION: string =
41
+ typeof __PLUGIN_VERSION__ === 'string' ? __PLUGIN_VERSION__ : ''
42
+
43
+ export const CATEGORY_ORDER = [
44
+ 'interface', 'session', 'memory', 'tools', 'agent', 'workflow',
45
+ 'integration', 'model', 'dev', 'knowledge', 'fun',
46
+ ]
47
+
48
+ /** 分类标签按界面语言取词;未知 key 原样返回。 */
49
+ export function categoryLabel(
50
+ map: Record<string, { zh: string; en: string }>,
51
+ key: string,
52
+ lang: LocaleId,
53
+ ): string {
54
+ return map[key]?.[lang] ?? key
55
+ }
56
+
57
+ export const CATEGORY_LABELS: Record<string, { zh: string; en: string }> = {
58
+ interface: { zh: '界面与体验', en: 'UI & Experience' },
59
+ session: { zh: '会话与消息', en: 'Sessions & Messages' },
60
+ memory: { zh: '记忆与上下文', en: 'Memory & Context' },
61
+ tools: { zh: '工具与能力', en: 'Tools & Capabilities' },
62
+ agent: { zh: '技能与智能体', en: 'Skills & Agents' },
63
+ workflow: { zh: '工作流与自动化', en: 'Workflow & Automation' },
64
+ integration: { zh: '集成与连接', en: 'Integrations & Connections' },
65
+ model: { zh: '模型与推理', en: 'Models & Reasoning' },
66
+ dev: { zh: '开发与运维', en: 'Development & Operations' },
67
+ knowledge: { zh: '数据与知识', en: 'Data & Knowledge' },
68
+ fun: { zh: '娱乐', en: 'Entertainment' },
69
+ }
70
+
71
+ /** 分类 Tab 的紧凑标签(英文模式空间受限时使用)。 */
72
+ export const CATEGORY_SHORT_LABELS: Record<string, { zh: string; en: string }> = {
73
+ interface: { zh: '界面体验', en: 'UI Exp' },
74
+ session: { zh: '会话消息', en: 'Sessions' },
75
+ memory: { zh: '记忆上下文', en: 'Memory' },
76
+ tools: { zh: '工具能力', en: 'Tools' },
77
+ agent: { zh: '技能智能体', en: 'Agents' },
78
+ workflow: { zh: '工作流', en: 'Workflow' },
79
+ integration: { zh: '集成连接', en: 'Integrations' },
80
+ model: { zh: '模型推理', en: 'Models' },
81
+ dev: { zh: '开发运维', en: 'Dev' },
82
+ knowledge: { zh: '数据知识', en: 'Knowledge' },
83
+ fun: { zh: '娱乐', en: 'Fun' },
84
+ }
85
+
86
+ export const SORTS = ['sortStars', 'sortForks', 'sortUpdated', 'sortNewest'] as const
87
+ export type SortKey = (typeof SORTS)[number]