dsh-plugin 1.6.12 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/client/client.js +615 -741
- package/client/client.js.map +1 -1
- package/lib/http/catalog.js +2 -3
- package/lib/http/diagnostics.js +6 -7
- package/lib/http/install.js +47 -213
- package/lib/http/logs.js +1 -2
- package/lib/http/npm-release-age.js +42 -0
- package/lib/http/routes.js +8 -7
- package/lib/http/settings.js +2 -2
- package/lib/http/shared.js +2 -2
- package/lib/http/task.js +1 -2
- package/lib/index.js +5 -6
- package/lib/services/install/install-types.js +4 -4
- package/lib/services/install/install.js +1 -1
- package/lib/services/install/npm-check.js +3 -2
- package/lib/services/install/npm-resolve.js +9 -96
- package/lib/services/install/package-entry.js +6 -11
- package/lib/services/install/registry-check.js +2 -2
- package/lib/services/install/release-target.js +8 -9
- package/lib/services/install/task-queue.js +40 -48
- package/lib/services/npm-release-age.js +119 -0
- package/lib/services/probe.js +4 -4
- package/lib/services/profile/installed-versions.js +15 -21
- package/lib/services/profile/profile.js +16 -44
- package/lib/services/profile/progress.js +8 -11
- package/lib/services/settings.js +2 -5
- package/lib/types/http/catalog.d.ts +1 -1
- package/lib/types/http/install.d.ts +2 -2
- package/lib/types/http/npm-release-age.d.ts +2 -0
- package/lib/types/http/routes.d.ts +10 -12
- package/lib/types/http/shared.d.ts +5 -6
- package/lib/types/index.d.ts +7 -8
- package/lib/types/services/install/install-types.d.ts +12 -13
- package/lib/types/services/install/install.d.ts +1 -1
- package/lib/types/services/install/npm-resolve.d.ts +4 -16
- package/lib/types/services/install/package-entry.d.ts +6 -11
- package/lib/types/services/install/release-target.d.ts +7 -8
- package/lib/types/services/install/task-queue.d.ts +25 -30
- package/lib/types/services/npm-release-age.d.ts +15 -0
- package/lib/types/services/probe.d.ts +4 -4
- package/lib/types/services/profile/installed-versions.d.ts +5 -7
- package/lib/types/services/profile/profile.d.ts +14 -18
- package/lib/types/services/profile/progress.d.ts +7 -10
- package/lib/types/services/settings.d.ts +0 -4
- package/package.json +1 -1
- package/src/client/components/PluginHubSection.tsx +17 -22
- package/src/client/components/catalog/CatalogList.tsx +2 -4
- package/src/client/components/catalog/PluginCard.tsx +2 -3
- package/src/client/components/layout/CatalogControls.tsx +5 -6
- package/src/client/components/layout/CatalogHeader.tsx +1 -2
- package/src/client/components/layout/CategoryTabs.tsx +2 -3
- package/src/client/components/layout/SectionTabs.tsx +3 -5
- package/src/client/components/modals/ConfirmDialog.tsx +4 -6
- package/src/client/components/modals/InstalledDetailModal.tsx +3 -6
- package/src/client/components/modals/LogsModal.tsx +7 -12
- package/src/client/components/modals/NotificationsModal.tsx +35 -16
- package/src/client/components/modals/ProgressView.tsx +3 -4
- package/src/client/components/modals/modals.tsx +35 -15
- package/src/client/components/ui/Dropdown.tsx +4 -6
- package/src/client/components/ui/Toggle.tsx +2 -3
- package/src/client/components/ui/icons.tsx +1 -2
- package/src/client/components/views/CustomInstallView.tsx +20 -178
- package/src/client/components/views/DiagnosticsView.tsx +3 -6
- package/src/client/components/views/InstalledView.tsx +6 -11
- package/src/client/components/views/MarketView.tsx +2 -4
- package/src/client/components/views/SettingsView.tsx +9 -32
- package/src/client/css-modules.d.ts +1 -1
- package/src/client/data/catalog.ts +2 -3
- package/src/client/data/host.ts +26 -3
- package/src/client/data/hub.ts +2 -3
- package/src/client/hooks/useCatalog.ts +79 -24
- package/src/client/hooks/useIncrementalList.ts +3 -5
- package/src/client/hooks/useLanguage.ts +4 -6
- package/src/client/hooks/useSettings.ts +4 -11
- package/src/client/hooks/useTaskQueue.ts +36 -42
- package/src/client/index.tsx +2 -3
- package/src/client/locales.ts +75 -114
- package/src/client/logic/constants.ts +1 -2
- package/src/client/logic/ensure-plugin-css.ts +8 -12
- package/src/client/logic/failures.ts +16 -18
- package/src/client/logic/format.ts +1 -1
- package/src/client/logic/install-command.ts +14 -35
- package/src/client/logic/installed.ts +15 -10
- package/src/client/logic/normalize.ts +3 -3
- package/src/client/logic/release-age.ts +19 -0
- package/src/client/logic/urls.ts +20 -20
- package/src/client/styles/CustomInstallView.module.css +3 -30
- package/src/client/styles/DiagnosticsView.module.css +3 -5
- package/src/client/styles/Dropdown.module.css +2 -4
- package/src/client/styles/Header.module.css +6 -7
- package/src/client/styles/InstalledView.module.css +4 -7
- package/src/client/styles/List.module.css +4 -5
- package/src/client/styles/LogsView.module.css +2 -3
- package/src/client/styles/Modal.module.css +4 -5
- package/src/client/styles/SectionTabs.module.css +2 -4
- package/src/client/styles/SettingsView.module.css +3 -5
- package/src/client/styles/Toggle.module.css +2 -4
- package/src/client/styles/tokens.module.css +14 -18
- package/src/client/types.ts +11 -11
- package/src/server/http/catalog.ts +2 -3
- package/src/server/http/diagnostics.ts +6 -7
- package/src/server/http/install.ts +47 -208
- package/src/server/http/logs.ts +1 -2
- package/src/server/http/npm-release-age.ts +42 -0
- package/src/server/http/routes.ts +12 -12
- package/src/server/http/settings.ts +2 -2
- package/src/server/http/shared.ts +5 -6
- package/src/server/http/task.ts +1 -2
- package/src/server/index.ts +7 -8
- package/src/server/services/install/install-types.ts +12 -13
- package/src/server/services/install/install.ts +0 -1
- package/src/server/services/install/npm-check.ts +3 -2
- package/src/server/services/install/npm-resolve.ts +9 -99
- package/src/server/services/install/package-entry.ts +6 -11
- package/src/server/services/install/registry-check.ts +2 -2
- package/src/server/services/install/release-target.ts +8 -9
- package/src/server/services/install/task-queue.ts +47 -54
- package/src/server/services/npm-release-age.ts +107 -0
- package/src/server/services/probe.ts +4 -4
- package/src/server/services/profile/installed-versions.ts +16 -22
- package/src/server/services/profile/profile.ts +16 -42
- package/src/server/services/profile/progress.ts +8 -11
- package/src/server/services/settings.ts +2 -9
- package/lib/services/install/preflight.js +0 -178
- package/lib/types/services/install/preflight.d.ts +0 -23
- package/src/server/services/install/preflight.ts +0 -184
package/client/client.js
CHANGED
|
@@ -11,7 +11,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
11
11
|
* Website: https://dsh-plugin.org
|
|
12
12
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
13
13
|
*
|
|
14
|
-
* zh/en
|
|
14
|
+
* 插件中心设置板块的 zh/en 字典。
|
|
15
15
|
*/
|
|
16
16
|
const zh = {
|
|
17
17
|
nav: "插件市场",
|
|
@@ -46,34 +46,23 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
46
46
|
viewSettings: "设置",
|
|
47
47
|
viewMarketHint: "浏览与发现插件",
|
|
48
48
|
viewInstalledHint: "管理已安装插件",
|
|
49
|
-
viewCustomHint: "手动安装 NPM
|
|
49
|
+
viewCustomHint: "手动安装 NPM 包",
|
|
50
50
|
viewSettingsHint: "网络通道与偏好设置",
|
|
51
51
|
installedEmpty: "还没有安装插件",
|
|
52
|
-
installedEmptyDesc: "可以去「自定义安装」,手动安装 NPM
|
|
52
|
+
installedEmptyDesc: "可以去「自定义安装」,手动安装 NPM 包",
|
|
53
53
|
npmInstallLabel: "NPM 包 / 命令",
|
|
54
54
|
npmInstallPlaceholder: "npm install <包名> 或直接输包名",
|
|
55
55
|
npmInstallExample: "支持原生命令:npm install lodash、npm i lodash、pnpm add @scope/pkg",
|
|
56
56
|
npmInstallExample2: "全局安装 CLI:npm install -g @scope/cli;或直接输入包名 lodash",
|
|
57
57
|
npmInstallInvalid: "请输入 npm 包名(如 lodash、@scope/pkg),或原生安装命令(如 npm install lodash、npm i lodash、pnpm add @scope/pkg、npm install -g @scope/cli)",
|
|
58
|
-
gitInstallLabel: "GitHub 源码",
|
|
59
|
-
gitInstallPlaceholder: "输入仓库地址",
|
|
60
|
-
gitInstallExample: "例如:owner/repo 或 https://github.com/owner/repo",
|
|
61
|
-
gitInstallInvalid: "请输入 GitHub 仓库地址,例如:owner/repo 或 https://github.com/owner/repo",
|
|
62
|
-
dshCmdLabel: "DeepSeek Harness 命令",
|
|
63
|
-
dshCmdPlaceholder: "粘贴官方 dsh plugin 命令",
|
|
64
|
-
dshCmdInsertHubUpdate: "插入更新命令",
|
|
65
|
-
dshCmdExample: "例如:dsh plugin --profile {profile} add github:owner/repo,或 dsh plugin --profile {profile} update dsh-plugin",
|
|
66
|
-
dshCmdInvalid: "请输入官方 dsh plugin 命令(--profile 必填,支持 add / update)。例如:dsh plugin --profile {profile} update dsh-plugin",
|
|
67
58
|
installHelp: "帮助",
|
|
68
59
|
helpModalTitle: "支持的命令格式",
|
|
69
60
|
npmInstallHelp: "lodash、@scope/pkg 直接输入包名\nnpm install lodash\nnpm i lodash\npnpm add @scope/pkg\npnpm i @scope/pkg\nnpm install -g @scope/cli 全局安装 CLI 工具,不进「已安装」列表",
|
|
70
|
-
gitInstallHelp: "owner/repo\nhttps://github.com/owner/repo\ngithub:owner/repo\ngit+https://github.com/owner/repo.git\ngit@github.com:owner/repo.git",
|
|
71
|
-
dshCmdHelp: "dsh plugin --profile {profile} add <目标> 安装\ndsh plugin --profile {profile} update <目标> 更新已安装目标到最新版本\ndsh plugin --profile={profile} add <目标>\ndsh plugin --profile={profile} update <目标>\n --profile 必填(此处已填当前 profile),官方 CLI 无 -p 简写;<目标> 可为 npm 包名或 github:owner/repo;卸载请用「已安装」列表",
|
|
72
61
|
globalNpmHint: "将全局安装 CLI 工具(npm install -g),不会出现在「已安装」列表,无需重启宿主",
|
|
73
62
|
installCliBtn: "安装",
|
|
74
63
|
channelDisabledHint: "该安装通道已关闭,请在「设置 → 安全信任」中打开开关",
|
|
75
64
|
goToSettings: "前往设置",
|
|
76
|
-
customViewDesc: "手动安装目录外的 NPM
|
|
65
|
+
customViewDesc: "手动安装目录外的 NPM 包。装完的条目会出现在「已安装」列表,并标记为自定义安装。",
|
|
77
66
|
customLabel: "自定义安装",
|
|
78
67
|
installedSearch: "搜索已安装的插件…",
|
|
79
68
|
installedFilterCatalog: "目录插件",
|
|
@@ -125,13 +114,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
125
114
|
mirrorTencent: "腾讯云镜像",
|
|
126
115
|
mirrorTsinghua: "清华大学 TUNA 镜像",
|
|
127
116
|
settingsSecurity: "安全信任",
|
|
128
|
-
settingsSecurityDesc: "
|
|
117
|
+
settingsSecurityDesc: "命令行安装的开关:NPM 包",
|
|
129
118
|
settingsEnableNpm: "启用 NPM 安装",
|
|
130
119
|
settingsEnableNpmDesc: "允许通过命令行安装 npm 包;关闭后输入包名安装会被拦截",
|
|
131
|
-
settingsEnableGit: "启用 GitHub 源码安装",
|
|
132
|
-
settingsEnableGitDesc: "允许通过命令行安装 GitHub 源码;关闭后输入仓库地址安装会被拦截",
|
|
133
|
-
settingsEnableDsh: "启用 DSH 命令安装",
|
|
134
|
-
settingsEnableDshDesc: "允许通过命令行粘贴 dsh plugin 命令安装;关闭后命令输入会被禁用",
|
|
135
120
|
settingsDiagnostics: "系统诊断",
|
|
136
121
|
settingsDiagnosticsDesc: "检测 npm 源 / GitHub / 目录站点等安装通道的连通状态",
|
|
137
122
|
settingsLogs: "系统日志",
|
|
@@ -300,11 +285,11 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
300
285
|
failTimeoutHint: "本次操作耗时超过本地上限、已被中断 —— 但很可能其实已经生效了(安装器在超时后会先核对本地已安装列表)。请刷新页面确认当前状态;若确实没生效,可在终端手动执行一次对应命令查看完整输出。这不是插件本身的问题。",
|
|
301
286
|
failProfileLockHint: "DSH 在写入插件清单时等不到文件锁、超时中止 —— 通常是同时有另一个 DSH 进程或安装任务在写同一个 profile(也可能是上一次的进程没退干净留下的锁)。请先关掉其他 dsh 窗口或正在跑的命令,再重试一次;若反复出现,重启一次 DSH。这不是插件本身的问题,也不需要重复{action}。",
|
|
302
287
|
failHostCliSpawnHint: "DSH 没能启动自身来完成这次操作(系统报「找不到可执行文件」):通常是因为 DSH 的安装目录被移动或正在更新,或该 profile 目录还不存在。请重启一次 DSH 后重试;若反复出现,重新安装 DSH。这不是插件本身的问题,换别的插件也一样。",
|
|
303
|
-
failPrepareHint: "该插件安装时的构建脚本执行失败(
|
|
288
|
+
failPrepareHint: "该插件安装时的构建脚本执行失败(npm 分发物不完整),属插件打包分发问题。请向作者仓库提交 Issue 反馈。",
|
|
304
289
|
failMisjudgeHint: "如果这个插件其实能正常安装(上面这个判定是插件中心误报的),请反馈给插件中心:文字提示里的判据由市场自身产出,误报只有靠你的反馈才能被发现。",
|
|
305
290
|
failMisjudgeLink: "插件能装却被拦下?反馈给插件中心",
|
|
306
|
-
failPackagingHint: "
|
|
307
|
-
failIgnoredBuild: "该插件(或其依赖)需要在安装时执行构建脚本,被 pnpm 的安全白名单(allowBuilds)默认拦截,本次操作因此失败(如原生模块 node-pty,或 git 安装时插件自己的 prepare 脚本)。安装器已自动放行该 key
|
|
291
|
+
failPackagingHint: "该插件的 npm 分发物不完整:缺少它需要的文件(`main` / `exports` 声明的入口、补丁按本包名 mount 的入口,或 `dsh.bundle.patch` 声明的补丁)。请到作者仓库提交 Issue 反馈,请其发布包含完整构建产物的 npm 包。",
|
|
292
|
+
failIgnoredBuild: "该插件(或其依赖)需要在安装时执行构建脚本,被 pnpm 的安全白名单(allowBuilds)默认拦截,本次操作因此失败(如原生模块 node-pty,或 git 安装时插件自己的 prepare 脚本)。安装器已自动放行该 key 并重试过一次;仍失败说明构建本身没通过、任何用户都装不上。可先在终端手动执行一次安装命令查看完整构建错误;这属插件的构建/分发问题,请到作者仓库反馈:建议作者预置构建产物、发布含构建产物的 npm 包或提供预构建 .tgz。",
|
|
308
293
|
failNpmTooLow: "怀疑本机 npm 版本过低:npm 解析插件依赖时内部崩溃(这是 npm 自身的已知缺陷,不是插件问题)。请升级 npm 后重试:npm install -g npm@latest",
|
|
309
294
|
failNpmTooLowV: "本机 npm 版本过低(当前 v{v}):npm 解析插件依赖时内部崩溃(这是 npm 自身的已知缺陷,不是插件问题)。请升级 npm 后重试:npm install -g npm@latest",
|
|
310
295
|
failNetworkHint: "{action}前检测到网络不通:无法连接到安装源(可能是断网、DNS 解析失败、被防火墙拦截,或代理配置有问题)。这不是插件本身的问题 —— 请检查网络连接,或到「设置」里确认 HTTP 代理配置,再到「系统诊断」运行一次连通性检测,然后重试。",
|
|
@@ -333,8 +318,6 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
333
318
|
failPnpmPolicyHint: "安装器调用 pnpm 时被其供应链安全策略拦截——装任何插件都会撞墙,不是插件本身的问题。分两种情况处理:① 提示「Minimum release age」(ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION):包发布还不满 24 小时,pnpm 11 出于安全会拒收这种刚发布的新包。可在 pnpm 配置(pnpm-workspace.yaml)里加 minimumReleaseAge: 0 豁免,或等满 24 小时后重试。② 提示「untrusted origin」(ERR_PNPM_UNTRUSTED_ORIGIN):依赖来源不被本机 pnpm 信任,通常是该 profile 里之前用 github: 或非官方 npm 源装过插件,锁文件记录了不受信任的来源。请删除该 profile 目录下的 node_modules 与 pnpm-lock.yaml 后重新安装(可先到「系统日志」或 ~/.dsh/profiles/<profile>/hub.log 查看完整报错)。",
|
|
334
319
|
failPnpmReleaseAgeHint: "安装器调用 pnpm 时被其供应链安全策略拦住了,任何插件装进这个 profile 都会先撞上它——与插件本身无关。原因是这个包发布还不满 24 小时,pnpm 11 出于安全会拒收刚发布的新包,这段时间内该 profile 的安装与卸载都会被拦下。可重试时间:{time}(即该包发布满 24 小时后)。如确需立刻安装,可在 profile 目录(~/.dsh/profiles/<profile>)的 pnpm-workspace.yaml 里加 minimumReleaseAge: 0 豁免,但这会放宽整个 profile 的供应链保护。",
|
|
335
320
|
installChannelNpm: "NPM 包",
|
|
336
|
-
installChannelGit: "GitHub 源码",
|
|
337
|
-
installChannelDsh: "DSH 命令",
|
|
338
321
|
installEntryLine: "安装入口:{c}。",
|
|
339
322
|
reportIssue: "去插件仓库提交 Issue",
|
|
340
323
|
detail: "打开详情",
|
|
@@ -406,34 +389,23 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
406
389
|
viewSettings: "Settings",
|
|
407
390
|
viewMarketHint: "Browse and discover plugins",
|
|
408
391
|
viewInstalledHint: "Manage installed plugins",
|
|
409
|
-
viewCustomHint: "Install npm packages
|
|
392
|
+
viewCustomHint: "Install npm packages manually",
|
|
410
393
|
viewSettingsHint: "Network sources and preferences",
|
|
411
394
|
installedEmpty: "No plugins installed yet",
|
|
412
|
-
installedEmptyDesc: "Go to Custom to add an npm package
|
|
395
|
+
installedEmptyDesc: "Go to Custom to add an npm package manually",
|
|
413
396
|
npmInstallLabel: "npm package / command",
|
|
414
397
|
npmInstallPlaceholder: "npm install <pkg> or a bare package name",
|
|
415
398
|
npmInstallExample: "Native commands: npm install lodash, npm i lodash, pnpm add @scope/pkg",
|
|
416
399
|
npmInstallExample2: "Global CLI: npm install -g @scope/cli; or just type a package name like lodash",
|
|
417
400
|
npmInstallInvalid: "Enter an npm package name (e.g. lodash, @scope/pkg), or a native install command (e.g. npm install lodash, npm i lodash, pnpm add @scope/pkg, npm install -g @scope/cli)",
|
|
418
|
-
gitInstallLabel: "GitHub source",
|
|
419
|
-
gitInstallPlaceholder: "Repository address",
|
|
420
|
-
gitInstallExample: "e.g. owner/repo or https://github.com/owner/repo",
|
|
421
|
-
gitInstallInvalid: "Enter a GitHub repository address, e.g. owner/repo or https://github.com/owner/repo",
|
|
422
|
-
dshCmdLabel: "DeepSeek Harness command",
|
|
423
|
-
dshCmdPlaceholder: "Paste an official dsh plugin command",
|
|
424
|
-
dshCmdInsertHubUpdate: "Insert update command",
|
|
425
|
-
dshCmdExample: "e.g. dsh plugin --profile {profile} add github:owner/repo, or dsh plugin --profile {profile} update dsh-plugin",
|
|
426
|
-
dshCmdInvalid: "Paste an official dsh plugin command (--profile required, add / update), e.g. dsh plugin --profile {profile} update dsh-plugin",
|
|
427
401
|
installHelp: "Help",
|
|
428
402
|
helpModalTitle: "Supported command formats",
|
|
429
403
|
npmInstallHelp: "lodash or @scope/pkg just type the package name\nnpm install lodash\nnpm i lodash\npnpm add @scope/pkg\npnpm i @scope/pkg\nnpm install -g @scope/cli installs the CLI globally, not shown in Installed",
|
|
430
|
-
gitInstallHelp: "owner/repo\nhttps://github.com/owner/repo\ngithub:owner/repo\ngit+https://github.com/owner/repo.git\ngit@github.com:owner/repo.git",
|
|
431
|
-
dshCmdHelp: "dsh plugin --profile {profile} add <target> install\ndsh plugin --profile {profile} update <target> update an installed target to the latest version\ndsh plugin --profile={profile} add <target>\ndsh plugin --profile={profile} update <target>\n --profile is required (prefilled with the current profile here) and there is no -p shorthand; <target> can be an npm package or github:owner/repo; uninstall from the Installed list",
|
|
432
404
|
globalNpmHint: "This installs CLI tools globally (npm install -g). They won't appear in Installed and no host restart is needed.",
|
|
433
405
|
installCliBtn: "Install",
|
|
434
406
|
channelDisabledHint: "This install channel is disabled — enable it in Settings → Security & Trust",
|
|
435
407
|
goToSettings: "Go to Settings",
|
|
436
|
-
customViewDesc: "Manually install an npm package
|
|
408
|
+
customViewDesc: "Manually install an npm package outside the catalog. Finished installs appear in Installed, marked as custom.",
|
|
437
409
|
customLabel: "Custom install",
|
|
438
410
|
installedSearch: "Search installed plugins…",
|
|
439
411
|
installedFilterCatalog: "Catalog",
|
|
@@ -487,13 +459,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
487
459
|
mirrorTencent: "Tencent Cloud mirror",
|
|
488
460
|
mirrorTsinghua: "Tsinghua TUNA mirror",
|
|
489
461
|
settingsSecurity: "Security & Trust",
|
|
490
|
-
settingsSecurityDesc: "Toggles for
|
|
462
|
+
settingsSecurityDesc: "Toggles for command-line installs: npm packages",
|
|
491
463
|
settingsEnableNpm: "Enable npm installs",
|
|
492
464
|
settingsEnableNpmDesc: "Allow installing npm packages from the command line; turning this off rejects package-name installs",
|
|
493
|
-
settingsEnableGit: "Enable GitHub source installs",
|
|
494
|
-
settingsEnableGitDesc: "Allow installing from GitHub sources on the command line; turning this off rejects repository-address installs",
|
|
495
|
-
settingsEnableDsh: "Enable DSH command installs",
|
|
496
|
-
settingsEnableDshDesc: "Allow pasting a dsh plugin command to install; turning this off disables the command input",
|
|
497
465
|
settingsDiagnostics: "System Diagnostics",
|
|
498
466
|
settingsDiagnosticsDesc: "Check the connectivity of install channels: npm registry, GitHub and the catalog site",
|
|
499
467
|
settingsLogs: "System Logs",
|
|
@@ -663,11 +631,11 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
663
631
|
failTimeoutHint: "This operation exceeded the local time limit and was interrupted — but it may well have taken effect already (the installer re-checks the installed list after a timeout). Refresh the page to confirm the current state; if it did not take effect, run the corresponding command in a terminal to see the full output. This is not a plugin problem.",
|
|
664
632
|
failProfileLockHint: "DSH timed out waiting for the file lock while writing the plugin list — usually because another DSH process or install task is writing the same profile (sometimes a previous run left the lock behind). Close other dsh windows or running commands, then retry; if it keeps happening, restart DSH once. This is not a plugin problem, and there is no need to repeat the {action}.",
|
|
665
633
|
failHostCliSpawnHint: "DSH could not start itself to perform this operation (the system reported that the executable was not found). This usually means the DSH installation folder has been moved or is being updated, or that the profile directory does not exist yet. Restart DSH and retry; if it keeps happening, reinstall DSH. This is not a plugin problem — other plugins would fail the same way.",
|
|
666
|
-
failPrepareHint: "This plugin failed while running its build scripts during install (
|
|
634
|
+
failPrepareHint: "This plugin failed while running its build scripts during install (the published npm package is incomplete). This is a packaging issue of the plugin itself — please report it to the author repository.",
|
|
667
635
|
failMisjudgeHint: "If this plugin actually installs fine (the verdict above is the Plugin Hub misjudging it), please report it to the Hub: that verdict is produced by the marketplace itself, so a false positive can only be found through your feedback.",
|
|
668
636
|
failMisjudgeLink: "Plugin installs fine but got blocked? Report to the Plugin Hub",
|
|
669
637
|
failPackagingHint: "This plugin does not support the official default install method: its git distribution lacks a file the package needs (the entry from `main` / `exports`, an entry its own patch mounts by name, or the patch declared by `dsh.bundle.patch`), 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, a prebuilt release `.tgz` (`releases/download/<tag>/<asset>.tgz`), or a complete npm release.",
|
|
670
|
-
failIgnoredBuild: "This plugin (or one of its dependencies) needs to run build scripts at install time, which pnpm blocks by default via its allowBuilds allowlist — so this operation fails (e.g. native modules like node-pty, or the plugin's own prepare script on git installs). The installer already auto-allows that key and retries once; if it still fails, the build itself is
|
|
638
|
+
failIgnoredBuild: "This plugin (or one of its dependencies) needs to run build scripts at install time, which pnpm blocks by default via its allowBuilds allowlist — so this operation fails (e.g. native modules like node-pty, or the plugin's own prepare script on git installs). The installer already auto-allows that key and retries once; if it still fails, the build itself is the problem, so no user can install it. Run the install command in a terminal to see the full build error; this is a build/distribution issue of the plugin itself — please report it to the author repository, asking them to ship prebuilt output, a complete npm release, or a prebuilt .tgz.",
|
|
671
639
|
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",
|
|
672
640
|
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",
|
|
673
641
|
failNetworkHint: "The network could not be reached before the {action}: the install source is unreachable (offline, DNS failure, firewall block, or a misconfigured proxy). This is not a problem with the plugin itself — please check your connection, confirm the HTTP proxy in Settings, run a connectivity check under System Diagnostics, then retry.",
|
|
@@ -696,8 +664,6 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
696
664
|
failPnpmPolicyHint: "The installer was blocked by pnpm supply-chain security policy — every plugin install would hit the same wall, so this is not a problem with the plugin itself. Two cases: ① \"Minimum release age\" (ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION): the package was published less than 24 hours ago, and pnpm 11 refuses freshly-published packages for safety. Add minimumReleaseAge: 0 to your pnpm config (pnpm-workspace.yaml) to opt out, or wait until the 24 hours have passed and retry. ② \"untrusted origin\" (ERR_PNPM_UNTRUSTED_ORIGIN): a dependency source is not trusted by this machine, usually because plugins were previously installed via github: or a non-official npm registry, so the lockfile records an untrusted source. Delete node_modules and pnpm-lock.yaml under the profile directory (see System Logs or ~/.dsh/profiles/<profile>/hub.log for the full output), then reinstall.",
|
|
697
665
|
failPnpmReleaseAgeHint: "The installer was blocked by pnpm supply-chain security policy, and every plugin installed into this profile would hit the same wall — this is not a problem with the plugin itself. The package was published less than 24 hours ago, and pnpm 11 refuses freshly-published packages for safety, so both installs and removals are blocked for this profile in the meantime. Retry after: {time} (i.e. 24 hours after the package was published). If you must install right now, add minimumReleaseAge: 0 to pnpm-workspace.yaml inside the profile directory (~/.dsh/profiles/<profile>) to opt out, but that loosens supply-chain protection for the whole profile.",
|
|
698
666
|
installChannelNpm: "NPM package",
|
|
699
|
-
installChannelGit: "GitHub source",
|
|
700
|
-
installChannelDsh: "DSH command",
|
|
701
667
|
installEntryLine: "Install entry: {c}.",
|
|
702
668
|
reportIssue: "Report an Issue to the plugin repo",
|
|
703
669
|
detail: "Open details",
|
|
@@ -752,42 +718,42 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
752
718
|
css: css$11
|
|
753
719
|
});
|
|
754
720
|
var Header_module_css_default = {
|
|
755
|
-
"
|
|
756
|
-
"
|
|
721
|
+
"githubIcon": "qikqja_githubIcon",
|
|
722
|
+
"tab": "qikqja_tab",
|
|
757
723
|
"resultSeg": "qikqja_resultSeg",
|
|
758
724
|
"searchRow": "qikqja_searchRow",
|
|
759
|
-
"
|
|
760
|
-
"tab": "qikqja_tab",
|
|
761
|
-
"adText": "qikqja_adText",
|
|
762
|
-
"versionBtn": "qikqja_versionBtn",
|
|
763
|
-
"segGroup": "qikqja_segGroup",
|
|
764
|
-
"headerRight": "qikqja_headerRight",
|
|
765
|
-
"segLabel": "qikqja_segLabel",
|
|
766
|
-
"adBadge": "qikqja_adBadge",
|
|
767
|
-
"controls": "qikqja_controls",
|
|
768
|
-
"tabCount": "qikqja_tabCount",
|
|
769
|
-
"adArrow": "qikqja_adArrow",
|
|
770
|
-
"githubLink": "qikqja_githubLink",
|
|
771
|
-
"version": "qikqja_version",
|
|
725
|
+
"header": "qikqja_header",
|
|
772
726
|
"segBtnActive": "qikqja_segBtnActive",
|
|
773
|
-
"
|
|
727
|
+
"version": "qikqja_version",
|
|
728
|
+
"brandTitle": "qikqja_brandTitle",
|
|
729
|
+
"root": "qikqja_root",
|
|
774
730
|
"sortGroup": "qikqja_sortGroup",
|
|
775
|
-
"
|
|
776
|
-
"
|
|
777
|
-
"githubIcon": "qikqja_githubIcon",
|
|
778
|
-
"aboutBtn": "qikqja_aboutBtn",
|
|
779
|
-
"tagline": "qikqja_tagline",
|
|
731
|
+
"tabsRow": "qikqja_tabsRow",
|
|
732
|
+
"adText": "qikqja_adText",
|
|
780
733
|
"segBtn": "qikqja_segBtn",
|
|
781
|
-
"
|
|
734
|
+
"tagline": "qikqja_tagline",
|
|
782
735
|
"resultCount": "qikqja_resultCount",
|
|
783
|
-
"
|
|
784
|
-
"
|
|
785
|
-
"
|
|
786
|
-
"tabs": "qikqja_tabs",
|
|
736
|
+
"headerRight": "qikqja_headerRight",
|
|
737
|
+
"segGroup": "qikqja_segGroup",
|
|
738
|
+
"langBtn": "qikqja_langBtn",
|
|
787
739
|
"title": "qikqja_title",
|
|
740
|
+
"githubLink": "qikqja_githubLink",
|
|
788
741
|
"headerTitleRow": "qikqja_headerTitleRow",
|
|
789
|
-
"
|
|
790
|
-
"
|
|
742
|
+
"tabCount": "qikqja_tabCount",
|
|
743
|
+
"versionBtn": "qikqja_versionBtn",
|
|
744
|
+
"hubUpdateBadge": "qikqja_hubUpdateBadge",
|
|
745
|
+
"controls": "qikqja_controls",
|
|
746
|
+
"adBadge": "qikqja_adBadge",
|
|
747
|
+
"segLabel": "qikqja_segLabel",
|
|
748
|
+
"taglineLink": "qikqja_taglineLink",
|
|
749
|
+
"logoIcon": "qikqja_logoIcon",
|
|
750
|
+
"tabs": "qikqja_tabs",
|
|
751
|
+
"adBanner": "qikqja_adBanner",
|
|
752
|
+
"aboutBtn": "qikqja_aboutBtn",
|
|
753
|
+
"search": "qikqja_search",
|
|
754
|
+
"copyIcon": "qikqja_copyIcon",
|
|
755
|
+
"adArrow": "qikqja_adArrow",
|
|
756
|
+
"tabActive": "qikqja_tabActive"
|
|
791
757
|
};
|
|
792
758
|
//#endregion
|
|
793
759
|
//#region \0dsh-css:src/client/styles/Modal.module.css.mjs
|
|
@@ -806,153 +772,153 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
806
772
|
css: css$10
|
|
807
773
|
});
|
|
808
774
|
var Modal_module_css_default = {
|
|
809
|
-
"
|
|
810
|
-
"
|
|
811
|
-
"resultDesc": "BiQ1zG_resultDesc",
|
|
812
|
-
"modalCmdText": "BiQ1zG_modalCmdText",
|
|
813
|
-
"resultTitle": "BiQ1zG_resultTitle",
|
|
814
|
-
"detailPathBtn": "BiQ1zG_detailPathBtn",
|
|
815
|
-
"errorCopySoft": "BiQ1zG_errorCopySoft",
|
|
816
|
-
"modalInstall": "BiQ1zG_modalInstall",
|
|
817
|
-
"hubUpdateMetaItem": "BiQ1zG_hubUpdateMetaItem",
|
|
818
|
-
"noticeBadgeOk": "BiQ1zG_noticeBadgeOk",
|
|
819
|
-
"restartNow": "BiQ1zG_restartNow",
|
|
820
|
-
"modalActions": "BiQ1zG_modalActions",
|
|
821
|
-
"noticeMain": "BiQ1zG_noticeMain",
|
|
775
|
+
"hubUpdateNotes": "BiQ1zG_hubUpdateNotes",
|
|
776
|
+
"noticeRowOk": "BiQ1zG_noticeRowOk",
|
|
822
777
|
"queueRowStatus": "BiQ1zG_queueRowStatus",
|
|
823
|
-
"
|
|
824
|
-
"
|
|
825
|
-
"
|
|
826
|
-
"
|
|
827
|
-
"
|
|
778
|
+
"toastFail": "BiQ1zG_toastFail",
|
|
779
|
+
"failHead": "BiQ1zG_failHead",
|
|
780
|
+
"queueRowPct": "BiQ1zG_queueRowPct",
|
|
781
|
+
"modalBody": "BiQ1zG_modalBody",
|
|
782
|
+
"resultTitle": "BiQ1zG_resultTitle",
|
|
783
|
+
"errorHint": "BiQ1zG_errorHint",
|
|
784
|
+
"queueRowDesc": "BiQ1zG_queueRowDesc",
|
|
785
|
+
"detailLabel": "BiQ1zG_detailLabel",
|
|
828
786
|
"detailArrow": "BiQ1zG_detailArrow",
|
|
829
|
-
"
|
|
830
|
-
"
|
|
787
|
+
"hubUpdateMeta": "BiQ1zG_hubUpdateMeta",
|
|
788
|
+
"errorModal": "BiQ1zG_errorModal",
|
|
789
|
+
"detailStars": "BiQ1zG_detailStars",
|
|
790
|
+
"pendingRowActions": "BiQ1zG_pendingRowActions",
|
|
791
|
+
"overlay": "BiQ1zG_overlay",
|
|
792
|
+
"failRepo": "BiQ1zG_failRepo",
|
|
793
|
+
"linkIcon": "BiQ1zG_linkIcon",
|
|
794
|
+
"failKind": "BiQ1zG_failKind",
|
|
831
795
|
"modalLabel": "BiQ1zG_modalLabel",
|
|
832
|
-
"
|
|
833
|
-
"
|
|
834
|
-
"
|
|
796
|
+
"modalWide": "BiQ1zG_modalWide",
|
|
797
|
+
"errorCopySoft": "BiQ1zG_errorCopySoft",
|
|
798
|
+
"restartNowWarning": "BiQ1zG_restartNowWarning",
|
|
799
|
+
"noticeIgnore": "BiQ1zG_noticeIgnore",
|
|
835
800
|
"confirmIcon": "BiQ1zG_confirmIcon",
|
|
836
|
-
"
|
|
837
|
-
"
|
|
838
|
-
"queueSection": "BiQ1zG_queueSection",
|
|
839
|
-
"stripCancel": "BiQ1zG_stripCancel",
|
|
840
|
-
"confirmPrimary": "BiQ1zG_confirmPrimary",
|
|
841
|
-
"progressFill": "BiQ1zG_progressFill",
|
|
842
|
-
"noticeRow": "BiQ1zG_noticeRow",
|
|
843
|
-
"noticeTextOk": "BiQ1zG_noticeTextOk",
|
|
844
|
-
"errorHint": "BiQ1zG_errorHint",
|
|
845
|
-
"noticeRemove": "BiQ1zG_noticeRemove",
|
|
846
|
-
"failKindInstall": "BiQ1zG_failKindInstall",
|
|
847
|
-
"detailRow": "BiQ1zG_detailRow",
|
|
801
|
+
"restartLater": "BiQ1zG_restartLater",
|
|
802
|
+
"detailPath": "BiQ1zG_detailPath",
|
|
848
803
|
"detailStatusRunning": "BiQ1zG_detailStatusRunning",
|
|
849
|
-
"
|
|
850
|
-
"
|
|
804
|
+
"modalCmdText": "BiQ1zG_modalCmdText",
|
|
805
|
+
"modalTitleQueued": "BiQ1zG_modalTitleQueued",
|
|
806
|
+
"queueRowTrack": "BiQ1zG_queueRowTrack",
|
|
807
|
+
"failList": "BiQ1zG_failList",
|
|
808
|
+
"queueRowTarget": "BiQ1zG_queueRowTarget",
|
|
809
|
+
"queueRowHead": "BiQ1zG_queueRowHead",
|
|
810
|
+
"modalActions": "BiQ1zG_modalActions",
|
|
811
|
+
"failCopy": "BiQ1zG_failCopy",
|
|
812
|
+
"noticeFoot": "BiQ1zG_noticeFoot",
|
|
851
813
|
"dangerConfirm": "BiQ1zG_dangerConfirm",
|
|
814
|
+
"modalLink": "BiQ1zG_modalLink",
|
|
815
|
+
"failKindInstall": "BiQ1zG_failKindInstall",
|
|
816
|
+
"aboutModal": "BiQ1zG_aboutModal",
|
|
817
|
+
"confirmIconDanger": "BiQ1zG_confirmIconDanger",
|
|
818
|
+
"hubUpdateModal": "BiQ1zG_hubUpdateModal",
|
|
819
|
+
"failedCopyHint": "BiQ1zG_failedCopyHint",
|
|
820
|
+
"stripCancel": "BiQ1zG_stripCancel",
|
|
821
|
+
"overlayIn": "BiQ1zG_overlayIn",
|
|
822
|
+
"resultCheck": "BiQ1zG_resultCheck",
|
|
823
|
+
"resultRestarting": "BiQ1zG_resultRestarting",
|
|
852
824
|
"detailMono": "BiQ1zG_detailMono",
|
|
853
|
-
"
|
|
854
|
-
"
|
|
855
|
-
"
|
|
856
|
-
"hubUpdateMeta": "BiQ1zG_hubUpdateMeta",
|
|
857
|
-
"confirmIconWrap": "BiQ1zG_confirmIconWrap",
|
|
858
|
-
"detailStars": "BiQ1zG_detailStars",
|
|
859
|
-
"queueSectionTitle": "BiQ1zG_queueSectionTitle",
|
|
860
|
-
"resultCheckIcon": "BiQ1zG_resultCheckIcon",
|
|
861
|
-
"noticeBadgeFail": "BiQ1zG_noticeBadgeFail",
|
|
862
|
-
"noticeHead": "BiQ1zG_noticeHead",
|
|
863
|
-
"pendingRowStatus": "BiQ1zG_pendingRowStatus",
|
|
864
|
-
"failCopy": "BiQ1zG_failCopy",
|
|
865
|
-
"hubUpdateNotes": "BiQ1zG_hubUpdateNotes",
|
|
825
|
+
"noticeRemove": "BiQ1zG_noticeRemove",
|
|
826
|
+
"modal": "BiQ1zG_modal",
|
|
827
|
+
"errorTitle": "BiQ1zG_errorTitle",
|
|
866
828
|
"detailDim": "BiQ1zG_detailDim",
|
|
867
|
-
"
|
|
868
|
-
"
|
|
869
|
-
"
|
|
829
|
+
"noticeUpdateGo": "BiQ1zG_noticeUpdateGo",
|
|
830
|
+
"failKindUninstall": "BiQ1zG_failKindUninstall",
|
|
831
|
+
"failNetworkTarget": "BiQ1zG_failNetworkTarget",
|
|
832
|
+
"queuedHint": "BiQ1zG_queuedHint",
|
|
870
833
|
"trustHint": "BiQ1zG_trustHint",
|
|
871
|
-
"
|
|
872
|
-
"
|
|
873
|
-
"
|
|
834
|
+
"detailPathActions": "BiQ1zG_detailPathActions",
|
|
835
|
+
"failClear": "BiQ1zG_failClear",
|
|
836
|
+
"noticeHead": "BiQ1zG_noticeHead",
|
|
837
|
+
"noticeBadgeIcon": "BiQ1zG_noticeBadgeIcon",
|
|
838
|
+
"aboutContent": "BiQ1zG_aboutContent",
|
|
874
839
|
"modalTitle": "BiQ1zG_modalTitle",
|
|
875
840
|
"detailModal": "BiQ1zG_detailModal",
|
|
876
|
-
"restartNowWarning": "BiQ1zG_restartNowWarning",
|
|
877
|
-
"noticeIgnore": "BiQ1zG_noticeIgnore",
|
|
878
|
-
"detailStatusPending": "BiQ1zG_detailStatusPending",
|
|
879
|
-
"failBigIssue": "BiQ1zG_failBigIssue",
|
|
880
|
-
"modalRow": "BiQ1zG_modalRow",
|
|
881
|
-
"noticeFoot": "BiQ1zG_noticeFoot",
|
|
882
|
-
"modalCmdCopy": "BiQ1zG_modalCmdCopy",
|
|
883
|
-
"queueRowPct": "BiQ1zG_queueRowPct",
|
|
884
|
-
"failedCopyHint": "BiQ1zG_failedCopyHint",
|
|
885
|
-
"modalCancel": "BiQ1zG_modalCancel",
|
|
886
|
-
"queueRowBody": "BiQ1zG_queueRowBody",
|
|
887
|
-
"failDiagBtn": "BiQ1zG_failDiagBtn",
|
|
888
|
-
"failMisjudgeLink": "BiQ1zG_failMisjudgeLink",
|
|
889
|
-
"logModal": "BiQ1zG_logModal",
|
|
890
|
-
"cliOnlyHint": "BiQ1zG_cliOnlyHint",
|
|
891
|
-
"failClear": "BiQ1zG_failClear",
|
|
892
841
|
"noticeRowMain": "BiQ1zG_noticeRowMain",
|
|
893
|
-
"
|
|
894
|
-
"
|
|
895
|
-
"
|
|
842
|
+
"progressFill": "BiQ1zG_progressFill",
|
|
843
|
+
"queueRow": "BiQ1zG_queueRow",
|
|
844
|
+
"detailGrid": "BiQ1zG_detailGrid",
|
|
845
|
+
"progressHead": "BiQ1zG_progressHead",
|
|
896
846
|
"result": "BiQ1zG_result",
|
|
897
|
-
"noticeTextFail": "BiQ1zG_noticeTextFail",
|
|
898
|
-
"failHead": "BiQ1zG_failHead",
|
|
899
|
-
"queueRowTarget": "BiQ1zG_queueRowTarget",
|
|
900
|
-
"detailPath": "BiQ1zG_detailPath",
|
|
901
|
-
"hubUpdateModal": "BiQ1zG_hubUpdateModal",
|
|
902
|
-
"failRepo": "BiQ1zG_failRepo",
|
|
903
|
-
"uninstallConfirm": "BiQ1zG_uninstallConfirm",
|
|
904
|
-
"modalBody": "BiQ1zG_modalBody",
|
|
905
|
-
"modalValue": "BiQ1zG_modalValue",
|
|
906
|
-
"helpModal": "BiQ1zG_helpModal",
|
|
907
847
|
"failEmpty": "BiQ1zG_failEmpty",
|
|
908
|
-
"
|
|
909
|
-
"
|
|
910
|
-
"
|
|
911
|
-
"
|
|
912
|
-
"
|
|
913
|
-
"
|
|
914
|
-
"
|
|
848
|
+
"hubUpdateMetaItem": "BiQ1zG_hubUpdateMetaItem",
|
|
849
|
+
"queueSection": "BiQ1zG_queueSection",
|
|
850
|
+
"modalClose": "BiQ1zG_modalClose",
|
|
851
|
+
"progressText": "BiQ1zG_progressText",
|
|
852
|
+
"errorBox": "BiQ1zG_errorBox",
|
|
853
|
+
"noticeTextFail": "BiQ1zG_noticeTextFail",
|
|
854
|
+
"detailPathText": "BiQ1zG_detailPathText",
|
|
915
855
|
"toastIn": "BiQ1zG_toastIn",
|
|
916
|
-
"
|
|
917
|
-
"
|
|
856
|
+
"failDiagBtn": "BiQ1zG_failDiagBtn",
|
|
857
|
+
"modalInstall": "BiQ1zG_modalInstall",
|
|
858
|
+
"queueSectionTitle": "BiQ1zG_queueSectionTitle",
|
|
859
|
+
"detailValue": "BiQ1zG_detailValue",
|
|
860
|
+
"failMisjudgeLink": "BiQ1zG_failMisjudgeLink",
|
|
861
|
+
"resultCheckIcon": "BiQ1zG_resultCheckIcon",
|
|
918
862
|
"modalTitleBusy": "BiQ1zG_modalTitleBusy",
|
|
919
|
-
"
|
|
863
|
+
"confirmIconWrap": "BiQ1zG_confirmIconWrap",
|
|
864
|
+
"noticeRow": "BiQ1zG_noticeRow",
|
|
865
|
+
"modalCloseIcon": "BiQ1zG_modalCloseIcon",
|
|
866
|
+
"modalCopy": "BiQ1zG_modalCopy",
|
|
867
|
+
"confirmPrimary": "BiQ1zG_confirmPrimary",
|
|
868
|
+
"cliOnlyHint": "BiQ1zG_cliOnlyHint",
|
|
869
|
+
"modalRow": "BiQ1zG_modalRow",
|
|
870
|
+
"detailLink": "BiQ1zG_detailLink",
|
|
871
|
+
"noticeBadgeOk": "BiQ1zG_noticeBadgeOk",
|
|
872
|
+
"modalCancel": "BiQ1zG_modalCancel",
|
|
873
|
+
"detailStatusPending": "BiQ1zG_detailStatusPending",
|
|
874
|
+
"modalHead": "BiQ1zG_modalHead",
|
|
875
|
+
"queueRowBody": "BiQ1zG_queueRowBody",
|
|
876
|
+
"failPrepareHint": "BiQ1zG_failPrepareHint",
|
|
877
|
+
"aboutMeta": "BiQ1zG_aboutMeta",
|
|
878
|
+
"resultDesc": "BiQ1zG_resultDesc",
|
|
879
|
+
"helpModal": "BiQ1zG_helpModal",
|
|
880
|
+
"noticeMain": "BiQ1zG_noticeMain",
|
|
881
|
+
"noticeTime": "BiQ1zG_noticeTime",
|
|
920
882
|
"modalDesc": "BiQ1zG_modalDesc",
|
|
921
|
-
"
|
|
922
|
-
"
|
|
883
|
+
"modalCmd": "BiQ1zG_modalCmd",
|
|
884
|
+
"noticeList": "BiQ1zG_noticeList",
|
|
885
|
+
"failRow": "BiQ1zG_failRow",
|
|
923
886
|
"noticeRowUpdate": "BiQ1zG_noticeRowUpdate",
|
|
924
|
-
"
|
|
925
|
-
"
|
|
926
|
-
"
|
|
927
|
-
"
|
|
928
|
-
"
|
|
929
|
-
"
|
|
930
|
-
"
|
|
887
|
+
"detailPathBtn": "BiQ1zG_detailPathBtn",
|
|
888
|
+
"failBigIssue": "BiQ1zG_failBigIssue",
|
|
889
|
+
"pendingRowStatus": "BiQ1zG_pendingRowStatus",
|
|
890
|
+
"restartNow": "BiQ1zG_restartNow",
|
|
891
|
+
"noticeTextOk": "BiQ1zG_noticeTextOk",
|
|
892
|
+
"uninstallConfirm": "BiQ1zG_uninstallConfirm",
|
|
893
|
+
"modalIn": "BiQ1zG_modalIn",
|
|
931
894
|
"progress": "BiQ1zG_progress",
|
|
932
|
-
"
|
|
933
|
-
"
|
|
934
|
-
"
|
|
935
|
-
"
|
|
936
|
-
"
|
|
937
|
-
"
|
|
938
|
-
"
|
|
939
|
-
"
|
|
895
|
+
"noticeBadgeFail": "BiQ1zG_noticeBadgeFail",
|
|
896
|
+
"progressTrack": "BiQ1zG_progressTrack",
|
|
897
|
+
"modalCmdCopy": "BiQ1zG_modalCmdCopy",
|
|
898
|
+
"progressFillFail": "BiQ1zG_progressFillFail",
|
|
899
|
+
"detailUpdateHint": "BiQ1zG_detailUpdateHint",
|
|
900
|
+
"toast": "BiQ1zG_toast",
|
|
901
|
+
"detailStatusText": "BiQ1zG_detailStatusText",
|
|
902
|
+
"logModal": "BiQ1zG_logModal",
|
|
903
|
+
"modalValue": "BiQ1zG_modalValue",
|
|
904
|
+
"noticeVersion": "BiQ1zG_noticeVersion",
|
|
905
|
+
"detailRow": "BiQ1zG_detailRow"
|
|
940
906
|
};
|
|
941
907
|
//#endregion
|
|
942
908
|
//#region src/server/services/install/release-target.ts
|
|
943
|
-
/**
|
|
944
|
-
const DSH_PLUGIN_CMD_RE
|
|
909
|
+
/** 完整命令前缀:`dsh plugin --profile <p> add|update <target>`(与 profile.ts installTargetOf 同口径)。 */
|
|
910
|
+
const DSH_PLUGIN_CMD_RE = /^dsh[ \t]+plugin[ \t]+--profile(?:[ \t]+|=)[A-Za-z0-9_-]+[ \t]+(?:add|update)[ \t]+(.+)$/i;
|
|
945
911
|
/** 固定形态的 release .tgz 直链:主机、路径段与扩展名全部锁死。 */
|
|
946
912
|
const RELEASE_URL_RE = /^https:\/\/github\.com\/([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+)\/releases\/download\/([A-Za-z0-9._+-]+)\/([A-Za-z0-9._+-]+\.tgz)$/;
|
|
947
913
|
/**
|
|
948
|
-
*
|
|
949
|
-
* @param value -
|
|
914
|
+
* 解析一个历史安装目标里的 release 直链。
|
|
915
|
+
* @param value - 完整命令(`dsh plugin --profile web add <url>`)或裸直链。
|
|
950
916
|
* @returns 命中返回 `{ target, repo }`,否则 null。
|
|
951
917
|
*/
|
|
952
918
|
function githubReleaseTarget(value) {
|
|
953
919
|
const input = typeof value === "string" ? value.trim() : "";
|
|
954
920
|
if (input === "") return null;
|
|
955
|
-
const command = DSH_PLUGIN_CMD_RE
|
|
921
|
+
const command = DSH_PLUGIN_CMD_RE.exec(input);
|
|
956
922
|
const raw = command !== null ? command[1].trim() : input;
|
|
957
923
|
const match = RELEASE_URL_RE.exec(raw);
|
|
958
924
|
if (match === null) return null;
|
|
@@ -964,54 +930,30 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
964
930
|
}
|
|
965
931
|
//#endregion
|
|
966
932
|
//#region src/client/logic/install-command.ts
|
|
967
|
-
/**
|
|
968
|
-
*
|
|
933
|
+
/** 后端 attempts 按时间先后排列:取最后一次实际执行的命令,取不到再回退到展示用命令。
|
|
934
|
+
* 这里匹配的是任务队列记录的指令形态,不是要在此执行的命令。
|
|
969
935
|
*/
|
|
970
936
|
function executedCommandOf(command, attempts) {
|
|
971
937
|
if (attempts === void 0) return command;
|
|
972
938
|
return attempts.slice().reverse().find((attempt) => /^dsh plugin --profile(?:=| )\S+ (?:add|remove|update) \S/.test(attempt) || /^npm install -g \S/.test(attempt));
|
|
973
939
|
}
|
|
974
940
|
/**
|
|
975
|
-
*
|
|
976
|
-
* (走 npm registry tarball
|
|
977
|
-
*
|
|
978
|
-
* 都没有 → git 直装。
|
|
979
|
-
* 返回值 target 即传给后端 /install 的安装目标(npm 包名 / release URL / owner/repo)。
|
|
941
|
+
* 目录条目的安装目标(用户无感知):目录条目必带 npm 包名,直接用该包名安装
|
|
942
|
+
* (走 npm registry tarball)。
|
|
943
|
+
* 返回值即传给后端 /install 的安装目标(npm 包名)。
|
|
980
944
|
*/
|
|
981
945
|
function installTargetOf(p) {
|
|
982
|
-
|
|
983
|
-
const repo = (p.source?.repo ?? "").trim();
|
|
984
|
-
if (pkg && repo) return {
|
|
985
|
-
target: pkg,
|
|
986
|
-
via: "npm"
|
|
987
|
-
};
|
|
988
|
-
const release = githubReleaseTarget(p.install?.githubCommand ?? "");
|
|
989
|
-
if (release !== null && repo !== "" && release.repo.toLowerCase() === repo.toLowerCase()) return {
|
|
990
|
-
target: release.target,
|
|
991
|
-
via: "release"
|
|
992
|
-
};
|
|
993
|
-
return {
|
|
994
|
-
target: repo,
|
|
995
|
-
via: "github"
|
|
996
|
-
};
|
|
946
|
+
return (p.source?.npmPackage ?? "").trim();
|
|
997
947
|
}
|
|
998
948
|
/** 展示用安装命令(复制/弹窗):目录下发的权威命令优先(CLI-only 插件如 dsh-tui
|
|
999
|
-
* 需专属 profile(--profile dsh-tui),无法从
|
|
1000
|
-
*
|
|
949
|
+
* 需专属 profile(--profile dsh-tui),无法从 npm 包名推断,必须用官方命令);
|
|
950
|
+
* 常规插件无目录命令时用 npm 包名回退生成。 */
|
|
1001
951
|
function installCommandOf(p, withProfile = false) {
|
|
1002
|
-
const
|
|
1003
|
-
if (
|
|
1004
|
-
|
|
1005
|
-
if (cmd) return cmd;
|
|
1006
|
-
} else {
|
|
1007
|
-
const cmd = p.install?.githubCommand;
|
|
1008
|
-
if (cmd) return cmd;
|
|
1009
|
-
}
|
|
1010
|
-
const prefix = `dsh plugin${withProfile ? " --profile web" : ""} add `;
|
|
1011
|
-
if (via === "npm" || via === "release") return `${prefix}${target}`;
|
|
1012
|
-
return `${prefix}git+https://github.com/${target}.git`;
|
|
952
|
+
const cmd = p.install?.command;
|
|
953
|
+
if (cmd) return cmd;
|
|
954
|
+
return `${`dsh plugin${withProfile ? " --profile web" : ""} add `}${installTargetOf(p)}`;
|
|
1013
955
|
}
|
|
1014
|
-
/**
|
|
956
|
+
/** 把任务/安装目标归一化为 owner/repo 展示身份。 */
|
|
1015
957
|
function repoFromInstallTarget(value) {
|
|
1016
958
|
const input = value.trim();
|
|
1017
959
|
const release = githubReleaseTarget(input);
|
|
@@ -1050,7 +992,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1050
992
|
* tsdown 构建时用 define 把 __PLUGIN_VERSION__ 替换成 package.json 的版本号;
|
|
1051
993
|
* node --test 直接 import 本模块时该标识符不存在,typeof 守卫兜底为空串。
|
|
1052
994
|
*/
|
|
1053
|
-
const PLUGIN_VERSION = "
|
|
995
|
+
const PLUGIN_VERSION = "2.0.0";
|
|
1054
996
|
const CATEGORY_ORDER = [
|
|
1055
997
|
"interface",
|
|
1056
998
|
"session",
|
|
@@ -1169,7 +1111,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1169
1111
|
];
|
|
1170
1112
|
//#endregion
|
|
1171
1113
|
//#region src/client/logic/ensure-plugin-css.ts
|
|
1172
|
-
/**
|
|
1114
|
+
/** 补注入 DOM 中缺失的已登记样式表,幂等。 */
|
|
1173
1115
|
function ensurePluginCss() {
|
|
1174
1116
|
if (typeof document === "undefined") return;
|
|
1175
1117
|
const registry = window.__DSH_PLUGIN_CSS__;
|
|
@@ -1203,6 +1145,22 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1203
1145
|
return null;
|
|
1204
1146
|
}
|
|
1205
1147
|
}
|
|
1148
|
+
/** 批量查询已安装插件 npm 包的最新版本发布时间(供应链门禁用);失败返回 null(调用方按原逻辑照常提示)。 */
|
|
1149
|
+
async function fetchNpmReleaseAge(packages) {
|
|
1150
|
+
if (packages.length === 0) return {};
|
|
1151
|
+
try {
|
|
1152
|
+
const res = await fetch("/dsh-plugin-hub/npm-release-age", {
|
|
1153
|
+
method: "POST",
|
|
1154
|
+
headers: { "content-type": "application/json" },
|
|
1155
|
+
body: JSON.stringify({ packages }),
|
|
1156
|
+
cache: "no-store"
|
|
1157
|
+
});
|
|
1158
|
+
if (!res.ok) return null;
|
|
1159
|
+
return (await res.json()).packages ?? null;
|
|
1160
|
+
} catch {
|
|
1161
|
+
return null;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1206
1164
|
let envPromise = null;
|
|
1207
1165
|
/** 在系统文件管理器里定位并打开已安装插件的目录(服务端 spawn open,跨平台);失败返回 false。 */
|
|
1208
1166
|
async function revealInstallFolder(name) {
|
|
@@ -1362,13 +1320,32 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1362
1320
|
}
|
|
1363
1321
|
}
|
|
1364
1322
|
//#endregion
|
|
1323
|
+
//#region src/client/logic/release-age.ts
|
|
1324
|
+
/**
|
|
1325
|
+
* DSH Plugin Hub — the community plugin marketplace for DeepSeek Harness.
|
|
1326
|
+
* Website: https://dsh-plugin.org
|
|
1327
|
+
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
1328
|
+
*
|
|
1329
|
+
* 供应链门禁的时间判定(纯函数):pnpm 会静默回退发布未满门槛的版本,
|
|
1330
|
+
* 故发布太新的版本不该提示更新。Hub 自身更新与插件更新共用同一门槛。
|
|
1331
|
+
*/
|
|
1332
|
+
/** pnpm 供应链门禁:dsh profile 默认 minimumReleaseAge=1440(分钟);+30 分钟缓冲抵消网络/CDN 边缘时间偏差。 */
|
|
1333
|
+
const MIN_RELEASE_AGE_MS = 882e5;
|
|
1334
|
+
/** 发布时间是否仍在门禁窗口内(太新 → 暂缓提示);无值/解析不出返回 false(不拦真实更新)。 */
|
|
1335
|
+
function isReleaseTooFresh(publishedAt, now) {
|
|
1336
|
+
if (typeof publishedAt !== "string" || publishedAt === "") return false;
|
|
1337
|
+
const ms = Date.parse(publishedAt);
|
|
1338
|
+
if (Number.isNaN(ms)) return false;
|
|
1339
|
+
return now - ms < MIN_RELEASE_AGE_MS;
|
|
1340
|
+
}
|
|
1341
|
+
//#endregion
|
|
1365
1342
|
//#region src/client/logic/installed.ts
|
|
1366
1343
|
/** 安装时记录的目录信号(按仓库小写 key 查表)。 */
|
|
1367
1344
|
function signalOf(repo, versions) {
|
|
1368
1345
|
if (!repo) return null;
|
|
1369
1346
|
return versions[repo.toLowerCase()] ?? null;
|
|
1370
1347
|
}
|
|
1371
|
-
/** 插件是否已安装:匹配 Git spec 中的 owner/repo,或 npm
|
|
1348
|
+
/** 插件是否已安装:匹配 Git spec 中的 owner/repo,或 npm 安装的依赖包名;命中返回 npm 包名。 */
|
|
1372
1349
|
function installedNameOf(plugin, installed, versions) {
|
|
1373
1350
|
const repo = plugin.source?.repo;
|
|
1374
1351
|
if (!repo) return null;
|
|
@@ -1387,6 +1364,12 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1387
1364
|
if (!repo) return null;
|
|
1388
1365
|
return versions[repo.toLowerCase()]?.version ?? null;
|
|
1389
1366
|
}
|
|
1367
|
+
/** 该插件对应的 npm 包名(目录下发,或安装时持久化的映射);无则 null。决定更新是否走 npm registry。 */
|
|
1368
|
+
function npmPackageOf(plugin, versions) {
|
|
1369
|
+
const repo = plugin.source?.repo;
|
|
1370
|
+
const pkg = (plugin.source?.npmPackage || (repo ? versions[repo.toLowerCase()]?.npmPackage : void 0) || "").trim();
|
|
1371
|
+
return pkg === "" ? null : pkg;
|
|
1372
|
+
}
|
|
1390
1373
|
/**
|
|
1391
1374
|
* 是否有更新:仅对已安装插件有意义。
|
|
1392
1375
|
* 双信号判定——有 release 版本的比版本;无版本(repo 不打 tag)的比仓库最近更新时间
|
|
@@ -1514,14 +1497,15 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1514
1497
|
* Website: https://dsh-plugin.org
|
|
1515
1498
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
1516
1499
|
*
|
|
1517
|
-
*
|
|
1500
|
+
* 插件中心的数据 + 视图状态。
|
|
1518
1501
|
*
|
|
1519
|
-
*
|
|
1520
|
-
*
|
|
1521
|
-
* state, exposing the derived visible list and per-category counts.
|
|
1502
|
+
* 掌管在线数据管道(从 api.dsh-plugin.org 实时拉取)、本地已装插件表,以及
|
|
1503
|
+
* 筛选/搜索/排序/安装状态等视图状态,对外暴露派生出的可见列表与各分类计数。
|
|
1522
1504
|
*/
|
|
1523
1505
|
/** 插件市场自身仓库:DSH Plugin Hub 不显示在目录里(自己不进自己的插件列表) */
|
|
1524
1506
|
const SELF_REPO = "dshplugin/dsh-plugin-hub";
|
|
1507
|
+
/** 共享的空门禁集合:无暂缓包时复用,避免每次渲染新建 Set。 */
|
|
1508
|
+
const EMPTY_PACKAGES = /* @__PURE__ */ new Set();
|
|
1525
1509
|
/** 市场各排序的默认方向:全部按倒序(Star/Fork 多、更新/收录近的在前) */
|
|
1526
1510
|
const SORT_DEFAULT_DIR$1 = {
|
|
1527
1511
|
sortStars: "desc",
|
|
@@ -1574,7 +1558,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1574
1558
|
/** 当前 profile 已安装插件:npm 包名 -> manifest spec(来自宿主本地路由) */
|
|
1575
1559
|
const [installed, setInstalled] = (0, react.useState)({});
|
|
1576
1560
|
/** 安装时记录的目录信号:repo(小写) -> { version, updatedAt }(来自宿主本地路由);
|
|
1577
|
-
* npmPackage
|
|
1561
|
+
* npmPackage 为安装时记录的包名映射(目录数据未下发时客户端靠它把依赖 key 匹配回仓库) */
|
|
1578
1562
|
const [versions, setVersions] = (0, react.useState)({});
|
|
1579
1563
|
/** 每个依赖在系统上的安装目录(profile/node_modules/<包名>),详情视图展示用 */
|
|
1580
1564
|
const [installPaths, setInstallPaths] = (0, react.useState)(null);
|
|
@@ -1657,18 +1641,20 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1657
1641
|
cancelled = true;
|
|
1658
1642
|
};
|
|
1659
1643
|
}, [reloadKey]);
|
|
1660
|
-
/** 插件是否已安装:匹配 Git spec 中的 owner/repo,或 npm
|
|
1644
|
+
/** 插件是否已安装:匹配 Git spec 中的 owner/repo,或 npm 安装的依赖包名;命中返回 npm 包名。 */
|
|
1661
1645
|
const installedName = (p) => installedNameOf(p, installed, versions);
|
|
1662
1646
|
/** 该插件安装时记录的目录版本(无记录/未安装 → null)。 */
|
|
1663
1647
|
const installedVersion = (p) => installedVersionOf(p, versions);
|
|
1664
1648
|
/**
|
|
1665
|
-
*
|
|
1666
|
-
*
|
|
1667
|
-
* (repoUpdatedAt,ISO 字符串字典序 = 时间序),更新时间变新说明有新提交。
|
|
1649
|
+
* 供应链门禁状态:包名集合为当前「暂缓提示」的 npm 包(最新版本发布未满门槛)。
|
|
1650
|
+
* key 是这批候选包名的指纹,与已查出的 key 一致才算就绪,避免查询未回来时先显示更新。
|
|
1668
1651
|
*/
|
|
1669
|
-
const
|
|
1670
|
-
|
|
1671
|
-
|
|
1652
|
+
const [releaseAge, setReleaseAge] = (0, react.useState)({
|
|
1653
|
+
key: "",
|
|
1654
|
+
held: EMPTY_PACKAGES
|
|
1655
|
+
});
|
|
1656
|
+
/** 已安装项原始列表(未套门禁):先算出来才能收集需要查发布时间的候选包名。 */
|
|
1657
|
+
const rawInstalledItems = (0, react.useMemo)(() => installedItemsOf(plugins, installed, versions, installPaths, loadedNames, dshCapableNames), [
|
|
1672
1658
|
plugins,
|
|
1673
1659
|
installed,
|
|
1674
1660
|
versions,
|
|
@@ -1676,6 +1662,74 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1676
1662
|
loadedNames,
|
|
1677
1663
|
dshCapableNames
|
|
1678
1664
|
]);
|
|
1665
|
+
/** 门禁候选:有更新、且有 npm 包名(更新走 npm registry)的已安装插件包名。 */
|
|
1666
|
+
const releaseAgeCandidates = (0, react.useMemo)(() => {
|
|
1667
|
+
const names = /* @__PURE__ */ new Set();
|
|
1668
|
+
for (const item of rawInstalledItems) {
|
|
1669
|
+
if (!item.hasUpdate || !item.plugin) continue;
|
|
1670
|
+
const pkg = npmPackageOf(item.plugin, versions);
|
|
1671
|
+
if (pkg !== null) names.add(pkg);
|
|
1672
|
+
}
|
|
1673
|
+
return [...names].sort();
|
|
1674
|
+
}, [rawInstalledItems, versions]);
|
|
1675
|
+
const releaseAgeKey = releaseAgeCandidates.join("\n");
|
|
1676
|
+
(0, react.useEffect)(() => {
|
|
1677
|
+
if (releaseAgeKey === releaseAge.key) return;
|
|
1678
|
+
if (releaseAgeCandidates.length === 0) {
|
|
1679
|
+
setReleaseAge({
|
|
1680
|
+
key: "",
|
|
1681
|
+
held: EMPTY_PACKAGES
|
|
1682
|
+
});
|
|
1683
|
+
return;
|
|
1684
|
+
}
|
|
1685
|
+
let cancelled = false;
|
|
1686
|
+
fetchNpmReleaseAge(releaseAgeCandidates).then((result) => {
|
|
1687
|
+
if (cancelled) return;
|
|
1688
|
+
const now = Date.now();
|
|
1689
|
+
const held = /* @__PURE__ */ new Set();
|
|
1690
|
+
for (const name of releaseAgeCandidates) {
|
|
1691
|
+
const info = result?.[name];
|
|
1692
|
+
if (info && isReleaseTooFresh(info.publishedAt, now)) held.add(name);
|
|
1693
|
+
}
|
|
1694
|
+
setReleaseAge({
|
|
1695
|
+
key: releaseAgeKey,
|
|
1696
|
+
held
|
|
1697
|
+
});
|
|
1698
|
+
});
|
|
1699
|
+
return () => {
|
|
1700
|
+
cancelled = true;
|
|
1701
|
+
};
|
|
1702
|
+
}, [releaseAgeKey, releaseAge.key]);
|
|
1703
|
+
/** 门禁结果是否已就绪(候选为空也算就绪):未就绪时不写更新提醒,等查询回来再定。 */
|
|
1704
|
+
const releaseAgeReady = releaseAgeKey === releaseAge.key;
|
|
1705
|
+
const heldPackages = releaseAgeReady ? releaseAge.held : EMPTY_PACKAGES;
|
|
1706
|
+
/**
|
|
1707
|
+
* 是否有更新:仅对已安装插件有意义。
|
|
1708
|
+
* 双信号判定——有 release 版本的比版本;无版本(repo 不打 tag)的比仓库最近更新时间
|
|
1709
|
+
* (repoUpdatedAt,ISO 字符串字典序 = 时间序),更新时间变新说明有新提交。
|
|
1710
|
+
* 另加供应链门禁:npm 包最新版本发布未满门槛时视为暂缓,不打更新标记。
|
|
1711
|
+
*/
|
|
1712
|
+
const hasUpdate = (p) => {
|
|
1713
|
+
if (!hasUpdateOf(p, installed, versions)) return false;
|
|
1714
|
+
const pkg = npmPackageOf(p, versions);
|
|
1715
|
+
return pkg === null || !heldPackages.has(pkg);
|
|
1716
|
+
};
|
|
1717
|
+
/** 已安装项统一列表(目录元数据 + 运行时信息合并):门禁命中的去掉更新标记,驱动「已安装」tab。 */
|
|
1718
|
+
const installedItems = (0, react.useMemo)(() => {
|
|
1719
|
+
if (heldPackages.size === 0) return rawInstalledItems;
|
|
1720
|
+
return rawInstalledItems.map((item) => {
|
|
1721
|
+
if (!item.hasUpdate || !item.plugin) return item;
|
|
1722
|
+
const pkg = npmPackageOf(item.plugin, versions);
|
|
1723
|
+
return pkg !== null && heldPackages.has(pkg) ? {
|
|
1724
|
+
...item,
|
|
1725
|
+
hasUpdate: false
|
|
1726
|
+
} : item;
|
|
1727
|
+
});
|
|
1728
|
+
}, [
|
|
1729
|
+
rawInstalledItems,
|
|
1730
|
+
heldPackages,
|
|
1731
|
+
versions
|
|
1732
|
+
]);
|
|
1679
1733
|
/**
|
|
1680
1734
|
* Hub 自身更新状态:Hub 就是当前运行的应用(始终已安装,无需 installedName 命中)。
|
|
1681
1735
|
* 以 Worker 版本控制中心返回的「最新版本」为准,与当前运行的版本号比对——
|
|
@@ -1687,17 +1741,11 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1687
1741
|
* registry 真实发布时间下发(同源),据此判断最准。门槛命中要单列成 `pending` 而不是
|
|
1688
1742
|
* 落回「无更新」——回落会让弹窗在本机版本落后时谎称「已是最新」。
|
|
1689
1743
|
*/
|
|
1690
|
-
const hubCurrentVersion = "
|
|
1744
|
+
const hubCurrentVersion = "2.0.0";
|
|
1691
1745
|
const hubUpdateState = (() => {
|
|
1692
1746
|
if (!hubUpdateInfo) return "none";
|
|
1693
1747
|
if (hubUpdateInfo.version === hubCurrentVersion) return "latest";
|
|
1694
|
-
|
|
1695
|
-
if (publishedAt) {
|
|
1696
|
-
const publishedMs = Date.parse(publishedAt);
|
|
1697
|
-
if (!Number.isNaN(publishedMs)) {
|
|
1698
|
-
if (Date.now() - publishedMs < 882e5) return "pending";
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1748
|
+
if (isReleaseTooFresh(hubUpdateInfo.publishedAt, Date.now())) return "pending";
|
|
1701
1749
|
return "available";
|
|
1702
1750
|
})();
|
|
1703
1751
|
const hubHasUpdate = hubUpdateState === "available";
|
|
@@ -1729,7 +1777,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1729
1777
|
sortDir,
|
|
1730
1778
|
installed
|
|
1731
1779
|
]);
|
|
1732
|
-
/**
|
|
1780
|
+
/** 分类 chip 上展示的各分类插件计数。 */
|
|
1733
1781
|
const categoryCounts = (0, react.useMemo)(() => {
|
|
1734
1782
|
const counts = {};
|
|
1735
1783
|
for (const p of plugins ?? []) if (p.category) counts[p.category] = (counts[p.category] ?? 0) + 1;
|
|
@@ -1751,6 +1799,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1751
1799
|
hasUpdate,
|
|
1752
1800
|
hubHasUpdate,
|
|
1753
1801
|
hubUpdateState,
|
|
1802
|
+
releaseAgeReady,
|
|
1754
1803
|
hubCurrentVersion,
|
|
1755
1804
|
hubUpdateInfo,
|
|
1756
1805
|
hubAboutInfo,
|
|
@@ -1892,7 +1941,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1892
1941
|
if (rec.action !== void 0) return rec.action;
|
|
1893
1942
|
return rec.kind === "uninstall" ? "uninstall" : rec.kind === "update" ? "update" : "install";
|
|
1894
1943
|
}
|
|
1895
|
-
/**
|
|
1944
|
+
/** 只匹配 pnpm 的错误码,不匹配泛泛出现的 checksum / integrity 字样。 */
|
|
1896
1945
|
function missingTarballIntegrity(message) {
|
|
1897
1946
|
return /\bERR_PNPM_MISSING_TARBALL_INTEGRITY\b/.test(message);
|
|
1898
1947
|
}
|
|
@@ -1905,9 +1954,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1905
1954
|
return `${new Date(published + 864e5).toISOString().slice(0, 16)}Z`;
|
|
1906
1955
|
}
|
|
1907
1956
|
/**
|
|
1908
|
-
*
|
|
1909
|
-
*
|
|
1910
|
-
*
|
|
1957
|
+
* 同一策略子类型也用于选择实时/已保存失败的提示文案:minimumReleaseAge 只有在能算出
|
|
1958
|
+
* 可重试时刻时才走专属文案(给出确切的「何时可再试」),算不出时退回通用文案,
|
|
1959
|
+
* 避免出现「预计可重试时间:」后接空值的残缺句子。
|
|
1911
1960
|
*/
|
|
1912
1961
|
function pnpmPolicyHintOf(message) {
|
|
1913
1962
|
if (missingTarballIntegrity(message)) return "failPnpmTarballIntegrityHint";
|
|
@@ -1938,7 +1987,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
1938
1987
|
if (/os error 5\b|ERROR_ACCESS_DENIED|\bEPERM\b|\bEACCES\b|access is denied/i.test(message)) return "accessDenied";
|
|
1939
1988
|
if (/os error 112\b|os error 19\b|ERROR_DISK_FULL|ERROR_WRITE_PROTECT|\bENOSPC\b|\bEROFS\b|\bEMFILE\b|\bENFILE\b|no space left on device|read-only file system|too many open files/i.test(message)) return "fsUnavailable";
|
|
1940
1989
|
if (/ERR_PNPM_IGNORED_BUILDS|Ignored build scripts:|ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED/i.test(message)) return "pnpmIgnoredBuild";
|
|
1941
|
-
if (/\[network\]|ERR_PNPM_GIT_FETCH_FAILED|ETIMEDOUT|ECONNREFUSED|ECONNRESET|ENOTFOUND|EAI_AGAIN|EPIPE|EHOSTUNREACH|ENETUNREACH|getaddrinfo|Could not connect|Could not resolve host|Network unreachable|Failed to connect|socket hang up|CERT_HAS_EXPIRED|SSL certificate problem|\bTLS\b|\bSSL\b|fetch failed|failed to fetch|\bGET https?:\/\/\S+\.tgz\s+error \(
|
|
1990
|
+
if (/\[network\]|ERR_PNPM_GIT_FETCH_FAILED|ETIMEDOUT|ECONNREFUSED|ECONNRESET|ENOTFOUND|EAI_AGAIN|EPIPE|EHOSTUNREACH|ENETUNREACH|UND_ERR_[A-Z0-9_]+|getaddrinfo|Could not connect|Could not resolve host|Network unreachable|Failed to connect|socket hang up|CERT_HAS_EXPIRED|SSL certificate problem|\bTLS\b|\bSSL\b|fetch failed|failed to fetch|\bGET https?:\/\/\S+\.tgz\s+error \([A-Za-z0-9_]+\)/i.test(message)) return "network";
|
|
1942
1991
|
if (/\[packaging\]|entry file missing/i.test(message)) return "pluginPrepare";
|
|
1943
1992
|
if (/\[registry-missing\]/i.test(message)) return "pluginMissingDep";
|
|
1944
1993
|
if (/ERR_PNPM_FETCH_404|404 Not Found|Not Found - 404/i.test(message)) return "pnpmMissingDep";
|
|
@@ -2008,8 +2057,8 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2008
2057
|
return m ? m[0].replace(/^\[|\]$/g, "") : null;
|
|
2009
2058
|
}
|
|
2010
2059
|
/** 「包在 registry 不存在」失败的提示变体:服务端用官方源复核过(会注入 `[registry-mirror-lag]`)
|
|
2011
|
-
* 时,说明包在官方源上存在、是本机镜像源未同步 →
|
|
2012
|
-
*
|
|
2060
|
+
* 时,说明包在官方源上存在、是本机镜像源未同步 → 提示换源;否则按「profile 残留依赖」提示
|
|
2061
|
+
* (删掉 profile 里那条依赖即可)。 */
|
|
2013
2062
|
function registryMissingHintOf(message) {
|
|
2014
2063
|
return /\[registry-mirror-lag\]/i.test(message) ? "failRegistryMirrorLagHint" : "failPnpmMissingDepHint";
|
|
2015
2064
|
}
|
|
@@ -2025,7 +2074,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2025
2074
|
}
|
|
2026
2075
|
/**
|
|
2027
2076
|
* 从网络类失败消息里提取「具体连不上的地址」,供弹窗精准提示(你的网络无法访问什么)。
|
|
2028
|
-
* 优先取服务端 [network]
|
|
2077
|
+
* 优先取服务端 [network] 网络探测消息括号里的探测地址(中文「(…)」/ 英文「(…)」),
|
|
2029
2078
|
* 否则取消息里出现的第一个 URL(git fetch 的仓库地址、registry 域名等)。
|
|
2030
2079
|
* 提取不到返回 null —— 调用方据此跳过地址行。
|
|
2031
2080
|
*/
|
|
@@ -2121,7 +2170,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2121
2170
|
* 错误核心摘要(完整日志太长,塞进 URL 会被 GitHub 以「request URL too long」拒绝,
|
|
2122
2171
|
* 故只收集重点)。错误弹窗、失败记录共用此逻辑。
|
|
2123
2172
|
* env 取不到时为 null,链接照常生成、只是少环境段。
|
|
2124
|
-
* attempts
|
|
2173
|
+
* attempts(尝试过的安装方式,实际执行过的命令):作者看到我们试过的命令,
|
|
2125
2174
|
* 组织 scope 与 GitHub 用户名不一致时也能直接指认正确的 npm 包名。
|
|
2126
2175
|
*/
|
|
2127
2176
|
function pluginIssueUrl(repo, message, env, command, attempts, action = "install") {
|
|
@@ -2129,7 +2178,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2129
2178
|
const executed = executedCommandOf(command, attempts);
|
|
2130
2179
|
const zhWord = actionWordZh(action);
|
|
2131
2180
|
const title = `[dsh-plugin.org | dsh-plugin-hub] ${reasonTitleOf(kind, action)}: ${repo}`;
|
|
2132
|
-
const reason = /\[packaging\]/i.test(message) ? "plugin distribution is incomplete — a file the package needs (its entry from main / exports, an entry a bundled patch mounts, or the patch declared by dsh.bundle.patch) is missing from the published
|
|
2181
|
+
const reason = /\[packaging\]/i.test(message) ? "plugin distribution is incomplete — a file the package needs (its entry from main / exports, an entry a bundled patch mounts, or the patch declared by dsh.bundle.patch) is missing from the published npm package; please publish a complete package" : /\[registry-missing\]/i.test(message) ? "a dependency declared by the plugin is not published on the public npm registry (missing, removed, or never released); please publish or correct that dependency, or ship it with the plugin" : kind === "network" ? "network connectivity issue on the user side (DNS, proxy, firewall, or a blocked connection)" : kind === "pluginPrepare" ? "plugin prepare/build script failed during install (packaging/distribution issue)" : kind === "pnpmIgnoredBuild" ? "plugin depends on a native module whose build script pnpm blocks by default (use a prebuilt variant)" : kind === "originRejected" ? "the request never reached the install flow — the local service rejected its origin (local environment issue)" : kind === "pnpmPolicy" ? pnpmPolicyHintOf(message) === "failPnpmTarballIntegrityHint" ? "pnpm rejected a lockfile entry without tarball integrity; inspect and back up the profile lockfile before resolving it again, keeping integrity checks enabled" : "the pnpm supply-chain policy on the user machine blocked the install (minimum release age for freshly published packages / untrusted origin)" : kind === "pnpmUnusedPatch" ? "the profile keeps a pnpm patch entry for an older dsh-plugin version, so pnpm aborted the install (local config issue)" : kind === "fileLocked" ? "a file in the profile is locked by another process on the user machine (local environment issue)" : kind === "accessDenied" ? "the system denied write access to a file in the profile on the user machine (local environment issue)" : kind === "fsUnavailable" ? "the local file system could not accept the write — no space left, read-only volume, or too many open file handles on the user machine (local environment issue)" : "plugin-side install failure";
|
|
2133
2182
|
const code = coreErrorCode(message);
|
|
2134
2183
|
const build = (coreChars) => {
|
|
2135
2184
|
const body = [
|
|
@@ -2149,7 +2198,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2149
2198
|
.../\[packaging\]/i.test(message) ? [
|
|
2150
2199
|
"",
|
|
2151
2200
|
"## 安装方式说明",
|
|
2152
|
-
"
|
|
2201
|
+
"当前插件的 npm 分发物缺少它需要的文件(`main` / `exports` 声明的入口、补丁按本包名 mount 的入口,或 `dsh.bundle.patch` 声明的补丁)。请发布包含完整构建产物的 npm 包后重试。"
|
|
2153
2202
|
] : [],
|
|
2154
2203
|
"",
|
|
2155
2204
|
"## Environment",
|
|
@@ -2206,7 +2255,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2206
2255
|
`- Auto-classified cause: ${reasonTitleOf(kind, action)}`,
|
|
2207
2256
|
`- Target plugin: \`${repo}\``,
|
|
2208
2257
|
...code ? [`- Key error: \`${code}\``] : [],
|
|
2209
|
-
...variant === "misjudge" ? ["- Filed from:
|
|
2258
|
+
...variant === "misjudge" ? ["- Filed from: a branch that normally routes to the plugin repo — filed here because that verdict may be our own misjudgment.", "- Source of that verdict: produced by dsh-plugin-hub's own check or its auto-allow retry, not by plain pnpm output."] : ["- Why filed here: the installer only routes a failure to the plugin repo when the cause is demonstrably the plugin's own build/distribution (pluginPrepare, or build scripts pnpm blocks that even an auto-allow retry cannot get past). This failure does not match that, so it is routed here for triage."],
|
|
2210
2259
|
"",
|
|
2211
2260
|
`## [DSH Plugin 插件市场](${SITE_URL}) · ${zhWord} Plugin 失败错误信息`,
|
|
2212
2261
|
`本错误信息由 [dsh-plugin-hub](${GITHUB_URL}) 插件市场的安装程序自动生成,随本次${zhWord}失败一并提交。`,
|
|
@@ -2266,11 +2315,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2266
2315
|
* Website: https://dsh-plugin.org
|
|
2267
2316
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
2268
2317
|
*
|
|
2269
|
-
*
|
|
2270
|
-
*
|
|
2271
|
-
*
|
|
2272
|
-
* together instead of drifting apart. Exposes the localized dictionary lookup
|
|
2273
|
-
* `t()` plus the zh/en language flag and the /zh/ URL path prefix.
|
|
2318
|
+
* 板块的语言状态:Hub 与宿主(系统)locale 共用 —— 头部语言开关通过 setLocale 写入
|
|
2319
|
+
* 宿主语言偏好,让宿主界面(左侧菜单、设置弹窗)与 Hub 面板一起切换、不会各说各话。
|
|
2320
|
+
* 对外暴露本地化字典查询 `t()`、zh/en 语言标记与 /zh/ URL 路径前缀。
|
|
2274
2321
|
*/
|
|
2275
2322
|
function useLanguage(locale) {
|
|
2276
2323
|
const [, setRev] = (0, react.useState)(0);
|
|
@@ -2298,19 +2345,16 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2298
2345
|
* Website: https://dsh-plugin.org
|
|
2299
2346
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
2300
2347
|
*
|
|
2301
|
-
*
|
|
2302
|
-
*
|
|
2303
|
-
*
|
|
2304
|
-
*
|
|
2305
|
-
* the defaults and keeps working (settings simply do not persist).
|
|
2348
|
+
* 插件中心设置状态:从宿主本地 /settings 路由加载一次(持久化在
|
|
2349
|
+
* ~/.dsh/profiles/<profile>/hub-settings.json),并按乐观方式更新。
|
|
2350
|
+
* 每次改动立即 POST 补丁,切换过的开关刷新后仍在;宿主未挂服务端路由时退回默认值
|
|
2351
|
+
* 继续可用(设置不持久化而已)。
|
|
2306
2352
|
*/
|
|
2307
2353
|
const DEFAULT_SETTINGS = {
|
|
2308
2354
|
checkUpdatesOnStart: true,
|
|
2309
2355
|
proxy: "",
|
|
2310
2356
|
npmRegistry: "",
|
|
2311
2357
|
enableNpmInstall: true,
|
|
2312
|
-
enableGitInstall: true,
|
|
2313
|
-
enableDshInstall: true,
|
|
2314
2358
|
logPath: ""
|
|
2315
2359
|
};
|
|
2316
2360
|
async function loadRemote() {
|
|
@@ -2374,20 +2418,17 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2374
2418
|
* Website: https://dsh-plugin.org
|
|
2375
2419
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
2376
2420
|
*
|
|
2377
|
-
*
|
|
2421
|
+
* 插件中心的后台安装/卸载任务队列。
|
|
2378
2422
|
*
|
|
2379
|
-
*
|
|
2380
|
-
*
|
|
2381
|
-
* uninstall, cancel) plus the modal task lookups used by the dialogs.
|
|
2423
|
+
* 通过轮询 /active 镜像服务端 FIFO 活动队列,对消失的任务用 /status 收尾,并暴露
|
|
2424
|
+
* 队列动作(安装、卸载、取消)以及弹窗用的任务查找。
|
|
2382
2425
|
*/
|
|
2383
|
-
/** 安装/卸载请求超时(ms
|
|
2384
|
-
*
|
|
2426
|
+
/** 安装/卸载请求超时(ms):服务端入队前要做目录包校验与网络探测(各自有超时,合计可达十几秒),
|
|
2427
|
+
* 给足余量;超时主动中止,避免服务端网络挂起时前端永久卡「安装中 0%」。 */
|
|
2385
2428
|
const REQUEST_TIMEOUT_MS = 6e4;
|
|
2386
|
-
/** 入口渠道的 i18n key:NPM 包 / GitHub 源码 / DSH 命令。 */
|
|
2387
|
-
const channelKeyOf = (channel) => channel === "git" ? "installChannelGit" : channel === "dsh" ? "installChannelDsh" : "installChannelNpm";
|
|
2388
2429
|
/** 失败消息的入口溯源前缀:自定义安装(带渠道)在错误正文顶部精准指出从哪张卡片发起;
|
|
2389
2430
|
* 目录插件安装(无渠道)返回 null,错误正文保持原样。 */
|
|
2390
|
-
const entryLineOf = (t, channel) => channel ? t("installEntryLine", { c: t(
|
|
2431
|
+
const entryLineOf = (t, channel) => channel ? t("installEntryLine", { c: t("installChannelNpm") }) : null;
|
|
2391
2432
|
function useTaskQueue(opts) {
|
|
2392
2433
|
const { t, langKey, refreshInstalled, onInstallDone, onUninstallDone, onError, installPlugin, installCustomTarget, installGlobalTarget, uninstallPlugin, uninstallName, installedName, resolvePending } = opts;
|
|
2393
2434
|
const [queue, setQueue] = (0, react.useState)([]);
|
|
@@ -2604,7 +2645,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2604
2645
|
lines: Array.isArray(a.lines) ? a.lines : prevTask?.lines ?? [],
|
|
2605
2646
|
attempts: Array.isArray(a.attempts) ? a.attempts : prevTask?.attempts ?? [],
|
|
2606
2647
|
needsRestart: typeof a.needsRestart === "boolean" ? a.needsRestart : prevTask?.needsRestart ?? true,
|
|
2607
|
-
channel: a.installChannel === "npm"
|
|
2648
|
+
channel: a.installChannel === "npm" ? "npm" : prevTask?.channel
|
|
2608
2649
|
});
|
|
2609
2650
|
}
|
|
2610
2651
|
const keepOpt = prev.filter((q) => q.optimistic && !next.some((x) => x.id === q.id));
|
|
@@ -2650,7 +2691,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2650
2691
|
lines: Array.isArray(a.lines) ? a.lines : [],
|
|
2651
2692
|
attempts: Array.isArray(a.attempts) ? a.attempts : [],
|
|
2652
2693
|
needsRestart: typeof a.needsRestart === "boolean" ? a.needsRestart : true,
|
|
2653
|
-
channel: a.installChannel === "npm"
|
|
2694
|
+
channel: a.installChannel === "npm" ? "npm" : void 0
|
|
2654
2695
|
};
|
|
2655
2696
|
});
|
|
2656
2697
|
if (items.length > 0 || pendingRef.current.length > 0) {
|
|
@@ -2667,7 +2708,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2667
2708
|
/** 弹窗动作:直接安装。请求宿主本地路由,任务进入服务端队列(FIFO),弹窗内实时显示进度。 */
|
|
2668
2709
|
/** 安装入队核心:目录插件(catalog,后端走目录白名单)与命令行安装(custom,
|
|
2669
2710
|
* 受安全开关控制)共用。队列条目一律用仓库名(repo)展示/防重,只有发给后端的
|
|
2670
|
-
* 实际安装目标(target
|
|
2711
|
+
* 实际安装目标(target)为 npm 包名。 */
|
|
2671
2712
|
const submitInstall = async (input) => {
|
|
2672
2713
|
if (queueRef.current.some((q) => q.kind === "install" && q.target === input.repo)) return;
|
|
2673
2714
|
if (submittingRef.current.has(input.repo)) return;
|
|
@@ -2743,11 +2784,11 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2743
2784
|
setSubmitting(false);
|
|
2744
2785
|
}
|
|
2745
2786
|
};
|
|
2746
|
-
/**
|
|
2787
|
+
/** 目录插件安装:安装目标取目录数据的 npm 包名,走 catalog 白名单。 */
|
|
2747
2788
|
const installNow = async (p, opts) => {
|
|
2748
2789
|
const repo = p.source?.repo ?? "";
|
|
2749
2790
|
if (!repo) return;
|
|
2750
|
-
const
|
|
2791
|
+
const target = installTargetOf(p);
|
|
2751
2792
|
if (!target) return;
|
|
2752
2793
|
await submitInstall({
|
|
2753
2794
|
target,
|
|
@@ -2760,12 +2801,11 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2760
2801
|
update: opts?.update
|
|
2761
2802
|
});
|
|
2762
2803
|
};
|
|
2763
|
-
/** 命令行安装:用户手输 npm
|
|
2804
|
+
/** 命令行安装:用户手输 npm 包名,走 custom 源(受安全开关控制)。
|
|
2764
2805
|
* update=true 时对已安装目标放行覆盖重装(与目录插件「更新」同一语义)。
|
|
2765
|
-
* channel=入口渠道(NPM
|
|
2766
|
-
*
|
|
2767
|
-
*
|
|
2768
|
-
* 弹窗目标匹配同口径,npm 包名透传不受影响。 */
|
|
2806
|
+
* channel=入口渠道(NPM 包卡片):上报服务端落日志,失败弹窗/通知据此精准溯源。
|
|
2807
|
+
* 队列展示/防重一律用归一化身份:与服务端 /active 合并、弹窗目标匹配同口径,
|
|
2808
|
+
* npm 包名透传不受影响。 */
|
|
2769
2809
|
const installCustom = async (raw, opts) => {
|
|
2770
2810
|
const target = raw.trim();
|
|
2771
2811
|
if (!target) return;
|
|
@@ -2898,8 +2938,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
2898
2938
|
* Website: https://dsh-plugin.org
|
|
2899
2939
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
2900
2940
|
*
|
|
2901
|
-
*
|
|
2902
|
-
* they adapt to themes and disabled states automatically.
|
|
2941
|
+
* 客户端各处使用的内联 SVG 图标。图标继承 currentColor,自动适配主题与禁用态。
|
|
2903
2942
|
*/
|
|
2904
2943
|
/** 弹窗右上角关闭按钮图标:内联 SVG 十字(stroke 继承 currentColor),随按钮禁用态一起变淡。 */
|
|
2905
2944
|
function CloseIcon() {
|
|
@@ -3387,10 +3426,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
3387
3426
|
* Website: https://dsh-plugin.org
|
|
3388
3427
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
3389
3428
|
*
|
|
3390
|
-
*
|
|
3391
|
-
*
|
|
3392
|
-
*
|
|
3393
|
-
* empty for most of the run; failures surface their full output in ErrorModal.
|
|
3429
|
+
* 安装与卸载弹窗共用的内联进度块:真实百分比进度条(服务端估算、客户端轮询)。
|
|
3430
|
+
* 不做实时终端窗口 —— pnpm 在 git clone/构建期间几乎无输出,日志面板大部分时间是空的;
|
|
3431
|
+
* 失败时完整输出在 ErrorModal 里展示。
|
|
3394
3432
|
*/
|
|
3395
3433
|
function ProgressView({ task }) {
|
|
3396
3434
|
return (0, react.createElement)("div", { className: Modal_module_css_default.progress }, (0, react.createElement)("div", { className: Modal_module_css_default.progressHead }, (0, react.createElement)("span", { className: Modal_module_css_default.progressText }, `${Math.round(task.progress)}%`)), (0, react.createElement)("div", { className: Modal_module_css_default.progressTrack }, (0, react.createElement)("div", {
|
|
@@ -3405,11 +3443,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
3405
3443
|
* Website: https://dsh-plugin.org
|
|
3406
3444
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
3407
3445
|
*
|
|
3408
|
-
*
|
|
3409
|
-
*
|
|
3410
|
-
*
|
|
3411
|
-
* the common case (the page refreshes on close so the change applies), or a
|
|
3412
|
-
* single "restart now" for the rare changes a refresh cannot pick up.
|
|
3446
|
+
* 插件中心的弹窗层:安装确认弹窗、卸载弹窗与全局 Toast。两个弹窗在变更执行期间
|
|
3447
|
+
* 自我锁定,随后切到只有一个动作的结果视图 —— 常见情况给「完成」(关闭时刷新页面即生效),
|
|
3448
|
+
* 刷新解决不了的少数情况才给单个「立即重启」。
|
|
3413
3449
|
*/
|
|
3414
3450
|
/** 完成结果视图:绿色对勾 + 标题/描述;
|
|
3415
3451
|
* 终态只有两种:
|
|
@@ -3627,7 +3663,23 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
3627
3663
|
rel: "noopener noreferrer",
|
|
3628
3664
|
title: t("failHubIssueHint")
|
|
3629
3665
|
}, t("failMisjudgeLink"))]) : null
|
|
3630
|
-
]) : failureKind === "hubState" ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failHubStateHint", { action: actionWord }))]) : failureKind === "timeout" ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failTimeoutHint"))]) : failureKind === "profileLock" ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failProfileLockHint", { action: actionWord }))]) : failureKind === "hostCliSpawn" ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failHostCliSpawnHint"))]) :
|
|
3666
|
+
]) : failureKind === "hubState" ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failHubStateHint", { action: actionWord }))]) : failureKind === "timeout" ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failTimeoutHint"))]) : failureKind === "profileLock" ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failProfileLockHint", { action: actionWord }))]) : failureKind === "hostCliSpawn" ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failHostCliSpawnHint"))]) : failureKind === "pnpmIgnoredBuild" ? (0, react.createElement)("div", null, [
|
|
3667
|
+
(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failIgnoredBuild")),
|
|
3668
|
+
repo ? (0, react.createElement)("a", {
|
|
3669
|
+
className: Modal_module_css_default.failBigIssue,
|
|
3670
|
+
href: pluginIssueUrl(repo, message, env, command, attempts, action),
|
|
3671
|
+
target: "_blank",
|
|
3672
|
+
rel: "noopener noreferrer",
|
|
3673
|
+
title: t("failIssueHint")
|
|
3674
|
+
}, t("failIssueBig")) : null,
|
|
3675
|
+
repo ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failMisjudgeHint")), (0, react.createElement)("a", {
|
|
3676
|
+
className: Modal_module_css_default.failMisjudgeLink,
|
|
3677
|
+
href: hubIssueUrl(repo, message, env, command, attempts, "misjudge", action),
|
|
3678
|
+
target: "_blank",
|
|
3679
|
+
rel: "noopener noreferrer",
|
|
3680
|
+
title: t("failHubIssueHint")
|
|
3681
|
+
}, t("failMisjudgeLink"))]) : null
|
|
3682
|
+
]) : (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failUnclassifiedHint", { action: actionWord })), (0, react.createElement)("a", {
|
|
3631
3683
|
className: Modal_module_css_default.failBigIssue,
|
|
3632
3684
|
href: hubIssueUrl(repo, message, env, command, attempts, "triage", action),
|
|
3633
3685
|
target: "_blank",
|
|
@@ -3899,12 +3951,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
3899
3951
|
* Website: https://dsh-plugin.org
|
|
3900
3952
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
3901
3953
|
*
|
|
3902
|
-
*
|
|
3903
|
-
*
|
|
3904
|
-
*
|
|
3905
|
-
* latest version) merged with the host runtime facts (install path, installed
|
|
3906
|
-
* version, install time, last update). Update / uninstall actions are
|
|
3907
|
-
* offered from here too, mirroring the row actions.
|
|
3954
|
+
* 已安装插件详情弹窗:从「已安装」视图打开(行点击或详情按钮),展示我们对某个已安装项
|
|
3955
|
+
* 掌握的全部信息 —— 目录元数据(分类、收录入口、Star/Fork、最新版本)与宿主运行时事实
|
|
3956
|
+
* (安装路径、已装版本、安装时间、最后更新)合并呈现。此处的更新/卸载动作与行内动作一致。
|
|
3908
3957
|
*/
|
|
3909
3958
|
/** ISO 安装时间 → 本地可读;非法值返回 null(行内不显示)。 */
|
|
3910
3959
|
function fmtDate(iso, lang) {
|
|
@@ -3981,13 +4030,11 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
3981
4030
|
* Website: https://dsh-plugin.org
|
|
3982
4031
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
3983
4032
|
*
|
|
3984
|
-
*
|
|
3985
|
-
*
|
|
3986
|
-
* in-button double-click.
|
|
4033
|
+
* 通用确认弹窗 —— 应用里所有「确定吗?」问题的唯一入口。规则:任何询问都必须是
|
|
4034
|
+
* 弹窗,绝不用按钮内双击。
|
|
3987
4035
|
*
|
|
3988
|
-
*
|
|
3989
|
-
*
|
|
3990
|
-
* action glyph for destructive ones (clear / delete / uninstall / reset).
|
|
4036
|
+
* 中间的图标一眼说明类型:常规确认(安装/更新/重启/忽略)用蓝色问号,
|
|
4037
|
+
* 危险操作(清空/删除/卸载/重置)用红色动作图形。
|
|
3991
4038
|
*/
|
|
3992
4039
|
/** 通用确认弹窗:标题 + 类型图标 + 描述 + 取消/确认按钮。
|
|
3993
4040
|
* type='question' → 蓝问号 + 品牌蓝确认按钮;危险类型 → 红图形 + 红色确认按钮。 */
|
|
@@ -4026,15 +4073,11 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4026
4073
|
* Website: https://dsh-plugin.org
|
|
4027
4074
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4028
4075
|
*
|
|
4029
|
-
*
|
|
4030
|
-
* remove task — successes and failures alike.
|
|
4076
|
+
* 通知中心弹窗:每个已结算的安装/卸载任务(成功与失败)的持久化清单。
|
|
4031
4077
|
*
|
|
4032
|
-
*
|
|
4033
|
-
*
|
|
4034
|
-
*
|
|
4035
|
-
* success, red cross for failure) with white glyph and message text;
|
|
4036
|
-
* failures keep their copy / fix / file-an-issue actions. Opened from the
|
|
4037
|
-
* header entry button (after the Settings tab).
|
|
4078
|
+
* 记录在结算时写入 localStorage(见 logic/failures.ts),即使弹窗被关闭或用户离开,
|
|
4079
|
+
* 结果也不会丢失。每条带圆形状态徽标(成功绿勾、失败红叉,白色图形)与消息文本;
|
|
4080
|
+
* 失败项保留复制/修复/提 Issue 动作。由头部入口按钮(「设置」tab 之后)打开。
|
|
4038
4081
|
*/
|
|
4039
4082
|
/** 记录时间完整展示:YYYY-MM-DD HH:mm:ss(每条通知都带精确到秒的时间戳)。 */
|
|
4040
4083
|
function fmtTime(at) {
|
|
@@ -4239,7 +4282,24 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4239
4282
|
if (kind === "timeout") return (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failTimeoutHint"))]);
|
|
4240
4283
|
if (kind === "profileLock") return (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failProfileLockHint", { action: actionWord }))]);
|
|
4241
4284
|
if (kind === "hostCliSpawn") return (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failHostCliSpawnHint"))]);
|
|
4242
|
-
|
|
4285
|
+
if (kind === "pnpmIgnoredBuild") return (0, react.createElement)("div", null, [
|
|
4286
|
+
(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failIgnoredBuild")),
|
|
4287
|
+
r.repo && shownRepo ? (0, react.createElement)("a", {
|
|
4288
|
+
className: Modal_module_css_default.failBigIssue,
|
|
4289
|
+
href: pluginIssueUrl(shownRepo, r.message, env, r.command, r.attempts, action),
|
|
4290
|
+
target: "_blank",
|
|
4291
|
+
rel: "noopener noreferrer",
|
|
4292
|
+
title: t("failIssueHint")
|
|
4293
|
+
}, t("failIssueBig")) : null,
|
|
4294
|
+
r.repo && shownRepo ? (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failMisjudgeHint")), (0, react.createElement)("a", {
|
|
4295
|
+
className: Modal_module_css_default.failMisjudgeLink,
|
|
4296
|
+
href: hubIssueUrl(shownRepo, r.message, env, r.command, r.attempts, "misjudge", action),
|
|
4297
|
+
target: "_blank",
|
|
4298
|
+
rel: "noopener noreferrer",
|
|
4299
|
+
title: t("failHubIssueHint")
|
|
4300
|
+
}, t("failMisjudgeLink"))]) : null
|
|
4301
|
+
]);
|
|
4302
|
+
return (0, react.createElement)("div", null, [(0, react.createElement)("div", { className: Modal_module_css_default.failPrepareHint }, t("failUnclassifiedHint", { action: actionWord })), (0, react.createElement)("a", {
|
|
4243
4303
|
className: Modal_module_css_default.failBigIssue,
|
|
4244
4304
|
href: hubIssueUrl(shownRepo || r.repo, r.message, env, r.command, r.attempts, "triage", action),
|
|
4245
4305
|
target: "_blank",
|
|
@@ -4287,8 +4347,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4287
4347
|
* Website: https://dsh-plugin.org
|
|
4288
4348
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4289
4349
|
*
|
|
4290
|
-
*
|
|
4291
|
-
* by the purple ad banner that promotes the catalog stats.
|
|
4350
|
+
* 板块头部:品牌标题行(H1 + 官网入口按钮)+ 副标题,其后是宣传目录统计的紫色广告条。
|
|
4292
4351
|
*/
|
|
4293
4352
|
function CatalogHeader({ t, langPath, statsTotal, statsVerified, onToggleLang, hubUpdate, onVersionClick, onAboutClick }) {
|
|
4294
4353
|
return (0, react.createElement)(react.Fragment, null, (0, react.createElement)("div", { className: Header_module_css_default.header }, (0, react.createElement)("div", { className: Header_module_css_default.headerTitleRow }, (0, react.createElement)("a", {
|
|
@@ -4349,9 +4408,8 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4349
4408
|
* Website: https://dsh-plugin.org
|
|
4350
4409
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4351
4410
|
*
|
|
4352
|
-
*
|
|
4353
|
-
*
|
|
4354
|
-
* carry no counts so their widths stay uniform.
|
|
4411
|
+
* 分类 Tab:先是「全部」chip,其后每个目录分类一个 chip。「全部」chip 带插件总数,
|
|
4412
|
+
* 各分类 chip 不带计数以保持宽度一致。
|
|
4355
4413
|
*/
|
|
4356
4414
|
function CategoryTabs({ category, setCategory, allLabel, totalCount, langKey }) {
|
|
4357
4415
|
return (0, react.createElement)("div", { className: Header_module_css_default.tabs }, (0, react.createElement)("button", {
|
|
@@ -4371,12 +4429,11 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4371
4429
|
* Website: https://dsh-plugin.org
|
|
4372
4430
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4373
4431
|
*
|
|
4374
|
-
*
|
|
4375
|
-
*
|
|
4376
|
-
*
|
|
4377
|
-
*
|
|
4378
|
-
*
|
|
4379
|
-
* button shows an up/down arrow for the current direction).
|
|
4432
|
+
* 市场列表上方的工具栏:
|
|
4433
|
+
* 第一行 —— 整行宽的搜索框;
|
|
4434
|
+
* 第二行 —— 左侧结果计数,右侧排序分段控件
|
|
4435
|
+
* (与已安装视图一致:点同一排序切换正/倒序,点新排序用其默认方向;
|
|
4436
|
+
* 激活按钮显示当前方向的上/下箭头)。
|
|
4380
4437
|
*/
|
|
4381
4438
|
/** 单选按钮组中的一个按钮(segmented control,与已安装视图排序按钮同款) */
|
|
4382
4439
|
function SegBtn$1({ active, onClick, label, icon }) {
|
|
@@ -4426,40 +4483,40 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4426
4483
|
css: css$9
|
|
4427
4484
|
});
|
|
4428
4485
|
var List_module_css_default = {
|
|
4429
|
-
"
|
|
4430
|
-
"
|
|
4431
|
-
"
|
|
4432
|
-
"
|
|
4433
|
-
"
|
|
4434
|
-
"state": "_3XaZHa_state",
|
|
4435
|
-
"stateDesc": "_3XaZHa_stateDesc",
|
|
4486
|
+
"uninstallBtn": "_3XaZHa_uninstallBtn",
|
|
4487
|
+
"diagBtn": "_3XaZHa_diagBtn",
|
|
4488
|
+
"installBtnUpdate": "_3XaZHa_installBtnUpdate",
|
|
4489
|
+
"desc": "_3XaZHa_desc",
|
|
4490
|
+
"installBtn": "_3XaZHa_installBtn",
|
|
4436
4491
|
"retryBtn": "_3XaZHa_retryBtn",
|
|
4437
|
-
"
|
|
4438
|
-
"
|
|
4492
|
+
"state": "_3XaZHa_state",
|
|
4493
|
+
"footLink": "_3XaZHa_footLink",
|
|
4494
|
+
"date": "_3XaZHa_date",
|
|
4495
|
+
"stats": "_3XaZHa_stats",
|
|
4496
|
+
"topic": "_3XaZHa_topic",
|
|
4439
4497
|
"cardTitle": "_3XaZHa_cardTitle",
|
|
4440
|
-
"
|
|
4441
|
-
"
|
|
4442
|
-
"
|
|
4498
|
+
"topics": "_3XaZHa_topics",
|
|
4499
|
+
"categoryBadge": "_3XaZHa_categoryBadge",
|
|
4500
|
+
"star": "_3XaZHa_star",
|
|
4501
|
+
"verified": "_3XaZHa_verified",
|
|
4502
|
+
"versionBadge": "_3XaZHa_versionBadge",
|
|
4503
|
+
"moreSentinel": "_3XaZHa_moreSentinel",
|
|
4443
4504
|
"installBtnInstalled": "_3XaZHa_installBtnInstalled",
|
|
4444
|
-
"
|
|
4445
|
-
"
|
|
4505
|
+
"list": "_3XaZHa_list",
|
|
4506
|
+
"updateBadge": "_3XaZHa_updateBadge",
|
|
4507
|
+
"footer": "_3XaZHa_footer",
|
|
4446
4508
|
"card": "_3XaZHa_card",
|
|
4447
|
-
"diagBtn": "_3XaZHa_diagBtn",
|
|
4448
|
-
"footLink": "_3XaZHa_footLink",
|
|
4449
|
-
"actions": "_3XaZHa_actions",
|
|
4450
|
-
"moreSentinel": "_3XaZHa_moreSentinel",
|
|
4451
|
-
"installBtn": "_3XaZHa_installBtn",
|
|
4452
4509
|
"installBtnCopied": "_3XaZHa_installBtnCopied",
|
|
4453
|
-
"footer": "_3XaZHa_footer",
|
|
4454
4510
|
"cardMain": "_3XaZHa_cardMain",
|
|
4511
|
+
"body": "_3XaZHa_body",
|
|
4512
|
+
"detailBtn": "_3XaZHa_detailBtn",
|
|
4513
|
+
"fork": "_3XaZHa_fork",
|
|
4514
|
+
"stateTitle": "_3XaZHa_stateTitle",
|
|
4515
|
+
"actions": "_3XaZHa_actions",
|
|
4455
4516
|
"cardHead": "_3XaZHa_cardHead",
|
|
4456
|
-
"
|
|
4457
|
-
"
|
|
4458
|
-
"
|
|
4459
|
-
"updateBadge": "_3XaZHa_updateBadge",
|
|
4460
|
-
"star": "_3XaZHa_star",
|
|
4461
|
-
"categoryBadge": "_3XaZHa_categoryBadge",
|
|
4462
|
-
"uninstallBtn": "_3XaZHa_uninstallBtn"
|
|
4517
|
+
"cardSide": "_3XaZHa_cardSide",
|
|
4518
|
+
"stateDesc": "_3XaZHa_stateDesc",
|
|
4519
|
+
"stateActions": "_3XaZHa_stateActions"
|
|
4463
4520
|
};
|
|
4464
4521
|
//#endregion
|
|
4465
4522
|
//#region src/client/hooks/useIncrementalList.ts
|
|
@@ -4468,11 +4525,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4468
4525
|
* Website: https://dsh-plugin.org
|
|
4469
4526
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4470
4527
|
*
|
|
4471
|
-
*
|
|
4472
|
-
*
|
|
4473
|
-
*
|
|
4474
|
-
* The items reference is the list identity — category / search / sort
|
|
4475
|
-
* changes produce a new array, which resets the window to the first batch.
|
|
4528
|
+
* 增量列表:只渲染(可能很大的)结果集的第一批,末尾哨兵滚入视口时就追加下一批,
|
|
4529
|
+
* 让插件市场绝不一次性挂载成千上万张卡片。
|
|
4530
|
+
* items 引用即列表身份 —— 分类/搜索/排序变化会产出新数组,窗口随之重置回第一批。
|
|
4476
4531
|
*/
|
|
4477
4532
|
/** 首批渲染条数 & 每次滚到底追加的增量(单卡约 80px 高,100 条已远超一屏) */
|
|
4478
4533
|
const PAGE_SIZE = 100;
|
|
@@ -4506,9 +4561,8 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4506
4561
|
* Website: https://dsh-plugin.org
|
|
4507
4562
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4508
4563
|
*
|
|
4509
|
-
*
|
|
4510
|
-
*
|
|
4511
|
-
* uninstall actions.
|
|
4564
|
+
* 目录列表里的单张插件卡片:名称/分类/verified 徽标、描述 + 标签、Star/Fork/日期
|
|
4565
|
+
* 统计,以及详情/安装/卸载动作。
|
|
4512
4566
|
*/
|
|
4513
4567
|
function PluginCard({ plugin: p, copied, installedName, installedVersion, hasUpdate, t, langKey, langPath, onInstall, onUninstall }) {
|
|
4514
4568
|
const repo = p.source?.repo ?? "";
|
|
@@ -4557,10 +4611,8 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4557
4611
|
* Website: https://dsh-plugin.org
|
|
4558
4612
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4559
4613
|
*
|
|
4560
|
-
*
|
|
4561
|
-
*
|
|
4562
|
-
* the category or install-status filter changes so the replaced content is
|
|
4563
|
-
* not mistaken for a no-op update.
|
|
4614
|
+
* 目录列表:承载加载/失败/空三态、插件卡片与计数页脚的滚动容器。分类或安装状态
|
|
4615
|
+
* 筛选变化时重置滚动位置,避免替换后的内容被误当成「没变化」。
|
|
4564
4616
|
*/
|
|
4565
4617
|
function CatalogList({ plugins, failed, visible, total, t, langPath, reload, category, copied, installedName, installedVersion, hasUpdate, langKey, onInstall, onUninstall, hasProxy, onOpenDiagnostics }) {
|
|
4566
4618
|
/** 列表滚动容器:分类/搜索切换后列表内容替换但 scrollTop 保留,会让用户误以为列表没更新,需重置回顶部 */
|
|
@@ -4609,10 +4661,8 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4609
4661
|
* Website: https://dsh-plugin.org
|
|
4610
4662
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4611
4663
|
*
|
|
4612
|
-
*
|
|
4613
|
-
*
|
|
4614
|
-
* it wires catalog state (query/sort/filter/category) to the small
|
|
4615
|
-
* presentational components so PluginHubSection stays free of view internals.
|
|
4664
|
+
* 市场视图:目录的浏览体验 —— 分类 Tab、搜索/排序/安装状态控件与插件列表。自身不持有状态,
|
|
4665
|
+
* 只把目录状态(query/sort/filter/category)接到小型展示组件上,让 PluginHubSection 不掺视图细节。
|
|
4616
4666
|
*/
|
|
4617
4667
|
function MarketView({ catalog, t, langPath, langKey, copied, resultText, onInstall, onUninstall, hasProxy, onOpenDiagnostics }) {
|
|
4618
4668
|
return (0, react.createElement)(react.Fragment, null, (0, react.createElement)(CategoryTabs, {
|
|
@@ -4666,15 +4716,15 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4666
4716
|
css: css$8
|
|
4667
4717
|
});
|
|
4668
4718
|
var SectionTabs_module_css_default = {
|
|
4669
|
-
"tabActive": "_7tvizq_tabActive",
|
|
4670
|
-
"tabIcon": "_7tvizq_tabIcon",
|
|
4671
|
-
"noticeBtn": "_7tvizq_noticeBtn",
|
|
4672
|
-
"tab": "_7tvizq_tab",
|
|
4673
|
-
"root": "_7tvizq_root",
|
|
4674
4719
|
"tabCountActive": "_7tvizq_tabCountActive",
|
|
4720
|
+
"tabActive": "_7tvizq_tabActive",
|
|
4721
|
+
"noticeCount": "_7tvizq_noticeCount",
|
|
4675
4722
|
"noticeIcon": "_7tvizq_noticeIcon",
|
|
4723
|
+
"noticeBtn": "_7tvizq_noticeBtn",
|
|
4676
4724
|
"tabCount": "_7tvizq_tabCount",
|
|
4677
|
-
"
|
|
4725
|
+
"tab": "_7tvizq_tab",
|
|
4726
|
+
"tabIcon": "_7tvizq_tabIcon",
|
|
4727
|
+
"root": "_7tvizq_root"
|
|
4678
4728
|
};
|
|
4679
4729
|
//#endregion
|
|
4680
4730
|
//#region src/client/components/layout/SectionTabs.tsx
|
|
@@ -4683,11 +4733,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4683
4733
|
* Website: https://dsh-plugin.org
|
|
4684
4734
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4685
4735
|
*
|
|
4686
|
-
*
|
|
4687
|
-
*
|
|
4688
|
-
*
|
|
4689
|
-
* Kept visually distinct from the category chips so the hierarchy reads:
|
|
4690
|
-
* section → category → plugin.
|
|
4736
|
+
* 一级导航:紧凑分段控件,在四个顶层板块间切换 —— 市场(浏览)、已安装(管理)、
|
|
4737
|
+
* 自定义(手动命令安装)与设置(网络源与偏好)。与分类 chip 视觉上区分开,
|
|
4738
|
+
* 让层级清晰:板块 → 分类 → 插件。
|
|
4691
4739
|
*/
|
|
4692
4740
|
const ORDER = [
|
|
4693
4741
|
{
|
|
@@ -4751,42 +4799,42 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4751
4799
|
css: css$7
|
|
4752
4800
|
});
|
|
4753
4801
|
var InstalledView_module_css_default = {
|
|
4754
|
-
"
|
|
4755
|
-
"
|
|
4756
|
-
"
|
|
4757
|
-
"exampleRow": "_1nXeGW_exampleRow",
|
|
4758
|
-
"rowCategory": "_1nXeGW_rowCategory",
|
|
4802
|
+
"root": "_1nXeGW_root",
|
|
4803
|
+
"rowSourceTagHub": "_1nXeGW_rowSourceTagHub",
|
|
4804
|
+
"toolbar": "_1nXeGW_toolbar",
|
|
4759
4805
|
"list": "_1nXeGW_list",
|
|
4806
|
+
"segLabel": "_1nXeGW_segLabel",
|
|
4807
|
+
"segBtn": "_1nXeGW_segBtn",
|
|
4760
4808
|
"rowMeta": "_1nXeGW_rowMeta",
|
|
4761
4809
|
"rowActions": "_1nXeGW_rowActions",
|
|
4762
|
-
"
|
|
4763
|
-
"
|
|
4764
|
-
"rowTitle": "_1nXeGW_rowTitle",
|
|
4765
|
-
"root": "_1nXeGW_root",
|
|
4810
|
+
"emptyDesc": "_1nXeGW_emptyDesc",
|
|
4811
|
+
"rowSourceTagManual": "_1nXeGW_rowSourceTagManual",
|
|
4766
4812
|
"segBtnActive": "_1nXeGW_segBtnActive",
|
|
4767
|
-
"
|
|
4813
|
+
"rowTitleLine": "_1nXeGW_rowTitleLine",
|
|
4814
|
+
"exampleRow": "_1nXeGW_exampleRow",
|
|
4815
|
+
"searchWrap": "_1nXeGW_searchWrap",
|
|
4768
4816
|
"rowMain": "_1nXeGW_rowMain",
|
|
4817
|
+
"segGroup": "_1nXeGW_segGroup",
|
|
4818
|
+
"updateBadge": "_1nXeGW_updateBadge",
|
|
4819
|
+
"rowUninstall": "_1nXeGW_rowUninstall",
|
|
4769
4820
|
"row": "_1nXeGW_row",
|
|
4821
|
+
"exampleBadge": "_1nXeGW_exampleBadge",
|
|
4770
4822
|
"rowRepo": "_1nXeGW_rowRepo",
|
|
4771
|
-
"statusInactive": "_1nXeGW_statusInactive",
|
|
4772
|
-
"versionBadge": "_1nXeGW_versionBadge",
|
|
4773
4823
|
"segRow": "_1nXeGW_segRow",
|
|
4774
|
-
"
|
|
4824
|
+
"statusPending": "_1nXeGW_statusPending",
|
|
4825
|
+
"empty": "_1nXeGW_empty",
|
|
4775
4826
|
"rowSourceTag": "_1nXeGW_rowSourceTag",
|
|
4776
|
-
"
|
|
4777
|
-
"
|
|
4778
|
-
"
|
|
4827
|
+
"emptyTitle": "_1nXeGW_emptyTitle",
|
|
4828
|
+
"statusInactive": "_1nXeGW_statusInactive",
|
|
4829
|
+
"rowCategory": "_1nXeGW_rowCategory",
|
|
4830
|
+
"versionBadge": "_1nXeGW_versionBadge",
|
|
4831
|
+
"rowUpdate": "_1nXeGW_rowUpdate",
|
|
4779
4832
|
"searchInput": "_1nXeGW_searchInput",
|
|
4780
|
-
"
|
|
4781
|
-
"rowTitleLine": "_1nXeGW_rowTitleLine",
|
|
4833
|
+
"rowTitle": "_1nXeGW_rowTitle",
|
|
4782
4834
|
"statusDot": "_1nXeGW_statusDot",
|
|
4783
|
-
"
|
|
4784
|
-
"
|
|
4785
|
-
"
|
|
4786
|
-
"segLabel": "_1nXeGW_segLabel",
|
|
4787
|
-
"segBtn": "_1nXeGW_segBtn",
|
|
4788
|
-
"statusPending": "_1nXeGW_statusPending",
|
|
4789
|
-
"rowSourceTagManual": "_1nXeGW_rowSourceTagManual"
|
|
4835
|
+
"rowDetail": "_1nXeGW_rowDetail",
|
|
4836
|
+
"rowDesc": "_1nXeGW_rowDesc",
|
|
4837
|
+
"rowRestart": "_1nXeGW_rowRestart"
|
|
4790
4838
|
};
|
|
4791
4839
|
//#endregion
|
|
4792
4840
|
//#region src/client/components/views/InstalledView.tsx
|
|
@@ -4795,18 +4843,13 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
4795
4843
|
* Website: https://dsh-plugin.org
|
|
4796
4844
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
4797
4845
|
*
|
|
4798
|
-
*
|
|
4799
|
-
*
|
|
4800
|
-
*
|
|
4801
|
-
*
|
|
4802
|
-
*
|
|
4803
|
-
* search box plus two segmented radio-button groups: source filter
|
|
4804
|
-
* (all / catalog / custom) and sort (name / recently installed / stars / forks).
|
|
4805
|
-
* Each row carries restart (when pending), update and uninstall actions
|
|
4806
|
-
* and opens a detail modal with the full install metadata.
|
|
4846
|
+
* 已安装视图:管理安装进当前 profile 的插件。沿用主流扩展管理器模式(VSCode 已安装 tab)——
|
|
4847
|
+
* 可搜索、可排序的已安装清单,混排目录插件(完整元数据)与命令行自定义安装(目录之外,
|
|
4848
|
+
* 只有运行时信息,打「自定义」徽标)。工具栏含搜索框与两组分段单选:来源筛选
|
|
4849
|
+
* (全部/目录/自定义)与排序(名称/最近安装/Star/Fork)。每行带重启(待重启时)、更新与
|
|
4850
|
+
* 卸载动作,并打开含完整安装元数据的详情弹窗。
|
|
4807
4851
|
*
|
|
4808
|
-
*
|
|
4809
|
-
* model arrives from the catalog hook and actions bubble up via callbacks.
|
|
4852
|
+
* 纯展示组件:只持有本地搜索/排序状态;InstalledItem 模型来自目录 hook,动作经回调上抛。
|
|
4810
4853
|
*/
|
|
4811
4854
|
const INSTALLED_SORTS = [
|
|
4812
4855
|
"sortName",
|
|
@@ -5020,7 +5063,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5020
5063
|
}
|
|
5021
5064
|
//#endregion
|
|
5022
5065
|
//#region \0dsh-css:src/client/styles/CustomInstallView.module.css.mjs
|
|
5023
|
-
const css$6 = ".zISxCG_root{flex-direction:column;gap:10px;min-width:0;max-width:560px;display:flex}.zISxCG_desc{color:var(--hub-text-tertiary);margin:0;font-size:12px;line-height:18px}.zISxCG_installCards{flex-direction:column;flex-shrink:0;gap:10px;min-width:0;display:flex}.zISxCG_installCard{background:var(--hub-bg-1);border:1px solid var(--hub-border-1);border-radius:8px;flex-direction:column;gap:8px;min-width:0;padding:10px 12px;display:flex}.zISxCG_installCardHead{align-items:center;min-width:0;display:flex}.zISxCG_installLabel{color:var(--hub-text-primary);font-size:12px;font-weight:600;line-height:18px}.zISxCG_installHelpBtn{width:18px;height:18px;color:var(--hub-text-tertiary);cursor:pointer;-webkit-user-select:none;user-select:none;background:0 0;border:1px solid #0000;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;margin-left:6px;padding:0;transition:color .12s,background .12s,border-color .12s;display:inline-flex}.zISxCG_installHelpBtn:hover{color:var(--hub-brand);background:var(--hub-brand-tint);border-color:var(--hub-brand-border-soft)}.
|
|
5066
|
+
const css$6 = ".zISxCG_root{flex-direction:column;gap:10px;min-width:0;max-width:560px;display:flex}.zISxCG_desc{color:var(--hub-text-tertiary);margin:0;font-size:12px;line-height:18px}.zISxCG_installCards{flex-direction:column;flex-shrink:0;gap:10px;min-width:0;display:flex}.zISxCG_installCard{background:var(--hub-bg-1);border:1px solid var(--hub-border-1);border-radius:8px;flex-direction:column;gap:8px;min-width:0;padding:10px 12px;display:flex}.zISxCG_installCardHead{align-items:center;min-width:0;display:flex}.zISxCG_installLabel{color:var(--hub-text-primary);font-size:12px;font-weight:600;line-height:18px}.zISxCG_installHelpBtn{width:18px;height:18px;color:var(--hub-text-tertiary);cursor:pointer;-webkit-user-select:none;user-select:none;background:0 0;border:1px solid #0000;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;margin-left:6px;padding:0;transition:color .12s,background .12s,border-color .12s;display:inline-flex}.zISxCG_installHelpBtn:hover{color:var(--hub-brand);background:var(--hub-brand-tint);border-color:var(--hub-brand-border-soft)}.zISxCG_installExample{color:var(--hub-text-tertiary);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;line-height:16px;overflow:hidden}.zISxCG_installRow{align-items:center;gap:8px;min-width:0;display:flex}.zISxCG_installInput{min-width:0;height:28px;color:var(--hub-text-primary);border:1px solid var(--hub-border-2);background:0 0;border-radius:6px;outline:none;flex:auto;padding:0 9px;font-size:12px;line-height:26px;transition:border-color .12s}.zISxCG_installInput::placeholder{color:var(--hub-text-tertiary)}.zISxCG_installInput:focus{border-color:var(--hub-brand)}.zISxCG_installInputError,.zISxCG_installInputError:focus{border-color:var(--hub-danger-text)}.zISxCG_installBtn{color:#fff;background:var(--hub-brand);cursor:pointer;-webkit-user-select:none;user-select:none;border:none;border-radius:6px;flex-shrink:0;padding:5px 14px;font-family:inherit;font-size:12px;font-weight:500;line-height:18px;transition:background .12s,opacity .12s}.zISxCG_installBtn:hover{background:var(--hub-brand-hover)}.zISxCG_installBtn:disabled{opacity:.45;cursor:default}.zISxCG_installCardDisabled{opacity:.8}.zISxCG_channelOff{min-width:0;color:var(--hub-warn);background:var(--hub-warn-tint);border:1px solid var(--hub-warn-border);border-radius:6px;justify-content:space-between;align-items:center;gap:8px;padding:6px 9px;font-size:12px;line-height:16px;display:flex}.zISxCG_channelOffText{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.zISxCG_channelOffBtn{color:var(--hub-warn-strong);border:1px solid var(--hub-warn-border);cursor:pointer;white-space:nowrap;background:0 0;border-radius:6px;flex-shrink:0;padding:3px 10px;font-family:inherit;font-size:12px;font-weight:500;line-height:18px;transition:background .12s,color .12s}.zISxCG_channelOffBtn:hover{background:var(--hub-warn-tint);color:var(--hub-warn)}.zISxCG_installError{color:var(--hub-danger-text);background:var(--hub-danger-tint);border:1px solid var(--hub-danger-border);border-radius:6px;padding:5px 8px;font-size:12px;line-height:16px}.zISxCG_helpBody{flex-direction:column;gap:7px;padding:4px 2px;display:flex}.zISxCG_helpLine{align-items:baseline;gap:12px;min-width:0;font-size:12px;line-height:20px;display:flex}.zISxCG_helpCmd{color:var(--hub-text-primary);white-space:nowrap;flex-shrink:0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.zISxCG_helpNote{min-width:0;color:var(--hub-text-tertiary);font-size:11px}";
|
|
5024
5067
|
const tagId$6 = "dsh-plugin/CustomInstallView.module.css";
|
|
5025
5068
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$6) + "]") === null) {
|
|
5026
5069
|
const tag = document.createElement("style");
|
|
@@ -5035,28 +5078,27 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5035
5078
|
css: css$6
|
|
5036
5079
|
});
|
|
5037
5080
|
var CustomInstallView_module_css_default = {
|
|
5038
|
-
"
|
|
5081
|
+
"installCard": "zISxCG_installCard",
|
|
5082
|
+
"installCards": "zISxCG_installCards",
|
|
5083
|
+
"installRow": "zISxCG_installRow",
|
|
5039
5084
|
"helpBody": "zISxCG_helpBody",
|
|
5040
|
-
"helpLine": "zISxCG_helpLine",
|
|
5041
|
-
"channelOffText": "zISxCG_channelOffText",
|
|
5042
|
-
"installError": "zISxCG_installError",
|
|
5043
|
-
"installHelpBtn": "zISxCG_installHelpBtn",
|
|
5044
5085
|
"root": "zISxCG_root",
|
|
5045
|
-
"desc": "zISxCG_desc",
|
|
5046
5086
|
"installBtn": "zISxCG_installBtn",
|
|
5047
|
-
"installCards": "zISxCG_installCards",
|
|
5048
|
-
"helpNote": "zISxCG_helpNote",
|
|
5049
|
-
"installInsertBtn": "zISxCG_installInsertBtn",
|
|
5050
|
-
"channelOff": "zISxCG_channelOff",
|
|
5051
|
-
"installCard": "zISxCG_installCard",
|
|
5052
|
-
"installRow": "zISxCG_installRow",
|
|
5053
|
-
"installCardHead": "zISxCG_installCardHead",
|
|
5054
5087
|
"installCardDisabled": "zISxCG_installCardDisabled",
|
|
5088
|
+
"installError": "zISxCG_installError",
|
|
5055
5089
|
"installLabel": "zISxCG_installLabel",
|
|
5056
|
-
"installInput": "zISxCG_installInput",
|
|
5057
|
-
"installInputError": "zISxCG_installInputError",
|
|
5058
5090
|
"installExample": "zISxCG_installExample",
|
|
5059
|
-
"
|
|
5091
|
+
"installHelpBtn": "zISxCG_installHelpBtn",
|
|
5092
|
+
"channelOffBtn": "zISxCG_channelOffBtn",
|
|
5093
|
+
"helpLine": "zISxCG_helpLine",
|
|
5094
|
+
"installInputError": "zISxCG_installInputError",
|
|
5095
|
+
"installCardHead": "zISxCG_installCardHead",
|
|
5096
|
+
"channelOffText": "zISxCG_channelOffText",
|
|
5097
|
+
"helpCmd": "zISxCG_helpCmd",
|
|
5098
|
+
"helpNote": "zISxCG_helpNote",
|
|
5099
|
+
"channelOff": "zISxCG_channelOff",
|
|
5100
|
+
"installInput": "zISxCG_installInput",
|
|
5101
|
+
"desc": "zISxCG_desc"
|
|
5060
5102
|
};
|
|
5061
5103
|
//#endregion
|
|
5062
5104
|
//#region src/client/components/views/CustomInstallView.tsx
|
|
@@ -5065,47 +5107,21 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5065
5107
|
* Website: https://dsh-plugin.org
|
|
5066
5108
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
5067
5109
|
*
|
|
5068
|
-
*
|
|
5069
|
-
*
|
|
5070
|
-
*
|
|
5071
|
-
* npm/pnpm install command, including the official global `npm install -g`),
|
|
5072
|
-
* GitHub source and the official `dsh plugin ... add <target>` command —
|
|
5073
|
-
* each with a placeholder example above the input and its own format check.
|
|
5074
|
-
* The cards stay separate so a user never has to guess which format goes
|
|
5075
|
-
* where. Finished installs surface in the Installed view, marked as custom.
|
|
5110
|
+
* 自定义安装视图:独立一级板块,用于手动安装目录之外的 npm 包。安装卡片接受裸包名或完整的
|
|
5111
|
+
* npm/pnpm 安装命令(含官方全局 `npm install -g`),输入框上方带示例并自带格式校验。
|
|
5112
|
+
* 装完的插件出现在「已安装」视图,标记为自定义安装。
|
|
5076
5113
|
*
|
|
5077
|
-
*
|
|
5078
|
-
*
|
|
5079
|
-
* via onInstallCustom.
|
|
5114
|
+
* 纯展示组件:只持有本地输入/错误状态;真正的安装(custom 源,受安全开关控制)经
|
|
5115
|
+
* onInstallCustom 上抛。
|
|
5080
5116
|
*/
|
|
5081
|
-
/** GitHub 地址(带前缀形态):github:、https://github.com/、git+https://github.com/、git@github.com: */
|
|
5082
|
-
const GITHUB_URL_RE = /^(?:github:|https?:\/\/github\.com\/|git\+https?:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?$/;
|
|
5083
|
-
/** 裸 owner/repo(npm 包名只有 @scope/pkg 才带斜杠,无 @ 前缀的 a/b 一定是 GitHub 仓库) */
|
|
5084
|
-
const GITHUB_BARE_RE = /^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+$/;
|
|
5085
5117
|
/** npm 包名(含 @scope/pkg) */
|
|
5086
5118
|
const NPM_PACKAGE_RE = /^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/;
|
|
5087
|
-
/** DSH 命令行前缀(官方唯一形式 `dsh plugin --profile <name> <add|update> <target>`)—— 提取其中的动作与目标。
|
|
5088
|
-
* 官方 CLI(apps/cli/src/args.ts,commander):--profile 为必填长选项(无 -p 简写,省略即报错),
|
|
5089
|
-
* 支持 `--profile=<name>` 等号形式;命令大小写不敏感。update = 已安装目标覆盖更新到最新;
|
|
5090
|
-
* remove 不走这里(卸载由「已安装」列表的卸载按钮执行,命令框不认卸载动词)。
|
|
5091
|
-
* 与 server 端 installTargetOf 口径一致。 */
|
|
5092
|
-
const DSH_PLUGIN_CMD_RE = /^dsh\s+plugin\s+--profile(?:\s+|=)\S+\s+(add|update)\s+(.+)$/i;
|
|
5093
5119
|
/** npm 全局安装命令(官方 README 格式,如 `npm install -g @deepseek-ai/dsh @deepseek-harness-tui/dsh-tui`)——
|
|
5094
5120
|
* 提取 -g 之后的包列表;任一包名非法返回 null(交给格式错误提示)。与 server 端 globalNpmPackagesOf 口径一致。 */
|
|
5095
5121
|
const NPM_GLOBAL_CMD_RE = /^npm\s+(?:install|i)\s+(?:-g|--global)\s+(.+)$/i;
|
|
5096
5122
|
/** 常规 npm/pnpm 安装命令(装进当前 profile,如 `npm install lodash`、`pnpm add @scope/pkg`)——
|
|
5097
5123
|
* 提取命令后的包列表;包列表在 splitPackages 里逐个校验。 */
|
|
5098
5124
|
const NPM_INSTALL_CMD_RE = /^(?:npm\s+(?:install|i)|pnpm\s+(?:add|i|install))\s+(.+)$/i;
|
|
5099
|
-
/** 解析 DSH 命令:返回 { action, target };非官方命令返回 null(交给格式错误提示)。 */
|
|
5100
|
-
function parseDshCommand(raw) {
|
|
5101
|
-
const input = raw.trim();
|
|
5102
|
-
const match = DSH_PLUGIN_CMD_RE.exec(input);
|
|
5103
|
-
if (match === null) return null;
|
|
5104
|
-
return {
|
|
5105
|
-
action: match[1].toLowerCase(),
|
|
5106
|
-
target: match[2].trim()
|
|
5107
|
-
};
|
|
5108
|
-
}
|
|
5109
5125
|
/** 空格分隔的包列表:逐个按 npm 包名语法校验 + 拒绝以 - 开头的 token(npm 会把 --xxx 当参数而非包名),
|
|
5110
5126
|
* 任一非法返回 null(交给格式错误提示)。与 server 端 globalNpmPackagesOf 同口径。 */
|
|
5111
5127
|
function splitPackages(raw) {
|
|
@@ -5139,36 +5155,16 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5139
5155
|
}
|
|
5140
5156
|
return null;
|
|
5141
5157
|
}
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
npm: {
|
|
5149
|
-
titleKey: "npmInstallLabel",
|
|
5150
|
-
contentKey: "npmInstallHelp"
|
|
5151
|
-
},
|
|
5152
|
-
git: {
|
|
5153
|
-
titleKey: "gitInstallLabel",
|
|
5154
|
-
contentKey: "gitInstallHelp"
|
|
5155
|
-
},
|
|
5156
|
-
cmd: {
|
|
5157
|
-
titleKey: "dshCmdLabel",
|
|
5158
|
-
contentKey: "dshCmdHelp"
|
|
5159
|
-
}
|
|
5160
|
-
};
|
|
5161
|
-
function CustomInstallView({ t, onInstallCustom, enableNpm, enableGit, enableDsh, onOpenSettings, profile }) {
|
|
5158
|
+
/** 卡片标题旁的「帮助」弹窗:该卡片的标题与格式清单语言包 key。 */
|
|
5159
|
+
const HELP_CARDS = { npm: {
|
|
5160
|
+
titleKey: "npmInstallLabel",
|
|
5161
|
+
contentKey: "npmInstallHelp"
|
|
5162
|
+
} };
|
|
5163
|
+
function CustomInstallView({ t, onInstallCustom, enableNpm, onOpenSettings }) {
|
|
5162
5164
|
/** 自定义安装:NPM 包输入与格式错误('' = 无错误) */
|
|
5163
5165
|
const [npmQuery, setNpmQuery] = (0, react.useState)("");
|
|
5164
5166
|
const [npmError, setNpmError] = (0, react.useState)("");
|
|
5165
|
-
/**
|
|
5166
|
-
const [gitQuery, setGitQuery] = (0, react.useState)("");
|
|
5167
|
-
const [gitError, setGitError] = (0, react.useState)("");
|
|
5168
|
-
/** 自定义安装:DSH 命令输入与格式错误('' = 无错误) */
|
|
5169
|
-
const [cmdQuery, setCmdQuery] = (0, react.useState)("");
|
|
5170
|
-
const [cmdError, setCmdError] = (0, react.useState)("");
|
|
5171
|
-
/** 卡片标题旁「帮助」弹窗:null = 未打开;'npm' | 'git' | 'cmd' = 打开对应卡片的格式清单 */
|
|
5167
|
+
/** 卡片标题旁「帮助」弹窗:null = 未打开;'npm' = 打开该卡片的格式清单 */
|
|
5172
5168
|
const [helpFor, setHelpFor] = (0, react.useState)(null);
|
|
5173
5169
|
/** 通道关闭提示行:开关关掉后替代示例与输入行,引导去设置打开 */
|
|
5174
5170
|
const channelOffRow = (0, react.createElement)("div", { className: CustomInstallView_module_css_default.channelOff }, (0, react.createElement)("span", { className: CustomInstallView_module_css_default.channelOffText }, t("channelDisabledHint")), (0, react.createElement)("button", {
|
|
@@ -5192,34 +5188,6 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5192
5188
|
setNpmQuery("");
|
|
5193
5189
|
setNpmError("");
|
|
5194
5190
|
};
|
|
5195
|
-
const submitGit = () => {
|
|
5196
|
-
const target = gitQuery.trim();
|
|
5197
|
-
if (!target) return;
|
|
5198
|
-
if (!isGitHubInput(target)) {
|
|
5199
|
-
setGitError(t("gitInstallInvalid"));
|
|
5200
|
-
return;
|
|
5201
|
-
}
|
|
5202
|
-
onInstallCustom(target, { installChannel: "git" });
|
|
5203
|
-
setGitQuery("");
|
|
5204
|
-
setGitError("");
|
|
5205
|
-
};
|
|
5206
|
-
const submitCmd = () => {
|
|
5207
|
-
const raw = cmdQuery.trim();
|
|
5208
|
-
if (!raw) return;
|
|
5209
|
-
const parsed = parseDshCommand(raw);
|
|
5210
|
-
if (parsed === null) {
|
|
5211
|
-
setCmdError(t("dshCmdInvalid", { profile }));
|
|
5212
|
-
return;
|
|
5213
|
-
}
|
|
5214
|
-
onInstallCustom(parsed.target, { installChannel: "dsh" });
|
|
5215
|
-
setCmdQuery("");
|
|
5216
|
-
setCmdError("");
|
|
5217
|
-
};
|
|
5218
|
-
/** 一键插入 DSH Plugin Hub 自身的更新命令:按当前 profile 拼官方命令填进输入框,用户确认后提交 */
|
|
5219
|
-
const insertHubUpdate = () => {
|
|
5220
|
-
setCmdQuery(`dsh plugin --profile ${profile} update dsh-plugin`);
|
|
5221
|
-
setCmdError("");
|
|
5222
|
-
};
|
|
5223
5191
|
return (0, react.createElement)("div", { className: CustomInstallView_module_css_default.root }, (0, react.createElement)("p", { className: CustomInstallView_module_css_default.desc }, t("customViewDesc")), (0, react.createElement)("div", { className: CustomInstallView_module_css_default.installCards }, (0, react.createElement)("div", { className: enableNpm ? CustomInstallView_module_css_default.installCard : `${CustomInstallView_module_css_default.installCard} ${CustomInstallView_module_css_default.installCardDisabled}` }, (0, react.createElement)("div", { className: CustomInstallView_module_css_default.installCardHead }, (0, react.createElement)("span", { className: CustomInstallView_module_css_default.installLabel }, t("npmInstallLabel")), (0, react.createElement)("button", {
|
|
5224
5192
|
type: "button",
|
|
5225
5193
|
className: CustomInstallView_module_css_default.installHelpBtn,
|
|
@@ -5248,66 +5216,6 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5248
5216
|
onClick: submitNpm
|
|
5249
5217
|
}, t("installCliBtn"))),
|
|
5250
5218
|
npmError ? (0, react.createElement)("div", { className: CustomInstallView_module_css_default.installError }, npmError) : null
|
|
5251
|
-
]), (0, react.createElement)("div", { className: enableGit ? CustomInstallView_module_css_default.installCard : `${CustomInstallView_module_css_default.installCard} ${CustomInstallView_module_css_default.installCardDisabled}` }, (0, react.createElement)("div", { className: CustomInstallView_module_css_default.installCardHead }, (0, react.createElement)("span", { className: CustomInstallView_module_css_default.installLabel }, t("gitInstallLabel")), (0, react.createElement)("button", {
|
|
5252
|
-
type: "button",
|
|
5253
|
-
className: CustomInstallView_module_css_default.installHelpBtn,
|
|
5254
|
-
title: t("installHelp"),
|
|
5255
|
-
"aria-label": t("installHelp"),
|
|
5256
|
-
onClick: () => setHelpFor("git")
|
|
5257
|
-
}, (0, react.createElement)(HelpIcon))), !enableGit ? channelOffRow : [
|
|
5258
|
-
(0, react.createElement)("div", { className: CustomInstallView_module_css_default.installExample }, t("gitInstallExample")),
|
|
5259
|
-
(0, react.createElement)("div", { className: CustomInstallView_module_css_default.installRow }, (0, react.createElement)("input", {
|
|
5260
|
-
className: gitError ? `${CustomInstallView_module_css_default.installInput} ${CustomInstallView_module_css_default.installInputError}` : CustomInstallView_module_css_default.installInput,
|
|
5261
|
-
type: "text",
|
|
5262
|
-
placeholder: t("gitInstallPlaceholder"),
|
|
5263
|
-
value: gitQuery,
|
|
5264
|
-
spellCheck: false,
|
|
5265
|
-
onInput: (e) => {
|
|
5266
|
-
setGitQuery(e.target.value);
|
|
5267
|
-
setGitError("");
|
|
5268
|
-
},
|
|
5269
|
-
onKeyDown: (e) => {
|
|
5270
|
-
if (e.key === "Enter") submitGit();
|
|
5271
|
-
}
|
|
5272
|
-
}), (0, react.createElement)("button", {
|
|
5273
|
-
className: CustomInstallView_module_css_default.installBtn,
|
|
5274
|
-
type: "button",
|
|
5275
|
-
disabled: gitQuery.trim() === "",
|
|
5276
|
-
onClick: submitGit
|
|
5277
|
-
}, t("installCliBtn"))),
|
|
5278
|
-
gitError ? (0, react.createElement)("div", { className: CustomInstallView_module_css_default.installError }, gitError) : null
|
|
5279
|
-
]), (0, react.createElement)("div", { className: enableDsh ? CustomInstallView_module_css_default.installCard : `${CustomInstallView_module_css_default.installCard} ${CustomInstallView_module_css_default.installCardDisabled}` }, (0, react.createElement)("div", { className: CustomInstallView_module_css_default.installCardHead }, (0, react.createElement)("span", { className: CustomInstallView_module_css_default.installLabel }, t("dshCmdLabel")), (0, react.createElement)("button", {
|
|
5280
|
-
type: "button",
|
|
5281
|
-
className: CustomInstallView_module_css_default.installHelpBtn,
|
|
5282
|
-
title: t("installHelp"),
|
|
5283
|
-
"aria-label": t("installHelp"),
|
|
5284
|
-
onClick: () => setHelpFor("cmd")
|
|
5285
|
-
}, (0, react.createElement)(HelpIcon)), enableDsh ? (0, react.createElement)("button", {
|
|
5286
|
-
type: "button",
|
|
5287
|
-
className: CustomInstallView_module_css_default.installInsertBtn,
|
|
5288
|
-
onClick: insertHubUpdate
|
|
5289
|
-
}, t("dshCmdInsertHubUpdate")) : null), !enableDsh ? channelOffRow : [
|
|
5290
|
-
(0, react.createElement)("div", { className: CustomInstallView_module_css_default.installExample }, t("dshCmdExample", { profile })),
|
|
5291
|
-
(0, react.createElement)("div", { className: CustomInstallView_module_css_default.installRow }, (0, react.createElement)("input", {
|
|
5292
|
-
className: cmdError ? `${CustomInstallView_module_css_default.installInput} ${CustomInstallView_module_css_default.installInputError}` : CustomInstallView_module_css_default.installInput,
|
|
5293
|
-
type: "text",
|
|
5294
|
-
placeholder: t("dshCmdPlaceholder"),
|
|
5295
|
-
value: cmdQuery,
|
|
5296
|
-
spellCheck: false,
|
|
5297
|
-
onInput: (e) => {
|
|
5298
|
-
setCmdQuery(e.target.value);
|
|
5299
|
-
setCmdError("");
|
|
5300
|
-
},
|
|
5301
|
-
onKeyDown: (e) => {
|
|
5302
|
-
if (e.key === "Enter") submitCmd();
|
|
5303
|
-
}
|
|
5304
|
-
}), (0, react.createElement)("button", {
|
|
5305
|
-
className: CustomInstallView_module_css_default.installBtn,
|
|
5306
|
-
type: "button",
|
|
5307
|
-
disabled: cmdQuery.trim() === "",
|
|
5308
|
-
onClick: submitCmd
|
|
5309
|
-
}, t("installCliBtn"))),
|
|
5310
|
-
cmdError ? (0, react.createElement)("div", { className: CustomInstallView_module_css_default.installError }, cmdError) : null
|
|
5311
5219
|
])), helpFor !== null ? (0, react.createElement)("div", {
|
|
5312
5220
|
className: Modal_module_css_default.overlay,
|
|
5313
5221
|
onClick: (e) => {
|
|
@@ -5321,7 +5229,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5321
5229
|
className: Modal_module_css_default.modalClose,
|
|
5322
5230
|
"aria-label": t("errorClose"),
|
|
5323
5231
|
onClick: () => setHelpFor(null)
|
|
5324
|
-
}, (0, react.createElement)(CloseIcon))), (0, react.createElement)("div", { className: Modal_module_css_default.modalBody }, (0, react.createElement)("div", { className: CustomInstallView_module_css_default.helpBody }, t(HELP_CARDS[helpFor].contentKey
|
|
5232
|
+
}, (0, react.createElement)(CloseIcon))), (0, react.createElement)("div", { className: Modal_module_css_default.modalBody }, (0, react.createElement)("div", { className: CustomInstallView_module_css_default.helpBody }, t(HELP_CARDS[helpFor].contentKey).split("\n").map((line, i) => {
|
|
5325
5233
|
const [cmd, note] = line.split(" ");
|
|
5326
5234
|
return (0, react.createElement)("div", {
|
|
5327
5235
|
key: i,
|
|
@@ -5346,30 +5254,30 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5346
5254
|
css: css$5
|
|
5347
5255
|
});
|
|
5348
5256
|
var SettingsView_module_css_default = {
|
|
5349
|
-
"
|
|
5350
|
-
"
|
|
5351
|
-
"
|
|
5352
|
-
"navItemActive": "_506LLG_navItemActive",
|
|
5257
|
+
"pageHeader": "_506LLG_pageHeader",
|
|
5258
|
+
"sidebar": "_506LLG_sidebar",
|
|
5259
|
+
"root": "_506LLG_root",
|
|
5353
5260
|
"pageDesc": "_506LLG_pageDesc",
|
|
5261
|
+
"pageTitle": "_506LLG_pageTitle",
|
|
5262
|
+
"settingTitle": "_506LLG_settingTitle",
|
|
5263
|
+
"settingControl": "_506LLG_settingControl",
|
|
5354
5264
|
"card": "_506LLG_card",
|
|
5355
|
-
"proxyHintOk": "_506LLG_proxyHintOk",
|
|
5356
|
-
"root": "_506LLG_root",
|
|
5357
|
-
"navIcon": "_506LLG_navIcon",
|
|
5358
|
-
"settingControlStack": "_506LLG_settingControlStack",
|
|
5359
|
-
"textInput": "_506LLG_textInput",
|
|
5360
|
-
"proxyControl": "_506LLG_proxyControl",
|
|
5361
|
-
"sidebar": "_506LLG_sidebar",
|
|
5362
5265
|
"settingLabel": "_506LLG_settingLabel",
|
|
5363
|
-
"
|
|
5266
|
+
"content": "_506LLG_content",
|
|
5267
|
+
"settingControlStack": "_506LLG_settingControlStack",
|
|
5268
|
+
"proxyHintFail": "_506LLG_proxyHintFail",
|
|
5269
|
+
"proxyHintOk": "_506LLG_proxyHintOk",
|
|
5364
5270
|
"controlDropdown": "_506LLG_controlDropdown",
|
|
5365
|
-
"
|
|
5366
|
-
"pageHeader": "_506LLG_pageHeader",
|
|
5367
|
-
"settingRow": "_506LLG_settingRow",
|
|
5271
|
+
"settingRowStack": "_506LLG_settingRowStack",
|
|
5368
5272
|
"navItem": "_506LLG_navItem",
|
|
5369
|
-
"
|
|
5370
|
-
"settingControl": "_506LLG_settingControl",
|
|
5273
|
+
"proxyControl": "_506LLG_proxyControl",
|
|
5371
5274
|
"proxyHint": "_506LLG_proxyHint",
|
|
5372
|
-
"
|
|
5275
|
+
"resetBtn": "_506LLG_resetBtn",
|
|
5276
|
+
"navIcon": "_506LLG_navIcon",
|
|
5277
|
+
"navItemActive": "_506LLG_navItemActive",
|
|
5278
|
+
"settingRow": "_506LLG_settingRow",
|
|
5279
|
+
"textInput": "_506LLG_textInput",
|
|
5280
|
+
"settingDesc": "_506LLG_settingDesc"
|
|
5373
5281
|
};
|
|
5374
5282
|
//#endregion
|
|
5375
5283
|
//#region \0dsh-css:src/client/styles/Dropdown.module.css.mjs
|
|
@@ -5388,18 +5296,18 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5388
5296
|
css: css$4
|
|
5389
5297
|
});
|
|
5390
5298
|
var Dropdown_module_css_default = {
|
|
5299
|
+
"dropdownItem": "B_Gxsq_dropdownItem",
|
|
5300
|
+
"dropdownArrowOpen": "B_Gxsq_dropdownArrowOpen",
|
|
5301
|
+
"dropdownPanel": "B_Gxsq_dropdownPanel",
|
|
5391
5302
|
"dropdownBtn": "B_Gxsq_dropdownBtn",
|
|
5392
5303
|
"dropdownFill": "B_Gxsq_dropdownFill",
|
|
5304
|
+
"dropdownArrow": "B_Gxsq_dropdownArrow",
|
|
5305
|
+
"dropdownItemActive": "B_Gxsq_dropdownItemActive",
|
|
5306
|
+
"dropdownItemLabel": "B_Gxsq_dropdownItemLabel",
|
|
5393
5307
|
"dropdownCount": "B_Gxsq_dropdownCount",
|
|
5394
5308
|
"dropdownCountActive": "B_Gxsq_dropdownCountActive",
|
|
5395
5309
|
"dropdown": "B_Gxsq_dropdown",
|
|
5396
|
-
"
|
|
5397
|
-
"dropdownItemLabel": "B_Gxsq_dropdownItemLabel",
|
|
5398
|
-
"dropdownArrowOpen": "B_Gxsq_dropdownArrowOpen",
|
|
5399
|
-
"dropdownLabel": "B_Gxsq_dropdownLabel",
|
|
5400
|
-
"dropdownPanel": "B_Gxsq_dropdownPanel",
|
|
5401
|
-
"dropdownItemActive": "B_Gxsq_dropdownItemActive",
|
|
5402
|
-
"dropdownArrow": "B_Gxsq_dropdownArrow"
|
|
5310
|
+
"dropdownLabel": "B_Gxsq_dropdownLabel"
|
|
5403
5311
|
};
|
|
5404
5312
|
//#endregion
|
|
5405
5313
|
//#region \0dsh-css:src/client/styles/Toggle.module.css.mjs
|
|
@@ -5418,8 +5326,8 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5418
5326
|
css: css$3
|
|
5419
5327
|
});
|
|
5420
5328
|
var Toggle_module_css_default = {
|
|
5421
|
-
"toggleOn": "k-cD4G_toggleOn",
|
|
5422
5329
|
"toggle": "k-cD4G_toggle",
|
|
5330
|
+
"toggleOn": "k-cD4G_toggleOn",
|
|
5423
5331
|
"knob": "k-cD4G_knob"
|
|
5424
5332
|
};
|
|
5425
5333
|
//#endregion
|
|
@@ -5429,9 +5337,8 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5429
5337
|
* Website: https://dsh-plugin.org
|
|
5430
5338
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
5431
5339
|
*
|
|
5432
|
-
*
|
|
5433
|
-
*
|
|
5434
|
-
* by the --hub-* tokens (on = brand fill, off = neutral track).
|
|
5340
|
+
* 设置行用的紧凑开关。基于原生 button,可键盘聚焦并通过 aria-checked 播报状态;
|
|
5341
|
+
* 样式由 --hub-* 变量驱动(开 = 品牌填充,关 = 中性轨道)。
|
|
5435
5342
|
*/
|
|
5436
5343
|
function Toggle({ checked, onChange, title, disabled }) {
|
|
5437
5344
|
return (0, react.createElement)("button", {
|
|
@@ -5451,13 +5358,11 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5451
5358
|
* Website: https://dsh-plugin.org
|
|
5452
5359
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
5453
5360
|
*
|
|
5454
|
-
*
|
|
5361
|
+
* 按钮式下拉框(替代原生 <select>)。
|
|
5455
5362
|
*
|
|
5456
|
-
*
|
|
5457
|
-
*
|
|
5458
|
-
*
|
|
5459
|
-
* outside or pressing Esc closes the panel; options get a hover fill and
|
|
5460
|
-
* the active one a brand highlight, all driven by the --hub-* tokens.
|
|
5363
|
+
* 触发器是紧凑的工具栏按钮 —— 细边框 + 淡灰填充 + 当前值 + 箭头 —— 与其它工具栏按钮
|
|
5364
|
+
* 并排自然,只占一格横向空间。点击外部或按 Esc 关闭面板;选项有 hover 填充、
|
|
5365
|
+
* 激活项为品牌高亮,全部由 --hub-* 变量驱动。
|
|
5461
5366
|
*/
|
|
5462
5367
|
function Dropdown({ value, options, onChange, title, className }) {
|
|
5463
5368
|
const [open, setOpen] = (0, react.useState)(false);
|
|
@@ -5520,29 +5425,29 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5520
5425
|
css: css$2
|
|
5521
5426
|
});
|
|
5522
5427
|
var DiagnosticsView_module_css_default = {
|
|
5523
|
-
"envTitle": "k9eRya_envTitle",
|
|
5524
|
-
"runBtn": "k9eRya_runBtn",
|
|
5525
|
-
"headHint": "k9eRya_headHint",
|
|
5526
5428
|
"badgeOk": "k9eRya_badgeOk",
|
|
5527
|
-
"
|
|
5528
|
-
"panel": "k9eRya_panel",
|
|
5429
|
+
"badgeFail": "k9eRya_badgeFail",
|
|
5529
5430
|
"badgeIdle": "k9eRya_badgeIdle",
|
|
5530
|
-
"envDesc": "k9eRya_envDesc",
|
|
5531
|
-
"envRow": "k9eRya_envRow",
|
|
5532
|
-
"display": "k9eRya_display",
|
|
5533
5431
|
"envCopyBtn": "k9eRya_envCopyBtn",
|
|
5534
|
-
"
|
|
5535
|
-
"
|
|
5432
|
+
"envLabel": "k9eRya_envLabel",
|
|
5433
|
+
"headHint": "k9eRya_headHint",
|
|
5434
|
+
"meta": "k9eRya_meta",
|
|
5435
|
+
"summaryFail": "k9eRya_summaryFail",
|
|
5536
5436
|
"row": "k9eRya_row",
|
|
5537
5437
|
"badgeRunning": "k9eRya_badgeRunning",
|
|
5538
|
-
"
|
|
5539
|
-
"
|
|
5438
|
+
"panel": "k9eRya_panel",
|
|
5439
|
+
"envTitle": "k9eRya_envTitle",
|
|
5440
|
+
"display": "k9eRya_display",
|
|
5540
5441
|
"name": "k9eRya_name",
|
|
5541
|
-
"badgeFail": "k9eRya_badgeFail",
|
|
5542
|
-
"envLabel": "k9eRya_envLabel",
|
|
5543
|
-
"meta": "k9eRya_meta",
|
|
5544
5442
|
"badge": "k9eRya_badge",
|
|
5545
|
-
"
|
|
5443
|
+
"diagPulse": "k9eRya_diagPulse",
|
|
5444
|
+
"summaryOk": "k9eRya_summaryOk",
|
|
5445
|
+
"summaryRunning": "k9eRya_summaryRunning",
|
|
5446
|
+
"envRow": "k9eRya_envRow",
|
|
5447
|
+
"summary": "k9eRya_summary",
|
|
5448
|
+
"head": "k9eRya_head",
|
|
5449
|
+
"runBtn": "k9eRya_runBtn",
|
|
5450
|
+
"envDesc": "k9eRya_envDesc"
|
|
5546
5451
|
};
|
|
5547
5452
|
//#endregion
|
|
5548
5453
|
//#region src/client/components/views/DiagnosticsView.tsx
|
|
@@ -5551,12 +5456,9 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5551
5456
|
* Website: https://dsh-plugin.org
|
|
5552
5457
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
5553
5458
|
*
|
|
5554
|
-
*
|
|
5555
|
-
*
|
|
5556
|
-
*
|
|
5557
|
-
* automatically when the page opens; every row is a button that re-probes
|
|
5558
|
-
* just that channel, so a click always yields visible feedback
|
|
5559
|
-
* (row pulses → badge flips → latency refreshes).
|
|
5459
|
+
* 系统诊断列表:每个连通性通道(npm registry / GitHub API / 目录站点)一行,各带实时
|
|
5460
|
+
* 状态徽标 —— 200 OK 绿、不可达红、探测中显示「检测中…」。页面打开时自动跑一轮;
|
|
5461
|
+
* 每行都是按钮,点击只重测该通道,因此点击总有可见反馈(行脉冲 → 徽标翻转 → 延迟刷新)。
|
|
5560
5462
|
*/
|
|
5561
5463
|
/** 系统版本文本:提交 Issue 时粘贴到正文,方便作者复现。 */
|
|
5562
5464
|
function formatEnv(env) {
|
|
@@ -5720,57 +5622,57 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5720
5622
|
css: css$1
|
|
5721
5623
|
});
|
|
5722
5624
|
var LogsView_module_css_default = {
|
|
5723
|
-
"
|
|
5724
|
-
"
|
|
5725
|
-
"pathDraft": "_3j77BW_pathDraft",
|
|
5726
|
-
"filterBar": "_3j77BW_filterBar",
|
|
5727
|
-
"catUpdate": "_3j77BW_catUpdate",
|
|
5728
|
-
"moreEnd": "_3j77BW_moreEnd",
|
|
5729
|
-
"footActions": "_3j77BW_footActions",
|
|
5625
|
+
"headActions": "_3j77BW_headActions",
|
|
5626
|
+
"head": "_3j77BW_head",
|
|
5730
5627
|
"badgeDebug": "_3j77BW_badgeDebug",
|
|
5731
|
-
"actions": "_3j77BW_actions",
|
|
5732
|
-
"badgeInfo": "_3j77BW_badgeInfo",
|
|
5733
|
-
"pathLabel": "_3j77BW_pathLabel",
|
|
5734
|
-
"catInstall": "_3j77BW_catInstall",
|
|
5735
|
-
"entry": "_3j77BW_entry",
|
|
5736
|
-
"badgeSuccess": "_3j77BW_badgeSuccess",
|
|
5737
|
-
"pathDialogHint": "_3j77BW_pathDialogHint",
|
|
5738
|
-
"empty": "_3j77BW_empty",
|
|
5739
|
-
"filterChipActive": "_3j77BW_filterChipActive",
|
|
5740
5628
|
"btn": "_3j77BW_btn",
|
|
5741
|
-
"
|
|
5742
|
-
"panel": "_3j77BW_panel",
|
|
5743
|
-
"search": "_3j77BW_search",
|
|
5744
|
-
"time": "_3j77BW_time",
|
|
5629
|
+
"pathDialogFoot": "_3j77BW_pathDialogFoot",
|
|
5745
5630
|
"pathDialogRow": "_3j77BW_pathDialogRow",
|
|
5746
|
-
"
|
|
5747
|
-
"
|
|
5748
|
-
"
|
|
5631
|
+
"catUninstall": "_3j77BW_catUninstall",
|
|
5632
|
+
"footPath": "_3j77BW_footPath",
|
|
5633
|
+
"pathLabel": "_3j77BW_pathLabel",
|
|
5634
|
+
"panel": "_3j77BW_panel",
|
|
5635
|
+
"catDiagnostics": "_3j77BW_catDiagnostics",
|
|
5636
|
+
"catSystem": "_3j77BW_catSystem",
|
|
5637
|
+
"footFail": "_3j77BW_footFail",
|
|
5749
5638
|
"pathRow": "_3j77BW_pathRow",
|
|
5750
5639
|
"linkBtn": "_3j77BW_linkBtn",
|
|
5640
|
+
"searchInput": "_3j77BW_searchInput",
|
|
5751
5641
|
"footCount": "_3j77BW_footCount",
|
|
5752
|
-
"catUninstall": "_3j77BW_catUninstall",
|
|
5753
5642
|
"list": "_3j77BW_list",
|
|
5754
|
-
"
|
|
5755
|
-
"
|
|
5643
|
+
"entry": "_3j77BW_entry",
|
|
5644
|
+
"pathDialog": "_3j77BW_pathDialog",
|
|
5645
|
+
"actions": "_3j77BW_actions",
|
|
5646
|
+
"pathDialogDesc": "_3j77BW_pathDialogDesc",
|
|
5647
|
+
"filterChip": "_3j77BW_filterChip",
|
|
5648
|
+
"filterChipActive": "_3j77BW_filterChipActive",
|
|
5649
|
+
"moreEnd": "_3j77BW_moreEnd",
|
|
5650
|
+
"time": "_3j77BW_time",
|
|
5756
5651
|
"clearBtn": "_3j77BW_clearBtn",
|
|
5757
|
-
"
|
|
5652
|
+
"foot": "_3j77BW_foot",
|
|
5758
5653
|
"badge": "_3j77BW_badge",
|
|
5759
|
-
"
|
|
5760
|
-
"catSystem": "_3j77BW_catSystem",
|
|
5761
|
-
"searchInput": "_3j77BW_searchInput",
|
|
5762
|
-
"more": "_3j77BW_more",
|
|
5763
|
-
"filterChip": "_3j77BW_filterChip",
|
|
5654
|
+
"badgeSuccess": "_3j77BW_badgeSuccess",
|
|
5764
5655
|
"headHint": "_3j77BW_headHint",
|
|
5765
|
-
"pathText": "_3j77BW_pathText",
|
|
5766
|
-
"footPath": "_3j77BW_footPath",
|
|
5767
|
-
"event": "_3j77BW_event",
|
|
5768
|
-
"footFail": "_3j77BW_footFail",
|
|
5769
5656
|
"badgeError": "_3j77BW_badgeError",
|
|
5770
5657
|
"badgeWarn": "_3j77BW_badgeWarn",
|
|
5658
|
+
"badgeInfo": "_3j77BW_badgeInfo",
|
|
5659
|
+
"catUpdate": "_3j77BW_catUpdate",
|
|
5660
|
+
"search": "_3j77BW_search",
|
|
5661
|
+
"catSettings": "_3j77BW_catSettings",
|
|
5662
|
+
"event": "_3j77BW_event",
|
|
5663
|
+
"logList": "_3j77BW_logList",
|
|
5771
5664
|
"catBadge": "_3j77BW_catBadge",
|
|
5665
|
+
"footActions": "_3j77BW_footActions",
|
|
5666
|
+
"empty": "_3j77BW_empty",
|
|
5667
|
+
"more": "_3j77BW_more",
|
|
5668
|
+
"message": "_3j77BW_message",
|
|
5669
|
+
"pathText": "_3j77BW_pathText",
|
|
5670
|
+
"filterBar": "_3j77BW_filterBar",
|
|
5772
5671
|
"previewRow": "_3j77BW_previewRow",
|
|
5773
|
-
"
|
|
5672
|
+
"pathDraft": "_3j77BW_pathDraft",
|
|
5673
|
+
"pathDialogReset": "_3j77BW_pathDialogReset",
|
|
5674
|
+
"catInstall": "_3j77BW_catInstall",
|
|
5675
|
+
"pathDialogHint": "_3j77BW_pathDialogHint"
|
|
5774
5676
|
};
|
|
5775
5677
|
//#endregion
|
|
5776
5678
|
//#region src/client/components/modals/LogsModal.tsx
|
|
@@ -5779,20 +5681,15 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
5779
5681
|
* Website: https://dsh-plugin.org
|
|
5780
5682
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
5781
5683
|
*
|
|
5782
|
-
*
|
|
5783
|
-
*
|
|
5784
|
-
* ~/.dsh/profiles/<profile>/hub.log) straight from the server, one page at
|
|
5785
|
-
* a time.
|
|
5684
|
+
* 内置日志查看器弹窗:无需外部软件 —— 应用自己开窗,从服务端直接分页加载本地系统日志
|
|
5685
|
+
* (JSONL,位于 ~/.dsh/profiles/<profile>/hub.log)。
|
|
5786
5686
|
*
|
|
5787
|
-
*
|
|
5788
|
-
*
|
|
5789
|
-
*
|
|
5790
|
-
* say, only install errors — so the exact incompatible step of an install
|
|
5791
|
-
* (or uninstall) is easy to spot. Search narrows by event code or message.
|
|
5687
|
+
* 每行双重归类:功能域(安装/卸载/更新/诊断/设置/系统)与严重级别(debug/info/success/
|
|
5688
|
+
* warn/error)。两轴筛选可只盯某类,比如只看安装错误 —— 便于定位安装(或卸载)中真正
|
|
5689
|
+
* 卡住的那一步;搜索按事件码或消息缩小范围。
|
|
5792
5690
|
*
|
|
5793
|
-
*
|
|
5794
|
-
*
|
|
5795
|
-
* real file location and reveals it in the system file manager.
|
|
5691
|
+
* 服务端分页:GET /dsh-plugin-hub/logs?offset=&limit=&category=&level=&query=
|
|
5692
|
+
* → { entries, total, hasMore, path }。底部展示日志真实路径并可在系统文件管理器中定位。
|
|
5796
5693
|
*/
|
|
5797
5694
|
const PAGE = 100;
|
|
5798
5695
|
/** 类别筛选标签:值 → 语言包 key(弹窗内 chip 与行内类别徽章共用)。 */
|
|
@@ -6329,17 +6226,14 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
6329
6226
|
* Website: https://dsh-plugin.org
|
|
6330
6227
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
6331
6228
|
*
|
|
6332
|
-
*
|
|
6333
|
-
*
|
|
6334
|
-
* active section's rows. New settings only add rows, new areas only add a
|
|
6335
|
-
* sidebar entry.
|
|
6229
|
+
* 设置视图:桌面设置式导航 —— 固定左侧栏列出各分组(图标 + 名称,点击切换),
|
|
6230
|
+
* 右侧面板展示当前分组的设置行。新增设置只加行,新增区域只加一条侧栏项。
|
|
6336
6231
|
*
|
|
6337
|
-
*
|
|
6338
|
-
*
|
|
6339
|
-
*
|
|
6340
|
-
*
|
|
6341
|
-
*
|
|
6342
|
-
* Logs — system log viewer + storage location
|
|
6232
|
+
* 各分组对应本地服务端实际强制的行为:
|
|
6233
|
+
* 更新与源 —— 启动检查更新 / npm 镜像 / HTTP 代理(都接进安装命令链路)
|
|
6234
|
+
* 安全与信任 —— 受限的自定义安装(服务端 403 门禁)
|
|
6235
|
+
* 诊断 —— 实时连通性探测 + 环境快照
|
|
6236
|
+
* 日志 —— 系统日志查看器 + 存放位置
|
|
6343
6237
|
*/
|
|
6344
6238
|
/** npm 镜像源预设:空串 = 未配置(跟随用户本机 npm 配置,本插件不注入任何 registry)。
|
|
6345
6239
|
* 只提供常见国内顶级镜像下拉,不做自定义输入 —— 想用其它镜像直接在 ~/.npmrc 配置即可。 */
|
|
@@ -6505,22 +6399,6 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
6505
6399
|
onChange: (v) => update({ enableNpmInstall: v }),
|
|
6506
6400
|
title: t("settingsEnableNpm")
|
|
6507
6401
|
})
|
|
6508
|
-
}), (0, react.createElement)(SettingRow, {
|
|
6509
|
-
title: t("settingsEnableGit"),
|
|
6510
|
-
desc: t("settingsEnableGitDesc"),
|
|
6511
|
-
children: (0, react.createElement)(Toggle, {
|
|
6512
|
-
checked: settings.enableGitInstall,
|
|
6513
|
-
onChange: (v) => update({ enableGitInstall: v }),
|
|
6514
|
-
title: t("settingsEnableGit")
|
|
6515
|
-
})
|
|
6516
|
-
}), (0, react.createElement)(SettingRow, {
|
|
6517
|
-
title: t("settingsEnableDsh"),
|
|
6518
|
-
desc: t("settingsEnableDshDesc"),
|
|
6519
|
-
children: (0, react.createElement)(Toggle, {
|
|
6520
|
-
checked: settings.enableDshInstall,
|
|
6521
|
-
onChange: (v) => update({ enableDshInstall: v }),
|
|
6522
|
-
title: t("settingsEnableDsh")
|
|
6523
|
-
})
|
|
6524
6402
|
}));
|
|
6525
6403
|
const diagnosticsCard = (0, react.createElement)("div", { className: SettingsView_module_css_default.card }, (0, react.createElement)(DiagnosticsView, {
|
|
6526
6404
|
t,
|
|
@@ -6586,10 +6464,8 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
6586
6464
|
* Website: https://dsh-plugin.org
|
|
6587
6465
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
6588
6466
|
*
|
|
6589
|
-
*
|
|
6590
|
-
*
|
|
6591
|
-
* rendering is delegated to the small presentational components in this
|
|
6592
|
-
* folder; it hosts the dialogs/toast and the section-level copy actions.
|
|
6467
|
+
* 插件中心板块:把目录数据管道、后台任务队列与反馈状态接在一起。数据/队列逻辑在 hooks/,
|
|
6468
|
+
* 渲染交给本目录下的小型展示组件;本文件托管各弹窗/Toast 与板块级复制动作。
|
|
6593
6469
|
*/
|
|
6594
6470
|
function PluginHubSection({ t: _hostT, locale }) {
|
|
6595
6471
|
const { lang, langKey, langPath, t, toggleLang } = useLanguage(locale);
|
|
@@ -6627,10 +6503,10 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
6627
6503
|
const [confirmPlugin, setConfirmPlugin] = (0, react.useState)(null);
|
|
6628
6504
|
/** 弹窗动作是否为「更新」:已安装插件点「更新」→ 走同一条 add 命令原位覆盖重装,文案区分安装/更新 */
|
|
6629
6505
|
const [confirmIsUpdate, setConfirmIsUpdate] = (0, react.useState)(false);
|
|
6630
|
-
/** 命令行安装确认弹窗:记录待安装的裸目标(npm
|
|
6506
|
+
/** 命令行安装确认弹窗:记录待安装的裸目标(npm 包名)——
|
|
6631
6507
|
* 与应用商店同一套确认/进度/结果弹窗,提供时 plugin 传 null 走 customTarget 模式 */
|
|
6632
6508
|
const [confirmCustomTarget, setConfirmCustomTarget] = (0, react.useState)(null);
|
|
6633
|
-
/**
|
|
6509
|
+
/** 自定义安装入口渠道(NPM 包卡片):随确认弹窗记录,提交时上报服务端,
|
|
6634
6510
|
* 报错/日志据此精准溯源「从哪个入口发起」(npm 全局安装固定为 'npm') */
|
|
6635
6511
|
const [confirmCustomChannel, setConfirmCustomChannel] = (0, react.useState)(null);
|
|
6636
6512
|
/** 全局 npm 安装确认弹窗(官方 `npm install -g <pkgs>`):记录原始命令 + 解析出的包列表,
|
|
@@ -6779,6 +6655,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
6779
6655
|
(0, react.useEffect)(() => {
|
|
6780
6656
|
if (startupCheckedRef.current) return;
|
|
6781
6657
|
if (!settingsReady || catalog.plugins === null || catalog.failed) return;
|
|
6658
|
+
if (!catalog.releaseAgeReady) return;
|
|
6782
6659
|
startupCheckedRef.current = true;
|
|
6783
6660
|
if (!hubSettings.checkUpdatesOnStart) return;
|
|
6784
6661
|
syncUpdateNotices();
|
|
@@ -6788,6 +6665,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
6788
6665
|
catalog.plugins,
|
|
6789
6666
|
catalog.failed,
|
|
6790
6667
|
catalog.installedItems,
|
|
6668
|
+
catalog.releaseAgeReady,
|
|
6791
6669
|
queue
|
|
6792
6670
|
]);
|
|
6793
6671
|
(0, react.useEffect)(() => {
|
|
@@ -6862,7 +6740,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
6862
6740
|
const pkg = repo.replace(/@[^@]*$/, "").toLowerCase();
|
|
6863
6741
|
return catalog.installedItems.some((i) => i.name.toLowerCase() === pkg) || Object.keys(catalog.installed).some((k) => k.toLowerCase() === pkg);
|
|
6864
6742
|
};
|
|
6865
|
-
/** 弹窗动作一:复制安装命令到剪贴板,引导去终端粘贴执行(npm
|
|
6743
|
+
/** 弹窗动作一:复制安装命令到剪贴板,引导去终端粘贴执行(npm 安装显示包名命令)。 */
|
|
6866
6744
|
const copyCommand = async (p) => {
|
|
6867
6745
|
const repo = p.source?.repo ?? "";
|
|
6868
6746
|
if (await doCopy(installCommandOf(p))) {
|
|
@@ -6956,7 +6834,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
6956
6834
|
t,
|
|
6957
6835
|
noticeCount: notifications.length + queue.queue.length + queue.pendingRestarts.length,
|
|
6958
6836
|
onOpenNotifications: () => {
|
|
6959
|
-
if (hubSettings.checkUpdatesOnStart) syncUpdateNotices();
|
|
6837
|
+
if (hubSettings.checkUpdatesOnStart && catalog.releaseAgeReady) syncUpdateNotices();
|
|
6960
6838
|
setShowNotifications(true);
|
|
6961
6839
|
}
|
|
6962
6840
|
})), view === "market" ? (0, react.createElement)(MarketView, {
|
|
@@ -7007,10 +6885,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
7007
6885
|
}) : view === "custom" ? (0, react.createElement)(CustomInstallView, {
|
|
7008
6886
|
t,
|
|
7009
6887
|
enableNpm: hubSettings.enableNpmInstall,
|
|
7010
|
-
enableGit: hubSettings.enableGitInstall,
|
|
7011
|
-
enableDsh: hubSettings.enableDshInstall,
|
|
7012
6888
|
onOpenSettings: () => setView("settings"),
|
|
7013
|
-
profile: env?.profile ?? "web",
|
|
7014
6889
|
onInstallCustom: (raw, opts) => {
|
|
7015
6890
|
const target = raw.trim();
|
|
7016
6891
|
if (!target) return;
|
|
@@ -7047,7 +6922,7 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
7047
6922
|
openSection: settingsSection,
|
|
7048
6923
|
onConsumedOpenSection: () => setSettingsSection(null)
|
|
7049
6924
|
}), showHubUpdate && (0, react.createElement)(HubUpdateModal, {
|
|
7050
|
-
info: catalog.hubUpdateInfo ?? { version: "
|
|
6925
|
+
info: catalog.hubUpdateInfo ?? { version: "2.0.0" },
|
|
7051
6926
|
state: catalog.hubUpdateState,
|
|
7052
6927
|
currentVersion: catalog.hubCurrentVersion,
|
|
7053
6928
|
lang,
|
|
@@ -7318,9 +7193,8 @@ window.__ModuleLoader__.load({ id: "dsh-plugin", factory: (require) => {
|
|
|
7318
7193
|
* Website: https://dsh-plugin.org
|
|
7319
7194
|
* GitHub: https://github.com/dshplugin/dsh-plugin-hub
|
|
7320
7195
|
*
|
|
7321
|
-
* dsh-plugin
|
|
7322
|
-
*
|
|
7323
|
-
* PluginHubSection; this file only performs the cordis apply wiring.
|
|
7196
|
+
* dsh-plugin 客户端入口:通过模块加载器 bundle(见 tsdown.config.ts)把插件中心接入宿主设置。
|
|
7197
|
+
* 全部 UI 逻辑都在 PluginHubSection;本文件只做 cordis apply 接线。
|
|
7324
7198
|
*/
|
|
7325
7199
|
const NS = "dsh-plugin";
|
|
7326
7200
|
const name = NS;
|