dsh-plugin 1.1.2 → 1.2.1
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/client/client.js +4465 -1442
- package/client/client.js.map +1 -1
- package/lib/http/routes.js +438 -22
- package/lib/index.js +1 -1
- package/lib/services/install/install.js +4 -0
- package/lib/services/install/npm-check.js +55 -0
- package/lib/services/{npm-resolve.js → install/npm-resolve.js} +7 -5
- package/lib/services/{preflight.js → install/preflight.js} +15 -4
- package/lib/services/{task-queue.js → install/task-queue.js} +155 -66
- package/lib/services/loader.js +56 -1
- package/lib/services/log.js +138 -0
- package/lib/services/probe.js +157 -0
- package/lib/services/{profile.js → profile/profile.js} +29 -1
- package/lib/services/settings.js +60 -0
- package/lib/types/http/routes.d.ts +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/{install-types.d.ts → install/install-types.d.ts} +3 -0
- package/lib/types/services/{install.d.ts → install/install.d.ts} +5 -5
- package/lib/types/services/install/npm-check.d.ts +12 -0
- package/lib/types/services/{npm-resolve.d.ts → install/npm-resolve.d.ts} +2 -1
- package/lib/types/services/{task-queue.d.ts → install/task-queue.d.ts} +5 -1
- package/lib/types/services/loader.d.ts +14 -8
- package/lib/types/services/log.d.ts +49 -0
- package/lib/types/services/probe.d.ts +30 -0
- package/lib/types/services/{pending-restart.d.ts → profile/pending-restart.d.ts} +1 -1
- package/lib/types/services/{profile.d.ts → profile/profile.d.ts} +2 -0
- package/lib/types/services/settings.d.ts +24 -0
- package/package.json +1 -1
- package/src/client/components/PluginHubSection.tsx +341 -120
- package/src/client/components/{CatalogList.tsx → catalog/CatalogList.tsx} +11 -7
- package/src/client/components/{PluginCard.tsx → catalog/PluginCard.tsx} +5 -4
- package/src/client/components/layout/CatalogControls.tsx +80 -0
- package/src/client/components/{CatalogHeader.tsx → layout/CatalogHeader.tsx} +4 -4
- package/src/client/components/{CategoryTabs.tsx → layout/CategoryTabs.tsx} +3 -3
- package/src/client/components/layout/SectionTabs.tsx +60 -0
- package/src/client/components/{AboutModal.tsx → modals/AboutModal.tsx} +7 -7
- package/src/client/components/{HubUpdateModal.tsx → modals/HubUpdateModal.tsx} +5 -5
- package/src/client/components/modals/InstalledDetailModal.tsx +193 -0
- package/src/client/components/modals/LogsModal.tsx +301 -0
- package/src/client/components/modals/LogsPathModal.tsx +161 -0
- package/src/client/components/{NotificationsModal.tsx → modals/NotificationsModal.tsx} +47 -20
- package/src/client/components/{ProgressView.tsx → modals/ProgressView.tsx} +2 -2
- package/src/client/components/{modals.tsx → modals/modals.tsx} +117 -40
- package/src/client/components/{Dropdown.tsx → ui/Dropdown.tsx} +14 -6
- package/src/client/components/ui/Toggle.tsx +28 -0
- package/src/client/components/ui/icons.tsx +343 -0
- package/src/client/components/views/CustomInstallView.tsx +250 -0
- package/src/client/components/views/DiagnosticsView.tsx +172 -0
- package/src/client/components/views/InstalledView.tsx +328 -0
- package/src/client/components/views/LogsView.tsx +150 -0
- package/src/client/components/views/MarketView.tsx +66 -0
- package/src/client/components/views/SettingsView.tsx +273 -0
- package/src/client/data/catalog.ts +38 -0
- package/src/client/data/host.ts +107 -0
- package/src/client/data/hub.ts +41 -0
- package/src/client/hooks/useCatalog.ts +71 -115
- package/src/client/hooks/useIncrementalList.ts +46 -0
- package/src/client/hooks/useLanguage.ts +40 -0
- package/src/client/hooks/useSettings.ts +90 -0
- package/src/client/hooks/useTaskQueue.ts +156 -39
- package/src/client/locales.ts +358 -38
- package/src/client/logic/constants.ts +86 -0
- package/src/client/{lib → logic}/failures.ts +95 -74
- package/src/client/logic/install-command.ts +56 -0
- package/src/client/logic/installed.ts +207 -0
- package/src/client/logic/normalize.ts +52 -0
- package/src/client/logic/urls.ts +125 -0
- package/src/client/styles/CustomInstallView.module.css +191 -0
- package/src/client/styles/DiagnosticsView.module.css +231 -0
- package/src/client/styles/Dropdown.module.css +42 -41
- package/src/client/styles/Header.module.css +100 -132
- package/src/client/styles/InstalledView.module.css +447 -0
- package/src/client/styles/List.module.css +6 -0
- package/src/client/styles/LogsView.module.css +503 -0
- package/src/client/styles/Modal.module.css +352 -70
- package/src/client/styles/SectionTabs.module.css +142 -0
- package/src/client/styles/SettingsView.module.css +232 -0
- package/src/client/styles/Toggle.module.css +60 -0
- package/src/client/styles/tokens.module.css +1 -0
- package/src/client/types.ts +23 -3
- package/src/server/http/routes.ts +414 -22
- package/src/server/index.ts +1 -1
- package/src/server/services/{install-types.ts → install/install-types.ts} +3 -1
- package/src/server/services/{install.ts → install/install.ts} +5 -5
- package/src/server/services/install/npm-check.ts +53 -0
- package/src/server/services/{npm-resolve.ts → install/npm-resolve.ts} +7 -5
- package/src/server/services/{preflight.ts → install/preflight.ts} +16 -4
- package/src/server/services/{task-queue.ts → install/task-queue.ts} +157 -63
- package/src/server/services/loader.ts +55 -1
- package/src/server/services/log.ts +167 -0
- package/src/server/services/probe.ts +157 -0
- package/src/server/services/{pending-restart.ts → profile/pending-restart.ts} +1 -1
- package/src/server/services/{profile.ts → profile/profile.ts} +31 -1
- package/src/server/services/settings.ts +79 -0
- package/lib/services/install.js +0 -4
- package/src/client/components/CatalogControls.tsx +0 -108
- package/src/client/components/icons.tsx +0 -129
- package/src/client/lib/catalog.ts +0 -293
- package/src/client/lib/env.ts +0 -20
- /package/lib/services/{install-types.js → install/install-types.js} +0 -0
- /package/lib/services/{installed-versions.js → profile/installed-versions.js} +0 -0
- /package/lib/services/{pending-restart.js → profile/pending-restart.js} +0 -0
- /package/lib/services/{progress.js → profile/progress.js} +0 -0
- /package/lib/types/services/{preflight.d.ts → install/preflight.d.ts} +0 -0
- /package/lib/types/services/{installed-versions.d.ts → profile/installed-versions.d.ts} +0 -0
- /package/lib/types/services/{progress.d.ts → profile/progress.d.ts} +0 -0
- /package/src/client/{lib → logic}/format.ts +0 -0
- /package/src/client/{lib → logic}/renderMarkdown.ts +0 -0
- /package/src/server/services/{installed-versions.ts → profile/installed-versions.ts} +0 -0
- /package/src/server/services/{progress.ts → profile/progress.ts} +0 -0
package/src/client/locales.ts
CHANGED
|
@@ -15,10 +15,11 @@ export const zh = {
|
|
|
15
15
|
ad: 'DSH-Plugin 插件中心:收录 {total} 款插件,{verified} 款人工精选验证,每日更新',
|
|
16
16
|
search: '搜索插件名称、描述、标签…',
|
|
17
17
|
all: '全部',
|
|
18
|
-
sortStars: 'Star
|
|
19
|
-
sortForks: 'Fork
|
|
18
|
+
sortStars: 'Star',
|
|
19
|
+
sortForks: 'Fork',
|
|
20
20
|
sortUpdated: '最近更新',
|
|
21
21
|
sortNewest: '最新收录',
|
|
22
|
+
sortAria: '插件排序方式',
|
|
22
23
|
openHint: '打开 dsh-plugin.org',
|
|
23
24
|
toggleLangHint: '切换界面语言',
|
|
24
25
|
fork: 'Fork',
|
|
@@ -32,15 +33,169 @@ export const zh = {
|
|
|
32
33
|
failedCopyHint: '安装失败。请复制上方安装命令到 dsh 终端手动执行(原生依赖构建脚本可能需要人工放行,如 pnpm approve-builds)',
|
|
33
34
|
toastCopied: '安装命令已复制,去 dsh 终端粘贴即可安装',
|
|
34
35
|
installed: '已安装',
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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: '去更新',
|
|
41
196
|
uninstall: '卸载',
|
|
42
197
|
uninstalling: '卸载中…',
|
|
43
|
-
uninstallTitle: '
|
|
198
|
+
uninstallTitle: '确认卸载?',
|
|
44
199
|
uninstallDesc: '将从当前环境卸载该插件。',
|
|
45
200
|
uninstallDone: '卸载成功',
|
|
46
201
|
uninstallFail: '卸载失败,请稍后重试',
|
|
@@ -54,6 +209,8 @@ export const zh = {
|
|
|
54
209
|
copyInstallCommand: '复制安装命令',
|
|
55
210
|
copyCmdLabel: '复制',
|
|
56
211
|
copyUninstallCommand: '复制卸载命令',
|
|
212
|
+
cancelUninstall: '取消卸载',
|
|
213
|
+
uninstallConfirm: '确认卸载',
|
|
57
214
|
installNow: '直接安装',
|
|
58
215
|
installing: '安装中…',
|
|
59
216
|
installDone: '安装成功',
|
|
@@ -67,6 +224,7 @@ export const zh = {
|
|
|
67
224
|
updateResultTitle: '更新完成',
|
|
68
225
|
updateResultDesc: '插件已更新到最新版本。',
|
|
69
226
|
installFail: '安装失败',
|
|
227
|
+
requestTimeout: '请求超时:无法访问 GitHub 或网络不稳定,请稍后重试',
|
|
70
228
|
confirmCancel: '取消',
|
|
71
229
|
doneBtn: '完成',
|
|
72
230
|
// 结果视图:部分插件需重启后才挂载,提供「立即重启 / 稍后重启」选择
|
|
@@ -80,6 +238,13 @@ export const zh = {
|
|
|
80
238
|
restartPendingHintUninstall: '卸载成功,重启后移除',
|
|
81
239
|
sectionPendingRestart: '待重启',
|
|
82
240
|
sectionInProgress: '进行中',
|
|
241
|
+
// 通知中心:安装/卸载任务成败的持久记录(工具栏铃铛入口按钮打开)
|
|
242
|
+
notifications: '通知',
|
|
243
|
+
notificationsHint: '查看安装/卸载/更新通知',
|
|
244
|
+
notificationsDesc: '安装、卸载任务与更新提醒都会记录在这里,即使错过提示也能随时回来查看。',
|
|
245
|
+
notificationsEmpty: '暂无通知记录',
|
|
246
|
+
notificationsClear: '清空通知',
|
|
247
|
+
removeNotification: '删除这条通知',
|
|
83
248
|
// 串行队列:安装/卸载弹窗内可后台关闭,排队任务自动串行执行
|
|
84
249
|
queuedTitle: '已加入安装排队',
|
|
85
250
|
queuedUninstallTitle: '已加入卸载排队',
|
|
@@ -93,15 +258,6 @@ export const zh = {
|
|
|
93
258
|
errorClose: '知道了',
|
|
94
259
|
errorCopy: '复制错误信息',
|
|
95
260
|
errCopied: '错误信息已复制',
|
|
96
|
-
// 任务通知中心:安装/卸载的成败自动落盘,随时可回来查看
|
|
97
|
-
notifications: '通知',
|
|
98
|
-
// 通知入口按钮文字:工具栏空间有限,与弹窗标题(notifications)区分,短文案不截断
|
|
99
|
-
notificationsBtn: '通知',
|
|
100
|
-
notificationsHint: '查看安装/卸载通知(含失败记录)',
|
|
101
|
-
notificationsDesc: '安装、卸载任务的成败都会记录在这里,即使错过提示也能随时回来查看。',
|
|
102
|
-
notificationsEmpty: '暂无通知记录',
|
|
103
|
-
notificationsClear: '清空通知',
|
|
104
|
-
removeNotification: '删除这条通知',
|
|
105
261
|
failCopy: '复制完整错误信息',
|
|
106
262
|
failIssueHint: '带着错误日志去作者仓库一键提交 Issue(正文含官网收录链接)',
|
|
107
263
|
failIssueBig: '一键提交 BUG 到 GitHub Issue 为开源作贡献',
|
|
@@ -111,6 +267,9 @@ export const zh = {
|
|
|
111
267
|
failPackagingHint: '该插件不支持官方默认安装方式:其 git 分发缺少构建产物(package.json 声明的入口文件在仓库中不存在),说明作者未适配官方安装流程。请到作者仓库提交 Issue 反馈,请其提交构建产物或发布 npm 版。',
|
|
112
268
|
// 原生依赖构建脚本被 pnpm 默认拦截(如 node-pty 的 ERR_PNPM_IGNORED_BUILDS):只影响带原生模块的插件,属插件依赖打包问题,应提 Issue
|
|
113
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',
|
|
114
273
|
reportIssue: '去插件仓库提交 Issue',
|
|
115
274
|
detail: '打开详情',
|
|
116
275
|
noResult: '没有找到匹配的插件',
|
|
@@ -147,7 +306,7 @@ export const zh = {
|
|
|
147
306
|
aboutEmpty: '内容暂未发布,敬请期待。',
|
|
148
307
|
aboutUpdated: '更新于',
|
|
149
308
|
empty: '该分类暂无插件',
|
|
150
|
-
dataFrom: '数据源 dsh-plugin.org · 每日人工更新',
|
|
309
|
+
dataFrom: '数据源 api.dsh-plugin.org · 每日人工更新',
|
|
151
310
|
}
|
|
152
311
|
|
|
153
312
|
export const en = {
|
|
@@ -159,10 +318,11 @@ export const en = {
|
|
|
159
318
|
ad: 'DSH-Plugin Hub: {total} plugins indexed, {verified} human-verified, updated daily',
|
|
160
319
|
search: 'Search plugins by name, description, tags…',
|
|
161
320
|
all: 'All',
|
|
162
|
-
sortStars: '
|
|
163
|
-
sortForks: '
|
|
321
|
+
sortStars: 'Stars',
|
|
322
|
+
sortForks: 'Forks',
|
|
164
323
|
sortUpdated: 'Recently updated',
|
|
165
324
|
sortNewest: 'Newest added',
|
|
325
|
+
sortAria: 'Plugin sort order',
|
|
166
326
|
openHint: 'Open dsh-plugin.org',
|
|
167
327
|
toggleLangHint: 'Switch language',
|
|
168
328
|
githubHint: 'View source on GitHub',
|
|
@@ -178,15 +338,171 @@ export const en = {
|
|
|
178
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)',
|
|
179
339
|
toastCopied: 'Install command copied — paste it in your dsh terminal',
|
|
180
340
|
installed: 'Installed',
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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',
|
|
187
503
|
uninstall: 'Uninstall',
|
|
188
504
|
uninstalling: 'Removing…',
|
|
189
|
-
uninstallTitle: 'Confirm uninstall',
|
|
505
|
+
uninstallTitle: 'Confirm uninstall?',
|
|
190
506
|
uninstallDesc: 'The plugin will be removed from this environment.',
|
|
191
507
|
uninstallDone: 'Uninstalled',
|
|
192
508
|
uninstallFail: 'Removal failed — try again',
|
|
@@ -200,6 +516,8 @@ export const en = {
|
|
|
200
516
|
copyInstallCommand: 'Copy install command',
|
|
201
517
|
copyCmdLabel: 'Copy',
|
|
202
518
|
copyUninstallCommand: 'Copy uninstall command',
|
|
519
|
+
cancelUninstall: 'Cancel uninstall',
|
|
520
|
+
uninstallConfirm: 'Confirm uninstall',
|
|
203
521
|
installNow: 'Install',
|
|
204
522
|
installing: 'Installing…',
|
|
205
523
|
installDone: 'Installed',
|
|
@@ -213,6 +531,7 @@ export const en = {
|
|
|
213
531
|
updateResultTitle: 'Updated',
|
|
214
532
|
updateResultDesc: 'The plugin has been updated to the latest version.',
|
|
215
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',
|
|
216
535
|
confirmCancel: 'Cancel',
|
|
217
536
|
doneBtn: 'Done',
|
|
218
537
|
// Result view: some plugins need a restart to mount — offer restart now / later
|
|
@@ -225,10 +544,18 @@ export const en = {
|
|
|
225
544
|
restartPendingHintUninstall: 'Removed — cleaned up after restart',
|
|
226
545
|
sectionPendingRestart: 'Pending restart',
|
|
227
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',
|
|
228
554
|
queuedTitle: 'Queued…',
|
|
229
555
|
queuedUninstallTitle: 'Queued for removal…',
|
|
230
556
|
queuedHint: 'Queued — starts automatically after earlier tasks finish. You may close this window.',
|
|
231
557
|
cancelTask: 'Cancel task',
|
|
558
|
+
cancel: 'Cancel',
|
|
232
559
|
cancelling: 'Cancelling…',
|
|
233
560
|
errorTitle: 'Operation failed',
|
|
234
561
|
errorTitleInstall: 'Install failed',
|
|
@@ -237,15 +564,6 @@ export const en = {
|
|
|
237
564
|
errorClose: 'Got it',
|
|
238
565
|
errorCopy: 'Copy error',
|
|
239
566
|
errCopied: 'Error copied',
|
|
240
|
-
// Task notification center: install/remove results are auto-logged, viewable later
|
|
241
|
-
notifications: 'Notifications',
|
|
242
|
-
// Entry button label: toolbar space is tight, keep it short so it never truncates; the modal title stays full
|
|
243
|
-
notificationsBtn: 'Notice',
|
|
244
|
-
notificationsHint: 'View install/remove notifications (including failures)',
|
|
245
|
-
notificationsDesc: 'Every install and remove result is logged here — even if you missed the prompt, you can always check back.',
|
|
246
|
-
notificationsEmpty: 'No notifications yet',
|
|
247
|
-
notificationsClear: 'Clear notifications',
|
|
248
|
-
removeNotification: 'Remove this notification',
|
|
249
567
|
failCopy: 'Copy full log',
|
|
250
568
|
failIssueHint: 'Open a pre-filled issue on the author repo with this error log (includes catalog links)',
|
|
251
569
|
failIssueBig: 'Report this bug to GitHub — contribute to open source',
|
|
@@ -255,6 +573,8 @@ export const en = {
|
|
|
255
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.',
|
|
256
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
|
|
257
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',
|
|
258
578
|
reportIssue: 'Report an Issue to the plugin repo',
|
|
259
579
|
detail: 'Open details',
|
|
260
580
|
noResult: 'No plugins match your search',
|
|
@@ -291,5 +611,5 @@ export const en = {
|
|
|
291
611
|
aboutEmpty: 'Content not published yet — stay tuned.',
|
|
292
612
|
aboutUpdated: 'Updated',
|
|
293
613
|
empty: 'No plugins in this category yet',
|
|
294
|
-
dataFrom: 'Data from dsh-plugin.org · curated daily',
|
|
614
|
+
dataFrom: 'Data from api.dsh-plugin.org · curated daily',
|
|
295
615
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
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,静态 JSON 发布)。
|
|
22
|
+
* 发新版 = 在 api-center 的 releases/ 写发版记录 + 重新部署,hub.json 随之更新,
|
|
23
|
+
* 所有已装用户的「可更新」徽标即可见,不再依赖主站目录数据管道。
|
|
24
|
+
* 响应:{ version: string | null, publishedAt: string | null, notes: string | {zh,en} | null }
|
|
25
|
+
*/
|
|
26
|
+
export const HUB_UPDATE_URL = 'https://api.dsh-plugin.org/hub.json'
|
|
27
|
+
|
|
28
|
+
/** 接口中心「关注我们」内容(静态 JSON,由 api-center 的 about.md 构建生成,Markdown)。 */
|
|
29
|
+
export const HUB_ABOUT_URL = 'https://api.dsh-plugin.org/about.json'
|
|
30
|
+
|
|
31
|
+
/** 构建时由 tsdown 从 package.json 注入的插件版本号(见 tsdown.config.ts define)。 */
|
|
32
|
+
declare const __PLUGIN_VERSION__: string
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 插件当前版本号,供头部标题展示「DSH-Plugin Hub v0.1.1」。
|
|
36
|
+
* tsdown 构建时用 define 把 __PLUGIN_VERSION__ 替换成 package.json 的版本号;
|
|
37
|
+
* node --test 直接 import 本模块时该标识符不存在,typeof 守卫兜底为空串。
|
|
38
|
+
*/
|
|
39
|
+
export const PLUGIN_VERSION: string =
|
|
40
|
+
typeof __PLUGIN_VERSION__ === 'string' ? __PLUGIN_VERSION__ : ''
|
|
41
|
+
|
|
42
|
+
export const CATEGORY_ORDER = [
|
|
43
|
+
'interface', 'session', 'memory', 'tools', 'agent', 'workflow',
|
|
44
|
+
'integration', 'model', 'dev', 'knowledge', 'fun',
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
/** 分类标签按界面语言取词;未知 key 原样返回。 */
|
|
48
|
+
export function categoryLabel(
|
|
49
|
+
map: Record<string, { zh: string; en: string }>,
|
|
50
|
+
key: string,
|
|
51
|
+
lang: LocaleId,
|
|
52
|
+
): string {
|
|
53
|
+
return map[key]?.[lang] ?? key
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const CATEGORY_LABELS: Record<string, { zh: string; en: string }> = {
|
|
57
|
+
interface: { zh: '界面与体验', en: 'UI & Experience' },
|
|
58
|
+
session: { zh: '会话与消息', en: 'Sessions & Messages' },
|
|
59
|
+
memory: { zh: '记忆与上下文', en: 'Memory & Context' },
|
|
60
|
+
tools: { zh: '工具与能力', en: 'Tools & Capabilities' },
|
|
61
|
+
agent: { zh: '技能与智能体', en: 'Skills & Agents' },
|
|
62
|
+
workflow: { zh: '工作流与自动化', en: 'Workflow & Automation' },
|
|
63
|
+
integration: { zh: '集成与连接', en: 'Integrations & Connections' },
|
|
64
|
+
model: { zh: '模型与推理', en: 'Models & Reasoning' },
|
|
65
|
+
dev: { zh: '开发与运维', en: 'Development & Operations' },
|
|
66
|
+
knowledge: { zh: '数据与知识', en: 'Data & Knowledge' },
|
|
67
|
+
fun: { zh: '娱乐', en: 'Entertainment' },
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** 分类 Tab 的紧凑标签(英文模式空间受限时使用)。 */
|
|
71
|
+
export const CATEGORY_SHORT_LABELS: Record<string, { zh: string; en: string }> = {
|
|
72
|
+
interface: { zh: '界面体验', en: 'UI Exp' },
|
|
73
|
+
session: { zh: '会话消息', en: 'Sessions' },
|
|
74
|
+
memory: { zh: '记忆上下文', en: 'Memory' },
|
|
75
|
+
tools: { zh: '工具能力', en: 'Tools' },
|
|
76
|
+
agent: { zh: '技能智能体', en: 'Agents' },
|
|
77
|
+
workflow: { zh: '工作流', en: 'Workflow' },
|
|
78
|
+
integration: { zh: '集成连接', en: 'Integrations' },
|
|
79
|
+
model: { zh: '模型推理', en: 'Models' },
|
|
80
|
+
dev: { zh: '开发运维', en: 'Dev' },
|
|
81
|
+
knowledge: { zh: '数据知识', en: 'Knowledge' },
|
|
82
|
+
fun: { zh: '娱乐', en: 'Fun' },
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const SORTS = ['sortStars', 'sortForks', 'sortUpdated', 'sortNewest'] as const
|
|
86
|
+
export type SortKey = (typeof SORTS)[number]
|