@linxin666/dsh-client-ui-plugin-manager 0.3.20 → 0.3.21

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 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: cbb7cb94ed7e245605caaf32a6f3791e87bb613d
6
- README.zh.md: dfa14ce438aeac90a6abe558af77550eceb22def
5
+ README.md: 8fea408c3d6d844627900d235b69a3bc47268dc0
6
+ README.zh.md: 8101fbf0b085993a14e744682df22e2bc8ed6db7
package/README.md CHANGED
@@ -11,6 +11,7 @@ Plugin manager tab for the dsh web GUI Plugins settings section: installs plugin
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
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).
14
+ - The aggregate child list is collapsed by default: the row shows only a `N/M child plugins on` summary that expands on click, so a bundle carrying 20+ family rows no longer stretches the settings page.
14
15
  - 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.
15
16
  - 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.
16
17
  - Shows the built-in product switches when the official plugin-control surface exists.
@@ -63,7 +64,7 @@ The contract source of truth is `src/core/service.ts` (`PluginManagerService`).
63
64
  - On the npm-published web runtime, gateway writes go through the official CLI. The gateway resolves `dsh` from the host process PATH first and then from `node_modules/.bin` project roots above the running host entry, which covers local-wrapper and npx launches. If neither source contains the CLI, writes remain unavailable. Installs of git sources can take minutes and run as background jobs. Gateway updates apply only to npm registry sources, resolve the latest version on the host, and succeed only after the same installed package reports that exact version.
64
65
  - Compatibility gating applies only when the target manifest declares a minimum DSH version; packages without `dsh.engines.dsh` update unchecked, and official-installer runtimes (DSHCode and the checkout web) are not gated here because their updates go through the official installer.
65
66
  - On the npm-published web runtime there is no boot-failure ring and no safe mode: those surfaces degrade to empty, and only install errors offer the repair handoff.
66
- - Enablement on the npm runtime writes bare `disabled` override rows into the profile's cordis.patch.yml; the runtime's loader honors them at the next start, but this path is less exercised than the official desktop writer's.
67
+ - Enablement on the npm runtime reports the effective next-start value: a profile override row wins where present, otherwise the installed bundle's own `disabled` rows decide (the aggregate's inactive-by-default families), and rows no layer mentions are enabled. Enabling a row the bundle disables writes an explicit `disabled: false` override, because deleting the user row would only restore the bundle default; the runtime's loader honors these rows at the next start, but this path is less exercised than the official desktop writer's.
67
68
  - The web build has no in-place restart: changes apply at the next manual restart.
68
69
  - Install-time conflict detection reports what the install actually changed (product rows in official mode, profile rows and bundle entries in gateway mode). On the npm runtime, duplicate insert-id claims are detected after install and the new plugin is rolled back automatically (a shared id can never be `disabled` away: the loader's duplicate check has no disabled exemption); on official runtimes the host's own rules and the boot-failure ring own that case.
69
70
  - The npm runtime's boot preflight (`--dump-config`) catches composition failures, and the static insert check catches insert rows naming packages that resolve nowhere; runtime import/apply failures still surface only at the next real start, where official runtimes keep the failure ring and the npm runtime does not.
package/README.zh.md CHANGED
@@ -11,6 +11,7 @@
11
11
  - 从 npm 包名或 git 仓库 URL 安装插件,带进度。
12
12
  - 列出已装用户插件:下次启动生效的启用开关、更新检查(npm 源走 registry)、已核验的 npm 更新与卸载。
13
13
  - 聚合包逐行启停(网关模式):`@linxin666/dsh-web-all` 等声明多条入口行的聚合包展开为子行列表,每个家族插件有独立开关(写单行 `disabled` 覆盖,兄弟行不受影响);管理器自身、家族设置面与聚合 compat 面为锁定行,整包停用时也强制保留,管理入口不会被自己关掉。子行卸载保持整包粒度——代码随聚合包分发,停用即不再加载;需要独立版本管理时安装对应独立包(独立安装经双挂载保护优先于聚合行)。
14
+ - 聚合包子插件列表默认收起:行上只显示「子插件 N/M 已启用」摘要,点击展开,携带 20+ 家族行的全家桶不再把设置页拉长。
14
15
  - 检测旧聚合包 `@linxin666/dsh-web-ui-all`,把更新动作转换为到 `@linxin666/dsh-web-all` 的事务迁移;网关先移除旧包、安装精确版本的新包、恢复旧聚合包的层顺序,并在 `--dump-config` 通过后才报告成功。
15
16
  - 更新前校验 DSH 运行时兼容(issue #754):更新检查读取最新版本清单声明的 DSH 最低版本(`dsh.engines.dsh`,兼容回退读顶层 `engines.dsh`),在更新按钮旁显示要求,运行 DSH 低于要求时禁用按钮;host 更新路由在启动任何 CLI 任务前若无法核实时也会返回 412 并拒绝。
16
17
  - 官方 plugin-control 面存在时展示内置产品开关。
@@ -63,7 +64,7 @@ dsh plugin --profile web add link:$(pwd)/packages/dsh-plugin-manager
63
64
  - npm 发布的官方 web 上,网关写入经官方 CLI 执行。网关先从 host 进程 PATH 解析 `dsh`,再从运行中 host 入口上层各项目根的 `node_modules/.bin` 回退查找,覆盖本地包装器与 npx 启动;两处都没有 CLI 时才不可写。git 源安装可能耗时数分钟,以后台任务运行。网关更新只适用于 npm registry 源,由 host 解析最新版本,且仅当同一已装包报告该精确版本时才算成功。
64
65
  - 兼容性门禁只在目标清单声明了最低 DSH 版本时生效;未声明 `dsh.engines.dsh` 的包更新不被检查,官方安装器运行时(DSHCode 与 checkout 版 web)不经过本门禁(其更新走官方安装器)。
65
66
  - npm 发布的官方 web 没有启动失败环与安全模式:这两处界面降级为空,只有安装错误提供修复转交。
66
- - npm 运行时上的启停会在 profile 的 cordis.patch.yml 写入裸 `disabled` 覆盖行;该运行时 loader 在下次启动时认读这些行,但这条路径不如官方桌面写入器经过充分锻炼。
67
+ - npm 运行时上的启停显示下次启动的真实生效值:profile 覆盖行优先,其次由所装 bundle 自带的 `disabled` 行决定(聚合包的按需开启家族),两层都未提及的行视为启用。开启一个被 bundle 停用的行会写入显式 `disabled: false` 覆盖行——只删除用户行只会退回 bundle 默认值;该运行时 loader 在下次启动时认读这些行,但这条路径不如官方桌面写入器经过充分锻炼。
67
68
  - web 端无壳内重启:变更在下次手动重启后生效。
68
69
  - 安装时冲突检测报告安装实际改了什么(官方模式为产品行;网关模式为 profile 行与 bundle 条目)。npm 运行时上重复 insert id 认领在安装后即被检出并自动回滚新插件(共享 id 写 disabled 无法阻止 loader 的重复检查,只会误伤现有插件);官方运行时由官方规则与失败环处置该类冲突。
69
70
  - npm 运行时的启动预检(`--dump-config`)能抓组合失败,静态 insert 检查能抓引用不存在包的 insert 行;真正的运行时 import/apply 失败仍要到下次启动才暴露,官方运行时靠失败环呈现,npm 运行时没有失败环。
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_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}";
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_childrenToggle{width:100%;color:var(--dsw-alias-label-secondary);text-align:left;cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;margin:6px 0 0;padding:4px 8px;font-size:12px;display:flex}.ZsMDKq_childrenToggle:hover{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}.ZsMDKq_childrenToggle:focus-visible{outline:2px solid var(--dsw-alias-border-l2);outline-offset:1px}.ZsMDKq_chevron{border-top:4px solid #0000;border-bottom:4px solid #0000;border-left:5px solid;flex:none;width:0;height:0;transition:transform .15s}.ZsMDKq_chevron[data-expanded=true]{transform:rotate(90deg)}@media (prefers-reduced-motion:reduce){.ZsMDKq_chevron{transition:none}}.ZsMDKq_childrenSummary{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.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,9 +156,12 @@ window.__ModuleLoader__.load({
156
156
  "actionsRow": "ZsMDKq_actionsRow",
157
157
  "applying": "ZsMDKq_applying",
158
158
  "badge": "ZsMDKq_badge",
159
+ "chevron": "ZsMDKq_chevron",
159
160
  "childList": "ZsMDKq_childList",
160
161
  "childName": "ZsMDKq_childName",
161
162
  "childRow": "ZsMDKq_childRow",
163
+ "childrenSummary": "ZsMDKq_childrenSummary",
164
+ "childrenToggle": "ZsMDKq_childrenToggle",
162
165
  "compatBlocked": "ZsMDKq_compatBlocked",
163
166
  "compatHint": "ZsMDKq_compatHint",
164
167
  "confirmBody": "ZsMDKq_confirmBody",
@@ -284,6 +287,8 @@ window.__ModuleLoader__.load({
284
287
  kind: "idle",
285
288
  stage: "fetch"
286
289
  });
290
+ /** Parent rows whose aggregate child list is expanded; collapsed by default. */
291
+ const [expandedChildren, setExpandedChildren] = (0, react.useState)(() => /* @__PURE__ */ new Set());
287
292
  /** Synchronous in-flight mirror of `busy`: the render-time guard alone lets a
288
293
  * click and an Enter land in the same frame and double-fire. */
289
294
  const busyRef = (0, react.useRef)(false);
@@ -383,6 +388,15 @@ window.__ModuleLoader__.load({
383
388
  };
384
389
  }, [busy, status]);
385
390
  const toggleDisabled = busy !== void 0 || toggleBusy !== void 0 || view.status === "ready" && view.failures.safeMode;
391
+ /** Expand or collapse one aggregate row's child list (pure view state). */
392
+ const toggleChildren = (id) => {
393
+ setExpandedChildren((current) => {
394
+ const next = new Set(current);
395
+ if (next.has(id)) next.delete(id);
396
+ else next.add(id);
397
+ return next;
398
+ });
399
+ };
386
400
  const onUserToggle = (id, enabled) => {
387
401
  setToggleBusy({
388
402
  kind: "user",
@@ -782,41 +796,67 @@ window.__ModuleLoader__.load({
782
796
  })
783
797
  ]
784
798
  })]
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,
799
+ }), children !== void 0 && children.length > 0 && (() => {
800
+ const listId = "pm-children-" + plugin.id.replace(/[^a-zA-Z0-9_-]/g, "-");
801
+ const expanded = expandedChildren.has(plugin.id);
802
+ const enabledCount = children.filter((child) => child.enabled).length;
803
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
804
+ type: "button",
805
+ className: plugin_manager_module_css_default.childrenToggle,
806
+ "aria-expanded": expanded,
807
+ "aria-controls": listId,
808
+ "aria-label": expanded ? t("childrenHide", { name: plugin.name }) : t("childrenShow", { name: plugin.name }),
809
+ onClick: () => {
810
+ toggleChildren(plugin.id);
811
+ },
790
812
  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,
813
+ className: plugin_manager_module_css_default.chevron,
814
+ "data-expanded": expanded,
815
+ "aria-hidden": "true"
816
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
817
+ className: plugin_manager_module_css_default.childrenSummary,
818
+ children: t("childrenSummary", {
819
+ enabled: enabledCount,
820
+ total: children.length
821
+ })
822
+ })]
823
+ }), expanded && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
824
+ id: listId,
825
+ className: plugin_manager_module_css_default.childList,
826
+ children: children.map((child) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
827
+ className: plugin_manager_module_css_default.childRow,
828
+ "data-plugin-row": child.id,
796
829
  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
- }
830
+ className: plugin_manager_module_css_default.childName,
831
+ title: child.id,
832
+ children: child.name
833
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
834
+ className: plugin_manager_module_css_default.actions,
835
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
836
+ className: plugin_manager_module_css_default.stateLabel,
837
+ "data-state": child.enabled ? "enabled" : "disabled",
838
+ children: child.enabled ? t("enabled") : t("disabled")
839
+ }), child.locked === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
840
+ className: plugin_manager_module_css_default.lockedHint,
841
+ children: t("lockedRowHint")
842
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
843
+ type: "button",
844
+ role: "switch",
845
+ "aria-checked": child.enabled,
846
+ "aria-label": child.enabled ? t("disableSwitch", { name: child.name }) : t("enableSwitch", { name: child.name }),
847
+ className: plugin_manager_module_css_default.switch,
848
+ disabled: toggleDisabled,
849
+ onClick: () => {
850
+ onUserToggle(child.id, !child.enabled);
851
+ }
852
+ })]
813
853
  })]
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
- })] })]
854
+ }, child.id))
855
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
856
+ className: plugin_manager_module_css_default.hint,
857
+ children: t("childrenHint")
858
+ })] })] });
859
+ })()]
820
860
  }, plugin.id);
821
861
  })
822
862
  })]
