@linxin666/dsh-client-ui-plugin-manager 0.3.18 → 0.3.19
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.i18n.yaml +2 -2
- package/README.md +1 -0
- package/README.zh.md +1 -0
- package/lib/client.js +171 -112
- package/lib/client.js.map +1 -1
- package/lib/index.js +60 -14
- package/lib/types/client/locales.d.ts +6 -0
- package/lib/types/core/protocol.d.ts +19 -0
- package/lib/types/host/rows.d.ts +6 -0
- package/lib/types/host/state.d.ts +24 -0
- package/package.json +1 -1
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# node scripts/verify-docs.mjs --write <dir>
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: cbb7cb94ed7e245605caaf32a6f3791e87bb613d
|
|
6
|
+
README.zh.md: dfa14ce438aeac90a6abe558af77550eceb22def
|
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ Plugin manager tab for the dsh web GUI Plugins settings section: installs plugin
|
|
|
10
10
|
- Dual-channel transport: on runtimes with the official installer services (DSHCode and the 1.0.4 checkout web), every operation rides the official `/plugin-installer` and `/plugin-control` loopback RPC channels; on the npm-published web runtime those channels do not exist, so the package's host half mounts a loopback-fenced HTTP gateway that spawns the official `dsh plugin` CLI for installs/removals (the single writer) and writes `disabled` override rows for enablement.
|
|
11
11
|
- Installs plugins from an npm package name or a git repository URL, with progress.
|
|
12
12
|
- Lists installed user plugins with next-start enable switches, update checks (registry, npm sources), verified npm updates, and uninstall.
|
|
13
|
+
- Per-row switches for aggregates (gateway mode): a bundle claiming several entry rows, such as `@linxin666/dsh-web-all`, expands into a child list where every family plugin toggles individually (a single-row `disabled` override; siblings are untouched). The manager tab, the family settings surface, and the aggregate compat face are locked rows that stay enabled even through a whole-package disable, so the management UI can never switch itself off. Child uninstall stays whole-package — the code ships in the aggregate, and a disabled child is simply never loaded; install the standalone package for independently versioned management (a standalone install wins over the aggregate row through the double-mount guard).
|
|
13
14
|
- Detects the legacy aggregate `@linxin666/dsh-web-ui-all` and converts its update action into a transactional migration to `@linxin666/dsh-web-all`; the gateway removes the legacy package, installs the current package at an exact version, restores the legacy layer position, and verifies `--dump-config` before reporting success.
|
|
14
15
|
- Verifies DSH runtime compatibility before npm updates (issue #754): update checks read the declared minimum DSH version from the latest manifest (`dsh.engines.dsh` with a top-level `engines.dsh` fallback), show the requirement beside the update button, disable the button when the running DSH is below it, and the host update route returns 412 before starting any CLI job when the runtime cannot be verified.
|
|
15
16
|
- Shows the built-in product switches when the official plugin-control surface exists.
|
package/README.zh.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
- 双通道传输:带官方安装器服务的运行时(DSHCode 与 1.0.4 checkout 版 web)走官方 `/plugin-installer`、`/plugin-control` loopback RPC 通道;npm 发布的官方 web 没有这些通道,本包的 host 半区挂载 loopback 门禁的 HTTP 网关——安装/卸载 spawn 官方 `dsh plugin` CLI(唯一写入器),启停写入 `disabled` 覆盖行。
|
|
11
11
|
- 从 npm 包名或 git 仓库 URL 安装插件,带进度。
|
|
12
12
|
- 列出已装用户插件:下次启动生效的启用开关、更新检查(npm 源走 registry)、已核验的 npm 更新与卸载。
|
|
13
|
+
- 聚合包逐行启停(网关模式):`@linxin666/dsh-web-all` 等声明多条入口行的聚合包展开为子行列表,每个家族插件有独立开关(写单行 `disabled` 覆盖,兄弟行不受影响);管理器自身、家族设置面与聚合 compat 面为锁定行,整包停用时也强制保留,管理入口不会被自己关掉。子行卸载保持整包粒度——代码随聚合包分发,停用即不再加载;需要独立版本管理时安装对应独立包(独立安装经双挂载保护优先于聚合行)。
|
|
13
14
|
- 检测旧聚合包 `@linxin666/dsh-web-ui-all`,把更新动作转换为到 `@linxin666/dsh-web-all` 的事务迁移;网关先移除旧包、安装精确版本的新包、恢复旧聚合包的层顺序,并在 `--dump-config` 通过后才报告成功。
|
|
14
15
|
- 更新前校验 DSH 运行时兼容(issue #754):更新检查读取最新版本清单声明的 DSH 最低版本(`dsh.engines.dsh`,兼容回退读顶层 `engines.dsh`),在更新按钮旁显示要求,运行 DSH 低于要求时禁用按钮;host 更新路由在启动任何 CLI 任务前若无法核实时也会返回 412 并拒绝。
|
|
15
16
|
- 官方 plugin-control 面存在时展示内置产品开关。
|
package/lib/client.js
CHANGED
|
@@ -142,7 +142,7 @@ window.__ModuleLoader__.load({
|
|
|
142
142
|
}
|
|
143
143
|
//#endregion
|
|
144
144
|
//#region \0dsh-css:packages/dsh-plugin-manager/src/client/plugin-manager.module.css.mjs
|
|
145
|
-
const css = ".ZsMDKq_section{flex-direction:column;gap:12px;display:flex}.ZsMDKq_notice{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:8px;flex-direction:column;gap:8px;padding:16px;display:flex}.ZsMDKq_notice p{color:var(--dsw-alias-label-secondary);margin:0}.ZsMDKq_state{color:var(--dsw-alias-label-secondary);padding:16px 0}.ZsMDKq_installRow{gap:8px;display:flex}.ZsMDKq_spec{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);min-width:0;color:var(--dsw-alias-label-primary);border-radius:6px;flex:1;padding:6px 10px}.ZsMDKq_spec:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary)}.ZsMDKq_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}.ZsMDKq_progressRow{flex-direction:column;gap:6px;display:flex}.ZsMDKq_progressTrack{background:var(--dsw-alias-bg-layer-2);border-radius:3px;height:6px;overflow:hidden}.ZsMDKq_progressBar{background:var(--dsw-alias-state-business-primary);height:100%;transition:width .2s}.ZsMDKq_progressBar[data-indeterminate=true]{width:40%;animation:1.2s ease-in-out infinite ZsMDKq_pluginManagerIndeterminate}@keyframes ZsMDKq_pluginManagerIndeterminate{0%{transform:translate(-100%)}to{transform:translate(250%)}}.ZsMDKq_progressLabel{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}@media (prefers-reduced-motion:reduce){.ZsMDKq_progressBar[data-indeterminate=true]{width:40%;animation:none}}.ZsMDKq_errorRow{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-danger);border-radius:8px;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 12px;display:flex}.ZsMDKq_error{min-width:200px;color:var(--dsw-alias-label-danger);word-break:break-all;flex:1}.ZsMDKq_group{flex-direction:column;gap:8px;display:flex}.ZsMDKq_sectionTitle{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;font-weight:600}.ZsMDKq_list{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_row{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:8px;justify-content:space-between;align-items:flex-start;gap:12px;padding:10px 12px;display:flex}.ZsMDKq_meta{flex-direction:column;gap:4px;min-width:0;display:flex}.ZsMDKq_name{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.ZsMDKq_sub{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:6px;min-width:0;font-size:12px;display:flex}.ZsMDKq_version{white-space:nowrap}.ZsMDKq_sourceBadge{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);border-radius:4px;padding:0 4px;font-size:11px}.ZsMDKq_specText{text-overflow:ellipsis;white-space:nowrap;max-width:320px;overflow:hidden}.ZsMDKq_latest{color:var(--dsw-alias-state-business-primary);font-size:12px}.ZsMDKq_compatHint{color:var(--dsw-alias-label-tertiary);font-size:12px}.ZsMDKq_compatBlocked{color:var(--dsw-alias-label-danger);font-size:12px}.ZsMDKq_actions{flex-shrink:0;align-items:center;gap:8px;display:flex}.ZsMDKq_empty{color:var(--dsw-alias-label-tertiary);margin:0}.ZsMDKq_link{color:var(--dsw-alias-state-business-primary)}.ZsMDKq_stateLabel{color:var(--dsw-alias-label-secondary);font-size:12px}.ZsMDKq_stateLabel[data-state=enabled]{color:var(--dsw-alias-state-success-primary)}.ZsMDKq_stateLabel[data-state=disabled]{color:var(--dsw-alias-label-tertiary)}.ZsMDKq_switch{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);cursor:pointer;border-radius:10px;width:34px;height:20px;padding:0;transition:background .2s;position:relative}.ZsMDKq_switch:after{content:\"\";background:var(--dsw-alias-label-on-danger,#fff);border-radius:50%;width:14px;height:14px;transition:transform .2s;position:absolute;top:2px;left:2px}.ZsMDKq_switch[aria-checked=true]{background:var(--dsw-alias-state-success-primary)}.ZsMDKq_switch[aria-checked=true]:after{transform:translate(14px)}.ZsMDKq_switch:disabled{opacity:.5;cursor:not-allowed}.ZsMDKq_switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary)}@media (prefers-reduced-motion:reduce){.ZsMDKq_switch,.ZsMDKq_switch:after{transition:none}}.ZsMDKq_failure{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-danger);border-radius:6px;flex-direction:column;gap:6px;margin-top:4px;padding:8px;display:flex}.ZsMDKq_badge{background:var(--dsw-alias-label-danger);color:var(--dsw-alias-label-on-danger);border-radius:10px;align-self:flex-start;padding:2px 8px;font-size:11px}.ZsMDKq_failureMessage{color:var(--dsw-alias-label-danger);word-break:break-all;font-size:12px}.ZsMDKq_failureActions{flex-wrap:wrap;gap:8px;display:flex}.ZsMDKq_conflicts{flex-direction:column;gap:8px;display:flex}.ZsMDKq_actionsRow{align-items:center;gap:12px;display:flex}.ZsMDKq_ok{color:var(--dsw-alias-state-success-primary);margin:0;font-size:12px}.ZsMDKq_applying{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}.ZsMDKq_restartRow{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-brand);border-radius:8px;padding:10px 12px}.ZsMDKq_restartRow p{color:var(--dsw-alias-brand-primary);margin:0}.ZsMDKq_safeModeBanner{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-warning);border-radius:8px;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;display:flex}.ZsMDKq_safeModeBanner p{color:var(--dsw-alias-label-primary);margin:0}.ZsMDKq_confirmBody{color:var(--dsw-alias-label-secondary);margin:0 0 12px}.ZsMDKq_modalActions{justify-content:flex-end;gap:8px;display:flex}.ZsMDKq_dangerButton{background:var(--dsw-alias-label-danger)!important;color:var(--dsw-alias-label-on-danger)!important}";
|
|
145
|
+
const css = ".ZsMDKq_section{flex-direction:column;gap:12px;display:flex}.ZsMDKq_notice{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:8px;flex-direction:column;gap:8px;padding:16px;display:flex}.ZsMDKq_notice p{color:var(--dsw-alias-label-secondary);margin:0}.ZsMDKq_state{color:var(--dsw-alias-label-secondary);padding:16px 0}.ZsMDKq_installRow{gap:8px;display:flex}.ZsMDKq_spec{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);min-width:0;color:var(--dsw-alias-label-primary);border-radius:6px;flex:1;padding:6px 10px}.ZsMDKq_spec:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary)}.ZsMDKq_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}.ZsMDKq_progressRow{flex-direction:column;gap:6px;display:flex}.ZsMDKq_progressTrack{background:var(--dsw-alias-bg-layer-2);border-radius:3px;height:6px;overflow:hidden}.ZsMDKq_progressBar{background:var(--dsw-alias-state-business-primary);height:100%;transition:width .2s}.ZsMDKq_progressBar[data-indeterminate=true]{width:40%;animation:1.2s ease-in-out infinite ZsMDKq_pluginManagerIndeterminate}@keyframes ZsMDKq_pluginManagerIndeterminate{0%{transform:translate(-100%)}to{transform:translate(250%)}}.ZsMDKq_progressLabel{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}@media (prefers-reduced-motion:reduce){.ZsMDKq_progressBar[data-indeterminate=true]{width:40%;animation:none}}.ZsMDKq_errorRow{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-danger);border-radius:8px;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 12px;display:flex}.ZsMDKq_error{min-width:200px;color:var(--dsw-alias-label-danger);word-break:break-all;flex:1}.ZsMDKq_group{flex-direction:column;gap:8px;display:flex}.ZsMDKq_sectionTitle{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;font-weight:600}.ZsMDKq_list{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_row{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:8px;justify-content:space-between;align-items:flex-start;gap:12px;padding:10px 12px;display:flex}.ZsMDKq_meta{flex-direction:column;gap:4px;min-width:0;display:flex}.ZsMDKq_name{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.ZsMDKq_sub{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:6px;min-width:0;font-size:12px;display:flex}.ZsMDKq_version{white-space:nowrap}.ZsMDKq_sourceBadge{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);border-radius:4px;padding:0 4px;font-size:11px}.ZsMDKq_specText{text-overflow:ellipsis;white-space:nowrap;max-width:320px;overflow:hidden}.ZsMDKq_latest{color:var(--dsw-alias-state-business-primary);font-size:12px}.ZsMDKq_compatHint{color:var(--dsw-alias-label-tertiary);font-size:12px}.ZsMDKq_compatBlocked{color:var(--dsw-alias-label-danger);font-size:12px}.ZsMDKq_actions{flex-shrink:0;align-items:center;gap:8px;display:flex}.ZsMDKq_empty{color:var(--dsw-alias-label-tertiary);margin:0}.ZsMDKq_link{color:var(--dsw-alias-state-business-primary)}.ZsMDKq_stateLabel{color:var(--dsw-alias-label-secondary);font-size:12px}.ZsMDKq_stateLabel[data-state=enabled]{color:var(--dsw-alias-state-success-primary)}.ZsMDKq_stateLabel[data-state=disabled]{color:var(--dsw-alias-label-tertiary)}.ZsMDKq_stateLabel[data-state=mixed]{color:var(--dsw-alias-state-warning-primary,var(--dsw-alias-label-secondary))}.ZsMDKq_childList{border-left:2px solid var(--dsw-alias-border-l1);flex-direction:column;gap:4px;margin:6px 0 0;padding:2px 0 2px 16px;list-style:none;display:flex}.ZsMDKq_childRow{justify-content:space-between;align-items:center;gap:12px;padding:4px 8px;display:flex}.ZsMDKq_childName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:13px;overflow:hidden}.ZsMDKq_lockedHint{color:var(--dsw-alias-label-tertiary);font-size:12px}.ZsMDKq_switch{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);cursor:pointer;border-radius:10px;width:34px;height:20px;padding:0;transition:background .2s;position:relative}.ZsMDKq_switch:after{content:\"\";background:var(--dsw-alias-label-on-danger,#fff);border-radius:50%;width:14px;height:14px;transition:transform .2s;position:absolute;top:2px;left:2px}.ZsMDKq_switch[aria-checked=true]{background:var(--dsw-alias-state-success-primary)}.ZsMDKq_switch[aria-checked=true]:after{transform:translate(14px)}.ZsMDKq_switch:disabled{opacity:.5;cursor:not-allowed}.ZsMDKq_switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary)}@media (prefers-reduced-motion:reduce){.ZsMDKq_switch,.ZsMDKq_switch:after{transition:none}}.ZsMDKq_failure{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-danger);border-radius:6px;flex-direction:column;gap:6px;margin-top:4px;padding:8px;display:flex}.ZsMDKq_badge{background:var(--dsw-alias-label-danger);color:var(--dsw-alias-label-on-danger);border-radius:10px;align-self:flex-start;padding:2px 8px;font-size:11px}.ZsMDKq_failureMessage{color:var(--dsw-alias-label-danger);word-break:break-all;font-size:12px}.ZsMDKq_failureActions{flex-wrap:wrap;gap:8px;display:flex}.ZsMDKq_conflicts{flex-direction:column;gap:8px;display:flex}.ZsMDKq_actionsRow{align-items:center;gap:12px;display:flex}.ZsMDKq_ok{color:var(--dsw-alias-state-success-primary);margin:0;font-size:12px}.ZsMDKq_applying{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}.ZsMDKq_restartRow{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-brand);border-radius:8px;padding:10px 12px}.ZsMDKq_restartRow p{color:var(--dsw-alias-brand-primary);margin:0}.ZsMDKq_safeModeBanner{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-warning);border-radius:8px;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;display:flex}.ZsMDKq_safeModeBanner p{color:var(--dsw-alias-label-primary);margin:0}.ZsMDKq_confirmBody{color:var(--dsw-alias-label-secondary);margin:0 0 12px}.ZsMDKq_modalActions{justify-content:flex-end;gap:8px;display:flex}.ZsMDKq_dangerButton{background:var(--dsw-alias-label-danger)!important;color:var(--dsw-alias-label-on-danger)!important}";
|
|
146
146
|
const tagId = "@linxin666/dsh-client-ui-plugin-manager/packages/dsh-plugin-manager/src/client/plugin-manager.module.css";
|
|
147
147
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
148
148
|
const tag = document.createElement("style");
|
|
@@ -156,6 +156,9 @@ window.__ModuleLoader__.load({
|
|
|
156
156
|
"actionsRow": "ZsMDKq_actionsRow",
|
|
157
157
|
"applying": "ZsMDKq_applying",
|
|
158
158
|
"badge": "ZsMDKq_badge",
|
|
159
|
+
"childList": "ZsMDKq_childList",
|
|
160
|
+
"childName": "ZsMDKq_childName",
|
|
161
|
+
"childRow": "ZsMDKq_childRow",
|
|
159
162
|
"compatBlocked": "ZsMDKq_compatBlocked",
|
|
160
163
|
"compatHint": "ZsMDKq_compatHint",
|
|
161
164
|
"confirmBody": "ZsMDKq_confirmBody",
|
|
@@ -173,6 +176,7 @@ window.__ModuleLoader__.load({
|
|
|
173
176
|
"latest": "ZsMDKq_latest",
|
|
174
177
|
"link": "ZsMDKq_link",
|
|
175
178
|
"list": "ZsMDKq_list",
|
|
179
|
+
"lockedHint": "ZsMDKq_lockedHint",
|
|
176
180
|
"meta": "ZsMDKq_meta",
|
|
177
181
|
"modalActions": "ZsMDKq_modalActions",
|
|
178
182
|
"name": "ZsMDKq_name",
|
|
@@ -388,7 +392,7 @@ window.__ModuleLoader__.load({
|
|
|
388
392
|
setEnabled(id, enabled).then((plugin) => {
|
|
389
393
|
setView((current) => current.status === "ready" ? {
|
|
390
394
|
...current,
|
|
391
|
-
plugins: current.plugins.map((item) => item.id === id ? plugin : item)
|
|
395
|
+
plugins: current.plugins.map((item) => item.id === plugin.id ? plugin : item)
|
|
392
396
|
} : current);
|
|
393
397
|
setDirty(true);
|
|
394
398
|
setToggleBusy(void 0);
|
|
@@ -664,117 +668,155 @@ window.__ModuleLoader__.load({
|
|
|
664
668
|
const latest = updateItem?.latest;
|
|
665
669
|
const dshRequirement = updateItem?.requiresDsh;
|
|
666
670
|
const failure = attributable.get(plugin.id);
|
|
671
|
+
const children = plugin.children;
|
|
672
|
+
const mixed = children !== void 0 && !plugin.enabled && children.some((child) => child.enabled);
|
|
667
673
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
668
|
-
className: plugin_manager_module_css_default.row,
|
|
669
674
|
"data-plugin-id": plugin.id,
|
|
670
675
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
671
|
-
className: plugin_manager_module_css_default.
|
|
672
|
-
children: [
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
"
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
676
|
+
className: plugin_manager_module_css_default.row,
|
|
677
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
678
|
+
className: plugin_manager_module_css_default.meta,
|
|
679
|
+
children: [
|
|
680
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
681
|
+
className: plugin_manager_module_css_default.name,
|
|
682
|
+
children: plugin.name
|
|
683
|
+
}),
|
|
684
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
685
|
+
className: plugin_manager_module_css_default.sub,
|
|
686
|
+
children: [
|
|
687
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
688
|
+
className: plugin_manager_module_css_default.version,
|
|
689
|
+
children: t("version", { version: plugin.version })
|
|
690
|
+
}),
|
|
691
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
692
|
+
className: plugin_manager_module_css_default.sourceBadge,
|
|
693
|
+
"data-source": plugin.source.kind,
|
|
694
|
+
children: plugin.source.kind === "npm" ? t("npmSource") : t("gitSource")
|
|
695
|
+
}),
|
|
696
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
697
|
+
className: plugin_manager_module_css_default.specText,
|
|
698
|
+
title: plugin.source.spec,
|
|
699
|
+
children: plugin.source.spec
|
|
700
|
+
})
|
|
701
|
+
]
|
|
702
|
+
}),
|
|
703
|
+
latest !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
704
|
+
className: plugin_manager_module_css_default.latest,
|
|
705
|
+
children: t("latest", { version: latest })
|
|
706
|
+
}),
|
|
707
|
+
updateItem !== void 0 && dshRequirement !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
708
|
+
className: updateItem.compatible === false ? plugin_manager_module_css_default.compatBlocked : plugin_manager_module_css_default.compatHint,
|
|
709
|
+
children: updateItem.compatible === false ? t("updateBlockedDsh", { min: displayMinimumVersion(dshRequirement) }) : t("updateRequiresDsh", { min: displayMinimumVersion(dshRequirement) })
|
|
710
|
+
}),
|
|
711
|
+
failure !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
712
|
+
className: plugin_manager_module_css_default.failure,
|
|
713
|
+
"data-plugin-failure": plugin.id,
|
|
714
|
+
children: [
|
|
715
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
716
|
+
className: plugin_manager_module_css_default.badge,
|
|
717
|
+
children: t("failureBadge")
|
|
718
|
+
}),
|
|
719
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
720
|
+
className: plugin_manager_module_css_default.failureMessage,
|
|
721
|
+
title: failure.message,
|
|
722
|
+
children: failure.message
|
|
723
|
+
}),
|
|
724
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
725
|
+
className: plugin_manager_module_css_default.failureActions,
|
|
726
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
727
|
+
variant: "primary",
|
|
728
|
+
disabled: busy !== void 0 || repairing !== void 0,
|
|
729
|
+
onClick: () => {
|
|
730
|
+
onRepair(failure, plugin.id);
|
|
731
|
+
},
|
|
732
|
+
children: repairing === plugin.id ? t("repairing") : t("repair")
|
|
733
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
734
|
+
variant: "outline",
|
|
735
|
+
disabled: busy !== void 0,
|
|
736
|
+
onClick: () => {
|
|
737
|
+
onCopy(failure, plugin.id);
|
|
738
|
+
},
|
|
739
|
+
children: copied === plugin.id ? t("copied") : t("copyError")
|
|
740
|
+
})]
|
|
741
|
+
})
|
|
742
|
+
]
|
|
743
|
+
})
|
|
744
|
+
]
|
|
745
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
746
|
+
className: plugin_manager_module_css_default.actions,
|
|
747
|
+
children: [
|
|
748
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
749
|
+
className: plugin_manager_module_css_default.stateLabel,
|
|
750
|
+
"data-state": plugin.enabled ? "enabled" : mixed ? "mixed" : "disabled",
|
|
751
|
+
children: plugin.enabled ? t("enabled") : mixed ? t("mixed") : t("disabled")
|
|
752
|
+
}),
|
|
753
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
754
|
+
type: "button",
|
|
755
|
+
role: "switch",
|
|
756
|
+
"aria-checked": plugin.enabled,
|
|
757
|
+
"aria-label": plugin.enabled ? t("disableSwitch", { name: plugin.name }) : t("enableSwitch", { name: plugin.name }),
|
|
758
|
+
className: plugin_manager_module_css_default.switch,
|
|
759
|
+
disabled: toggleDisabled,
|
|
760
|
+
onClick: () => {
|
|
761
|
+
onUserToggle(plugin.id, !plugin.enabled);
|
|
762
|
+
}
|
|
763
|
+
}),
|
|
764
|
+
latest !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
765
|
+
variant: "outline",
|
|
766
|
+
disabled: busy !== void 0 || updateItem?.compatible === false,
|
|
767
|
+
onClick: () => {
|
|
768
|
+
onUpdate(plugin.id);
|
|
769
|
+
},
|
|
770
|
+
children: busy?.kind === "update" && busy.id === plugin.id ? t("updating") : t("update")
|
|
771
|
+
}),
|
|
772
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
773
|
+
variant: "outline",
|
|
774
|
+
disabled: busy !== void 0,
|
|
775
|
+
onClick: () => {
|
|
776
|
+
setUninstallTarget({
|
|
777
|
+
id: plugin.id,
|
|
778
|
+
name: plugin.name
|
|
779
|
+
});
|
|
780
|
+
},
|
|
781
|
+
children: t("uninstall")
|
|
782
|
+
})
|
|
783
|
+
]
|
|
784
|
+
})]
|
|
785
|
+
}), children !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
786
|
+
className: plugin_manager_module_css_default.childList,
|
|
787
|
+
children: children.map((child) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
788
|
+
className: plugin_manager_module_css_default.childRow,
|
|
789
|
+
"data-plugin-row": child.id,
|
|
790
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
791
|
+
className: plugin_manager_module_css_default.childName,
|
|
792
|
+
title: child.id,
|
|
793
|
+
children: child.name
|
|
794
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
795
|
+
className: plugin_manager_module_css_default.actions,
|
|
796
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
797
|
+
className: plugin_manager_module_css_default.stateLabel,
|
|
798
|
+
"data-state": child.enabled ? "enabled" : "disabled",
|
|
799
|
+
children: child.enabled ? t("enabled") : t("disabled")
|
|
800
|
+
}), child.locked === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
801
|
+
className: plugin_manager_module_css_default.lockedHint,
|
|
802
|
+
children: t("lockedRowHint")
|
|
803
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
804
|
+
type: "button",
|
|
805
|
+
role: "switch",
|
|
806
|
+
"aria-checked": child.enabled,
|
|
807
|
+
"aria-label": child.enabled ? t("disableSwitch", { name: child.name }) : t("enableSwitch", { name: child.name }),
|
|
808
|
+
className: plugin_manager_module_css_default.switch,
|
|
809
|
+
disabled: toggleDisabled,
|
|
810
|
+
onClick: () => {
|
|
811
|
+
onUserToggle(child.id, !child.enabled);
|
|
812
|
+
}
|
|
813
|
+
})]
|
|
814
|
+
})]
|
|
815
|
+
}, child.id))
|
|
816
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
817
|
+
className: plugin_manager_module_css_default.hint,
|
|
818
|
+
children: t("childrenHint")
|
|
819
|
+
})] })]
|
|
778
820
|
}, plugin.id);
|
|
779
821
|
})
|
|
780
822
|
})]
|
|
@@ -991,6 +1033,8 @@ window.__ModuleLoader__.load({
|
|
|
991
1033
|
gitSource: "git",
|
|
992
1034
|
enableSwitch: "开启 {name}",
|
|
993
1035
|
disableSwitch: "关闭 {name}",
|
|
1036
|
+
lockedRowHint: "核心行",
|
|
1037
|
+
childrenHint: "全家桶子插件可单独启停;停用后不再加载,代码仍随全家桶更新。",
|
|
994
1038
|
repairInstallTitle: "插件安装失败,请帮我诊断并修复。",
|
|
995
1039
|
repairInstallSpecLabel: "安装目标",
|
|
996
1040
|
repairInstallErrorLabel: "错误信息",
|
|
@@ -1073,6 +1117,8 @@ window.__ModuleLoader__.load({
|
|
|
1073
1117
|
gitSource: "git",
|
|
1074
1118
|
enableSwitch: "Turn on {name}",
|
|
1075
1119
|
disableSwitch: "Turn off {name}",
|
|
1120
|
+
lockedRowHint: "Core row",
|
|
1121
|
+
childrenHint: "Bundle child plugins toggle individually; a disabled child is never loaded, while its code still updates with the bundle.",
|
|
1076
1122
|
repairInstallTitle: "The plugin installation failed. Please diagnose and fix it.",
|
|
1077
1123
|
repairInstallSpecLabel: "Install target",
|
|
1078
1124
|
repairInstallErrorLabel: "Error message",
|
|
@@ -1108,9 +1154,21 @@ window.__ModuleLoader__.load({
|
|
|
1108
1154
|
function isString(value) {
|
|
1109
1155
|
return typeof value === "string";
|
|
1110
1156
|
}
|
|
1157
|
+
/** Validate one aggregate child row. */
|
|
1158
|
+
function parsePluginChild(value, rowIndex, childIndex) {
|
|
1159
|
+
if (!isRecord(value) || !isString(value.id) || !isString(value.name) || typeof value.enabled !== "boolean") throw new Error(`plugin-manager: plugin row ${String(rowIndex)} child ${String(childIndex)} is invalid`);
|
|
1160
|
+
return {
|
|
1161
|
+
id: value.id,
|
|
1162
|
+
name: value.name,
|
|
1163
|
+
enabled: value.enabled,
|
|
1164
|
+
...typeof value.locked === "boolean" ? { locked: value.locked } : {}
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1111
1167
|
/** Validate one installed-plugin row. */
|
|
1112
1168
|
function parsePlugin(value, index) {
|
|
1113
1169
|
if (!isRecord(value) || !isString(value.id) || !isString(value.name) || !isString(value.version) || !isString(value.installedAt) || typeof value.enabled !== "boolean" || !isRecord(value.source) || value.source.kind !== "npm" && value.source.kind !== "git" || !isString(value.source.spec)) throw new Error(`plugin-manager: plugin row ${String(index)} is invalid`);
|
|
1170
|
+
if (value.children !== void 0 && !Array.isArray(value.children)) throw new Error(`plugin-manager: plugin row ${String(index)} children is invalid`);
|
|
1171
|
+
const children = value.children?.map((child, childIndex) => parsePluginChild(child, index, childIndex));
|
|
1114
1172
|
return {
|
|
1115
1173
|
id: value.id,
|
|
1116
1174
|
name: value.name,
|
|
@@ -1121,7 +1179,8 @@ window.__ModuleLoader__.load({
|
|
|
1121
1179
|
},
|
|
1122
1180
|
installedAt: value.installedAt,
|
|
1123
1181
|
enabled: value.enabled,
|
|
1124
|
-
...isString(value.commit) ? { commit: value.commit } : {}
|
|
1182
|
+
...isString(value.commit) ? { commit: value.commit } : {},
|
|
1183
|
+
...children !== void 0 ? { children } : {}
|
|
1125
1184
|
};
|
|
1126
1185
|
}
|
|
1127
1186
|
/**
|
|
@@ -1240,7 +1299,7 @@ window.__ModuleLoader__.load({
|
|
|
1240
1299
|
/** The building package's version, when the bundle carries it. */
|
|
1241
1300
|
function bakedVersion() {
|
|
1242
1301
|
try {
|
|
1243
|
-
return "0.3.
|
|
1302
|
+
return "0.3.19";
|
|
1244
1303
|
} catch {
|
|
1245
1304
|
return;
|
|
1246
1305
|
}
|