@@ -1035,6 +1075,9 @@ window.__ModuleLoader__.load({
1035
1075
  disableSwitch: "关闭 {name}",
1036
1076
  lockedRowHint: "核心行",
1037
1077
  childrenHint: "全家桶子插件可单独启停;停用后不再加载,代码仍随全家桶更新。",
1078
+ childrenSummary: "子插件 {enabled}/{total} 已启用",
1079
+ childrenShow: "展开 {name} 的子插件",
1080
+ childrenHide: "收起 {name} 的子插件",
1038
1081
  repairInstallTitle: "插件安装失败,请帮我诊断并修复。",
1039
1082
  repairInstallSpecLabel: "安装目标",
1040
1083
  repairInstallErrorLabel: "错误信息",
@@ -1119,6 +1162,9 @@ window.__ModuleLoader__.load({
1119
1162
  disableSwitch: "Turn off {name}",
1120
1163
  lockedRowHint: "Core row",
1121
1164
  childrenHint: "Bundle child plugins toggle individually; a disabled child is never loaded, while its code still updates with the bundle.",
1165
+ childrenSummary: "{enabled}/{total} child plugins on",
1166
+ childrenShow: "Show child plugins of {name}",
1167
+ childrenHide: "Hide child plugins of {name}",
1122
1168
  repairInstallTitle: "The plugin installation failed. Please diagnose and fix it.",
1123
1169
  repairInstallSpecLabel: "Install target",
1124
1170
  repairInstallErrorLabel: "Error message",
@@ -1299,7 +1345,7 @@ window.__ModuleLoader__.load({
1299
1345
  /** The building package's version, when the bundle carries it. */
1300
1346
  function bakedVersion() {
1301
1347
  try {
1302
- return "0.3.20";
1348
+ return "0.3.21";
1303
1349
  } catch {
1304
1350
  return;
1305
1351
  }
package/lib/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["css","Button","Modal"],"sources":["../../../packages/dsh-plugin-manager/src/core/conflict.ts","../../../packages/dsh-plugin-manager/src/core/repair.ts","../../../packages/dsh-plugin-manager/src/core/version.ts","../../../packages/dsh-plugin-manager/src/client/PluginManagerTab.tsx","../../../packages/dsh-plugin-manager/src/client/locales.ts","../../../packages/dsh-plugin-manager/src/core/protocol.ts","../../../packages/dsh-plugin-manager/src/core/service.ts","../../../packages/dsh-plugin-manager/src/client/telemetry.ts","../../../packages/dsh-plugin-manager/src/client/index.ts"],"sourcesContent":["/**\n * Conflict-ledger diffing. The official host applies structural conflict\n * rules at install time (disableControlsOnInstall: installing the dsh-web\n * family disables the built-in web-ui product rows so the two never\n * double-mount), but no UI surfaces what the rules just did. This module\n * diffs the plugin-control snapshots taken before and after an install and\n * classifies every state change so the tab can render it as a reversible,\n * attributable conflict notice.\n *\n * The install-time authority ends here: duplicate insert-id claims between\n * two user plugins carry no at-install signal through the RPC channels (the\n * Loader only re-reads the composition at the next start), so that failure\n * shape is left to the boot-failure ring — the real start is the authoritative\n * conflict detector.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { PluginControlItem } from './protocol.ts'\n\n/** One observed product-control state change between two snapshots. */\nexport interface ControlChange {\n id: string\n name: string\n from: PluginControlItem['state']\n to: PluginControlItem['state']\n}\n\n/** Meaningful change kinds a conflict notice distinguishes. */\nexport type ControlChangeKind = 'rule-disabled' | 'rule-enabled' | 'state-change'\n\n/**\n * Diff two plugin-control snapshots by id. Only entries present in both\n * snapshots with a changed state are reported; entries appearing or\n * disappearing are ordinary install/uninstall outcomes, not conflicts.\n * @param before - snapshot taken before the install.\n * @param after - snapshot taken after the install.\n * @returns one change per id whose state moved, in id order.\n */\nexport function diffControls(before: readonly PluginControlItem[], after: readonly PluginControlItem[]): ControlChange[] {\n const afterById = new Map(after.map(item => [item.id, item]))\n const changes: ControlChange[] = []\n for (const item of before) {\n const current = afterById.get(item.id)\n if (current === undefined || current.state === item.state) continue\n changes.push({ id: item.id, name: item.name, from: item.state, to: current.state })\n }\n return changes\n}\n\n/**\n * Classify one control-state change for messaging. A change into `disabled`\n * is the conflict rule's action (reversible by re-enabling); a change out of\n * `disabled` is a manual undo; anything else is reported neutrally.\n * @param change - one diff entry.\n * @returns the message kind.\n */\nexport function classifyChange(change: ControlChange): ControlChangeKind {\n if (change.to === 'disabled') return 'rule-disabled'\n if (change.from === 'disabled') return 'rule-enabled'\n return 'state-change'\n}\n","/**\n * Repair-conversation seed text. Two failure surfaces hand off to the agent\n * through the same shape: a failed install (target spec + install error) and\n * a recorded boot failure (the failure-ring row). The seeded message must be\n * self-contained — the repair session's workspace is the plugin install root,\n * so the agent's file tools reach the plugin code without leaving the\n * workspace boundary.\n *\n * Secret discipline: the seed carries only the spec, the host's truncated\n * failure message/stack, and paths. Callers must never append credentials,\n * tokens, or environment contents; the failure ring is the host's bounded,\n * pruned record and nothing else is added.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { PluginFailureItem } from './protocol.ts'\nimport type { LayerState } from './patch-diff.ts'\n\n/** Localized fragments the builders assemble. */\nexport interface RepairCopy {\n installTitle: string\n installSpecLabel: string\n installErrorLabel: string\n installAsk: string\n failureTitle: string\n failurePluginLabel: string\n failureKindLabel: string\n failureAtLabel: string\n failureMessageLabel: string\n failureStackLabel: string\n failurePathLabel: string\n failureAsk: string\n conflictTitle: string\n conflictPluginLabel: string\n conflictChangeLabel: string\n conflictAsk: string\n /** Localized names of the failure kinds. */\n kindNames: Record<PluginFailureItem['kind'], string>\n /** Localized names of the layer states a conflict change traverses. */\n stateNames: Record<LayerState, string>\n}\n\n/** Default copy (zh): the package's zh dictionary keys map onto these strings. */\nexport const DEFAULT_REPAIR_COPY: RepairCopy = {\n installTitle: '正在修复插件安装失败',\n installSpecLabel: '安装目标',\n installErrorLabel: '安装错误',\n installAsk: '请在插件安装根目录内检查插件包或依赖并修复,然后重试安装。',\n failureTitle: '正在修复插件启动失败',\n failurePluginLabel: '插件',\n failureKindLabel: '失败类型',\n failureAtLabel: '时间',\n failureMessageLabel: '错误信息',\n failureStackLabel: '堆栈',\n failurePathLabel: '安装路径',\n failureAsk: '请修复插件后重新启用并重启 dsh web。',\n conflictTitle: '正在处理插件安装冲突',\n conflictPluginLabel: '冲突条目',\n conflictChangeLabel: '状态变化',\n conflictAsk: '请检查冲突双方的入口行 id 与挂载方式,消除重复挂载后告诉我如何重新启用。',\n kindNames: {\n 'load-failure': '加载失败',\n hang: '启动挂起',\n 'late-rejection': '迟到拒绝',\n },\n stateNames: {\n enabled: '已开启',\n disabled: '已关闭',\n uninstalled: '已卸载',\n },\n}\n\n/**\n * Seed text for a failed install: the target and the rendered error,\n * self-contained for the agent.\n * @param spec - the install target (npm spec or git URL) that failed.\n * @param error - the rendered install error text.\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function installRepairMessage(spec: string, error: string, copy: RepairCopy = DEFAULT_REPAIR_COPY): string {\n return [\n copy.installTitle,\n `${copy.installSpecLabel}: ${spec}`,\n `${copy.installErrorLabel}:\\n${error}`,\n copy.installAsk,\n ].join('\\n\\n')\n}\n\n/**\n * Seed text for one boot-failure ring row: the failure record, so the agent\n * can attribute and fix it in place.\n * @param failure - the recorded failure row.\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function failureRepairMessage(failure: PluginFailureItem, copy: RepairCopy = DEFAULT_REPAIR_COPY): string {\n const parts = [\n copy.failureTitle,\n `${copy.failurePluginLabel}: ${failure.pluginId || '-'}`,\n `${copy.failureKindLabel}: ${copy.kindNames[failure.kind] ?? failure.kind}`,\n `${copy.failureAtLabel}: ${failure.at}`,\n `${copy.failureMessageLabel}:\\n${failure.message}`,\n ]\n if (failure.stack !== '') parts.push(`${copy.failureStackLabel}:\\n${failure.stack}`)\n if (failure.installPath !== '') parts.push(`${copy.failurePathLabel}: ${failure.installPath}`)\n parts.push(copy.failureAsk)\n return parts.join('\\n\\n')\n}\n\n/**\n * Seed text for one install-conflict notice: the entry and its state change,\n * so the agent can attribute the conflict and resolve the double mount.\n * @param change - the conflict change (id, display name, from/to states).\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function conflictRepairMessage(\n change: { id: string; name: string; from: LayerState; to: LayerState },\n copy: RepairCopy = DEFAULT_REPAIR_COPY,\n): string {\n return [\n copy.conflictTitle,\n `${copy.conflictPluginLabel}: ${change.name} (${change.id})`,\n `${copy.conflictChangeLabel}: ${copy.stateNames[change.from] ?? change.from} -> ${copy.stateNames[change.to] ?? change.to}`,\n copy.conflictAsk,\n ].join('\\n\\n')\n}\n","/**\n * DSH host version parsing and comparison for the update compatibility\n * check. The declared minimum lives in the published package manifest under\n * `dsh.engines.dsh`, falling back to the top-level `engines.dsh`; the only\n * supported form is `>=X.Y.Z[-prerelease]`.\n *\n * Comparison deliberately uses plain semver ordering instead of\n * `semver.satisfies`: npm's prerelease rule only allows a prerelease version\n * to satisfy a comparator set carrying a prerelease on the same\n * major.minor.patch tuple, which would reject a newer host line (0.1.1-rc.2)\n * against a declared `>=0.1.0-rc.8` — exactly the cross-cohort upgrade path\n * this check must allow. Everything here is pure and tolerant of untrusted\n * input: a malformed value means \"cannot verify\", which the callers treat as\n * a fail-closed verdict when a requirement was declared (issue #754).\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\n/** One parsed DSH host or package version. */\nexport interface DshVersion {\n major: number\n minor: number\n patch: number\n /** Prerelease identifiers, numeric identifiers kept as numbers (semver order). */\n prerelease: readonly (number | string)[]\n}\n\nconst VERSION_PATTERN = /^v?(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?$/\n\n/**\n * Parse a DSH host or package version string.\n * @param value - e.g. `0.1.0-rc.8`, `v1.2.3`.\n * @returns the parsed version, or undefined when malformed.\n */\nexport function parseDshVersion(value: string): DshVersion | undefined {\n const match = VERSION_PATTERN.exec(value.trim())\n if (match === null) return undefined\n const prereleaseParts = match[4] === undefined ? [] : match[4].split('.')\n if (prereleaseParts.some(part => part === '')) return undefined\n return {\n major: Number(match[1]),\n minor: Number(match[2]),\n patch: Number(match[3]),\n prerelease: prereleaseParts.map(part => /^\\d+$/.test(part) ? Number(part) : part),\n }\n}\n\n/**\n * Compare two version strings by semver order (a release is newer than any\n * prerelease of the same tuple).\n * @returns -1 / 0 / 1, or undefined when either side is malformed.\n */\nexport function compareVersions(left: string, right: string): number | undefined {\n const a = parseDshVersion(left)\n const b = parseDshVersion(right)\n if (a === undefined || b === undefined) return undefined\n for (const key of ['major', 'minor', 'patch'] as const) {\n if (a[key] !== b[key]) return a[key] < b[key] ? -1 : 1\n }\n return comparePrerelease(a.prerelease, b.prerelease)\n}\n\n/**\n * Semver prerelease ordering: numeric identifiers compare numerically,\n * numeric identifiers rank below alphanumeric ones, alphanumeric identifiers\n * compare lexically, and a longer list wins when the shared prefix is equal.\n */\nfunction comparePrerelease(left: readonly (number | string)[], right: readonly (number | string)[]): number {\n if (left.length === 0 && right.length === 0) return 0\n if (left.length === 0) return 1\n if (right.length === 0) return -1\n const length = Math.max(left.length, right.length)\n for (let index = 0; index < length; index += 1) {\n const a = left[index]\n const b = right[index]\n if (a === undefined) return -1\n if (b === undefined) return 1\n if (typeof a === 'number' && typeof b === 'number') {\n if (a !== b) return a < b ? -1 : 1\n } else if (typeof a === 'number') {\n return -1\n } else if (typeof b === 'number') {\n return 1\n } else if (a !== b) {\n return a < b ? -1 : 1\n }\n }\n return 0\n}\n\nconst MINIMUM_RANGE_PATTERN = /^>=\\s*(v?\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?)$/\n\n/**\n * Whether a host version satisfies a declared `>=X.Y.Z[-prerelease]` minimum.\n * @param host - the running DSH host version.\n * @param minimum - the declared minimum; any form other than `>=<semver>`\n * (plain semver, `^`, `~`, multi-comparator ranges, empty) returns undefined.\n * @returns true / false, or undefined when the host version is malformed or\n * the minimum uses an unsupported form — callers treat undefined as\n * \"cannot verify\" and fail closed for declared requirements.\n */\nexport function meetsMinimumDsh(host: string, minimum: string): boolean | undefined {\n const match = MINIMUM_RANGE_PATTERN.exec(minimum.trim())\n if (match === null) return undefined\n const compared = compareVersions(host, match[1])\n if (compared === undefined) return undefined\n return compared >= 0\n}\n\n/**\n * The bare minimum version for display: strips the `>=` operator (and an\n * optional leading `v`) from a declared requirement so UI copy that already\n * contains the comparison operator renders `0.1.1-rc.1` instead of\n * `>= >=0.1.1-rc.1`. Unsupported range forms render unchanged.\n * @param minimum - the declared minimum range.\n * @returns the version portion for display.\n */\nexport function displayMinimumVersion(minimum: string): string {\n const match = MINIMUM_RANGE_PATTERN.exec(minimum.trim())\n return match === null ? minimum.trim() : match[1].replace(/^v/, '')\n}\n\n/**\n * Read the declared DSH minimum from a published registry manifest:\n * `dsh.engines.dsh` first, top-level `engines.dsh` as the fallback.\n * Defensive against malformed or untrusted metadata: anything that is not a\n * non-empty string reads as absent.\n * @param manifest - the decoded registry version manifest.\n * @returns the declared minimum, or undefined when not declared.\n */\nexport function dshRequirementOf(manifest: { dsh?: unknown; engines?: unknown }): string | undefined {\n const dshEngines = (manifest.dsh as { engines?: unknown } | undefined)?.engines as { dsh?: unknown } | undefined\n const engines = (manifest.engines as { dsh?: unknown } | undefined)?.dsh\n const value = dshEngines?.dsh ?? engines\n return typeof value === 'string' && value.trim() !== '' ? value.trim() : undefined\n}\n","/**\n * The plugin-manager tab: an install box, one row per installed user plugin\n * (next-start enablement switch, source badge, update availability, update and\n * uninstall actions, per-plugin boot-failure block), the built-in product\n * switches, an install-conflict notice (the diff of the plugin-control\n * snapshot around each install, reversible through the product switch), and\n * the failure-repair affordances. Enablement switches and installs persist\n * through the official host channels and apply at the next restart; the web\n * build shows a restart hint instead of an in-place restart.\n *\n * This tab registers into the official Plugins settings section\n * (`settings.plugins.tab` slot) next to the official installer tab; its added\n * value over that tab is the conflict ledger, the bilingual repair seeds, and\n * the family card vocabulary.\n */\nimport { useEffect, useRef, useState } from 'react'\nimport { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { classifyChange, diffControls, type ControlChange } from '../core/conflict.ts'\nimport type {\n InstallProgressItem,\n InstalledPluginItem,\n PluginControlItem,\n PluginFailureItem,\n PluginFailuresSnapshot,\n PluginUpdateItem,\n} from '../core/protocol.ts'\nimport { conflictRepairMessage, failureRepairMessage, installRepairMessage, type RepairCopy } from '../core/repair.ts'\nimport { displayMinimumVersion } from '../core/version.ts'\nimport css from './plugin-manager.module.css'\n\n/** Registration-side wire face used by the tab. */\nexport interface PluginManagerTabInjected {\n /** Whether this browser has loopback authority to use the host routes. */\n isLoopback: boolean\n /** Read the installed snapshot. */\n list: () => Promise<InstalledPluginItem[]>\n /** Install one plugin from an npm spec or git URL. */\n install: (spec: string) => Promise<InstalledPluginItem>\n /** Re-install one plugin from its recorded source. */\n update: (id: string) => Promise<InstalledPluginItem>\n /** Remove one plugin. */\n uninstall: (id: string) => Promise<InstalledPluginItem[]>\n /** Persist one user plugin's next-start enablement. */\n setEnabled: (id: string, enabled: boolean) => Promise<InstalledPluginItem>\n /** Compare installed versions against their sources. */\n checkUpdates: () => Promise<PluginUpdateItem[]>\n /** Read the current install/update progress. */\n status: () => Promise<InstallProgressItem>\n /** Read the recorded boot failures, plugin root, and safe-mode state. */\n failures: () => Promise<PluginFailuresSnapshot>\n /** Persist the safe-mode marker (web: applied at the next manual restart). */\n setSafeMode: (enabled: boolean) => Promise<void>\n /** Start a repair conversation over the plugin install root. */\n repairPlugin: (pluginRoot: string, message: string) => Promise<void>\n /** Read the deployment-configured built-in product switches. */\n controlsList: () => Promise<PluginControlItem[]>\n /** Persist one product's next-start enablement. */\n controlsSetEnabled: (pluginId: string, enabled: boolean) => Promise<PluginControlItem[]>\n /** Conflicts the gateway host computed around the last install (gateway mode only). */\n lastInstallConflicts?: () => readonly ControlChange[]\n}\n\n/** Full component props assembled by the Settings slot renderer. */\nexport type PluginManagerTabProps =\n PropsRuntime<'settings.plugins.tab'>\n & PropsLocale<'settings.pluginManager'>\n & InjectFace<PluginManagerTabInjected>\n\ntype ViewState =\n | { readonly status: 'loading' }\n | { readonly status: 'error' }\n | {\n readonly status: 'ready'\n readonly plugins: readonly InstalledPluginItem[]\n readonly controls: readonly PluginControlItem[]\n readonly failures: PluginFailuresSnapshot\n }\n\n/** One row operation in flight. */\ntype BusyAction = { readonly kind: 'install' | 'update' | 'uninstall' | 'check'; readonly id?: string }\n\n/** One enablement switch in flight: a user plugin or a built-in product. */\ntype ToggleBusy = { readonly kind: 'user' | 'product'; readonly id: string }\n\n/** One uninstall target awaiting confirmation. */\ninterface UninstallTarget {\n readonly id: string\n readonly name: string\n}\n\n/** Error text for a caught request or lifecycle failure. */\nfunction messageOf(error: unknown): string {\n if (error instanceof AggregateError) {\n const details = error.errors.map(messageOf).join('; ')\n return details === '' ? error.message : `${error.message}: ${details}`\n }\n return error instanceof Error ? error.message : String(error)\n}\n\n/** Localized fragments for the repair seed builders, read from the tab's dictionaries. */\nfunction repairCopy(t: PluginManagerTabProps['t']): RepairCopy {\n return {\n installTitle: t('repairInstallTitle'),\n installSpecLabel: t('repairInstallSpecLabel'),\n installErrorLabel: t('repairInstallErrorLabel'),\n installAsk: t('repairInstallAsk'),\n failureTitle: t('repairFailureTitle'),\n failurePluginLabel: t('repairFailurePluginLabel'),\n failureKindLabel: t('repairFailureKindLabel'),\n failureAtLabel: t('repairFailureAtLabel'),\n failureMessageLabel: t('repairFailureMessageLabel'),\n failureStackLabel: t('repairFailureStackLabel'),\n failurePathLabel: t('repairFailurePathLabel'),\n failureAsk: t('repairFailureAsk'),\n kindNames: {\n 'load-failure': t('repairKindLoad'),\n hang: t('repairKindHang'),\n 'late-rejection': t('repairKindLate'),\n },\n conflictTitle: t('repairConflictTitle'),\n conflictPluginLabel: t('repairConflictPluginLabel'),\n conflictChangeLabel: t('repairConflictChangeLabel'),\n conflictAsk: t('repairConflictAsk'),\n stateNames: {\n enabled: t('repairStateEnabled'),\n disabled: t('repairStateDisabled'),\n uninstalled: t('repairStateUninstalled'),\n },\n }\n}\n\n/** Localized label for one install phase, with percent when the download has one. */\nfunction progressLabel(progress: InstallProgressItem, t: PluginManagerTabProps['t']): string {\n if (progress.stage === 'fetch') return t('fetching')\n if (progress.stage === 'extract') return t('extracting')\n if (progress.stage === 'write') return t('writing')\n return progress.percent === undefined ? t('downloading') : t('downloadingPercent', { percent: String(progress.percent) })\n}\n\n/** The plugin-manager settings tab. */\nexport function PluginManagerTab(props: PluginManagerTabProps) {\n const {\n t,\n isLoopback,\n list,\n install,\n update,\n uninstall,\n setEnabled,\n checkUpdates,\n status,\n failures,\n setSafeMode,\n repairPlugin,\n controlsList,\n controlsSetEnabled,\n lastInstallConflicts,\n } = props\n\n const [view, setView] = useState<ViewState>({ status: 'loading' })\n const [busy, setBusy] = useState<BusyAction | undefined>(undefined)\n const [toggleBusy, setToggleBusy] = useState<ToggleBusy | undefined>(undefined)\n const [error, setError] = useState<string | undefined>(undefined)\n const [failedSpec, setFailedSpec] = useState<string | undefined>(undefined)\n const [installError, setInstallError] = useState<string | undefined>(undefined)\n const [spec, setSpec] = useState('')\n const [dirty, setDirty] = useState(false)\n const [repairing, setRepairing] = useState<string | undefined>(undefined)\n const [copied, setCopied] = useState<string | undefined>(undefined)\n const [updates, setUpdates] = useState<ReadonlyMap<string, PluginUpdateItem>>(new Map())\n const [uninstallTarget, setUninstallTarget] = useState<UninstallTarget | undefined>(undefined)\n const [conflicts, setConflicts] = useState<readonly ControlChange[]>([])\n const [progress, setProgress] = useState<InstallProgressItem>({ kind: 'idle', stage: 'fetch' })\n /** Synchronous in-flight mirror of `busy`: the render-time guard alone lets a\n * click and an Enter land in the same frame and double-fire. */\n const busyRef = useRef(false)\n\n /** Reload every snapshot into the ready view. */\n const reload = async (): Promise<void> => {\n const [plugins, controls, failureSnapshot] = await Promise.all([list(), controlsList(), failures()])\n setView({ status: 'ready', plugins, controls, failures: failureSnapshot })\n }\n\n useEffect(() => {\n let cancelled = false\n void reload().catch(() => {\n if (!cancelled) setView({ status: 'error' })\n })\n return () => { cancelled = true }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n /** One row/form operation: busy state, error row, dirty flag on success. */\n const run = async (action: BusyAction, body: () => Promise<void>): Promise<void> => {\n if (busyRef.current) return\n busyRef.current = true\n setBusy(action)\n setError(undefined)\n try {\n await body()\n setDirty(true)\n } catch (reason) {\n setError(t('failed', { reason: messageOf(reason) }))\n } finally {\n busyRef.current = false\n setBusy(undefined)\n }\n }\n\n /** Install one spec, then diff the product snapshot into a conflict notice. */\n const onInstall = (): void => {\n const target = spec.trim()\n if (target === '' || busy !== undefined || busyRef.current) return\n void (async () => {\n busyRef.current = true\n const before = view.status === 'ready' ? view.controls : await controlsList().catch(() => [])\n setBusy({ kind: 'install' })\n setError(undefined)\n setFailedSpec(undefined)\n setInstallError(undefined)\n try {\n await install(target)\n setSpec('')\n setDirty(true)\n const after = await controlsList().catch(() => [] as readonly PluginControlItem[])\n setConflicts(lastInstallConflicts !== undefined ? lastInstallConflicts() : diffControls(before, after))\n await reload()\n } catch (reason) {\n const reasonText = messageOf(reason)\n setFailedSpec(target)\n setInstallError(reasonText)\n setError(t('failed', { reason: reasonText }))\n } finally {\n busyRef.current = false\n setBusy(undefined)\n }\n })()\n }\n\n /** Poll install/update progress while such an operation is in flight. */\n useEffect(() => {\n if (busy === undefined || (busy.kind !== 'install' && busy.kind !== 'update')) {\n setProgress({ kind: 'idle', stage: 'fetch' })\n return\n }\n let stopped = false\n let timer: ReturnType<typeof setTimeout> | undefined\n const tick = (delay: number): void => {\n timer = setTimeout(() => {\n void status().then(next => {\n if (!stopped && next !== undefined) {\n setProgress(next)\n tick(400)\n }\n }).catch(() => { /* status polling fails silently; the operation itself owns the error row */ })\n }, delay)\n }\n tick(100)\n return () => {\n stopped = true\n if (timer !== undefined) clearTimeout(timer)\n }\n }, [busy, status])\n\n const toggleDisabled = busy !== undefined || toggleBusy !== undefined\n || (view.status === 'ready' && view.failures.safeMode)\n\n const onUserToggle = (id: string, enabled: boolean): void => {\n setToggleBusy({ kind: 'user', id })\n setError(undefined)\n void setEnabled(id, enabled).then(plugin => {\n // Match by the RETURNED row id: a child-row toggle (id = entry id such\n // as web-ui-pet) answers with its owning package row, which carries the\n // refreshed children states.\n setView(current => current.status === 'ready'\n ? { ...current, plugins: current.plugins.map(item => item.id === plugin.id ? plugin : item) }\n : current)\n setDirty(true)\n setToggleBusy(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setToggleBusy(undefined)\n })\n }\n\n const onProductToggle = (id: string, enabled: boolean): void => {\n setToggleBusy({ kind: 'product', id })\n setError(undefined)\n void controlsSetEnabled(id, enabled).then(controls => {\n setView(current => current.status === 'ready' ? { ...current, controls } : current)\n setConflicts(previous => previous.filter(change => change.id !== id))\n setDirty(true)\n setToggleBusy(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setToggleBusy(undefined)\n })\n }\n\n const onCheck = (): void => {\n void run({ kind: 'check' }, async () => {\n const found = await checkUpdates()\n setUpdates(new Map(found.map(item => [item.id, item])))\n })\n }\n\n const onUpdate = (id: string): void => {\n void run({ kind: 'update', id }, async () => {\n await update(id)\n setUpdates(previous => {\n const next = new Map(previous)\n next.delete(id)\n return next\n })\n await reload()\n })\n }\n\n const onUninstall = (): void => {\n const target = uninstallTarget\n if (target === undefined) return\n void run({ kind: 'uninstall', id: target.id }, async () => {\n await uninstall(target.id)\n setUninstallTarget(undefined)\n await reload()\n })\n }\n\n /** Open a repair conversation seeded with one boot-failure record. `token`\n * identifies the row for the in-flight label (plugin id, or a row key for\n * unattributable failures). */\n const onRepair = (failure: PluginFailureItem, token: string): void => {\n if (view.status !== 'ready' || busy !== undefined || repairing !== undefined) return\n setError(undefined)\n setRepairing(token)\n void repairPlugin(view.failures.pluginRoot, failureRepairMessage(failure, repairCopy(t))).then(() => {\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n /** Hand the latest failed install off to a repair conversation over the\n * install root. The seed carries the install's own error (installError), not\n * whatever error the row currently shows. */\n const onRepairInstall = (): void => {\n if (view.status !== 'ready' || repairing !== undefined) return\n setError(undefined)\n setRepairing('install')\n void repairPlugin(view.failures.pluginRoot, installRepairMessage(failedSpec ?? '', installError ?? '', repairCopy(t))).then(() => {\n setError(undefined)\n setFailedSpec(undefined)\n setInstallError(undefined)\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n /** Copy a boot failure's message and stack for a manual repair conversation. */\n const onCopy = (failure: PluginFailureItem, token: string): void => {\n void navigator.clipboard.writeText(`${failure.message}\\n\\n${failure.stack}`).then(() => {\n setCopied(token)\n }).catch(() => {\n setError(t('failed', { reason: 'clipboard unavailable' }))\n })\n }\n\n const onExitSafeMode = (): void => {\n if (busy !== undefined) return\n setError(undefined)\n void setSafeMode(false).then(() => {\n setDirty(true)\n void reload().catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n })\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n })\n }\n\n /** Undo one conflict action by flipping the product switch back. */\n const onUndoConflict = (change: ControlChange): void => {\n if (change.to !== 'disabled') return\n onProductToggle(change.id, true)\n }\n\n /** Hand one conflict notice off to a repair conversation over the plugin root. */\n const onRepairConflict = (change: ControlChange): void => {\n if (view.status !== 'ready' || busy !== undefined || repairing !== undefined) return\n setError(undefined)\n const token = `conflict:${change.id}`\n setRepairing(token)\n void repairPlugin(view.failures.pluginRoot, conflictRepairMessage({\n id: change.id,\n name: change.name,\n from: change.from === 'enabled' || change.from === 'disabled' ? change.from : 'uninstalled',\n to: change.to === 'enabled' || change.to === 'disabled' ? change.to : 'uninstalled',\n }, repairCopy(t))).then(() => {\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n if (!isLoopback) {\n return (\n <div className={css.notice}>\n <strong>{t('localOnlyTitle')}</strong>\n <p>{t('localOnlyBody')}</p>\n </div>\n )\n }\n if (view.status === 'loading') return <div className={css.state}>{t('loading')}</div>\n if (view.status === 'error') return <div className={css.state}>{t('failed', { reason: 'load' })}</div>\n\n const attributable = new Map(view.failures.items.filter(item => item.pluginId !== '').map(item => [item.pluginId, item]))\n const unattributable = view.failures.items.filter(item => item.pluginId === '')\n\n return (\n <div className={css.section} aria-busy={busy !== undefined || toggleBusy !== undefined}>\n {view.failures.safeMode && (\n <div className={css.safeModeBanner} data-safe-mode>\n <p>{t('safeModeBanner')}</p>\n <Button variant=\"primary\" disabled={busy !== undefined} onClick={onExitSafeMode}>\n {t('exitSafeMode')}\n </Button>\n </div>\n )}\n\n <div className={css.installRow}>\n <input\n className={css.spec}\n type=\"text\"\n value={spec}\n placeholder={t('installPlaceholder')}\n disabled={busy !== undefined}\n onChange={event => { setSpec(event.target.value) }}\n onKeyDown={event => {\n if (event.key === 'Enter' && spec.trim() !== '' && busy === undefined) onInstall()\n }}\n />\n <Button\n variant=\"primary\"\n disabled={spec.trim() === '' || busy !== undefined}\n onClick={onInstall}\n >\n {busy !== undefined && busy.kind === 'install' ? t('installing') : t('install')}\n </Button>\n </div>\n <p className={css.hint}>{t('installHint')}</p>\n\n {(busy?.kind === 'install' || busy?.kind === 'update') && (\n <div className={css.progressRow} role=\"status\">\n <div className={css.progressTrack}>\n <div\n className={css.progressBar}\n style={progress.percent === undefined ? undefined : { width: `${progress.percent}%` }}\n data-indeterminate={progress.percent === undefined ? 'true' : undefined}\n />\n </div>\n <p className={css.progressLabel}>{progressLabel(progress, t)}</p>\n </div>\n )}\n\n {error !== undefined && (\n <div className={css.errorRow}>\n <span className={css.error}>{error}</span>\n {failedSpec !== undefined && (\n <Button variant=\"outline\" disabled={repairing !== undefined} onClick={onRepairInstall}>\n {repairing === 'install' ? t('repairing') : t('repair')}\n </Button>\n )}\n </div>\n )}\n\n {conflicts.length > 0 && (\n <div className={css.conflicts}>\n <h3 className={css.sectionTitle}>{t('conflictTitle')}</h3>\n <ul className={css.list}>\n {conflicts.map(change => (\n <li key={change.id} className={css.row} data-conflict={change.id}>\n <div className={css.meta}>\n <span className={css.name}>{change.name}</span>\n <span className={css.sub}>\n {classifyChange(change) === 'rule-disabled'\n ? t('conflictDisabled', { name: change.name })\n : classifyChange(change) === 'rule-enabled'\n ? t('conflictEnabled', { name: change.name })\n : t('conflictChanged', { name: change.name })}\n </span>\n </div>\n <div className={css.actions}>\n {change.to === 'disabled' && (\n <Button\n variant=\"outline\"\n disabled={toggleDisabled}\n onClick={() => { onUndoConflict(change) }}\n >\n {t('undoConflict')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepairConflict(change) }}\n >\n {repairing === `conflict:${change.id}` ? t('repairing') : t('repair')}\n </Button>\n </div>\n </li>\n ))}\n </ul>\n <p className={css.hint}>{t('conflictHint')}</p>\n </div>\n )}\n\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('userPlugins')}</h3>\n {view.plugins.length === 0\n ? <p className={css.empty}>{t('empty')}</p>\n : (\n <ul className={css.list}>\n {view.plugins.map(plugin => {\n const updateItem = updates.get(plugin.id)\n const latest = updateItem?.latest\n const dshRequirement = updateItem?.requiresDsh\n const failure = attributable.get(plugin.id)\n const children = plugin.children\n const mixed = children !== undefined && !plugin.enabled && children.some(child => child.enabled)\n return (\n <li key={plugin.id} data-plugin-id={plugin.id}>\n <div className={css.row}>\n <div className={css.meta}>\n <span className={css.name}>{plugin.name}</span>\n <span className={css.sub}>\n <span className={css.version}>{t('version', { version: plugin.version })}</span>\n <span className={css.sourceBadge} data-source={plugin.source.kind}>\n {plugin.source.kind === 'npm' ? t('npmSource') : t('gitSource')}\n </span>\n <span className={css.specText} title={plugin.source.spec}>{plugin.source.spec}</span>\n </span>\n {latest !== undefined && <span className={css.latest}>{t('latest', { version: latest })}</span>}\n {updateItem !== undefined && dshRequirement !== undefined && (\n <span className={updateItem.compatible === false ? css.compatBlocked : css.compatHint}>\n {updateItem.compatible === false\n ? t('updateBlockedDsh', { min: displayMinimumVersion(dshRequirement) })\n : t('updateRequiresDsh', { min: displayMinimumVersion(dshRequirement) })}\n </span>\n )}\n {failure !== undefined && (\n <div className={css.failure} data-plugin-failure={plugin.id}>\n <span className={css.badge}>{t('failureBadge')}</span>\n <span className={css.failureMessage} title={failure.message}>{failure.message}</span>\n <div className={css.failureActions}>\n <Button\n variant=\"primary\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepair(failure, plugin.id) }}\n >\n {repairing === plugin.id ? t('repairing') : t('repair')}\n </Button>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { onCopy(failure, plugin.id) }}>\n {copied === plugin.id ? t('copied') : t('copyError')}\n </Button>\n </div>\n </div>\n )}\n </div>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={plugin.enabled ? 'enabled' : mixed ? 'mixed' : 'disabled'}>\n {plugin.enabled ? t('enabled') : mixed ? t('mixed') : t('disabled')}\n </span>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={plugin.enabled}\n aria-label={plugin.enabled ? t('disableSwitch', { name: plugin.name }) : t('enableSwitch', { name: plugin.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onUserToggle(plugin.id, !plugin.enabled) }}\n />\n {latest !== undefined && (\n <Button\n variant=\"outline\"\n disabled={busy !== undefined || updateItem?.compatible === false}\n onClick={() => { onUpdate(plugin.id) }}\n >\n {busy?.kind === 'update' && busy.id === plugin.id ? t('updating') : t('update')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n disabled={busy !== undefined}\n onClick={() => { setUninstallTarget({ id: plugin.id, name: plugin.name }) }}\n >\n {t('uninstall')}\n </Button>\n </div>\n </div>\n {children !== undefined && (\n <>\n <ul className={css.childList}>\n {children.map(child => (\n <li key={child.id} className={css.childRow} data-plugin-row={child.id}>\n <span className={css.childName} title={child.id}>{child.name}</span>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={child.enabled ? 'enabled' : 'disabled'}>\n {child.enabled ? t('enabled') : t('disabled')}\n </span>\n {child.locked === true\n ? <span className={css.lockedHint}>{t('lockedRowHint')}</span>\n : (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={child.enabled}\n aria-label={child.enabled ? t('disableSwitch', { name: child.name }) : t('enableSwitch', { name: child.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onUserToggle(child.id, !child.enabled) }}\n />\n )}\n </div>\n </li>\n ))}\n </ul>\n <p className={css.hint}>{t('childrenHint')}</p>\n </>\n )}\n </li>\n )\n })}\n </ul>\n )}\n </div>\n\n {view.controls.length > 0 && (\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('products')}</h3>\n <ul className={css.list}>\n {view.controls.map(control => (\n <li key={control.id} className={css.row} data-product-id={control.id}>\n <div className={css.meta}>\n <span className={css.name}>{control.name}</span>\n <span className={css.sub}>\n <a className={css.link} href={control.repository} target=\"_blank\" rel=\"noreferrer\">{t('source')}</a>\n </span>\n </div>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={control.state}>\n {t(control.state)}\n </span>\n {control.state === 'enabled' || control.state === 'disabled'\n ? (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={control.state === 'enabled'}\n aria-label={control.state === 'enabled'\n ? t('disableSwitch', { name: control.name })\n : t('enableSwitch', { name: control.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onProductToggle(control.id, control.state !== 'enabled') }}\n />\n )\n : null}\n </div>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {unattributable.length > 0 && (\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('failureGroupTitle')}</h3>\n <ul className={css.list}>\n {unattributable.map((failure, index) => {\n const token = `other:${index}`\n return (\n <li key={`${failure.at}-${index}`} className={css.row} data-plugin-failure=\"other\">\n <div className={css.meta}>\n <span className={css.badge}>{t('failureBadge')}</span>\n <span className={css.failureMessage} title={failure.message}>{failure.message}</span>\n <div className={css.failureActions}>\n <Button\n variant=\"primary\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepair(failure, token) }}\n >\n {repairing === token ? t('repairing') : t('repair')}\n </Button>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { onCopy(failure, token) }}>\n {copied === token ? t('copied') : t('copyError')}\n </Button>\n </div>\n </div>\n </li>\n )\n })}\n </ul>\n </div>\n )}\n\n <div className={css.actionsRow}>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={onCheck}>\n {busy?.kind === 'check' ? t('checking') : t('checkUpdates')}\n </Button>\n {updates.size === 0 && busy === undefined && view.plugins.length > 0 && (\n <p className={css.ok}>{t('noUpdates')}</p>\n )}\n </div>\n\n {toggleBusy !== undefined && <p className={css.applying} aria-live=\"polite\">{t('applying')}</p>}\n\n {dirty && (\n <div className={css.restartRow}>\n <p>{t('restartHint')}</p>\n </div>\n )}\n\n <Modal\n title={t('uninstallConfirmTitle')}\n open={uninstallTarget !== undefined}\n onClose={() => { setUninstallTarget(undefined) }}\n closeLabel={t('cancel')}\n >\n <p className={css.confirmBody}>{t('uninstallConfirmBody', { name: uninstallTarget?.name ?? '' })}</p>\n <div className={css.modalActions}>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { setUninstallTarget(undefined) }}>\n {t('cancel')}\n </Button>\n <Button variant=\"primary\" className={css.dangerButton} disabled={busy !== undefined} onClick={onUninstall}>\n {t('confirm')}\n </Button>\n </div>\n </Modal>\n </div>\n )\n}\n","/**\n * Locale dictionaries for the plugin-manager tab. The zh dictionary is the\n * key source; the en dictionary mirrors the exact key set.\n * @module @linxin666/dsh-client-ui-plugin-manager/client\n */\n\n/** Simplified Chinese copy (the key-set source of truth). */\nconst STATIC_ZH = {\n tab: '插件管理',\n loading: '正在读取插件…',\n empty: '尚未安装任何用户插件。',\n userPlugins: '用户插件',\n products: '内置产品',\n conflictTitle: '安装冲突',\n conflictDisabled: '已自动禁用 {name},避免重复挂载。',\n conflictEnabled: '已重新启用 {name}。',\n conflictChanged: '{name} 的状态已变更。',\n undoConflict: '撤销',\n conflictHint: '冲突动作在安装时自动执行,撤销会写回开关并在重启后生效。',\n installPlaceholder: 'npm 包名(如 @scope/name)或 git 仓库 URL',\n install: '安装',\n installing: '安装中…',\n installHint: '在 GitHub 或 npm 找到插件后,粘贴其 npm 包名或仓库地址安装;应用重启后插件生效。',\n version: '已安装 {version}',\n latest: '最新 {version}',\n update: '更新',\n updating: '更新中…',\n checkUpdates: '检查更新',\n checking: '检查中…',\n noUpdates: '所有插件都是最新版本。',\n updateRequiresDsh: '需要 DSH ≥ {min}',\n updateBlockedDsh: '需要 DSH ≥ {min},请先升级 DSH 再更新',\n uninstall: '卸载',\n uninstallConfirmTitle: '卸载插件',\n uninstallConfirmBody: '将删除 {name} 的安装目录与配置行,并在重启后生效。',\n confirm: '确认卸载',\n cancel: '取消',\n restartHint: '插件变更将在重启应用后生效。',\n failed: '操作失败:{reason}',\n enabled: '已开启',\n disabled: '已关闭',\n mixed: '部分开启',\n unavailable: '不可用',\n uninstalled: '已卸载',\n source: '查看源码',\n applying: '正在应用更改…',\n fetching: '正在获取插件信息…',\n downloading: '正在下载…',\n downloadingPercent: '正在下载 {percent}%',\n extracting: '正在解压…',\n writing: '正在写入配置…',\n localOnlyTitle: '仅限本机操作',\n localOnlyBody: '为了保护主机配置,插件管理只能从本机打开。',\n failureBadge: '启动失败',\n failureGroupTitle: '其他启动失败',\n repair: '让 Agent 修复',\n repairing: '正在创建修复对话…',\n copyError: '复制错误',\n copied: '已复制',\n safeModeBanner: '安全模式:用户插件配置已跳过,插件开关不可用。',\n exitSafeMode: '恢复正常模式并重启',\n npmSource: 'npm',\n gitSource: 'git',\n enableSwitch: '开启 {name}',\n disableSwitch: '关闭 {name}',\n lockedRowHint: '核心行',\n childrenHint: '全家桶子插件可单独启停;停用后不再加载,代码仍随全家桶更新。',\n repairInstallTitle: '插件安装失败,请帮我诊断并修复。',\n repairInstallSpecLabel: '安装目标',\n repairInstallErrorLabel: '错误信息',\n repairInstallAsk: '请检查该插件并重新安装;完成后告诉我结果。',\n repairFailureTitle: '插件上次启动失败。请修复它。',\n repairFailurePluginLabel: '插件',\n repairFailureKindLabel: '失败类型',\n repairFailureAtLabel: '时间',\n repairFailureMessageLabel: '失败详情',\n repairFailureStackLabel: '原始堆栈',\n repairFailurePathLabel: '插件安装目录',\n repairFailureAsk: '请检查并修复该插件;修复完成后告诉我如何重新启用。',\n repairKindLoad: '加载失败',\n repairKindHang: '启动挂起',\n repairKindLate: '迟到拒绝',\n repairConflictTitle: '正在处理插件安装冲突',\n repairConflictPluginLabel: '冲突条目',\n repairConflictChangeLabel: '状态变化',\n repairConflictAsk: '请检查冲突双方的入口行 id 与挂载方式,消除重复挂载后告诉我如何重新启用。',\n repairStateEnabled: '已开启',\n repairStateDisabled: '已关闭',\n repairStateUninstalled: '已卸载',\n} satisfies Record<string, string>\n\n/** English copy, checked complete against the zh key set. */\nconst STATIC_EN = {\n tab: 'Plugin manager',\n loading: 'Reading plugins…',\n empty: 'No user plugins installed yet.',\n userPlugins: 'User plugins',\n products: 'Built-in products',\n conflictTitle: 'Install conflicts',\n conflictDisabled: 'Automatically disabled {name} to avoid double mounting.',\n conflictEnabled: 'Re-enabled {name}.',\n conflictChanged: 'The state of {name} changed.',\n undoConflict: 'Undo',\n conflictHint: 'Conflict actions run automatically at install time; undoing writes the switch back and applies after a restart.',\n installPlaceholder: 'npm package (e.g. @scope/name) or git repository URL',\n install: 'Install',\n installing: 'Installing…',\n installHint: 'Find a plugin on GitHub or npm, then paste its npm package name or repository URL; plugins load after a restart.',\n version: 'Installed {version}',\n latest: 'Latest {version}',\n update: 'Update',\n updating: 'Updating…',\n checkUpdates: 'Check for updates',\n checking: 'Checking…',\n noUpdates: 'All plugins are up to date.',\n updateRequiresDsh: 'Requires DSH >= {min}',\n updateBlockedDsh: 'Requires DSH >= {min}; upgrade DSH before updating',\n uninstall: 'Uninstall',\n uninstallConfirmTitle: 'Uninstall plugin',\n uninstallConfirmBody: '{name} and its configuration row will be removed; the change applies after a restart.',\n confirm: 'Uninstall',\n cancel: 'Cancel',\n restartHint: 'Plugin changes take effect after restarting the application.',\n failed: 'Operation failed: {reason}',\n enabled: 'On',\n disabled: 'Off',\n mixed: 'Partially on',\n unavailable: 'Unavailable',\n uninstalled: 'Uninstalled',\n source: 'View source',\n applying: 'Applying change…',\n fetching: 'Fetching plugin metadata…',\n downloading: 'Downloading…',\n downloadingPercent: 'Downloading {percent}%',\n extracting: 'Extracting…',\n writing: 'Writing configuration…',\n localOnlyTitle: 'Available on this computer only',\n localOnlyBody: 'To protect host configuration, plugin management is only available from a local browser.',\n failureBadge: 'Startup failure',\n failureGroupTitle: 'Other startup failures',\n repair: 'Ask the agent to fix',\n repairing: 'Opening repair conversation…',\n copyError: 'Copy error',\n copied: 'Copied',\n safeModeBanner: 'Safe mode: user plugin configuration is skipped; plugin switches are disabled.',\n exitSafeMode: 'Restore normal mode and restart',\n npmSource: 'npm',\n gitSource: 'git',\n enableSwitch: 'Turn on {name}',\n disableSwitch: 'Turn off {name}',\n lockedRowHint: 'Core row',\n childrenHint: 'Bundle child plugins toggle individually; a disabled child is never loaded, while its code still updates with the bundle.',\n repairInstallTitle: 'The plugin installation failed. Please diagnose and fix it.',\n repairInstallSpecLabel: 'Install target',\n repairInstallErrorLabel: 'Error message',\n repairInstallAsk: 'Please inspect the plugin and reinstall it; tell me when it is done.',\n repairFailureTitle: 'A plugin failed to start last time. Please fix it.',\n repairFailurePluginLabel: 'Plugin',\n repairFailureKindLabel: 'Failure kind',\n repairFailureAtLabel: 'At',\n repairFailureMessageLabel: 'Failure details',\n repairFailureStackLabel: 'Original stack',\n repairFailurePathLabel: 'Plugin install directory',\n repairFailureAsk: 'Please inspect and fix the plugin; tell me how to re-enable it afterwards.',\n repairKindLoad: 'Load failure',\n repairKindHang: 'Startup hang',\n repairKindLate: 'Late rejection',\n repairConflictTitle: 'Handling a plugin install conflict',\n repairConflictPluginLabel: 'Conflicting entry',\n repairConflictChangeLabel: 'State change',\n repairConflictAsk: 'Inspect the entry ids and mounting of both sides, resolve the double mount, and tell me how to re-enable.',\n repairStateEnabled: 'On',\n repairStateDisabled: 'Off',\n repairStateUninstalled: 'Uninstalled',\n} satisfies Record<keyof typeof STATIC_ZH, string>\n\nexport const zh = STATIC_ZH\nexport const en = STATIC_EN\nexport type PluginManagerKey = keyof typeof STATIC_ZH\n","/**\n * Wire parsing for the official plugin-installer / plugin-control RPC\n * channels. This package is a browser-side consumer of those channels: every\n * response is decoded but untrusted, so each parser validates the shape it\n * needs and throws a typed error on mismatch. Callers treat a parse failure\n * as \"channel unavailable or drifted\" and degrade to command hints.\n *\n * The shapes mirror the official web installer tab's wire protocol (see the\n * DSH checkout's packages/client/ui-settings-plugin-installer/src/client/\n * protocol.ts); they are a contract observation, not an import.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\n/** One loader entry row claimed by an installed bundle package (aggregate child). */\nexport interface InstalledPluginChild {\n /** The loader entry id, e.g. web-ui-pet. */\n id: string\n /** Display name: the real plugin package (shell config.plugin) when known. */\n name: string\n /** Saved next-start enablement of this row alone. */\n enabled: boolean\n /** Rows the manager must never disable (the manager tab itself, the compat face). */\n locked?: boolean\n}\n\n/** One installed user-plugin row served by `/plugin-installer list`. */\nexport interface InstalledPluginItem {\n id: string\n name: string\n version: string\n source: { kind: 'npm' | 'git'; spec: string }\n installedAt: string\n /** Saved next-start enablement from the managed profile patch row. */\n enabled: boolean\n commit?: string\n /**\n * Entry rows this package's bundle patch claims, present when the package\n * is an aggregate claiming more than one row (gateway mode only — the\n * official channel wire has no children). Child enablement is individually\n * switchable; uninstall stays whole-package (the code ships in one npm\n * package).\n */\n children?: InstalledPluginChild[]\n}\n\n/** Point-in-time install/update progress reported by the host. */\nexport interface InstallProgressItem {\n kind: 'idle' | 'install' | 'update'\n stage: 'fetch' | 'download' | 'extract' | 'write'\n percent?: number\n}\n\n/** Whether an update row is a normal same-name update or a legacy package migration. */\nexport type PluginUpdateKind = 'update' | 'migrate'\n\n/** One plugin with a newer version available. */\nexport interface PluginUpdateItem {\n id: string\n current: string\n latest: string\n /** Normal same-name update or legacy aggregate migration. Defaults to update. */\n kind?: PluginUpdateKind\n /** Target package name when kind is migrate. */\n target?: string\n /** Exact target package version when kind is migrate. */\n targetVersion?: string\n /** Declared DSH minimum the update needs (package manifest's `dsh.engines.dsh`). */\n requiresDsh?: string\n /** Whether the running DSH host satisfies requiresDsh; absent when unknown. */\n compatible?: boolean\n}\n\n/** One recorded plugin boot failure served by the host. */\nexport interface PluginFailureItem {\n /** Installed plugin id (package name); empty for unattributable failures. */\n pluginId: string\n kind: 'load-failure' | 'hang' | 'late-rejection'\n message: string\n stack: string\n installPath: string\n at: string\n}\n\n/** Recovery facts served by the host: the failure ring, the plugin root, and safe mode. */\nexport interface PluginFailuresSnapshot {\n items: PluginFailureItem[]\n /** Absolute plugin install root — the repair conversation's workspace. */\n pluginRoot: string\n /** Whether the host is running in safe mode (user plugins skipped). */\n safeMode: boolean\n}\n\n/** One deployment-configured logical product switch. */\nexport interface PluginControlItem {\n id: string\n name: string\n repository: string\n state: 'enabled' | 'disabled' | 'mixed' | 'unavailable' | 'uninstalled'\n}\n\n/** Whether a decoded value is a non-array object. */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/** Whether a decoded value is a string. */\nfunction isString(value: unknown): value is string {\n return typeof value === 'string'\n}\n\n/** Validate one aggregate child row. */\nfunction parsePluginChild(value: unknown, rowIndex: number, childIndex: number): InstalledPluginChild {\n if (!isRecord(value) || !isString(value.id) || !isString(value.name) || typeof value.enabled !== 'boolean') {\n throw new Error(`plugin-manager: plugin row ${String(rowIndex)} child ${String(childIndex)} is invalid`)\n }\n return {\n id: value.id,\n name: value.name,\n enabled: value.enabled,\n ...typeof value.locked === 'boolean' ? { locked: value.locked } : {},\n }\n}\n\n/** Validate one installed-plugin row. */\nfunction parsePlugin(value: unknown, index: number): InstalledPluginItem {\n if (!isRecord(value) || !isString(value.id) || !isString(value.name)\n || !isString(value.version) || !isString(value.installedAt)\n || typeof value.enabled !== 'boolean'\n || !isRecord(value.source) || (value.source.kind !== 'npm' && value.source.kind !== 'git')\n || !isString(value.source.spec)) {\n throw new Error(`plugin-manager: plugin row ${String(index)} is invalid`)\n }\n if (value.children !== undefined && !Array.isArray(value.children)) {\n throw new Error(`plugin-manager: plugin row ${String(index)} children is invalid`)\n }\n const children = (value.children as unknown[] | undefined)?.map((child, childIndex) => parsePluginChild(child, index, childIndex))\n return {\n id: value.id,\n name: value.name,\n version: value.version,\n source: { kind: value.source.kind, spec: value.source.spec },\n installedAt: value.installedAt,\n enabled: value.enabled,\n ...isString(value.commit) ? { commit: value.commit } : {},\n ...children !== undefined ? { children } : {},\n }\n}\n\n/**\n * Validate and normalize a `list` / `uninstall` response value.\n * @param value - decoded but untrusted response value.\n * @returns typed installed-plugin rows.\n */\nexport function parsePluginList(value: unknown): InstalledPluginItem[] {\n if (!isRecord(value) || !Array.isArray(value.plugins)) {\n throw new Error('plugin-manager: response must contain a plugins array')\n }\n return value.plugins.map((plugin, index) => parsePlugin(plugin, index))\n}\n\n/**\n * Validate and normalize an `install` / `update` / `set-enabled` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed installed-plugin row.\n */\nexport function parseInstalledPlugin(value: unknown): InstalledPluginItem {\n if (!isRecord(value) || value.plugin === undefined) {\n throw new Error('plugin-manager: response must contain a plugin row')\n }\n return parsePlugin(value.plugin, 0)\n}\n\n/**\n * Validate and normalize a plugin-control `list` / `set-enabled` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed control items.\n */\nexport function parsePluginControlSnapshot(value: unknown): PluginControlItem[] {\n if (!isRecord(value) || !Array.isArray(value.controls)) {\n throw new Error('plugin-manager: response must contain a controls array')\n }\n return value.controls.map((control, index) => {\n if (!isRecord(control) || !isString(control.id) || !isString(control.name)\n || !isString(control.repository)\n || (control.state !== 'enabled' && control.state !== 'disabled'\n && control.state !== 'mixed' && control.state !== 'unavailable'\n && control.state !== 'uninstalled')) {\n throw new Error(`plugin-manager: control row ${String(index)} is invalid`)\n }\n return {\n id: control.id,\n name: control.name,\n repository: control.repository,\n state: control.state,\n }\n })\n}\n\n/**\n * Validate and normalize a `status` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed progress state.\n */\nexport function parseInstallStatus(value: unknown): InstallProgressItem {\n if (!isRecord(value) || !isRecord(value.progress)\n || (value.progress.kind !== 'idle' && value.progress.kind !== 'install' && value.progress.kind !== 'update')\n || (value.progress.stage !== 'fetch' && value.progress.stage !== 'download'\n && value.progress.stage !== 'extract' && value.progress.stage !== 'write')\n || (value.progress.percent !== undefined\n && (typeof value.progress.percent !== 'number' || !Number.isFinite(value.progress.percent)))) {\n throw new Error('plugin-manager: response must contain a valid progress state')\n }\n return {\n kind: value.progress.kind,\n stage: value.progress.stage,\n ...typeof value.progress.percent === 'number' ? { percent: value.progress.percent } : {},\n }\n}\n\n/**\n * Validate and normalize a `check-updates` response value.\n * @param value - decoded but untrusted response value.\n * @returns typed update rows.\n */\nexport function parseUpdateList(value: unknown): PluginUpdateItem[] {\n if (!isRecord(value) || !Array.isArray(value.updates)) {\n throw new Error('plugin-manager: response must contain an updates array')\n }\n return value.updates.map((update, index) => {\n if (!isRecord(update) || !isString(update.id) || !isString(update.current) || !isString(update.latest)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n const kind = update.kind === undefined ? 'update' : update.kind\n if (kind !== 'update' && kind !== 'migrate') {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n const row: PluginUpdateItem = { id: update.id, current: update.current, latest: update.latest }\n if (kind === 'migrate') {\n if (!isString(update.target) || !isString(update.targetVersion)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.kind = 'migrate'\n row.target = update.target\n row.targetVersion = update.targetVersion\n }\n if (update.requiresDsh !== undefined) {\n if (!isString(update.requiresDsh)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.requiresDsh = update.requiresDsh\n }\n if (update.compatible !== undefined) {\n if (typeof update.compatible !== 'boolean') {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.compatible = update.compatible\n }\n return row\n })\n}\n\n/**\n * Validate and normalize a `failures` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed failures snapshot.\n */\nexport function parseFailuresSnapshot(value: unknown): PluginFailuresSnapshot {\n if (!isRecord(value) || !Array.isArray(value.items)\n || !isString(value.pluginRoot) || typeof value.safeMode !== 'boolean') {\n throw new Error('plugin-manager: response must contain a failures snapshot')\n }\n return {\n items: value.items.map((item, index) => {\n if (!isRecord(item) || !isString(item.pluginId)\n || (item.kind !== 'load-failure' && item.kind !== 'hang' && item.kind !== 'late-rejection')\n || !isString(item.message) || !isString(item.stack)\n || !isString(item.installPath) || !isString(item.at)) {\n throw new Error(`plugin-manager: failure row ${String(index)} is invalid`)\n }\n return {\n pluginId: item.pluginId,\n kind: item.kind,\n message: item.message,\n stack: item.stack,\n installPath: item.installPath,\n at: item.at,\n }\n }),\n pluginRoot: value.pluginRoot,\n safeMode: value.safeMode,\n }\n}\n","/**\n * The cordis service contract this package exposes to sibling client plugins\n * under the name `'pluginManager'`. The browser half builds one dual-channel\n * face (official /plugin-installer + /plugin-control RPC channels when\n * available, else this package's loopback HTTP gateway) and provides it via\n * `ctx.provide('pluginManager', face)`; consumers resolve it with\n * `ctx.inject(['pluginManager'], cb)` and read `ctx.pluginManager`.\n *\n * The interface is intentionally narrower than the face the Plugin manager\n * tab receives (`PluginManagerFace` in the client half): it is the stable\n * cross-plugin surface, so it only carries the operations a sibling plugin\n * needs to observe and drive the installed-plugin set.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { InstallProgressItem, InstalledPluginItem, PluginFailuresSnapshot } from './protocol.ts'\n\n/** The cordis service name the browser half provides the face under. */\nexport const PLUGIN_MANAGER_SERVICE = 'pluginManager'\n\n/**\n * The dual-channel plugin-management face, shared between the Plugin manager\n * tab and sibling client plugins.\n */\nexport interface PluginManagerService {\n /** Whether this browser has loopback authority to use the host routes. */\n readonly isLoopback: boolean\n /** Read the installed snapshot. */\n list(): Promise<InstalledPluginItem[]>\n /** Install one plugin from an npm spec or git URL. */\n install(spec: string): Promise<InstalledPluginItem>\n /** Remove one plugin. */\n uninstall(id: string): Promise<InstalledPluginItem[]>\n /** Read the current install/update progress. */\n status(): Promise<InstallProgressItem>\n /**\n * Read the recorded plugin boot-failure ring (plugin id, message, stack,\n * install path). On runtimes without a failure ring the host answers an\n * empty snapshot.\n */\n failures(): Promise<PluginFailuresSnapshot>\n /**\n * Flip one plugin's next-start enablement through the active channel (the\n * official installer RPC when available, else the loopback gateway's patch\n * `disabled` override row). The change takes effect after the host restart;\n * a running plugin is not stopped.\n */\n setEnabled(id: string, enabled: boolean): Promise<InstalledPluginItem>\n /**\n * Subscribe to successful mutations: the callback runs after install(),\n * update(), uninstall(), or setEnabled() resolves. One listener throwing\n * never breaks the others. Returns the unsubscribe function.\n */\n onChange(cb: () => void): () => void\n}\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n /** The plugin-manager face (provided by the dsh-plugin-manager client half). */\n pluginManager: PluginManagerService\n }\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/telemetry.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Anonymous install telemetry shared by the DSH Web UI family plugins.\n *\n * Once per UTC day per browser, each wired plugin sends one heartbeat to\n * the dsh-market edge API listing its package name (and version when known).\n * The payload carries no conversation data and no identifiers beyond a random\n * UUID generated in localStorage; the server hashes it with a deployment salt\n * before storage and never persists IP addresses. Sends are fire-and-forget:\n * failures stay silent and simply retry on a later mount or day. The system\n * is documented in docs/telemetry.md.\n */\n\nexport type TelemetryChannel = 'market' | 'npm' | 'unknown'\n\nexport interface TelemetryItem {\n /** npm package name or asset id, e.g. \"@linxin666/dsh-pet\" or \"skin:harbor\". */\n name: string\n /** Installed version when known; omitted otherwise. */\n version?: string\n /** Install channel when determinable (market = Workshop install). */\n channel?: TelemetryChannel\n}\n\nconst VISITOR_KEY = 'dsh-web-ui-telemetry-visitor'\nconst DAY_KEY_PREFIX = 'dsh-web-ui-telemetry-day:'\nconst ENDPOINT = 'https://dsh-market.com/api/telemetry/event'\n\n// Baked into each client bundle by shared/tsdown.client.ts (the package's own\n// package.json version at build time). Undefined in dev/test builds.\ndeclare const __DSH_PKG_VERSION__: string | undefined\n\n/** The building package's version, when the bundle carries it. */\nfunction bakedVersion(): string | undefined {\n try {\n return typeof __DSH_PKG_VERSION__ === 'string' && __DSH_PKG_VERSION__ !== ''\n ? __DSH_PKG_VERSION__\n : undefined\n } catch {\n return undefined\n }\n}\n\n/** Read or lazily create the anonymous visitor id; null when storage is unavailable. */\nfunction visitorId(): string | null {\n try {\n const existing = localStorage.getItem(VISITOR_KEY)\n if (existing && /^[A-Za-z0-9_-]{16,64}$/.test(existing)) return existing\n const fresh = crypto.randomUUID().replaceAll('-', '')\n localStorage.setItem(VISITOR_KEY, fresh)\n return fresh\n } catch {\n // Storage unavailable (privacy mode, sandboxed frame): report nothing.\n return null\n }\n}\n\n/** Drop stale per-day dedup keys so localStorage does not grow forever. */\nfunction pruneDayKeys(today: string): void {\n try {\n for (let index = localStorage.length - 1; index >= 0; index -= 1) {\n const key = localStorage.key(index)\n if (key !== null && key.startsWith(DAY_KEY_PREFIX) && key !== DAY_KEY_PREFIX + today) {\n localStorage.removeItem(key)\n }\n }\n } catch { /* best effort */ }\n}\n\n/**\n * Fire the daily heartbeat for the given items at most once per UTC day per\n * browser. Never throws and never blocks the caller. Items without an explicit\n * version inherit the bundle's baked build version.\n */\nexport function reportDailyHeartbeat(items: readonly TelemetryItem[]): void {\n try {\n if (items.length === 0) return\n const today = new Date().toISOString().slice(0, 10)\n // Automation contexts (CDP-driven QA browsers, fresh isolated profiles)\n // mint a new visitor id per run and would inflate instance counts.\n if (navigator.webdriver) return\n if (localStorage.getItem(DAY_KEY_PREFIX + today) !== null) return\n const visitor = visitorId()\n if (visitor === null) return\n pruneDayKeys(today)\n const payloadItems = items.map((item) => {\n const out: Record<string, string> = { name: item.name }\n const version = item.version ?? bakedVersion()\n if (version !== undefined) out.version = version\n if (item.channel !== undefined) out.channel = item.channel\n return out\n })\n const body = JSON.stringify({ kind: 'heartbeat', visitor, items: payloadItems })\n void fetch(ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body,\n keepalive: true,\n }).then((response) => {\n // Mark the day only after an accepted send, so offline browsers retry\n // on a later mount instead of going dark until tomorrow.\n if (response.ok) localStorage.setItem(DAY_KEY_PREFIX + today, '1')\n }).catch(() => { /* unreachable endpoint: stay silent */ })\n } catch { /* never break the host UI over telemetry */ }\n}\n","/**\n * Plugin-manager browser half: contributes the family plugin-manager tab to\n * the official Plugins settings section (`settings.plugins.tab` slot) and\n * provides the same dual-channel face as the `'pluginManager'` cordis\n * service for sibling client plugins. It is dual-channel: on runtimes with\n * the official installer services (DSHCode, the 1.0.4 checkout web) every\n * operation rides the official `/plugin-installer` and `/plugin-control`\n * loopback RPC channels (the single writer); on the npm-published web runtime\n * those channels do not exist, so the same face falls back to this package's\n * own loopback HTTP gateway, which spawns the official CLI for writes.\n * Neither the tab nor service consumers know which mode the face runs in.\n * @module @linxin666/dsh-client-ui-plugin-manager/client\n */\n\n// Type-only: pulls the locale plugin's Context merge (ctx.locale).\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the settings surface's slot contracts (settings.plugins.tab).\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n// Type-only: pulls the client runtime Context merge (ctx.workspaces, ctx.sessions).\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'\nimport { PluginManagerTab, type PluginManagerTabInjected } from './PluginManagerTab.tsx'\nimport { en, zh, type PluginManagerKey } from './locales.ts'\nimport {\n parseFailuresSnapshot,\n parseInstallStatus,\n parseInstalledPlugin,\n parsePluginControlSnapshot,\n parsePluginList,\n parseUpdateList,\n type InstalledPluginItem,\n type InstallProgressItem,\n type PluginControlItem,\n type PluginFailuresSnapshot,\n type PluginUpdateItem,\n} from '../core/protocol.ts'\nimport { PLUGIN_MANAGER_SERVICE, type PluginManagerService } from '../core/service.ts'\nimport type { ControlChange } from '../core/conflict.ts'\nimport { reportDailyHeartbeat } from './telemetry.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Copy for the family plugin-manager tab. */\n 'settings.pluginManager': PluginManagerKey\n }\n}\n\nconst NS = 'settings.pluginManager'\nconst CHANNEL = '/plugin-installer'\nconst CONTROL_CHANNEL = '/plugin-control'\nconst LIST_ENDPOINT = 'list'\nconst INSTALL_ENDPOINT = 'install'\nconst UPDATE_ENDPOINT = 'update'\nconst UNINSTALL_ENDPOINT = 'uninstall'\nconst SET_ENABLED_ENDPOINT = 'set-enabled'\nconst CHECK_UPDATES_ENDPOINT = 'check-updates'\nconst STATUS_ENDPOINT = 'status'\nconst FAILURES_ENDPOINT = 'failures'\nconst SET_SAFE_MODE_ENDPOINT = 'set-safe-mode'\n\nconst GATEWAY_PREFIX = '/api/plugin-manager'\n/** Gateway job polling cadence. */\nconst JOB_POLL_MS = 500\n/** Gateway job wait ceiling (the host add deadline is six minutes). */\nconst JOB_WAIT_MS = 7 * 60_000\n\n/** Services required by the slot registration and both channels. */\nexport const inject = ['slots', 'locale', 'connection', 'workspaces', 'sessions']\n\n/** The gateway job wire shape served by /status. */\ninterface GatewayJobWire {\n phase: 'running' | 'done' | 'error'\n plugin?: unknown\n conflicts?: unknown\n error?: string\n}\n\n/**\n * The face the Plugin manager tab and the `'pluginManager'` cordis service\n * share: the full tab surface plus the cross-plugin service contract.\n */\nexport type PluginManagerFace = PluginManagerTabInjected & PluginManagerService\n\n/**\n * Build the dual-channel face once: official-channel and gateway-channel\n * implementations, the mode detection that picks between them, the repair\n * handoff, and the change-notification listener set. The returned face is\n * both the tab's injected props and the value provided as the\n * `'pluginManager'` cordis service.\n * @param ctx - the client context (connection, workspaces, sessions).\n * @returns the shared face.\n */\nexport function createPluginManagerFace(ctx: ClientContext): PluginManagerFace {\n const connection = ctx.get('connection') as ConnectionHandle\n\n // ── official channel implementations ──────────────────────────────────────\n\n const call = async (endpoint: string, payload: unknown): Promise<unknown> => {\n const result = await connection.rpc.call(CHANNEL, endpoint, payload)\n if (!result.ok) {\n throw new Error(`plugin-installer ${endpoint} failed: ${result.error.code}: ${result.error.message}`)\n }\n return result.value\n }\n const official = {\n list: async (): Promise<InstalledPluginItem[]> => parsePluginList(await call(LIST_ENDPOINT, {})),\n install: async (spec: string): Promise<InstalledPluginItem> => parseInstalledPlugin(await call(INSTALL_ENDPOINT, { spec })),\n update: async (id: string): Promise<InstalledPluginItem> => parseInstalledPlugin(await call(UPDATE_ENDPOINT, { id })),\n uninstall: async (id: string): Promise<InstalledPluginItem[]> => parsePluginList(await call(UNINSTALL_ENDPOINT, { id })),\n setEnabled: async (id: string, enabled: boolean): Promise<InstalledPluginItem> =>\n parseInstalledPlugin(await call(SET_ENABLED_ENDPOINT, { id, enabled })),\n checkUpdates: async (): Promise<PluginUpdateItem[]> => parseUpdateList(await call(CHECK_UPDATES_ENDPOINT, {})),\n status: async (): Promise<InstallProgressItem> => parseInstallStatus(await call(STATUS_ENDPOINT, {})),\n failures: async (): Promise<PluginFailuresSnapshot> => parseFailuresSnapshot(await call(FAILURES_ENDPOINT, {})),\n setSafeMode: async (enabled: boolean): Promise<void> => {\n await call(SET_SAFE_MODE_ENDPOINT, { enabled })\n },\n controlsList: async (): Promise<PluginControlItem[]> =>\n parsePluginControlSnapshot(await connection.rpc.call(CONTROL_CHANNEL, 'list', {}).then(result => {\n if (!result.ok) throw new Error(`plugin-control list failed: ${result.error.code}: ${result.error.message}`)\n return result.value\n })),\n controlsSetEnabled: async (pluginId: string, enabled: boolean): Promise<PluginControlItem[]> =>\n parsePluginControlSnapshot(await connection.rpc.call(CONTROL_CHANNEL, 'set-enabled', { pluginId, enabled }).then(result => {\n if (!result.ok) throw new Error(`plugin-control set-enabled failed: ${result.error.code}: ${result.error.message}`)\n return result.value\n })),\n }\n\n // ── gateway channel implementations ──────────────────────────────────────\n\n const gatewayJson = async (path: string, init?: RequestInit): Promise<unknown> => {\n const response = await fetch(path, {\n ...init,\n headers: { 'content-type': 'application/json', ...init?.headers },\n })\n if (response.status === 403) {\n throw new Error('plugin-manager: plugin management is only available from a local browser')\n }\n if (!response.ok) {\n const body = await response.json().catch(() => ({})) as { error?: string }\n throw new Error(body.error ?? `plugin-manager: gateway ${path} failed: HTTP ${String(response.status)}`)\n }\n return response.json()\n }\n\n /** Wait for one gateway job to settle, returning its wire state. */\n const waitJob = async (jobId: string): Promise<GatewayJobWire> => {\n const deadline = Date.now() + JOB_WAIT_MS\n for (;;) {\n const body = await gatewayJson(`${GATEWAY_PREFIX}/status?job=${encodeURIComponent(jobId)}`) as { job?: GatewayJobWire }\n const job = body.job\n if (job === undefined) throw new Error('plugin-manager: gateway job vanished')\n if (job.phase === 'done') return job\n if (job.phase === 'error') throw new Error(job.error ?? 'plugin-manager: gateway job failed')\n if (Date.now() > deadline) throw new Error('plugin-manager: gateway job timed out')\n await new Promise(resolve => { setTimeout(resolve, JOB_POLL_MS) })\n }\n }\n\n /** The conflict ledger of the last settled gateway install. */\n let lastInstallConflicts: ControlChange[] = []\n /** Whether a gateway install/remove is in flight (drives the progress row). */\n let gatewayInflight = false\n\n const gateway = {\n list: async (): Promise<InstalledPluginItem[]> =>\n parsePluginList(await gatewayJson(`${GATEWAY_PREFIX}/list`)),\n install: async (spec: string): Promise<InstalledPluginItem> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/install`, {\n method: 'POST',\n body: JSON.stringify({ spec }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway install returned no job')\n const job = await waitJob(started.jobId)\n lastInstallConflicts = Array.isArray(job.conflicts) ? job.conflicts as ControlChange[] : []\n return parseInstalledPlugin({ plugin: job.plugin })\n } finally {\n gatewayInflight = false\n }\n },\n update: async (id: string): Promise<InstalledPluginItem> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/update`, {\n method: 'POST',\n body: JSON.stringify({ id }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway update returned no job')\n const job = await waitJob(started.jobId)\n lastInstallConflicts = Array.isArray(job.conflicts) ? job.conflicts as ControlChange[] : []\n return parseInstalledPlugin({ plugin: job.plugin })\n } finally {\n gatewayInflight = false\n }\n },\n uninstall: async (id: string): Promise<InstalledPluginItem[]> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/remove`, {\n method: 'POST',\n body: JSON.stringify({ id }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway remove returned no job')\n await waitJob(started.jobId)\n return gateway.list()\n } finally {\n gatewayInflight = false\n }\n },\n setEnabled: async (id: string, enabled: boolean): Promise<InstalledPluginItem> =>\n parseInstalledPlugin(await gatewayJson(`${GATEWAY_PREFIX}/set-enabled`, {\n method: 'POST',\n body: JSON.stringify({ id, enabled }),\n })),\n checkUpdates: async (): Promise<PluginUpdateItem[]> =>\n parseUpdateList(await gatewayJson(`${GATEWAY_PREFIX}/check-updates`)),\n status: async (): Promise<InstallProgressItem> =>\n gatewayInflight ? { kind: 'install', stage: 'download' } : { kind: 'idle', stage: 'fetch' },\n failures: async (): Promise<PluginFailuresSnapshot> =>\n parseFailuresSnapshot(await gatewayJson(`${GATEWAY_PREFIX}/failures`)),\n setSafeMode: async (): Promise<void> => {\n throw new Error('plugin-manager: safe mode is unavailable in this runtime')\n },\n controlsList: async (): Promise<PluginControlItem[]> => [],\n controlsSetEnabled: async (pluginId: string, enabled: boolean): Promise<PluginControlItem[]> => {\n await gateway.setEnabled(pluginId, enabled)\n return []\n },\n }\n\n // ── mode selection ────────────────────────────────────────────────────────\n\n let modePromise: Promise<'official' | 'gateway'> | undefined\n const ensureMode = (): Promise<'official' | 'gateway'> => {\n if (modePromise === undefined) {\n modePromise = (async () => {\n // Prefer the host verdict: the gateway's /mode route reports whether\n // the official installer channels exist, so the direct channel probe\n // below (which 405s into the browser console on the npm web runtime)\n // only runs when the host half is absent or explicitly returns null\n // for a desktop runtime whose services are registered in-process.\n try {\n const mode = await gatewayJson(`${GATEWAY_PREFIX}/mode`) as { official?: boolean | null }\n if (mode.official === true) return 'official' as const\n if (mode.official === false) return 'gateway' as const\n } catch {\n // Host half absent (an official runtime without a boot profile):\n // fall back to the direct channel probe.\n }\n try {\n const result = await connection.rpc.call(CHANNEL, LIST_ENDPOINT, {})\n return result.ok ? 'official' as const : 'gateway' as const\n } catch {\n return 'gateway' as const\n }\n })()\n }\n return modePromise\n }\n\n /**\n * Start a repair conversation for a failed plugin: resolve a workspace over\n * the plugin install root (created once, reused after), open a fresh\n * session there, and seed its first prompt with the failure details. The\n * session's workspace is the plugin home so the agent's file tools reach\n * the plugin code without leaving the workspace boundary.\n * @param pluginRoot - absolute plugin install root.\n * @param message - the seeded first user message.\n * @returns resolution after the prompt is accepted and the session opens.\n */\n const repairPlugin = async (pluginRoot: string, message: string): Promise<void> => {\n const workspace = await ctx.workspaces.create({ path: pluginRoot })\n const sessionId = await ctx.sessions.create({ workspaceId: workspace.workspaceId })\n const binding = ctx.sessions.binding(sessionId)\n if (binding === undefined) throw new Error(`plugin-manager: repair session ${sessionId} is unavailable`)\n const result = await binding.session.prompt([{ type: 'text', text: message }], 'queue')\n if (!result.ok) throw new Error(`plugin-manager: repair prompt failed: ${result.error.code}: ${result.error.message}`)\n ctx.sessions.open(sessionId)\n }\n\n // ── change notification ───────────────────────────────────────────────────\n\n /** Listeners subscribed through onChange; fired after successful mutations. */\n const listeners = new Set<() => void>()\n /** Notify every listener; one listener throwing never breaks the others. */\n const notifyChange = (): void => {\n for (const listener of [...listeners]) {\n try {\n listener()\n } catch {\n // A consumer's listener failure is its own; keep notifying the rest.\n }\n }\n }\n\n // ── the shared face ───────────────────────────────────────────────────────\n\n return {\n isLoopback: connection.isLoopback,\n list: async () => (await ensureMode()) === 'official' ? official.list() : gateway.list(),\n install: async spec => {\n const item = await ((await ensureMode()) === 'official' ? official.install(spec) : gateway.install(spec))\n notifyChange()\n return item\n },\n update: async id => {\n const item = await ((await ensureMode()) === 'official' ? official.update(id) : gateway.update(id))\n notifyChange()\n return item\n },\n uninstall: async id => {\n const rows = await ((await ensureMode()) === 'official' ? official.uninstall(id) : gateway.uninstall(id))\n notifyChange()\n return rows\n },\n setEnabled: async (id, enabled) => {\n const item = await ((await ensureMode()) === 'official' ? official.setEnabled(id, enabled) : gateway.setEnabled(id, enabled))\n notifyChange()\n return item\n },\n checkUpdates: async () => (await ensureMode()) === 'official' ? official.checkUpdates() : gateway.checkUpdates(),\n status: async () => (await ensureMode()) === 'official' ? official.status() : gateway.status(),\n failures: async () => (await ensureMode()) === 'official' ? official.failures() : gateway.failures(),\n setSafeMode: async enabled => (await ensureMode()) === 'official' ? official.setSafeMode(enabled) : gateway.setSafeMode(),\n repairPlugin,\n controlsList: async () => (await ensureMode()) === 'official' ? official.controlsList() : gateway.controlsList(),\n controlsSetEnabled: async (id, enabled) => (await ensureMode()) === 'official' ? official.controlsSetEnabled(id, enabled) : gateway.controlsSetEnabled(id, enabled),\n lastInstallConflicts: () => lastInstallConflicts,\n onChange: cb => {\n listeners.add(cb)\n return () => { listeners.delete(cb) }\n },\n }\n}\n\n/** Contribute the family plugin-manager tab and provide the shared face. */\nexport function apply(ctx: ClientContext): void {\n // Anonymous install heartbeat (docs/telemetry.md): one beat per browser per\n // UTC day, package name only, silent failure.\n reportDailyHeartbeat([{ name: '@linxin666/dsh-client-ui-plugin-manager' }])\n\n ctx.effect(() => {\n try {\n return ctx.locale.register(NS, { zh, en })\n } catch {\n return () => {}\n }\n }, 'plugin-manager: dictionaries')\n\n // Built once: the tab and the 'pluginManager' cordis service share one\n // face, so consumers observe exactly the mutations the tab performs.\n const face = createPluginManagerFace(ctx)\n try {\n if (!ctx.get(PLUGIN_MANAGER_SERVICE)) {\n ctx.provide(PLUGIN_MANAGER_SERVICE, face)\n }\n } catch {\n // ignore duplicate provide\n }\n\n ctx.slots.inject('settings.plugins.tab', () => {\n try {\n return ctx.slots.register({\n name: 'settings.plugins.tab',\n id: 'family-plugins',\n order: 20,\n label: () => ctx.locale.bind(NS)('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A,SAAgB,MAAM,KAA0B;GAG9C,qBAAqB,CAAC,EAAE,MAAM,0CAA0C,CAAC,CAAC;GAE1E,IAAI,aAAa;IACf,IAAI;KACF,OAAO,IAAI,OAAO,SAAS,IAAI;MAAE;MAAI;KAAG,CAAC;IAC3C,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,GAAG,8BAA8B;GAIjC,MAAM,OAAO,wBAAwB,GAAG;GACxC,IAAI;IACF,IAAI,CAAC,IAAI,IAAA,eAA0B,GACjC,IAAI,QAAQ,wBAAwB,IAAI;GAE5C,QAAQ,CAER;GAEA,IAAI,MAAM,OAAO,8BAA8B;IAC7C,IAAI;KACF,OAAO,IAAI,MAAM,SAAS;MACxB,MAAM;MACN,IAAI;MACJ,OAAO;MACP,aAAa,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,KAAK;MACtC,QAAQ;MACR,cAAc;KAChB,GAAG,gBAAgB;IACrB,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,CAAC;EACH"}
1
+ {"version":3,"file":"client.js","names":["css","Button","Modal"],"sources":["../../../packages/dsh-plugin-manager/src/core/conflict.ts","../../../packages/dsh-plugin-manager/src/core/repair.ts","../../../packages/dsh-plugin-manager/src/core/version.ts","../../../packages/dsh-plugin-manager/src/client/PluginManagerTab.tsx","../../../packages/dsh-plugin-manager/src/client/locales.ts","../../../packages/dsh-plugin-manager/src/core/protocol.ts","../../../packages/dsh-plugin-manager/src/core/service.ts","../../../packages/dsh-plugin-manager/src/client/telemetry.ts","../../../packages/dsh-plugin-manager/src/client/index.ts"],"sourcesContent":["/**\n * Conflict-ledger diffing. The official host applies structural conflict\n * rules at install time (disableControlsOnInstall: installing the dsh-web\n * family disables the built-in web-ui product rows so the two never\n * double-mount), but no UI surfaces what the rules just did. This module\n * diffs the plugin-control snapshots taken before and after an install and\n * classifies every state change so the tab can render it as a reversible,\n * attributable conflict notice.\n *\n * The install-time authority ends here: duplicate insert-id claims between\n * two user plugins carry no at-install signal through the RPC channels (the\n * Loader only re-reads the composition at the next start), so that failure\n * shape is left to the boot-failure ring — the real start is the authoritative\n * conflict detector.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { PluginControlItem } from './protocol.ts'\n\n/** One observed product-control state change between two snapshots. */\nexport interface ControlChange {\n id: string\n name: string\n from: PluginControlItem['state']\n to: PluginControlItem['state']\n}\n\n/** Meaningful change kinds a conflict notice distinguishes. */\nexport type ControlChangeKind = 'rule-disabled' | 'rule-enabled' | 'state-change'\n\n/**\n * Diff two plugin-control snapshots by id. Only entries present in both\n * snapshots with a changed state are reported; entries appearing or\n * disappearing are ordinary install/uninstall outcomes, not conflicts.\n * @param before - snapshot taken before the install.\n * @param after - snapshot taken after the install.\n * @returns one change per id whose state moved, in id order.\n */\nexport function diffControls(before: readonly PluginControlItem[], after: readonly PluginControlItem[]): ControlChange[] {\n const afterById = new Map(after.map(item => [item.id, item]))\n const changes: ControlChange[] = []\n for (const item of before) {\n const current = afterById.get(item.id)\n if (current === undefined || current.state === item.state) continue\n changes.push({ id: item.id, name: item.name, from: item.state, to: current.state })\n }\n return changes\n}\n\n/**\n * Classify one control-state change for messaging. A change into `disabled`\n * is the conflict rule's action (reversible by re-enabling); a change out of\n * `disabled` is a manual undo; anything else is reported neutrally.\n * @param change - one diff entry.\n * @returns the message kind.\n */\nexport function classifyChange(change: ControlChange): ControlChangeKind {\n if (change.to === 'disabled') return 'rule-disabled'\n if (change.from === 'disabled') return 'rule-enabled'\n return 'state-change'\n}\n","/**\n * Repair-conversation seed text. Two failure surfaces hand off to the agent\n * through the same shape: a failed install (target spec + install error) and\n * a recorded boot failure (the failure-ring row). The seeded message must be\n * self-contained — the repair session's workspace is the plugin install root,\n * so the agent's file tools reach the plugin code without leaving the\n * workspace boundary.\n *\n * Secret discipline: the seed carries only the spec, the host's truncated\n * failure message/stack, and paths. Callers must never append credentials,\n * tokens, or environment contents; the failure ring is the host's bounded,\n * pruned record and nothing else is added.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { PluginFailureItem } from './protocol.ts'\nimport type { LayerState } from './patch-diff.ts'\n\n/** Localized fragments the builders assemble. */\nexport interface RepairCopy {\n installTitle: string\n installSpecLabel: string\n installErrorLabel: string\n installAsk: string\n failureTitle: string\n failurePluginLabel: string\n failureKindLabel: string\n failureAtLabel: string\n failureMessageLabel: string\n failureStackLabel: string\n failurePathLabel: string\n failureAsk: string\n conflictTitle: string\n conflictPluginLabel: string\n conflictChangeLabel: string\n conflictAsk: string\n /** Localized names of the failure kinds. */\n kindNames: Record<PluginFailureItem['kind'], string>\n /** Localized names of the layer states a conflict change traverses. */\n stateNames: Record<LayerState, string>\n}\n\n/** Default copy (zh): the package's zh dictionary keys map onto these strings. */\nexport const DEFAULT_REPAIR_COPY: RepairCopy = {\n installTitle: '正在修复插件安装失败',\n installSpecLabel: '安装目标',\n installErrorLabel: '安装错误',\n installAsk: '请在插件安装根目录内检查插件包或依赖并修复,然后重试安装。',\n failureTitle: '正在修复插件启动失败',\n failurePluginLabel: '插件',\n failureKindLabel: '失败类型',\n failureAtLabel: '时间',\n failureMessageLabel: '错误信息',\n failureStackLabel: '堆栈',\n failurePathLabel: '安装路径',\n failureAsk: '请修复插件后重新启用并重启 dsh web。',\n conflictTitle: '正在处理插件安装冲突',\n conflictPluginLabel: '冲突条目',\n conflictChangeLabel: '状态变化',\n conflictAsk: '请检查冲突双方的入口行 id 与挂载方式,消除重复挂载后告诉我如何重新启用。',\n kindNames: {\n 'load-failure': '加载失败',\n hang: '启动挂起',\n 'late-rejection': '迟到拒绝',\n },\n stateNames: {\n enabled: '已开启',\n disabled: '已关闭',\n uninstalled: '已卸载',\n },\n}\n\n/**\n * Seed text for a failed install: the target and the rendered error,\n * self-contained for the agent.\n * @param spec - the install target (npm spec or git URL) that failed.\n * @param error - the rendered install error text.\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function installRepairMessage(spec: string, error: string, copy: RepairCopy = DEFAULT_REPAIR_COPY): string {\n return [\n copy.installTitle,\n `${copy.installSpecLabel}: ${spec}`,\n `${copy.installErrorLabel}:\\n${error}`,\n copy.installAsk,\n ].join('\\n\\n')\n}\n\n/**\n * Seed text for one boot-failure ring row: the failure record, so the agent\n * can attribute and fix it in place.\n * @param failure - the recorded failure row.\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function failureRepairMessage(failure: PluginFailureItem, copy: RepairCopy = DEFAULT_REPAIR_COPY): string {\n const parts = [\n copy.failureTitle,\n `${copy.failurePluginLabel}: ${failure.pluginId || '-'}`,\n `${copy.failureKindLabel}: ${copy.kindNames[failure.kind] ?? failure.kind}`,\n `${copy.failureAtLabel}: ${failure.at}`,\n `${copy.failureMessageLabel}:\\n${failure.message}`,\n ]\n if (failure.stack !== '') parts.push(`${copy.failureStackLabel}:\\n${failure.stack}`)\n if (failure.installPath !== '') parts.push(`${copy.failurePathLabel}: ${failure.installPath}`)\n parts.push(copy.failureAsk)\n return parts.join('\\n\\n')\n}\n\n/**\n * Seed text for one install-conflict notice: the entry and its state change,\n * so the agent can attribute the conflict and resolve the double mount.\n * @param change - the conflict change (id, display name, from/to states).\n * @param copy - localized fragments.\n * @returns the repair prompt text.\n */\nexport function conflictRepairMessage(\n change: { id: string; name: string; from: LayerState; to: LayerState },\n copy: RepairCopy = DEFAULT_REPAIR_COPY,\n): string {\n return [\n copy.conflictTitle,\n `${copy.conflictPluginLabel}: ${change.name} (${change.id})`,\n `${copy.conflictChangeLabel}: ${copy.stateNames[change.from] ?? change.from} -> ${copy.stateNames[change.to] ?? change.to}`,\n copy.conflictAsk,\n ].join('\\n\\n')\n}\n","/**\n * DSH host version parsing and comparison for the update compatibility\n * check. The declared minimum lives in the published package manifest under\n * `dsh.engines.dsh`, falling back to the top-level `engines.dsh`; the only\n * supported form is `>=X.Y.Z[-prerelease]`.\n *\n * Comparison deliberately uses plain semver ordering instead of\n * `semver.satisfies`: npm's prerelease rule only allows a prerelease version\n * to satisfy a comparator set carrying a prerelease on the same\n * major.minor.patch tuple, which would reject a newer host line (0.1.1-rc.2)\n * against a declared `>=0.1.0-rc.8` — exactly the cross-cohort upgrade path\n * this check must allow. Everything here is pure and tolerant of untrusted\n * input: a malformed value means \"cannot verify\", which the callers treat as\n * a fail-closed verdict when a requirement was declared (issue #754).\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\n/** One parsed DSH host or package version. */\nexport interface DshVersion {\n major: number\n minor: number\n patch: number\n /** Prerelease identifiers, numeric identifiers kept as numbers (semver order). */\n prerelease: readonly (number | string)[]\n}\n\nconst VERSION_PATTERN = /^v?(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?$/\n\n/**\n * Parse a DSH host or package version string.\n * @param value - e.g. `0.1.0-rc.8`, `v1.2.3`.\n * @returns the parsed version, or undefined when malformed.\n */\nexport function parseDshVersion(value: string): DshVersion | undefined {\n const match = VERSION_PATTERN.exec(value.trim())\n if (match === null) return undefined\n const prereleaseParts = match[4] === undefined ? [] : match[4].split('.')\n if (prereleaseParts.some(part => part === '')) return undefined\n return {\n major: Number(match[1]),\n minor: Number(match[2]),\n patch: Number(match[3]),\n prerelease: prereleaseParts.map(part => /^\\d+$/.test(part) ? Number(part) : part),\n }\n}\n\n/**\n * Compare two version strings by semver order (a release is newer than any\n * prerelease of the same tuple).\n * @returns -1 / 0 / 1, or undefined when either side is malformed.\n */\nexport function compareVersions(left: string, right: string): number | undefined {\n const a = parseDshVersion(left)\n const b = parseDshVersion(right)\n if (a === undefined || b === undefined) return undefined\n for (const key of ['major', 'minor', 'patch'] as const) {\n if (a[key] !== b[key]) return a[key] < b[key] ? -1 : 1\n }\n return comparePrerelease(a.prerelease, b.prerelease)\n}\n\n/**\n * Semver prerelease ordering: numeric identifiers compare numerically,\n * numeric identifiers rank below alphanumeric ones, alphanumeric identifiers\n * compare lexically, and a longer list wins when the shared prefix is equal.\n */\nfunction comparePrerelease(left: readonly (number | string)[], right: readonly (number | string)[]): number {\n if (left.length === 0 && right.length === 0) return 0\n if (left.length === 0) return 1\n if (right.length === 0) return -1\n const length = Math.max(left.length, right.length)\n for (let index = 0; index < length; index += 1) {\n const a = left[index]\n const b = right[index]\n if (a === undefined) return -1\n if (b === undefined) return 1\n if (typeof a === 'number' && typeof b === 'number') {\n if (a !== b) return a < b ? -1 : 1\n } else if (typeof a === 'number') {\n return -1\n } else if (typeof b === 'number') {\n return 1\n } else if (a !== b) {\n return a < b ? -1 : 1\n }\n }\n return 0\n}\n\nconst MINIMUM_RANGE_PATTERN = /^>=\\s*(v?\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?)$/\n\n/**\n * Whether a host version satisfies a declared `>=X.Y.Z[-prerelease]` minimum.\n * @param host - the running DSH host version.\n * @param minimum - the declared minimum; any form other than `>=<semver>`\n * (plain semver, `^`, `~`, multi-comparator ranges, empty) returns undefined.\n * @returns true / false, or undefined when the host version is malformed or\n * the minimum uses an unsupported form — callers treat undefined as\n * \"cannot verify\" and fail closed for declared requirements.\n */\nexport function meetsMinimumDsh(host: string, minimum: string): boolean | undefined {\n const match = MINIMUM_RANGE_PATTERN.exec(minimum.trim())\n if (match === null) return undefined\n const compared = compareVersions(host, match[1])\n if (compared === undefined) return undefined\n return compared >= 0\n}\n\n/**\n * The bare minimum version for display: strips the `>=` operator (and an\n * optional leading `v`) from a declared requirement so UI copy that already\n * contains the comparison operator renders `0.1.1-rc.1` instead of\n * `>= >=0.1.1-rc.1`. Unsupported range forms render unchanged.\n * @param minimum - the declared minimum range.\n * @returns the version portion for display.\n */\nexport function displayMinimumVersion(minimum: string): string {\n const match = MINIMUM_RANGE_PATTERN.exec(minimum.trim())\n return match === null ? minimum.trim() : match[1].replace(/^v/, '')\n}\n\n/**\n * Read the declared DSH minimum from a published registry manifest:\n * `dsh.engines.dsh` first, top-level `engines.dsh` as the fallback.\n * Defensive against malformed or untrusted metadata: anything that is not a\n * non-empty string reads as absent.\n * @param manifest - the decoded registry version manifest.\n * @returns the declared minimum, or undefined when not declared.\n */\nexport function dshRequirementOf(manifest: { dsh?: unknown; engines?: unknown }): string | undefined {\n const dshEngines = (manifest.dsh as { engines?: unknown } | undefined)?.engines as { dsh?: unknown } | undefined\n const engines = (manifest.engines as { dsh?: unknown } | undefined)?.dsh\n const value = dshEngines?.dsh ?? engines\n return typeof value === 'string' && value.trim() !== '' ? value.trim() : undefined\n}\n","/**\n * The plugin-manager tab: an install box, one row per installed user plugin\n * (next-start enablement switch, source badge, update availability, update and\n * uninstall actions, per-plugin boot-failure block), the built-in product\n * switches, an install-conflict notice (the diff of the plugin-control\n * snapshot around each install, reversible through the product switch), and\n * the failure-repair affordances. Enablement switches and installs persist\n * through the official host channels and apply at the next restart; the web\n * build shows a restart hint instead of an in-place restart.\n *\n * This tab registers into the official Plugins settings section\n * (`settings.plugins.tab` slot) next to the official installer tab; its added\n * value over that tab is the conflict ledger, the bilingual repair seeds, and\n * the family card vocabulary.\n */\nimport { useEffect, useRef, useState } from 'react'\nimport { Button, Modal } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { classifyChange, diffControls, type ControlChange } from '../core/conflict.ts'\nimport type {\n InstallProgressItem,\n InstalledPluginItem,\n PluginControlItem,\n PluginFailureItem,\n PluginFailuresSnapshot,\n PluginUpdateItem,\n} from '../core/protocol.ts'\nimport { conflictRepairMessage, failureRepairMessage, installRepairMessage, type RepairCopy } from '../core/repair.ts'\nimport { displayMinimumVersion } from '../core/version.ts'\nimport css from './plugin-manager.module.css'\n\n/** Registration-side wire face used by the tab. */\nexport interface PluginManagerTabInjected {\n /** Whether this browser has loopback authority to use the host routes. */\n isLoopback: boolean\n /** Read the installed snapshot. */\n list: () => Promise<InstalledPluginItem[]>\n /** Install one plugin from an npm spec or git URL. */\n install: (spec: string) => Promise<InstalledPluginItem>\n /** Re-install one plugin from its recorded source. */\n update: (id: string) => Promise<InstalledPluginItem>\n /** Remove one plugin. */\n uninstall: (id: string) => Promise<InstalledPluginItem[]>\n /** Persist one user plugin's next-start enablement. */\n setEnabled: (id: string, enabled: boolean) => Promise<InstalledPluginItem>\n /** Compare installed versions against their sources. */\n checkUpdates: () => Promise<PluginUpdateItem[]>\n /** Read the current install/update progress. */\n status: () => Promise<InstallProgressItem>\n /** Read the recorded boot failures, plugin root, and safe-mode state. */\n failures: () => Promise<PluginFailuresSnapshot>\n /** Persist the safe-mode marker (web: applied at the next manual restart). */\n setSafeMode: (enabled: boolean) => Promise<void>\n /** Start a repair conversation over the plugin install root. */\n repairPlugin: (pluginRoot: string, message: string) => Promise<void>\n /** Read the deployment-configured built-in product switches. */\n controlsList: () => Promise<PluginControlItem[]>\n /** Persist one product's next-start enablement. */\n controlsSetEnabled: (pluginId: string, enabled: boolean) => Promise<PluginControlItem[]>\n /** Conflicts the gateway host computed around the last install (gateway mode only). */\n lastInstallConflicts?: () => readonly ControlChange[]\n}\n\n/** Full component props assembled by the Settings slot renderer. */\nexport type PluginManagerTabProps =\n PropsRuntime<'settings.plugins.tab'>\n & PropsLocale<'settings.pluginManager'>\n & InjectFace<PluginManagerTabInjected>\n\ntype ViewState =\n | { readonly status: 'loading' }\n | { readonly status: 'error' }\n | {\n readonly status: 'ready'\n readonly plugins: readonly InstalledPluginItem[]\n readonly controls: readonly PluginControlItem[]\n readonly failures: PluginFailuresSnapshot\n }\n\n/** One row operation in flight. */\ntype BusyAction = { readonly kind: 'install' | 'update' | 'uninstall' | 'check'; readonly id?: string }\n\n/** One enablement switch in flight: a user plugin or a built-in product. */\ntype ToggleBusy = { readonly kind: 'user' | 'product'; readonly id: string }\n\n/** One uninstall target awaiting confirmation. */\ninterface UninstallTarget {\n readonly id: string\n readonly name: string\n}\n\n/** Error text for a caught request or lifecycle failure. */\nfunction messageOf(error: unknown): string {\n if (error instanceof AggregateError) {\n const details = error.errors.map(messageOf).join('; ')\n return details === '' ? error.message : `${error.message}: ${details}`\n }\n return error instanceof Error ? error.message : String(error)\n}\n\n/** Localized fragments for the repair seed builders, read from the tab's dictionaries. */\nfunction repairCopy(t: PluginManagerTabProps['t']): RepairCopy {\n return {\n installTitle: t('repairInstallTitle'),\n installSpecLabel: t('repairInstallSpecLabel'),\n installErrorLabel: t('repairInstallErrorLabel'),\n installAsk: t('repairInstallAsk'),\n failureTitle: t('repairFailureTitle'),\n failurePluginLabel: t('repairFailurePluginLabel'),\n failureKindLabel: t('repairFailureKindLabel'),\n failureAtLabel: t('repairFailureAtLabel'),\n failureMessageLabel: t('repairFailureMessageLabel'),\n failureStackLabel: t('repairFailureStackLabel'),\n failurePathLabel: t('repairFailurePathLabel'),\n failureAsk: t('repairFailureAsk'),\n kindNames: {\n 'load-failure': t('repairKindLoad'),\n hang: t('repairKindHang'),\n 'late-rejection': t('repairKindLate'),\n },\n conflictTitle: t('repairConflictTitle'),\n conflictPluginLabel: t('repairConflictPluginLabel'),\n conflictChangeLabel: t('repairConflictChangeLabel'),\n conflictAsk: t('repairConflictAsk'),\n stateNames: {\n enabled: t('repairStateEnabled'),\n disabled: t('repairStateDisabled'),\n uninstalled: t('repairStateUninstalled'),\n },\n }\n}\n\n/** Localized label for one install phase, with percent when the download has one. */\nfunction progressLabel(progress: InstallProgressItem, t: PluginManagerTabProps['t']): string {\n if (progress.stage === 'fetch') return t('fetching')\n if (progress.stage === 'extract') return t('extracting')\n if (progress.stage === 'write') return t('writing')\n return progress.percent === undefined ? t('downloading') : t('downloadingPercent', { percent: String(progress.percent) })\n}\n\n/** The plugin-manager settings tab. */\nexport function PluginManagerTab(props: PluginManagerTabProps) {\n const {\n t,\n isLoopback,\n list,\n install,\n update,\n uninstall,\n setEnabled,\n checkUpdates,\n status,\n failures,\n setSafeMode,\n repairPlugin,\n controlsList,\n controlsSetEnabled,\n lastInstallConflicts,\n } = props\n\n const [view, setView] = useState<ViewState>({ status: 'loading' })\n const [busy, setBusy] = useState<BusyAction | undefined>(undefined)\n const [toggleBusy, setToggleBusy] = useState<ToggleBusy | undefined>(undefined)\n const [error, setError] = useState<string | undefined>(undefined)\n const [failedSpec, setFailedSpec] = useState<string | undefined>(undefined)\n const [installError, setInstallError] = useState<string | undefined>(undefined)\n const [spec, setSpec] = useState('')\n const [dirty, setDirty] = useState(false)\n const [repairing, setRepairing] = useState<string | undefined>(undefined)\n const [copied, setCopied] = useState<string | undefined>(undefined)\n const [updates, setUpdates] = useState<ReadonlyMap<string, PluginUpdateItem>>(new Map())\n const [uninstallTarget, setUninstallTarget] = useState<UninstallTarget | undefined>(undefined)\n const [conflicts, setConflicts] = useState<readonly ControlChange[]>([])\n const [progress, setProgress] = useState<InstallProgressItem>({ kind: 'idle', stage: 'fetch' })\n /** Parent rows whose aggregate child list is expanded; collapsed by default. */\n const [expandedChildren, setExpandedChildren] = useState<ReadonlySet<string>>(() => new Set())\n /** Synchronous in-flight mirror of `busy`: the render-time guard alone lets a\n * click and an Enter land in the same frame and double-fire. */\n const busyRef = useRef(false)\n\n /** Reload every snapshot into the ready view. */\n const reload = async (): Promise<void> => {\n const [plugins, controls, failureSnapshot] = await Promise.all([list(), controlsList(), failures()])\n setView({ status: 'ready', plugins, controls, failures: failureSnapshot })\n }\n\n useEffect(() => {\n let cancelled = false\n void reload().catch(() => {\n if (!cancelled) setView({ status: 'error' })\n })\n return () => { cancelled = true }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n /** One row/form operation: busy state, error row, dirty flag on success. */\n const run = async (action: BusyAction, body: () => Promise<void>): Promise<void> => {\n if (busyRef.current) return\n busyRef.current = true\n setBusy(action)\n setError(undefined)\n try {\n await body()\n setDirty(true)\n } catch (reason) {\n setError(t('failed', { reason: messageOf(reason) }))\n } finally {\n busyRef.current = false\n setBusy(undefined)\n }\n }\n\n /** Install one spec, then diff the product snapshot into a conflict notice. */\n const onInstall = (): void => {\n const target = spec.trim()\n if (target === '' || busy !== undefined || busyRef.current) return\n void (async () => {\n busyRef.current = true\n const before = view.status === 'ready' ? view.controls : await controlsList().catch(() => [])\n setBusy({ kind: 'install' })\n setError(undefined)\n setFailedSpec(undefined)\n setInstallError(undefined)\n try {\n await install(target)\n setSpec('')\n setDirty(true)\n const after = await controlsList().catch(() => [] as readonly PluginControlItem[])\n setConflicts(lastInstallConflicts !== undefined ? lastInstallConflicts() : diffControls(before, after))\n await reload()\n } catch (reason) {\n const reasonText = messageOf(reason)\n setFailedSpec(target)\n setInstallError(reasonText)\n setError(t('failed', { reason: reasonText }))\n } finally {\n busyRef.current = false\n setBusy(undefined)\n }\n })()\n }\n\n /** Poll install/update progress while such an operation is in flight. */\n useEffect(() => {\n if (busy === undefined || (busy.kind !== 'install' && busy.kind !== 'update')) {\n setProgress({ kind: 'idle', stage: 'fetch' })\n return\n }\n let stopped = false\n let timer: ReturnType<typeof setTimeout> | undefined\n const tick = (delay: number): void => {\n timer = setTimeout(() => {\n void status().then(next => {\n if (!stopped && next !== undefined) {\n setProgress(next)\n tick(400)\n }\n }).catch(() => { /* status polling fails silently; the operation itself owns the error row */ })\n }, delay)\n }\n tick(100)\n return () => {\n stopped = true\n if (timer !== undefined) clearTimeout(timer)\n }\n }, [busy, status])\n\n const toggleDisabled = busy !== undefined || toggleBusy !== undefined\n || (view.status === 'ready' && view.failures.safeMode)\n\n /** Expand or collapse one aggregate row's child list (pure view state). */\n const toggleChildren = (id: string): void => {\n setExpandedChildren(current => {\n const next = new Set(current)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n return next\n })\n }\n\n const onUserToggle = (id: string, enabled: boolean): void => {\n setToggleBusy({ kind: 'user', id })\n setError(undefined)\n void setEnabled(id, enabled).then(plugin => {\n // Match by the RETURNED row id: a child-row toggle (id = entry id such\n // as web-ui-pet) answers with its owning package row, which carries the\n // refreshed children states.\n setView(current => current.status === 'ready'\n ? { ...current, plugins: current.plugins.map(item => item.id === plugin.id ? plugin : item) }\n : current)\n setDirty(true)\n setToggleBusy(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setToggleBusy(undefined)\n })\n }\n\n const onProductToggle = (id: string, enabled: boolean): void => {\n setToggleBusy({ kind: 'product', id })\n setError(undefined)\n void controlsSetEnabled(id, enabled).then(controls => {\n setView(current => current.status === 'ready' ? { ...current, controls } : current)\n setConflicts(previous => previous.filter(change => change.id !== id))\n setDirty(true)\n setToggleBusy(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setToggleBusy(undefined)\n })\n }\n\n const onCheck = (): void => {\n void run({ kind: 'check' }, async () => {\n const found = await checkUpdates()\n setUpdates(new Map(found.map(item => [item.id, item])))\n })\n }\n\n const onUpdate = (id: string): void => {\n void run({ kind: 'update', id }, async () => {\n await update(id)\n setUpdates(previous => {\n const next = new Map(previous)\n next.delete(id)\n return next\n })\n await reload()\n })\n }\n\n const onUninstall = (): void => {\n const target = uninstallTarget\n if (target === undefined) return\n void run({ kind: 'uninstall', id: target.id }, async () => {\n await uninstall(target.id)\n setUninstallTarget(undefined)\n await reload()\n })\n }\n\n /** Open a repair conversation seeded with one boot-failure record. `token`\n * identifies the row for the in-flight label (plugin id, or a row key for\n * unattributable failures). */\n const onRepair = (failure: PluginFailureItem, token: string): void => {\n if (view.status !== 'ready' || busy !== undefined || repairing !== undefined) return\n setError(undefined)\n setRepairing(token)\n void repairPlugin(view.failures.pluginRoot, failureRepairMessage(failure, repairCopy(t))).then(() => {\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n /** Hand the latest failed install off to a repair conversation over the\n * install root. The seed carries the install's own error (installError), not\n * whatever error the row currently shows. */\n const onRepairInstall = (): void => {\n if (view.status !== 'ready' || repairing !== undefined) return\n setError(undefined)\n setRepairing('install')\n void repairPlugin(view.failures.pluginRoot, installRepairMessage(failedSpec ?? '', installError ?? '', repairCopy(t))).then(() => {\n setError(undefined)\n setFailedSpec(undefined)\n setInstallError(undefined)\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n /** Copy a boot failure's message and stack for a manual repair conversation. */\n const onCopy = (failure: PluginFailureItem, token: string): void => {\n void navigator.clipboard.writeText(`${failure.message}\\n\\n${failure.stack}`).then(() => {\n setCopied(token)\n }).catch(() => {\n setError(t('failed', { reason: 'clipboard unavailable' }))\n })\n }\n\n const onExitSafeMode = (): void => {\n if (busy !== undefined) return\n setError(undefined)\n void setSafeMode(false).then(() => {\n setDirty(true)\n void reload().catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n })\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n })\n }\n\n /** Undo one conflict action by flipping the product switch back. */\n const onUndoConflict = (change: ControlChange): void => {\n if (change.to !== 'disabled') return\n onProductToggle(change.id, true)\n }\n\n /** Hand one conflict notice off to a repair conversation over the plugin root. */\n const onRepairConflict = (change: ControlChange): void => {\n if (view.status !== 'ready' || busy !== undefined || repairing !== undefined) return\n setError(undefined)\n const token = `conflict:${change.id}`\n setRepairing(token)\n void repairPlugin(view.failures.pluginRoot, conflictRepairMessage({\n id: change.id,\n name: change.name,\n from: change.from === 'enabled' || change.from === 'disabled' ? change.from : 'uninstalled',\n to: change.to === 'enabled' || change.to === 'disabled' ? change.to : 'uninstalled',\n }, repairCopy(t))).then(() => {\n setRepairing(undefined)\n }).catch(reason => {\n setError(t('failed', { reason: messageOf(reason) }))\n setRepairing(undefined)\n })\n }\n\n if (!isLoopback) {\n return (\n <div className={css.notice}>\n <strong>{t('localOnlyTitle')}</strong>\n <p>{t('localOnlyBody')}</p>\n </div>\n )\n }\n if (view.status === 'loading') return <div className={css.state}>{t('loading')}</div>\n if (view.status === 'error') return <div className={css.state}>{t('failed', { reason: 'load' })}</div>\n\n const attributable = new Map(view.failures.items.filter(item => item.pluginId !== '').map(item => [item.pluginId, item]))\n const unattributable = view.failures.items.filter(item => item.pluginId === '')\n\n return (\n <div className={css.section} aria-busy={busy !== undefined || toggleBusy !== undefined}>\n {view.failures.safeMode && (\n <div className={css.safeModeBanner} data-safe-mode>\n <p>{t('safeModeBanner')}</p>\n <Button variant=\"primary\" disabled={busy !== undefined} onClick={onExitSafeMode}>\n {t('exitSafeMode')}\n </Button>\n </div>\n )}\n\n <div className={css.installRow}>\n <input\n className={css.spec}\n type=\"text\"\n value={spec}\n placeholder={t('installPlaceholder')}\n disabled={busy !== undefined}\n onChange={event => { setSpec(event.target.value) }}\n onKeyDown={event => {\n if (event.key === 'Enter' && spec.trim() !== '' && busy === undefined) onInstall()\n }}\n />\n <Button\n variant=\"primary\"\n disabled={spec.trim() === '' || busy !== undefined}\n onClick={onInstall}\n >\n {busy !== undefined && busy.kind === 'install' ? t('installing') : t('install')}\n </Button>\n </div>\n <p className={css.hint}>{t('installHint')}</p>\n\n {(busy?.kind === 'install' || busy?.kind === 'update') && (\n <div className={css.progressRow} role=\"status\">\n <div className={css.progressTrack}>\n <div\n className={css.progressBar}\n style={progress.percent === undefined ? undefined : { width: `${progress.percent}%` }}\n data-indeterminate={progress.percent === undefined ? 'true' : undefined}\n />\n </div>\n <p className={css.progressLabel}>{progressLabel(progress, t)}</p>\n </div>\n )}\n\n {error !== undefined && (\n <div className={css.errorRow}>\n <span className={css.error}>{error}</span>\n {failedSpec !== undefined && (\n <Button variant=\"outline\" disabled={repairing !== undefined} onClick={onRepairInstall}>\n {repairing === 'install' ? t('repairing') : t('repair')}\n </Button>\n )}\n </div>\n )}\n\n {conflicts.length > 0 && (\n <div className={css.conflicts}>\n <h3 className={css.sectionTitle}>{t('conflictTitle')}</h3>\n <ul className={css.list}>\n {conflicts.map(change => (\n <li key={change.id} className={css.row} data-conflict={change.id}>\n <div className={css.meta}>\n <span className={css.name}>{change.name}</span>\n <span className={css.sub}>\n {classifyChange(change) === 'rule-disabled'\n ? t('conflictDisabled', { name: change.name })\n : classifyChange(change) === 'rule-enabled'\n ? t('conflictEnabled', { name: change.name })\n : t('conflictChanged', { name: change.name })}\n </span>\n </div>\n <div className={css.actions}>\n {change.to === 'disabled' && (\n <Button\n variant=\"outline\"\n disabled={toggleDisabled}\n onClick={() => { onUndoConflict(change) }}\n >\n {t('undoConflict')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepairConflict(change) }}\n >\n {repairing === `conflict:${change.id}` ? t('repairing') : t('repair')}\n </Button>\n </div>\n </li>\n ))}\n </ul>\n <p className={css.hint}>{t('conflictHint')}</p>\n </div>\n )}\n\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('userPlugins')}</h3>\n {view.plugins.length === 0\n ? <p className={css.empty}>{t('empty')}</p>\n : (\n <ul className={css.list}>\n {view.plugins.map(plugin => {\n const updateItem = updates.get(plugin.id)\n const latest = updateItem?.latest\n const dshRequirement = updateItem?.requiresDsh\n const failure = attributable.get(plugin.id)\n const children = plugin.children\n const mixed = children !== undefined && !plugin.enabled && children.some(child => child.enabled)\n return (\n <li key={plugin.id} data-plugin-id={plugin.id}>\n <div className={css.row}>\n <div className={css.meta}>\n <span className={css.name}>{plugin.name}</span>\n <span className={css.sub}>\n <span className={css.version}>{t('version', { version: plugin.version })}</span>\n <span className={css.sourceBadge} data-source={plugin.source.kind}>\n {plugin.source.kind === 'npm' ? t('npmSource') : t('gitSource')}\n </span>\n <span className={css.specText} title={plugin.source.spec}>{plugin.source.spec}</span>\n </span>\n {latest !== undefined && <span className={css.latest}>{t('latest', { version: latest })}</span>}\n {updateItem !== undefined && dshRequirement !== undefined && (\n <span className={updateItem.compatible === false ? css.compatBlocked : css.compatHint}>\n {updateItem.compatible === false\n ? t('updateBlockedDsh', { min: displayMinimumVersion(dshRequirement) })\n : t('updateRequiresDsh', { min: displayMinimumVersion(dshRequirement) })}\n </span>\n )}\n {failure !== undefined && (\n <div className={css.failure} data-plugin-failure={plugin.id}>\n <span className={css.badge}>{t('failureBadge')}</span>\n <span className={css.failureMessage} title={failure.message}>{failure.message}</span>\n <div className={css.failureActions}>\n <Button\n variant=\"primary\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepair(failure, plugin.id) }}\n >\n {repairing === plugin.id ? t('repairing') : t('repair')}\n </Button>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { onCopy(failure, plugin.id) }}>\n {copied === plugin.id ? t('copied') : t('copyError')}\n </Button>\n </div>\n </div>\n )}\n </div>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={plugin.enabled ? 'enabled' : mixed ? 'mixed' : 'disabled'}>\n {plugin.enabled ? t('enabled') : mixed ? t('mixed') : t('disabled')}\n </span>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={plugin.enabled}\n aria-label={plugin.enabled ? t('disableSwitch', { name: plugin.name }) : t('enableSwitch', { name: plugin.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onUserToggle(plugin.id, !plugin.enabled) }}\n />\n {latest !== undefined && (\n <Button\n variant=\"outline\"\n disabled={busy !== undefined || updateItem?.compatible === false}\n onClick={() => { onUpdate(plugin.id) }}\n >\n {busy?.kind === 'update' && busy.id === plugin.id ? t('updating') : t('update')}\n </Button>\n )}\n <Button\n variant=\"outline\"\n disabled={busy !== undefined}\n onClick={() => { setUninstallTarget({ id: plugin.id, name: plugin.name }) }}\n >\n {t('uninstall')}\n </Button>\n </div>\n </div>\n {children !== undefined && children.length > 0 && (() => {\n // Default-collapsed child list: an aggregate such as\n // @linxin666/dsh-web-all expands to 20+ rows that would\n // otherwise push the whole settings page down.\n const listId = 'pm-children-' + plugin.id.replace(/[^a-zA-Z0-9_-]/g, '-')\n const expanded = expandedChildren.has(plugin.id)\n const enabledCount = children.filter(child => child.enabled).length\n return (\n <>\n <button\n type=\"button\"\n className={css.childrenToggle}\n aria-expanded={expanded}\n aria-controls={listId}\n aria-label={expanded\n ? t('childrenHide', { name: plugin.name })\n : t('childrenShow', { name: plugin.name })}\n onClick={() => { toggleChildren(plugin.id) }}\n >\n <span className={css.chevron} data-expanded={expanded} aria-hidden=\"true\" />\n <span className={css.childrenSummary}>\n {t('childrenSummary', { enabled: enabledCount, total: children.length })}\n </span>\n </button>\n {expanded && (\n <>\n <ul id={listId} className={css.childList}>\n {children.map(child => (\n <li key={child.id} className={css.childRow} data-plugin-row={child.id}>\n <span className={css.childName} title={child.id}>{child.name}</span>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={child.enabled ? 'enabled' : 'disabled'}>\n {child.enabled ? t('enabled') : t('disabled')}\n </span>\n {child.locked === true\n ? <span className={css.lockedHint}>{t('lockedRowHint')}</span>\n : (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={child.enabled}\n aria-label={child.enabled ? t('disableSwitch', { name: child.name }) : t('enableSwitch', { name: child.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onUserToggle(child.id, !child.enabled) }}\n />\n )}\n </div>\n </li>\n ))}\n </ul>\n <p className={css.hint}>{t('childrenHint')}</p>\n </>\n )}\n </>\n )\n })()}\n </li>\n )\n })}\n </ul>\n )}\n </div>\n\n {view.controls.length > 0 && (\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('products')}</h3>\n <ul className={css.list}>\n {view.controls.map(control => (\n <li key={control.id} className={css.row} data-product-id={control.id}>\n <div className={css.meta}>\n <span className={css.name}>{control.name}</span>\n <span className={css.sub}>\n <a className={css.link} href={control.repository} target=\"_blank\" rel=\"noreferrer\">{t('source')}</a>\n </span>\n </div>\n <div className={css.actions}>\n <span className={css.stateLabel} data-state={control.state}>\n {t(control.state)}\n </span>\n {control.state === 'enabled' || control.state === 'disabled'\n ? (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={control.state === 'enabled'}\n aria-label={control.state === 'enabled'\n ? t('disableSwitch', { name: control.name })\n : t('enableSwitch', { name: control.name })}\n className={css.switch}\n disabled={toggleDisabled}\n onClick={() => { onProductToggle(control.id, control.state !== 'enabled') }}\n />\n )\n : null}\n </div>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {unattributable.length > 0 && (\n <div className={css.group}>\n <h3 className={css.sectionTitle}>{t('failureGroupTitle')}</h3>\n <ul className={css.list}>\n {unattributable.map((failure, index) => {\n const token = `other:${index}`\n return (\n <li key={`${failure.at}-${index}`} className={css.row} data-plugin-failure=\"other\">\n <div className={css.meta}>\n <span className={css.badge}>{t('failureBadge')}</span>\n <span className={css.failureMessage} title={failure.message}>{failure.message}</span>\n <div className={css.failureActions}>\n <Button\n variant=\"primary\"\n disabled={busy !== undefined || repairing !== undefined}\n onClick={() => { onRepair(failure, token) }}\n >\n {repairing === token ? t('repairing') : t('repair')}\n </Button>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { onCopy(failure, token) }}>\n {copied === token ? t('copied') : t('copyError')}\n </Button>\n </div>\n </div>\n </li>\n )\n })}\n </ul>\n </div>\n )}\n\n <div className={css.actionsRow}>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={onCheck}>\n {busy?.kind === 'check' ? t('checking') : t('checkUpdates')}\n </Button>\n {updates.size === 0 && busy === undefined && view.plugins.length > 0 && (\n <p className={css.ok}>{t('noUpdates')}</p>\n )}\n </div>\n\n {toggleBusy !== undefined && <p className={css.applying} aria-live=\"polite\">{t('applying')}</p>}\n\n {dirty && (\n <div className={css.restartRow}>\n <p>{t('restartHint')}</p>\n </div>\n )}\n\n <Modal\n title={t('uninstallConfirmTitle')}\n open={uninstallTarget !== undefined}\n onClose={() => { setUninstallTarget(undefined) }}\n closeLabel={t('cancel')}\n >\n <p className={css.confirmBody}>{t('uninstallConfirmBody', { name: uninstallTarget?.name ?? '' })}</p>\n <div className={css.modalActions}>\n <Button variant=\"outline\" disabled={busy !== undefined} onClick={() => { setUninstallTarget(undefined) }}>\n {t('cancel')}\n </Button>\n <Button variant=\"primary\" className={css.dangerButton} disabled={busy !== undefined} onClick={onUninstall}>\n {t('confirm')}\n </Button>\n </div>\n </Modal>\n </div>\n )\n}\n","/**\n * Locale dictionaries for the plugin-manager tab. The zh dictionary is the\n * key source; the en dictionary mirrors the exact key set.\n * @module @linxin666/dsh-client-ui-plugin-manager/client\n */\n\n/** Simplified Chinese copy (the key-set source of truth). */\nconst STATIC_ZH = {\n tab: '插件管理',\n loading: '正在读取插件…',\n empty: '尚未安装任何用户插件。',\n userPlugins: '用户插件',\n products: '内置产品',\n conflictTitle: '安装冲突',\n conflictDisabled: '已自动禁用 {name},避免重复挂载。',\n conflictEnabled: '已重新启用 {name}。',\n conflictChanged: '{name} 的状态已变更。',\n undoConflict: '撤销',\n conflictHint: '冲突动作在安装时自动执行,撤销会写回开关并在重启后生效。',\n installPlaceholder: 'npm 包名(如 @scope/name)或 git 仓库 URL',\n install: '安装',\n installing: '安装中…',\n installHint: '在 GitHub 或 npm 找到插件后,粘贴其 npm 包名或仓库地址安装;应用重启后插件生效。',\n version: '已安装 {version}',\n latest: '最新 {version}',\n update: '更新',\n updating: '更新中…',\n checkUpdates: '检查更新',\n checking: '检查中…',\n noUpdates: '所有插件都是最新版本。',\n updateRequiresDsh: '需要 DSH ≥ {min}',\n updateBlockedDsh: '需要 DSH ≥ {min},请先升级 DSH 再更新',\n uninstall: '卸载',\n uninstallConfirmTitle: '卸载插件',\n uninstallConfirmBody: '将删除 {name} 的安装目录与配置行,并在重启后生效。',\n confirm: '确认卸载',\n cancel: '取消',\n restartHint: '插件变更将在重启应用后生效。',\n failed: '操作失败:{reason}',\n enabled: '已开启',\n disabled: '已关闭',\n mixed: '部分开启',\n unavailable: '不可用',\n uninstalled: '已卸载',\n source: '查看源码',\n applying: '正在应用更改…',\n fetching: '正在获取插件信息…',\n downloading: '正在下载…',\n downloadingPercent: '正在下载 {percent}%',\n extracting: '正在解压…',\n writing: '正在写入配置…',\n localOnlyTitle: '仅限本机操作',\n localOnlyBody: '为了保护主机配置,插件管理只能从本机打开。',\n failureBadge: '启动失败',\n failureGroupTitle: '其他启动失败',\n repair: '让 Agent 修复',\n repairing: '正在创建修复对话…',\n copyError: '复制错误',\n copied: '已复制',\n safeModeBanner: '安全模式:用户插件配置已跳过,插件开关不可用。',\n exitSafeMode: '恢复正常模式并重启',\n npmSource: 'npm',\n gitSource: 'git',\n enableSwitch: '开启 {name}',\n disableSwitch: '关闭 {name}',\n lockedRowHint: '核心行',\n childrenHint: '全家桶子插件可单独启停;停用后不再加载,代码仍随全家桶更新。',\n childrenSummary: '子插件 {enabled}/{total} 已启用',\n childrenShow: '展开 {name} 的子插件',\n childrenHide: '收起 {name} 的子插件',\n repairInstallTitle: '插件安装失败,请帮我诊断并修复。',\n repairInstallSpecLabel: '安装目标',\n repairInstallErrorLabel: '错误信息',\n repairInstallAsk: '请检查该插件并重新安装;完成后告诉我结果。',\n repairFailureTitle: '插件上次启动失败。请修复它。',\n repairFailurePluginLabel: '插件',\n repairFailureKindLabel: '失败类型',\n repairFailureAtLabel: '时间',\n repairFailureMessageLabel: '失败详情',\n repairFailureStackLabel: '原始堆栈',\n repairFailurePathLabel: '插件安装目录',\n repairFailureAsk: '请检查并修复该插件;修复完成后告诉我如何重新启用。',\n repairKindLoad: '加载失败',\n repairKindHang: '启动挂起',\n repairKindLate: '迟到拒绝',\n repairConflictTitle: '正在处理插件安装冲突',\n repairConflictPluginLabel: '冲突条目',\n repairConflictChangeLabel: '状态变化',\n repairConflictAsk: '请检查冲突双方的入口行 id 与挂载方式,消除重复挂载后告诉我如何重新启用。',\n repairStateEnabled: '已开启',\n repairStateDisabled: '已关闭',\n repairStateUninstalled: '已卸载',\n} satisfies Record<string, string>\n\n/** English copy, checked complete against the zh key set. */\nconst STATIC_EN = {\n tab: 'Plugin manager',\n loading: 'Reading plugins…',\n empty: 'No user plugins installed yet.',\n userPlugins: 'User plugins',\n products: 'Built-in products',\n conflictTitle: 'Install conflicts',\n conflictDisabled: 'Automatically disabled {name} to avoid double mounting.',\n conflictEnabled: 'Re-enabled {name}.',\n conflictChanged: 'The state of {name} changed.',\n undoConflict: 'Undo',\n conflictHint: 'Conflict actions run automatically at install time; undoing writes the switch back and applies after a restart.',\n installPlaceholder: 'npm package (e.g. @scope/name) or git repository URL',\n install: 'Install',\n installing: 'Installing…',\n installHint: 'Find a plugin on GitHub or npm, then paste its npm package name or repository URL; plugins load after a restart.',\n version: 'Installed {version}',\n latest: 'Latest {version}',\n update: 'Update',\n updating: 'Updating…',\n checkUpdates: 'Check for updates',\n checking: 'Checking…',\n noUpdates: 'All plugins are up to date.',\n updateRequiresDsh: 'Requires DSH >= {min}',\n updateBlockedDsh: 'Requires DSH >= {min}; upgrade DSH before updating',\n uninstall: 'Uninstall',\n uninstallConfirmTitle: 'Uninstall plugin',\n uninstallConfirmBody: '{name} and its configuration row will be removed; the change applies after a restart.',\n confirm: 'Uninstall',\n cancel: 'Cancel',\n restartHint: 'Plugin changes take effect after restarting the application.',\n failed: 'Operation failed: {reason}',\n enabled: 'On',\n disabled: 'Off',\n mixed: 'Partially on',\n unavailable: 'Unavailable',\n uninstalled: 'Uninstalled',\n source: 'View source',\n applying: 'Applying change…',\n fetching: 'Fetching plugin metadata…',\n downloading: 'Downloading…',\n downloadingPercent: 'Downloading {percent}%',\n extracting: 'Extracting…',\n writing: 'Writing configuration…',\n localOnlyTitle: 'Available on this computer only',\n localOnlyBody: 'To protect host configuration, plugin management is only available from a local browser.',\n failureBadge: 'Startup failure',\n failureGroupTitle: 'Other startup failures',\n repair: 'Ask the agent to fix',\n repairing: 'Opening repair conversation…',\n copyError: 'Copy error',\n copied: 'Copied',\n safeModeBanner: 'Safe mode: user plugin configuration is skipped; plugin switches are disabled.',\n exitSafeMode: 'Restore normal mode and restart',\n npmSource: 'npm',\n gitSource: 'git',\n enableSwitch: 'Turn on {name}',\n disableSwitch: 'Turn off {name}',\n lockedRowHint: 'Core row',\n childrenHint: 'Bundle child plugins toggle individually; a disabled child is never loaded, while its code still updates with the bundle.',\n childrenSummary: '{enabled}/{total} child plugins on',\n childrenShow: 'Show child plugins of {name}',\n childrenHide: 'Hide child plugins of {name}',\n repairInstallTitle: 'The plugin installation failed. Please diagnose and fix it.',\n repairInstallSpecLabel: 'Install target',\n repairInstallErrorLabel: 'Error message',\n repairInstallAsk: 'Please inspect the plugin and reinstall it; tell me when it is done.',\n repairFailureTitle: 'A plugin failed to start last time. Please fix it.',\n repairFailurePluginLabel: 'Plugin',\n repairFailureKindLabel: 'Failure kind',\n repairFailureAtLabel: 'At',\n repairFailureMessageLabel: 'Failure details',\n repairFailureStackLabel: 'Original stack',\n repairFailurePathLabel: 'Plugin install directory',\n repairFailureAsk: 'Please inspect and fix the plugin; tell me how to re-enable it afterwards.',\n repairKindLoad: 'Load failure',\n repairKindHang: 'Startup hang',\n repairKindLate: 'Late rejection',\n repairConflictTitle: 'Handling a plugin install conflict',\n repairConflictPluginLabel: 'Conflicting entry',\n repairConflictChangeLabel: 'State change',\n repairConflictAsk: 'Inspect the entry ids and mounting of both sides, resolve the double mount, and tell me how to re-enable.',\n repairStateEnabled: 'On',\n repairStateDisabled: 'Off',\n repairStateUninstalled: 'Uninstalled',\n} satisfies Record<keyof typeof STATIC_ZH, string>\n\nexport const zh = STATIC_ZH\nexport const en = STATIC_EN\nexport type PluginManagerKey = keyof typeof STATIC_ZH\n","/**\n * Wire parsing for the official plugin-installer / plugin-control RPC\n * channels. This package is a browser-side consumer of those channels: every\n * response is decoded but untrusted, so each parser validates the shape it\n * needs and throws a typed error on mismatch. Callers treat a parse failure\n * as \"channel unavailable or drifted\" and degrade to command hints.\n *\n * The shapes mirror the official web installer tab's wire protocol (see the\n * DSH checkout's packages/client/ui-settings-plugin-installer/src/client/\n * protocol.ts); they are a contract observation, not an import.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\n/** One loader entry row claimed by an installed bundle package (aggregate child). */\nexport interface InstalledPluginChild {\n /** The loader entry id, e.g. web-ui-pet. */\n id: string\n /** Display name: the real plugin package (shell config.plugin) when known. */\n name: string\n /** Effective next-start enablement of this row alone (bundle default plus user override). */\n enabled: boolean\n /** Rows the manager must never disable (the manager tab itself, the compat face). */\n locked?: boolean\n}\n\n/** One installed user-plugin row served by `/plugin-installer list`. */\nexport interface InstalledPluginItem {\n id: string\n name: string\n version: string\n source: { kind: 'npm' | 'git'; spec: string }\n installedAt: string\n /** Effective next-start enablement across the bundle's own rows and the managed profile patch row. */\n enabled: boolean\n commit?: string\n /**\n * Entry rows this package's bundle patch claims, present when the package\n * is an aggregate claiming more than one row (gateway mode only — the\n * official channel wire has no children). Child enablement is individually\n * switchable; uninstall stays whole-package (the code ships in one npm\n * package).\n */\n children?: InstalledPluginChild[]\n}\n\n/** Point-in-time install/update progress reported by the host. */\nexport interface InstallProgressItem {\n kind: 'idle' | 'install' | 'update'\n stage: 'fetch' | 'download' | 'extract' | 'write'\n percent?: number\n}\n\n/** Whether an update row is a normal same-name update or a legacy package migration. */\nexport type PluginUpdateKind = 'update' | 'migrate'\n\n/** One plugin with a newer version available. */\nexport interface PluginUpdateItem {\n id: string\n current: string\n latest: string\n /** Normal same-name update or legacy aggregate migration. Defaults to update. */\n kind?: PluginUpdateKind\n /** Target package name when kind is migrate. */\n target?: string\n /** Exact target package version when kind is migrate. */\n targetVersion?: string\n /** Declared DSH minimum the update needs (package manifest's `dsh.engines.dsh`). */\n requiresDsh?: string\n /** Whether the running DSH host satisfies requiresDsh; absent when unknown. */\n compatible?: boolean\n}\n\n/** One recorded plugin boot failure served by the host. */\nexport interface PluginFailureItem {\n /** Installed plugin id (package name); empty for unattributable failures. */\n pluginId: string\n kind: 'load-failure' | 'hang' | 'late-rejection'\n message: string\n stack: string\n installPath: string\n at: string\n}\n\n/** Recovery facts served by the host: the failure ring, the plugin root, and safe mode. */\nexport interface PluginFailuresSnapshot {\n items: PluginFailureItem[]\n /** Absolute plugin install root — the repair conversation's workspace. */\n pluginRoot: string\n /** Whether the host is running in safe mode (user plugins skipped). */\n safeMode: boolean\n}\n\n/** One deployment-configured logical product switch. */\nexport interface PluginControlItem {\n id: string\n name: string\n repository: string\n state: 'enabled' | 'disabled' | 'mixed' | 'unavailable' | 'uninstalled'\n}\n\n/** Whether a decoded value is a non-array object. */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\n/** Whether a decoded value is a string. */\nfunction isString(value: unknown): value is string {\n return typeof value === 'string'\n}\n\n/** Validate one aggregate child row. */\nfunction parsePluginChild(value: unknown, rowIndex: number, childIndex: number): InstalledPluginChild {\n if (!isRecord(value) || !isString(value.id) || !isString(value.name) || typeof value.enabled !== 'boolean') {\n throw new Error(`plugin-manager: plugin row ${String(rowIndex)} child ${String(childIndex)} is invalid`)\n }\n return {\n id: value.id,\n name: value.name,\n enabled: value.enabled,\n ...typeof value.locked === 'boolean' ? { locked: value.locked } : {},\n }\n}\n\n/** Validate one installed-plugin row. */\nfunction parsePlugin(value: unknown, index: number): InstalledPluginItem {\n if (!isRecord(value) || !isString(value.id) || !isString(value.name)\n || !isString(value.version) || !isString(value.installedAt)\n || typeof value.enabled !== 'boolean'\n || !isRecord(value.source) || (value.source.kind !== 'npm' && value.source.kind !== 'git')\n || !isString(value.source.spec)) {\n throw new Error(`plugin-manager: plugin row ${String(index)} is invalid`)\n }\n if (value.children !== undefined && !Array.isArray(value.children)) {\n throw new Error(`plugin-manager: plugin row ${String(index)} children is invalid`)\n }\n const children = (value.children as unknown[] | undefined)?.map((child, childIndex) => parsePluginChild(child, index, childIndex))\n return {\n id: value.id,\n name: value.name,\n version: value.version,\n source: { kind: value.source.kind, spec: value.source.spec },\n installedAt: value.installedAt,\n enabled: value.enabled,\n ...isString(value.commit) ? { commit: value.commit } : {},\n ...children !== undefined ? { children } : {},\n }\n}\n\n/**\n * Validate and normalize a `list` / `uninstall` response value.\n * @param value - decoded but untrusted response value.\n * @returns typed installed-plugin rows.\n */\nexport function parsePluginList(value: unknown): InstalledPluginItem[] {\n if (!isRecord(value) || !Array.isArray(value.plugins)) {\n throw new Error('plugin-manager: response must contain a plugins array')\n }\n return value.plugins.map((plugin, index) => parsePlugin(plugin, index))\n}\n\n/**\n * Validate and normalize an `install` / `update` / `set-enabled` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed installed-plugin row.\n */\nexport function parseInstalledPlugin(value: unknown): InstalledPluginItem {\n if (!isRecord(value) || value.plugin === undefined) {\n throw new Error('plugin-manager: response must contain a plugin row')\n }\n return parsePlugin(value.plugin, 0)\n}\n\n/**\n * Validate and normalize a plugin-control `list` / `set-enabled` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed control items.\n */\nexport function parsePluginControlSnapshot(value: unknown): PluginControlItem[] {\n if (!isRecord(value) || !Array.isArray(value.controls)) {\n throw new Error('plugin-manager: response must contain a controls array')\n }\n return value.controls.map((control, index) => {\n if (!isRecord(control) || !isString(control.id) || !isString(control.name)\n || !isString(control.repository)\n || (control.state !== 'enabled' && control.state !== 'disabled'\n && control.state !== 'mixed' && control.state !== 'unavailable'\n && control.state !== 'uninstalled')) {\n throw new Error(`plugin-manager: control row ${String(index)} is invalid`)\n }\n return {\n id: control.id,\n name: control.name,\n repository: control.repository,\n state: control.state,\n }\n })\n}\n\n/**\n * Validate and normalize a `status` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed progress state.\n */\nexport function parseInstallStatus(value: unknown): InstallProgressItem {\n if (!isRecord(value) || !isRecord(value.progress)\n || (value.progress.kind !== 'idle' && value.progress.kind !== 'install' && value.progress.kind !== 'update')\n || (value.progress.stage !== 'fetch' && value.progress.stage !== 'download'\n && value.progress.stage !== 'extract' && value.progress.stage !== 'write')\n || (value.progress.percent !== undefined\n && (typeof value.progress.percent !== 'number' || !Number.isFinite(value.progress.percent)))) {\n throw new Error('plugin-manager: response must contain a valid progress state')\n }\n return {\n kind: value.progress.kind,\n stage: value.progress.stage,\n ...typeof value.progress.percent === 'number' ? { percent: value.progress.percent } : {},\n }\n}\n\n/**\n * Validate and normalize a `check-updates` response value.\n * @param value - decoded but untrusted response value.\n * @returns typed update rows.\n */\nexport function parseUpdateList(value: unknown): PluginUpdateItem[] {\n if (!isRecord(value) || !Array.isArray(value.updates)) {\n throw new Error('plugin-manager: response must contain an updates array')\n }\n return value.updates.map((update, index) => {\n if (!isRecord(update) || !isString(update.id) || !isString(update.current) || !isString(update.latest)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n const kind = update.kind === undefined ? 'update' : update.kind\n if (kind !== 'update' && kind !== 'migrate') {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n const row: PluginUpdateItem = { id: update.id, current: update.current, latest: update.latest }\n if (kind === 'migrate') {\n if (!isString(update.target) || !isString(update.targetVersion)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.kind = 'migrate'\n row.target = update.target\n row.targetVersion = update.targetVersion\n }\n if (update.requiresDsh !== undefined) {\n if (!isString(update.requiresDsh)) {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.requiresDsh = update.requiresDsh\n }\n if (update.compatible !== undefined) {\n if (typeof update.compatible !== 'boolean') {\n throw new Error(`plugin-manager: update row ${String(index)} is invalid`)\n }\n row.compatible = update.compatible\n }\n return row\n })\n}\n\n/**\n * Validate and normalize a `failures` response value.\n * @param value - decoded but untrusted response value.\n * @returns the typed failures snapshot.\n */\nexport function parseFailuresSnapshot(value: unknown): PluginFailuresSnapshot {\n if (!isRecord(value) || !Array.isArray(value.items)\n || !isString(value.pluginRoot) || typeof value.safeMode !== 'boolean') {\n throw new Error('plugin-manager: response must contain a failures snapshot')\n }\n return {\n items: value.items.map((item, index) => {\n if (!isRecord(item) || !isString(item.pluginId)\n || (item.kind !== 'load-failure' && item.kind !== 'hang' && item.kind !== 'late-rejection')\n || !isString(item.message) || !isString(item.stack)\n || !isString(item.installPath) || !isString(item.at)) {\n throw new Error(`plugin-manager: failure row ${String(index)} is invalid`)\n }\n return {\n pluginId: item.pluginId,\n kind: item.kind,\n message: item.message,\n stack: item.stack,\n installPath: item.installPath,\n at: item.at,\n }\n }),\n pluginRoot: value.pluginRoot,\n safeMode: value.safeMode,\n }\n}\n","/**\n * The cordis service contract this package exposes to sibling client plugins\n * under the name `'pluginManager'`. The browser half builds one dual-channel\n * face (official /plugin-installer + /plugin-control RPC channels when\n * available, else this package's loopback HTTP gateway) and provides it via\n * `ctx.provide('pluginManager', face)`; consumers resolve it with\n * `ctx.inject(['pluginManager'], cb)` and read `ctx.pluginManager`.\n *\n * The interface is intentionally narrower than the face the Plugin manager\n * tab receives (`PluginManagerFace` in the client half): it is the stable\n * cross-plugin surface, so it only carries the operations a sibling plugin\n * needs to observe and drive the installed-plugin set.\n * @module @linxin666/dsh-client-ui-plugin-manager/core\n */\n\nimport type { InstallProgressItem, InstalledPluginItem, PluginFailuresSnapshot } from './protocol.ts'\n\n/** The cordis service name the browser half provides the face under. */\nexport const PLUGIN_MANAGER_SERVICE = 'pluginManager'\n\n/**\n * The dual-channel plugin-management face, shared between the Plugin manager\n * tab and sibling client plugins.\n */\nexport interface PluginManagerService {\n /** Whether this browser has loopback authority to use the host routes. */\n readonly isLoopback: boolean\n /** Read the installed snapshot. */\n list(): Promise<InstalledPluginItem[]>\n /** Install one plugin from an npm spec or git URL. */\n install(spec: string): Promise<InstalledPluginItem>\n /** Remove one plugin. */\n uninstall(id: string): Promise<InstalledPluginItem[]>\n /** Read the current install/update progress. */\n status(): Promise<InstallProgressItem>\n /**\n * Read the recorded plugin boot-failure ring (plugin id, message, stack,\n * install path). On runtimes without a failure ring the host answers an\n * empty snapshot.\n */\n failures(): Promise<PluginFailuresSnapshot>\n /**\n * Flip one plugin's next-start enablement through the active channel (the\n * official installer RPC when available, else the loopback gateway's patch\n * `disabled` override row). The change takes effect after the host restart;\n * a running plugin is not stopped.\n */\n setEnabled(id: string, enabled: boolean): Promise<InstalledPluginItem>\n /**\n * Subscribe to successful mutations: the callback runs after install(),\n * update(), uninstall(), or setEnabled() resolves. One listener throwing\n * never breaks the others. Returns the unsubscribe function.\n */\n onChange(cb: () => void): () => void\n}\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n /** The plugin-manager face (provided by the dsh-plugin-manager client half). */\n pluginManager: PluginManagerService\n }\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/telemetry.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Anonymous install telemetry shared by the DSH Web UI family plugins.\n *\n * Once per UTC day per browser, each wired plugin sends one heartbeat to\n * the dsh-market edge API listing its package name (and version when known).\n * The payload carries no conversation data and no identifiers beyond a random\n * UUID generated in localStorage; the server hashes it with a deployment salt\n * before storage and never persists IP addresses. Sends are fire-and-forget:\n * failures stay silent and simply retry on a later mount or day. The system\n * is documented in docs/telemetry.md.\n */\n\nexport type TelemetryChannel = 'market' | 'npm' | 'unknown'\n\nexport interface TelemetryItem {\n /** npm package name or asset id, e.g. \"@linxin666/dsh-pet\" or \"skin:harbor\". */\n name: string\n /** Installed version when known; omitted otherwise. */\n version?: string\n /** Install channel when determinable (market = Workshop install). */\n channel?: TelemetryChannel\n}\n\nconst VISITOR_KEY = 'dsh-web-ui-telemetry-visitor'\nconst DAY_KEY_PREFIX = 'dsh-web-ui-telemetry-day:'\nconst ENDPOINT = 'https://dsh-market.com/api/telemetry/event'\n\n// Baked into each client bundle by shared/tsdown.client.ts (the package's own\n// package.json version at build time). Undefined in dev/test builds.\ndeclare const __DSH_PKG_VERSION__: string | undefined\n\n/** The building package's version, when the bundle carries it. */\nfunction bakedVersion(): string | undefined {\n try {\n return typeof __DSH_PKG_VERSION__ === 'string' && __DSH_PKG_VERSION__ !== ''\n ? __DSH_PKG_VERSION__\n : undefined\n } catch {\n return undefined\n }\n}\n\n/** Read or lazily create the anonymous visitor id; null when storage is unavailable. */\nfunction visitorId(): string | null {\n try {\n const existing = localStorage.getItem(VISITOR_KEY)\n if (existing && /^[A-Za-z0-9_-]{16,64}$/.test(existing)) return existing\n const fresh = crypto.randomUUID().replaceAll('-', '')\n localStorage.setItem(VISITOR_KEY, fresh)\n return fresh\n } catch {\n // Storage unavailable (privacy mode, sandboxed frame): report nothing.\n return null\n }\n}\n\n/** Drop stale per-day dedup keys so localStorage does not grow forever. */\nfunction pruneDayKeys(today: string): void {\n try {\n for (let index = localStorage.length - 1; index >= 0; index -= 1) {\n const key = localStorage.key(index)\n if (key !== null && key.startsWith(DAY_KEY_PREFIX) && key !== DAY_KEY_PREFIX + today) {\n localStorage.removeItem(key)\n }\n }\n } catch { /* best effort */ }\n}\n\n/**\n * Fire the daily heartbeat for the given items at most once per UTC day per\n * browser. Never throws and never blocks the caller. Items without an explicit\n * version inherit the bundle's baked build version.\n */\nexport function reportDailyHeartbeat(items: readonly TelemetryItem[]): void {\n try {\n if (items.length === 0) return\n const today = new Date().toISOString().slice(0, 10)\n // Automation contexts (CDP-driven QA browsers, fresh isolated profiles)\n // mint a new visitor id per run and would inflate instance counts.\n if (navigator.webdriver) return\n if (localStorage.getItem(DAY_KEY_PREFIX + today) !== null) return\n const visitor = visitorId()\n if (visitor === null) return\n pruneDayKeys(today)\n const payloadItems = items.map((item) => {\n const out: Record<string, string> = { name: item.name }\n const version = item.version ?? bakedVersion()\n if (version !== undefined) out.version = version\n if (item.channel !== undefined) out.channel = item.channel\n return out\n })\n const body = JSON.stringify({ kind: 'heartbeat', visitor, items: payloadItems })\n void fetch(ENDPOINT, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body,\n keepalive: true,\n }).then((response) => {\n // Mark the day only after an accepted send, so offline browsers retry\n // on a later mount instead of going dark until tomorrow.\n if (response.ok) localStorage.setItem(DAY_KEY_PREFIX + today, '1')\n }).catch(() => { /* unreachable endpoint: stay silent */ })\n } catch { /* never break the host UI over telemetry */ }\n}\n","/**\n * Plugin-manager browser half: contributes the family plugin-manager tab to\n * the official Plugins settings section (`settings.plugins.tab` slot) and\n * provides the same dual-channel face as the `'pluginManager'` cordis\n * service for sibling client plugins. It is dual-channel: on runtimes with\n * the official installer services (DSHCode, the 1.0.4 checkout web) every\n * operation rides the official `/plugin-installer` and `/plugin-control`\n * loopback RPC channels (the single writer); on the npm-published web runtime\n * those channels do not exist, so the same face falls back to this package's\n * own loopback HTTP gateway, which spawns the official CLI for writes.\n * Neither the tab nor service consumers know which mode the face runs in.\n * @module @linxin666/dsh-client-ui-plugin-manager/client\n */\n\n// Type-only: pulls the locale plugin's Context merge (ctx.locale).\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the settings surface's slot contracts (settings.plugins.tab).\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n// Type-only: pulls the client runtime Context merge (ctx.workspaces, ctx.sessions).\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'\nimport { PluginManagerTab, type PluginManagerTabInjected } from './PluginManagerTab.tsx'\nimport { en, zh, type PluginManagerKey } from './locales.ts'\nimport {\n parseFailuresSnapshot,\n parseInstallStatus,\n parseInstalledPlugin,\n parsePluginControlSnapshot,\n parsePluginList,\n parseUpdateList,\n type InstalledPluginItem,\n type InstallProgressItem,\n type PluginControlItem,\n type PluginFailuresSnapshot,\n type PluginUpdateItem,\n} from '../core/protocol.ts'\nimport { PLUGIN_MANAGER_SERVICE, type PluginManagerService } from '../core/service.ts'\nimport type { ControlChange } from '../core/conflict.ts'\nimport { reportDailyHeartbeat } from './telemetry.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Copy for the family plugin-manager tab. */\n 'settings.pluginManager': PluginManagerKey\n }\n}\n\nconst NS = 'settings.pluginManager'\nconst CHANNEL = '/plugin-installer'\nconst CONTROL_CHANNEL = '/plugin-control'\nconst LIST_ENDPOINT = 'list'\nconst INSTALL_ENDPOINT = 'install'\nconst UPDATE_ENDPOINT = 'update'\nconst UNINSTALL_ENDPOINT = 'uninstall'\nconst SET_ENABLED_ENDPOINT = 'set-enabled'\nconst CHECK_UPDATES_ENDPOINT = 'check-updates'\nconst STATUS_ENDPOINT = 'status'\nconst FAILURES_ENDPOINT = 'failures'\nconst SET_SAFE_MODE_ENDPOINT = 'set-safe-mode'\n\nconst GATEWAY_PREFIX = '/api/plugin-manager'\n/** Gateway job polling cadence. */\nconst JOB_POLL_MS = 500\n/** Gateway job wait ceiling (the host add deadline is six minutes). */\nconst JOB_WAIT_MS = 7 * 60_000\n\n/** Services required by the slot registration and both channels. */\nexport const inject = ['slots', 'locale', 'connection', 'workspaces', 'sessions']\n\n/** The gateway job wire shape served by /status. */\ninterface GatewayJobWire {\n phase: 'running' | 'done' | 'error'\n plugin?: unknown\n conflicts?: unknown\n error?: string\n}\n\n/**\n * The face the Plugin manager tab and the `'pluginManager'` cordis service\n * share: the full tab surface plus the cross-plugin service contract.\n */\nexport type PluginManagerFace = PluginManagerTabInjected & PluginManagerService\n\n/**\n * Build the dual-channel face once: official-channel and gateway-channel\n * implementations, the mode detection that picks between them, the repair\n * handoff, and the change-notification listener set. The returned face is\n * both the tab's injected props and the value provided as the\n * `'pluginManager'` cordis service.\n * @param ctx - the client context (connection, workspaces, sessions).\n * @returns the shared face.\n */\nexport function createPluginManagerFace(ctx: ClientContext): PluginManagerFace {\n const connection = ctx.get('connection') as ConnectionHandle\n\n // ── official channel implementations ──────────────────────────────────────\n\n const call = async (endpoint: string, payload: unknown): Promise<unknown> => {\n const result = await connection.rpc.call(CHANNEL, endpoint, payload)\n if (!result.ok) {\n throw new Error(`plugin-installer ${endpoint} failed: ${result.error.code}: ${result.error.message}`)\n }\n return result.value\n }\n const official = {\n list: async (): Promise<InstalledPluginItem[]> => parsePluginList(await call(LIST_ENDPOINT, {})),\n install: async (spec: string): Promise<InstalledPluginItem> => parseInstalledPlugin(await call(INSTALL_ENDPOINT, { spec })),\n update: async (id: string): Promise<InstalledPluginItem> => parseInstalledPlugin(await call(UPDATE_ENDPOINT, { id })),\n uninstall: async (id: string): Promise<InstalledPluginItem[]> => parsePluginList(await call(UNINSTALL_ENDPOINT, { id })),\n setEnabled: async (id: string, enabled: boolean): Promise<InstalledPluginItem> =>\n parseInstalledPlugin(await call(SET_ENABLED_ENDPOINT, { id, enabled })),\n checkUpdates: async (): Promise<PluginUpdateItem[]> => parseUpdateList(await call(CHECK_UPDATES_ENDPOINT, {})),\n status: async (): Promise<InstallProgressItem> => parseInstallStatus(await call(STATUS_ENDPOINT, {})),\n failures: async (): Promise<PluginFailuresSnapshot> => parseFailuresSnapshot(await call(FAILURES_ENDPOINT, {})),\n setSafeMode: async (enabled: boolean): Promise<void> => {\n await call(SET_SAFE_MODE_ENDPOINT, { enabled })\n },\n controlsList: async (): Promise<PluginControlItem[]> =>\n parsePluginControlSnapshot(await connection.rpc.call(CONTROL_CHANNEL, 'list', {}).then(result => {\n if (!result.ok) throw new Error(`plugin-control list failed: ${result.error.code}: ${result.error.message}`)\n return result.value\n })),\n controlsSetEnabled: async (pluginId: string, enabled: boolean): Promise<PluginControlItem[]> =>\n parsePluginControlSnapshot(await connection.rpc.call(CONTROL_CHANNEL, 'set-enabled', { pluginId, enabled }).then(result => {\n if (!result.ok) throw new Error(`plugin-control set-enabled failed: ${result.error.code}: ${result.error.message}`)\n return result.value\n })),\n }\n\n // ── gateway channel implementations ──────────────────────────────────────\n\n const gatewayJson = async (path: string, init?: RequestInit): Promise<unknown> => {\n const response = await fetch(path, {\n ...init,\n headers: { 'content-type': 'application/json', ...init?.headers },\n })\n if (response.status === 403) {\n throw new Error('plugin-manager: plugin management is only available from a local browser')\n }\n if (!response.ok) {\n const body = await response.json().catch(() => ({})) as { error?: string }\n throw new Error(body.error ?? `plugin-manager: gateway ${path} failed: HTTP ${String(response.status)}`)\n }\n return response.json()\n }\n\n /** Wait for one gateway job to settle, returning its wire state. */\n const waitJob = async (jobId: string): Promise<GatewayJobWire> => {\n const deadline = Date.now() + JOB_WAIT_MS\n for (;;) {\n const body = await gatewayJson(`${GATEWAY_PREFIX}/status?job=${encodeURIComponent(jobId)}`) as { job?: GatewayJobWire }\n const job = body.job\n if (job === undefined) throw new Error('plugin-manager: gateway job vanished')\n if (job.phase === 'done') return job\n if (job.phase === 'error') throw new Error(job.error ?? 'plugin-manager: gateway job failed')\n if (Date.now() > deadline) throw new Error('plugin-manager: gateway job timed out')\n await new Promise(resolve => { setTimeout(resolve, JOB_POLL_MS) })\n }\n }\n\n /** The conflict ledger of the last settled gateway install. */\n let lastInstallConflicts: ControlChange[] = []\n /** Whether a gateway install/remove is in flight (drives the progress row). */\n let gatewayInflight = false\n\n const gateway = {\n list: async (): Promise<InstalledPluginItem[]> =>\n parsePluginList(await gatewayJson(`${GATEWAY_PREFIX}/list`)),\n install: async (spec: string): Promise<InstalledPluginItem> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/install`, {\n method: 'POST',\n body: JSON.stringify({ spec }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway install returned no job')\n const job = await waitJob(started.jobId)\n lastInstallConflicts = Array.isArray(job.conflicts) ? job.conflicts as ControlChange[] : []\n return parseInstalledPlugin({ plugin: job.plugin })\n } finally {\n gatewayInflight = false\n }\n },\n update: async (id: string): Promise<InstalledPluginItem> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/update`, {\n method: 'POST',\n body: JSON.stringify({ id }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway update returned no job')\n const job = await waitJob(started.jobId)\n lastInstallConflicts = Array.isArray(job.conflicts) ? job.conflicts as ControlChange[] : []\n return parseInstalledPlugin({ plugin: job.plugin })\n } finally {\n gatewayInflight = false\n }\n },\n uninstall: async (id: string): Promise<InstalledPluginItem[]> => {\n gatewayInflight = true\n try {\n const started = await gatewayJson(`${GATEWAY_PREFIX}/remove`, {\n method: 'POST',\n body: JSON.stringify({ id }),\n }) as { jobId?: string }\n if (started.jobId === undefined) throw new Error('plugin-manager: gateway remove returned no job')\n await waitJob(started.jobId)\n return gateway.list()\n } finally {\n gatewayInflight = false\n }\n },\n setEnabled: async (id: string, enabled: boolean): Promise<InstalledPluginItem> =>\n parseInstalledPlugin(await gatewayJson(`${GATEWAY_PREFIX}/set-enabled`, {\n method: 'POST',\n body: JSON.stringify({ id, enabled }),\n })),\n checkUpdates: async (): Promise<PluginUpdateItem[]> =>\n parseUpdateList(await gatewayJson(`${GATEWAY_PREFIX}/check-updates`)),\n status: async (): Promise<InstallProgressItem> =>\n gatewayInflight ? { kind: 'install', stage: 'download' } : { kind: 'idle', stage: 'fetch' },\n failures: async (): Promise<PluginFailuresSnapshot> =>\n parseFailuresSnapshot(await gatewayJson(`${GATEWAY_PREFIX}/failures`)),\n setSafeMode: async (): Promise<void> => {\n throw new Error('plugin-manager: safe mode is unavailable in this runtime')\n },\n controlsList: async (): Promise<PluginControlItem[]> => [],\n controlsSetEnabled: async (pluginId: string, enabled: boolean): Promise<PluginControlItem[]> => {\n await gateway.setEnabled(pluginId, enabled)\n return []\n },\n }\n\n // ── mode selection ────────────────────────────────────────────────────────\n\n let modePromise: Promise<'official' | 'gateway'> | undefined\n const ensureMode = (): Promise<'official' | 'gateway'> => {\n if (modePromise === undefined) {\n modePromise = (async () => {\n // Prefer the host verdict: the gateway's /mode route reports whether\n // the official installer channels exist, so the direct channel probe\n // below (which 405s into the browser console on the npm web runtime)\n // only runs when the host half is absent or explicitly returns null\n // for a desktop runtime whose services are registered in-process.\n try {\n const mode = await gatewayJson(`${GATEWAY_PREFIX}/mode`) as { official?: boolean | null }\n if (mode.official === true) return 'official' as const\n if (mode.official === false) return 'gateway' as const\n } catch {\n // Host half absent (an official runtime without a boot profile):\n // fall back to the direct channel probe.\n }\n try {\n const result = await connection.rpc.call(CHANNEL, LIST_ENDPOINT, {})\n return result.ok ? 'official' as const : 'gateway' as const\n } catch {\n return 'gateway' as const\n }\n })()\n }\n return modePromise\n }\n\n /**\n * Start a repair conversation for a failed plugin: resolve a workspace over\n * the plugin install root (created once, reused after), open a fresh\n * session there, and seed its first prompt with the failure details. The\n * session's workspace is the plugin home so the agent's file tools reach\n * the plugin code without leaving the workspace boundary.\n * @param pluginRoot - absolute plugin install root.\n * @param message - the seeded first user message.\n * @returns resolution after the prompt is accepted and the session opens.\n */\n const repairPlugin = async (pluginRoot: string, message: string): Promise<void> => {\n const workspace = await ctx.workspaces.create({ path: pluginRoot })\n const sessionId = await ctx.sessions.create({ workspaceId: workspace.workspaceId })\n const binding = ctx.sessions.binding(sessionId)\n if (binding === undefined) throw new Error(`plugin-manager: repair session ${sessionId} is unavailable`)\n const result = await binding.session.prompt([{ type: 'text', text: message }], 'queue')\n if (!result.ok) throw new Error(`plugin-manager: repair prompt failed: ${result.error.code}: ${result.error.message}`)\n ctx.sessions.open(sessionId)\n }\n\n // ── change notification ───────────────────────────────────────────────────\n\n /** Listeners subscribed through onChange; fired after successful mutations. */\n const listeners = new Set<() => void>()\n /** Notify every listener; one listener throwing never breaks the others. */\n const notifyChange = (): void => {\n for (const listener of [...listeners]) {\n try {\n listener()\n } catch {\n // A consumer's listener failure is its own; keep notifying the rest.\n }\n }\n }\n\n // ── the shared face ───────────────────────────────────────────────────────\n\n return {\n isLoopback: connection.isLoopback,\n list: async () => (await ensureMode()) === 'official' ? official.list() : gateway.list(),\n install: async spec => {\n const item = await ((await ensureMode()) === 'official' ? official.install(spec) : gateway.install(spec))\n notifyChange()\n return item\n },\n update: async id => {\n const item = await ((await ensureMode()) === 'official' ? official.update(id) : gateway.update(id))\n notifyChange()\n return item\n },\n uninstall: async id => {\n const rows = await ((await ensureMode()) === 'official' ? official.uninstall(id) : gateway.uninstall(id))\n notifyChange()\n return rows\n },\n setEnabled: async (id, enabled) => {\n const item = await ((await ensureMode()) === 'official' ? official.setEnabled(id, enabled) : gateway.setEnabled(id, enabled))\n notifyChange()\n return item\n },\n checkUpdates: async () => (await ensureMode()) === 'official' ? official.checkUpdates() : gateway.checkUpdates(),\n status: async () => (await ensureMode()) === 'official' ? official.status() : gateway.status(),\n failures: async () => (await ensureMode()) === 'official' ? official.failures() : gateway.failures(),\n setSafeMode: async enabled => (await ensureMode()) === 'official' ? official.setSafeMode(enabled) : gateway.setSafeMode(),\n repairPlugin,\n controlsList: async () => (await ensureMode()) === 'official' ? official.controlsList() : gateway.controlsList(),\n controlsSetEnabled: async (id, enabled) => (await ensureMode()) === 'official' ? official.controlsSetEnabled(id, enabled) : gateway.controlsSetEnabled(id, enabled),\n lastInstallConflicts: () => lastInstallConflicts,\n onChange: cb => {\n listeners.add(cb)\n return () => { listeners.delete(cb) }\n },\n }\n}\n\n/** Contribute the family plugin-manager tab and provide the shared face. */\nexport function apply(ctx: ClientContext): void {\n // Anonymous install heartbeat (docs/telemetry.md): one beat per browser per\n // UTC day, package name only, silent failure.\n reportDailyHeartbeat([{ name: '@linxin666/dsh-client-ui-plugin-manager' }])\n\n ctx.effect(() => {\n try {\n return ctx.locale.register(NS, { zh, en })\n } catch {\n return () => {}\n }\n }, 'plugin-manager: dictionaries')\n\n // Built once: the tab and the 'pluginManager' cordis service share one\n // face, so consumers observe exactly the mutations the tab performs.\n const face = createPluginManagerFace(ctx)\n try {\n if (!ctx.get(PLUGIN_MANAGER_SERVICE)) {\n ctx.provide(PLUGIN_MANAGER_SERVICE, face)\n }\n } catch {\n // ignore duplicate provide\n }\n\n ctx.slots.inject('settings.plugins.tab', () => {\n try {\n return ctx.slots.register({\n name: 'settings.plugins.tab',\n id: 'family-plugins',\n order: 20,\n label: () => ctx.locale.bind(NS)('tab'),\n locale: NS,\n inject: () => face,\n }, PluginManagerTab)\n } catch {\n return () => {}\n }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;EAsCA,SAAgB,aAAa,QAAsC,OAAsD;GACvH,MAAM,YAAY,IAAI,IAAI,MAAM,KAAI,SAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;GAC5D,MAAM,UAA2B,CAAC;GAClC,KAAK,MAAM,QAAQ,QAAQ;IACzB,MAAM,UAAU,UAAU,IAAI,KAAK,EAAE;IACrC,IAAI,YAAY,KAAA,KAAa,QAAQ,UAAU,KAAK,OAAO;I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MACxB,MAAM;MACN,IAAI;MACJ,OAAO;MACP,aAAa,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,KAAK;MACtC,QAAQ;MACR,cAAc;KAChB,GAAG,gBAAgB;IACrB,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,CAAC;EACH"}
package/lib/index.js CHANGED
@@ -180,6 +180,44 @@ function bareRowEnabled(item) {
180
180
  return !(isScalar(disabled) && disabled.value === true);
181
181
  }
182
182
  /**
183
+ * The enablement a bundle patch itself declares for the ids it mentions: an
184
+ * insert entry's own `disabled` key, then later top-level bare
185
+ * `{ id, disabled }` rows applied in file order (the loader's later-wins
186
+ * semantics). Ids the patch never mentions stay absent, which means "this
187
+ * layer has no opinion" — not "enabled". The aggregate package ships its
188
+ * inactive-by-default family rows exactly this way.
189
+ * @param patchText - the package's own bundle patch text (`[]` for none).
190
+ * @returns declared enablement by entry id, absent when undeclared.
191
+ */
192
+ function rowDefaultEnabledOf(patchText) {
193
+ const defaults = /* @__PURE__ */ new Map();
194
+ if (patchText.trim() === "" || patchText.trim() === "[]") return defaults;
195
+ try {
196
+ const { root } = parsePatch(patchText, "bundle patch");
197
+ for (const item of root.items) {
198
+ if (!isMap(item)) continue;
199
+ const insert = item.get("insert", true);
200
+ if (isSeq(insert)) {
201
+ for (const entry of insert.items) {
202
+ if (!isMap(entry)) continue;
203
+ const id = entry.get("id", true);
204
+ if (!(isScalar(id) && typeof id.value === "string")) continue;
205
+ const disabled = entry.get("disabled", true);
206
+ if (isScalar(disabled) && typeof disabled.value === "boolean") defaults.set(id.value, disabled.value !== true);
207
+ }
208
+ continue;
209
+ }
210
+ const id = bareRowId(item);
211
+ if (id === void 0) continue;
212
+ const disabled = item.get("disabled", true);
213
+ if (isScalar(disabled) && typeof disabled.value === "boolean") defaults.set(id, disabled.value !== true);
214
+ }
215
+ return defaults;
216
+ } catch {
217
+ return defaults;
218
+ }
219
+ }
220
+ /**
183
221
  * Find the bare override row for one id.
184
222
  * @param root - the top-level sequence.
185
223
  * @param id - the entry id to match.
@@ -263,8 +301,9 @@ function findInsertRow(root, id) {
263
301
  }
264
302
  /**
265
303
  * Persist the next-start enablement of one entry. Bare override rows are this
266
- * package's own shape: enabling removes the override, disabling creates or
267
- * updates `{ id, name, disabled: true }`. When a newer desktop tool already
304
+ * package's own shape: enabling removes the override (or writes
305
+ * `disabled: false` when the bundle itself ships the row disabled), disabling
306
+ * creates or updates `{ id, name, disabled: true }`. When a newer desktop tool already
268
307
  * manages the entry as an insert-format row, the inner row's `disabled` flag
269
308
  * is edited instead (the official writer's shape). The returned text
270
309
  * preserves every other row and comment.
@@ -273,9 +312,12 @@ function findInsertRow(root, id) {
273
312
  * @param id - the entry id to override.
274
313
  * @param name - the display name recorded on the row.
275
314
  * @param enabled - desired next-start enablement.
315
+ * @param baseEnabled - whether the bundle layer leaves the id enabled; a bundle
316
+ * that ships the row disabled needs an explicit `disabled: false` override,
317
+ * because removing the user row only restores "no user opinion".
276
318
  * @returns the new file text.
277
319
  */
278
- function setRowEnabled(text, filename, id, name, enabled) {
320
+ function setRowEnabled(text, filename, id, name, enabled, baseEnabled = true) {
279
321
  const { document, root } = parsePatch(text, filename);
280
322
  const insertRow = findInsertRow(root, id);
281
323
  if (insertRow !== void 0) {
@@ -283,10 +325,16 @@ function setRowEnabled(text, filename, id, name, enabled) {
283
325
  return document.toString({ lineWidth: 0 }) + "\n";
284
326
  }
285
327
  const found = findBareRow(root, id);
286
- if (enabled) {
287
- if (found === void 0) return text;
288
- root.items.splice(found.index, 1);
289
- } else if (found !== void 0) found.row.set("disabled", document.createNode(true));
328
+ if (enabled) if (found === void 0) {
329
+ if (baseEnabled) return text;
330
+ root.items.push(document.createNode({
331
+ id,
332
+ name,
333
+ disabled: false
334
+ }));
335
+ } else if (baseEnabled) root.items.splice(found.index, 1);
336
+ else found.row.set("disabled", document.createNode(false));
337
+ else if (found !== void 0) found.row.set("disabled", document.createNode(true));
290
338
  else root.items.push(document.createNode({
291
339
  id,
292
340
  name,
@@ -608,21 +656,30 @@ async function claimedEntryIdsOf(facts, name) {
608
656
  * write side needs the entry's own name: the include patch semantics skip a
609
657
  * bare override row whose name mismatches the inserted entry's name.
610
658
  * @param facts - resolved profile locations.
659
+ * `baseEnabled` carries the bundle layer's own enablement for the row: a
660
+ * package that ships a row disabled cannot be switched on by deleting the user
661
+ * override, so the caller needs it to write an explicit `disabled: false`.
662
+ * @param facts - resolved profile locations.
611
663
  * @param name - dependency name (possibly scoped).
612
664
  * @returns the claimed rows, never empty.
613
665
  */
614
666
  async function claimedEntryRowsOf(facts, name) {
615
667
  const patchPath = join(modulePathOf(facts.profileDir, name), "cordis.patch.yml");
616
668
  try {
617
- const claimed = insertRowsOf(stripBom(await readFile(patchPath, "utf8"))).filter((row) => row.id !== void 0);
669
+ const text = stripBom(await readFile(patchPath, "utf8"));
670
+ const rows = insertRowsOf(text);
671
+ const defaults = rowDefaultEnabledOf(text);
672
+ const claimed = rows.filter((row) => row.id !== void 0);
618
673
  if (claimed.length > 0) return claimed.map((row) => ({
619
674
  id: row.id,
620
- name: row.name ?? name
675
+ name: row.name ?? name,
676
+ baseEnabled: defaults.get(row.id) ?? true
621
677
  }));
622
678
  } catch {}
623
679
  return [{
624
680
  id: name,
625
- name
681
+ name,
682
+ baseEnabled: true
626
683
  }];
627
684
  }
628
685
  /**
@@ -653,11 +710,13 @@ async function buildPluginRow(facts, name, spec, rowEnabled) {
653
710
  bundlePatch = "[]";
654
711
  }
655
712
  const insertRows = insertRowsOf(bundlePatch).filter((row) => row.id !== void 0);
656
- const enabled = (insertRows.length > 0 ? insertRows.map((row) => row.id) : [name]).every((id) => rowEnabled.get(id) ?? true);
713
+ const entryIds = insertRows.length > 0 ? insertRows.map((row) => row.id) : [name];
714
+ const bundleDefaults = rowDefaultEnabledOf(bundlePatch);
715
+ const enabled = entryIds.every((id) => rowEnabled.get(id) ?? bundleDefaults.get(id) ?? true);
657
716
  const children = insertRows.length > 1 ? insertRows.map((row) => ({
658
717
  id: row.id,
659
718
  name: row.plugin ?? row.name ?? row.id,
660
- enabled: rowEnabled.get(row.id) ?? true,
719
+ enabled: rowEnabled.get(row.id) ?? bundleDefaults.get(row.id) ?? true,
661
720
  ...LOCKED_ENTRY_IDS.has(row.id) ? { locked: true } : {}
662
721
  })) : void 0;
663
722
  return {
@@ -2124,7 +2183,7 @@ function makeGatewayRoutes(deps) {
2124
2183
  let next = patchText;
2125
2184
  for (const entry of entries) {
2126
2185
  const entryEnabled = enabled || LOCKED_ENTRY_IDS.has(entry.id);
2127
- next = setRowEnabled(next, facts.patchPath, entry.id, entry.name, entryEnabled);
2186
+ next = setRowEnabled(next, facts.patchPath, entry.id, entry.name, entryEnabled, entry.baseEnabled);
2128
2187
  }
2129
2188
  if (next !== patchText) await writePatchAtomic(facts.patchPath, next);
2130
2189
  const plugin = (await snapshotGateway(facts, next)).plugins.find((item) => item.id === ownerName);
@@ -64,6 +64,9 @@ declare const STATIC_ZH: {
64
64
  disableSwitch: string;
65
65
  lockedRowHint: string;
66
66
  childrenHint: string;
67
+ childrenSummary: string;
68
+ childrenShow: string;
69
+ childrenHide: string;
67
70
  repairInstallTitle: string;
68
71
  repairInstallSpecLabel: string;
69
72
  repairInstallErrorLabel: string;
@@ -147,6 +150,9 @@ export declare const zh: {
147
150
  disableSwitch: string;
148
151
  lockedRowHint: string;
149
152
  childrenHint: string;
153
+ childrenSummary: string;
154
+ childrenShow: string;
155
+ childrenHide: string;
150
156
  repairInstallTitle: string;
151
157
  repairInstallSpecLabel: string;
152
158
  repairInstallErrorLabel: string;
@@ -230,6 +236,9 @@ export declare const en: {
230
236
  disableSwitch: string;
231
237
  lockedRowHint: string;
232
238
  childrenHint: string;
239
+ childrenSummary: string;
240
+ childrenShow: string;
241
+ childrenHide: string;
233
242
  repairInstallTitle: string;
234
243
  repairInstallSpecLabel: string;
235
244
  repairInstallErrorLabel: string;
@@ -16,7 +16,7 @@ export interface InstalledPluginChild {
16
16
  id: string;
17
17
  /** Display name: the real plugin package (shell config.plugin) when known. */
18
18
  name: string;
19
- /** Saved next-start enablement of this row alone. */
19
+ /** Effective next-start enablement of this row alone (bundle default plus user override). */
20
20
  enabled: boolean;
21
21
  /** Rows the manager must never disable (the manager tab itself, the compat face). */
22
22
  locked?: boolean;
@@ -31,7 +31,7 @@ export interface InstalledPluginItem {
31
31
  spec: string;
32
32
  };
33
33
  installedAt: string;
34
- /** Saved next-start enablement from the managed profile patch row. */
34
+ /** Effective next-start enablement across the bundle's own rows and the managed profile patch row. */
35
35
  enabled: boolean;
36
36
  commit?: string;
37
37
  /**
@@ -43,6 +43,17 @@ export declare function bareRowName(item: unknown): string | undefined;
43
43
  * @returns whether the item leaves its entry enabled.
44
44
  */
45
45
  export declare function bareRowEnabled(item: unknown): boolean;
46
+ /**
47
+ * The enablement a bundle patch itself declares for the ids it mentions: an
48
+ * insert entry's own `disabled` key, then later top-level bare
49
+ * `{ id, disabled }` rows applied in file order (the loader's later-wins
50
+ * semantics). Ids the patch never mentions stay absent, which means "this
51
+ * layer has no opinion" — not "enabled". The aggregate package ships its
52
+ * inactive-by-default family rows exactly this way.
53
+ * @param patchText - the package's own bundle patch text (`[]` for none).
54
+ * @returns declared enablement by entry id, absent when undeclared.
55
+ */
56
+ export declare function rowDefaultEnabledOf(patchText: string): Map<string, boolean>;
46
57
  /**
47
58
  * Find the bare override row for one id.
48
59
  * @param root - the top-level sequence.
@@ -92,8 +103,9 @@ export declare function insertRowsOf(patchText: string): InsertRow[];
92
103
  export declare function findInsertRow(root: YAMLSeq, id: string): YAMLMap | undefined;
93
104
  /**
94
105
  * Persist the next-start enablement of one entry. Bare override rows are this
95
- * package's own shape: enabling removes the override, disabling creates or
96
- * updates `{ id, name, disabled: true }`. When a newer desktop tool already
106
+ * package's own shape: enabling removes the override (or writes
107
+ * `disabled: false` when the bundle itself ships the row disabled), disabling
108
+ * creates or updates `{ id, name, disabled: true }`. When a newer desktop tool already
97
109
  * manages the entry as an insert-format row, the inner row's `disabled` flag
98
110
  * is edited instead (the official writer's shape). The returned text
99
111
  * preserves every other row and comment.
@@ -102,6 +114,9 @@ export declare function findInsertRow(root: YAMLSeq, id: string): YAMLMap | unde
102
114
  * @param id - the entry id to override.
103
115
  * @param name - the display name recorded on the row.
104
116
  * @param enabled - desired next-start enablement.
117
+ * @param baseEnabled - whether the bundle layer leaves the id enabled; a bundle
118
+ * that ships the row disabled needs an explicit `disabled: false` override,
119
+ * because removing the user row only restores "no user opinion".
105
120
  * @returns the new file text.
106
121
  */
107
- export declare function setRowEnabled(text: string, filename: string, id: string, name: string, enabled: boolean): string;
122
+ export declare function setRowEnabled(text: string, filename: string, id: string, name: string, enabled: boolean, baseEnabled?: boolean): string;
@@ -39,12 +39,17 @@ export declare function claimedEntryIdsOf(facts: ProfileFacts, name: string): Pr
39
39
  * write side needs the entry's own name: the include patch semantics skip a
40
40
  * bare override row whose name mismatches the inserted entry's name.
41
41
  * @param facts - resolved profile locations.
42
+ * `baseEnabled` carries the bundle layer's own enablement for the row: a
43
+ * package that ships a row disabled cannot be switched on by deleting the user
44
+ * override, so the caller needs it to write an explicit `disabled: false`.
45
+ * @param facts - resolved profile locations.
42
46
  * @param name - dependency name (possibly scoped).
43
47
  * @returns the claimed rows, never empty.
44
48
  */
45
49
  export declare function claimedEntryRowsOf(facts: ProfileFacts, name: string): Promise<Array<{
46
50
  id: string;
47
51
  name: string;
52
+ baseEnabled: boolean;
48
53
  }>>;
49
54
  /**
50
55
  * Build one installed-plugin row from the profile facts: version from the
@@ -71,6 +76,7 @@ export declare function findRowOwner(facts: ProfileFacts, dependencies: readonly
71
76
  row: {
72
77
  id: string;
73
78
  name: string;
79
+ baseEnabled: boolean;
74
80
  };
75
81
  } | undefined>;
76
82
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-client-ui-plugin-manager",
3
3
  "description": "Plugin manager tab for the dsh web GUI Plugins settings section: installs plugins from npm or git through the official host channels, lists installed plugins with next-start enablement switches, surfaces install-time conflict actions with undo, and hands failures off to repair conversations.",
4
- "version": "0.3.20",
4
+ "version": "0.3.21",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/types/index.d.ts",