@linxin666/dsh-client-ui-plugin-manager 0.4.19 → 0.4.20

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: 6277837fe663ae933a74084b49b9704e50a80ac6
6
- README.zh.md: 1b21020aea2789b0492041457ce719dc8576b51d
5
+ README.md: 2ce866ba0567ceb470ae9aa1ec16f43e80b5b5a9
6
+ README.zh.md: c885b32d9d9fe5bf6a1bd874266d9b13dc1f69f9
package/README.md CHANGED
@@ -25,7 +25,7 @@ An update and lifecycle manager for DeepSeek Harness (DSH) Web GUI and official
25
25
  - 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.
26
26
  - 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), evaluate it as a node-semver range with the call the official boot gate makes — `semver.satisfies(host, range, { includePrerelease: true })` — so `||` alternatives, `^` and `~`, whitespace-separated comparators and x-ranges decide here exactly as they decide at boot, and show the requirement beside the update action. A requirement the running DSH does not satisfy disables the action and says to upgrade DSH. A requirement the host could not verify — an unreadable running version, or a declaration that is not a range node-semver parses — is a different verdict with its own copy: it names no cause and never sends the user to upgrade a DSH that was never compared. Neither verdict lets the update run, and the host update route answers 412 before starting any CLI job in both cases.
27
27
  - Protects the next boot on the npm runtime: after each install the gateway verifies the dependency actually landed, rejects duplicate entry-id claims and insert rows naming unresolvable packages, and composes the profile with the CLI's `--dump-config` preflight; a conflicting or failing install is rolled back through the official remove path and the existing plugins are never touched.
28
- - Adds a "Built-in plugins" group at the bottom of the official Plugins page list; as the page declares no bottom extension slot, this group is inserted directly into the page DOM as a dedicated container with an independent React root (matching the update toolbar) and automatically resets or detaches on page rerenders and panel switches. By default the group lists only Loader rows not inserted by patches of any installed bundle (8 rows in this deployment), using a subtraction formula that surfaces rows declared in profile patch insert blocks (such as Computer Use's `computer-use` and `computer-use-cua-driver-native`) that were previously invisible in the official page; a control beside the group heading can expand it to append all remaining Loader rows (230 rows in this deployment) into the same list, where each owned row displays "From <bundle package name>" to indicate that it also appears on that bundle's details page. Expanding and collapsing only switches between the two already-read collections without re-reading, writing, or changing the enabled state of any row; switch behavior is identical across both scopes: each row provides a toggle switch calling official `pluginManager` remote `setPluginEnabled` to write the profile patch layer with hot-application (profiles with HMR require no restart); rows judged read-only by the official manager (`management-required` or `unaddressable`) render disabled switches with the lock type explained rather than maintaining a custom whitelist; accepted toggles re-read the Loader to verify state, and failures display copy mapped from official `error.code`.
28
+ - Adds a "Built-in plugins" group at the bottom of the official Plugins page list; as the page declares no bottom extension slot, this group is inserted directly into the page DOM as a dedicated container with an independent React root (matching the update toolbar) and automatically resets or detaches on page rerenders and panel switches. By default the group lists only Loader rows not inserted by patches of any installed bundle (8 rows in this deployment), using a subtraction formula that surfaces rows declared in profile patch insert blocks (such as Computer Use's `computer-use` and `computer-use-cua-driver-native`) that were previously invisible in the official page; a control beside the group heading can expand it to append all remaining Loader rows (230 rows in this deployment) into the same list, where each owned row displays "From <bundle package name>" to indicate that it also appears on that bundle's details page. Both scopes offer search by localized title, module package, entry id, or owning bundle, with at most 20 matching rows per page and previous/next controls. Expanding, collapsing, searching, clearing, and paging only change the local view over the already-read collections without re-reading, writing, or changing the enabled state of any row; switch behavior is identical across both scopes: each row provides a toggle switch calling official `pluginManager` remote `setPluginEnabled` to write the profile patch layer with hot-application (profiles with HMR require no restart); rows judged read-only by the official manager (`management-required` or `unaddressable`) render disabled switches with the lock type explained rather than maintaining a custom whitelist; accepted toggles re-read the Loader to verify state, and failures display copy mapped from official `error.code`.
29
29
  - Provides a read-only "Agent presets" block beneath the built-in plugins group, displaying each preset's composed rows and status (enabled, disabled, or conditionally enabled with expression) without switches since preset rows are determined by composition.
30
30
 
31
31
  ## Install
package/README.zh.md CHANGED
@@ -25,7 +25,7 @@
25
25
  - 检测旧聚合包 `@linxin666/dsh-web-ui-all`,把更新动作转换为到 `@linxin666/dsh-web-all` 的事务迁移;网关先移除旧包、安装精确版本的新包、恢复旧聚合包的层顺序,并在 `--dump-config` 通过后才报告成功。
26
26
  - 更新前校验 DSH 运行时兼容(issue #754):更新检查读取最新版本清单声明的 DSH 最低版本(`dsh.engines.dsh`,兼容回退读顶层 `engines.dsh`),按 node-semver 范围求值——用的正是官方启动门禁那一句 `semver.satisfies(host, range, { includePrerelease: true })`,因此 `||` 备选、`^` 与 `~`、空格分隔的多比较器与 x-range 在这里的判定与启动时完全一致——并在更新动作旁显示要求。运行 DSH 确实不满足要求时禁用更新并提示升级 DSH。宿主无法核验要求时(运行版本读不出来,或声明不是 node-semver 能解析的范围)是另一种结论,有独立文案:不预设原因,也绝不把用户推去升级一个从未参与比较的 DSH。两种结论都不放行更新,host 更新路由在两种情况下都会在启动任何 CLI 任务前返回 412。
27
27
  - npm 运行时保护下次启动:安装后网关校验依赖真实落盘、拒绝重复入口 id 认领与引用不可解析包的 insert 行,并用 CLI 的 `--dump-config` 做组合预检;冲突或失败的安装会经官方 remove 路径自动回滚,绝不触碰现有插件。
28
- - 在官方「插件」页列表最下方挂载「内置插件」分组,因官方页面未提供列表底部扩展槽位,该分组与检查更新工具条一样作为独立 React root 容器插入官方 DOM,在页面重绘或切换面板时自动复位或摘除。分组默认只列「没有任何已安装 bundle 的补丁所插入」的 Loader 行(本部署是 8 行),采用减法口径使 profile 补丁 insert 块中的行(例如 Computer Use 的 `computer-use` 与 `computer-use-cua-driver-native`)得以正常呈现;分组标题旁的控件可以展开,展开后在同一列表里追加其余全部 Loader 行(本部署是 230 行),每条已归属行会显示「来自 <bundle 包名>」,说明它同时出现在那个组合包的详情页里。展开/收起只切换已读取到的两个集合,不重新读取、不写入、不改任何行的启停状态;两种范围下开关行为一致:每行提供启停开关,调用官方 `pluginManager` 远端的 `setPluginEnabled` 写入 profile 补丁层并热应用(带 HMR 的 profile 无需重启);官方 manager 判定为只读的行(`management-required` / `unaddressable`)显示为禁用开关并标明锁类型,本包不自建白名单;切换被接受后界面重读 Loader 确认状态,失败则按官方 `error.code` 呈现提示。
28
+ - 在官方「插件」页列表最下方挂载「内置插件」分组,因官方页面未提供列表底部扩展槽位,该分组与检查更新工具条一样作为独立 React root 容器插入官方 DOM,在页面重绘或切换面板时自动复位或摘除。分组默认只列「没有任何已安装 bundle 的补丁所插入」的 Loader 行(本部署是 8 行),采用减法口径使 profile 补丁 insert 块中的行(例如 Computer Use 的 `computer-use` 与 `computer-use-cua-driver-native`)得以正常呈现;分组标题旁的控件可以展开,展开后在同一列表里追加其余全部 Loader 行(本部署是 230 行),每条已归属行会显示「来自 <bundle 包名>」,说明它同时出现在那个组合包的详情页里。两种范围都可按当前语言标题、模块包名、行 id 或组合包归属搜索,匹配结果每页最多显示 20 行并提供上一页/下一页。展开/收起、搜索、清空与翻页只改变已读取集合的本地视图,不重新读取、不写入、不改任何行的启停状态;两种范围下开关行为一致:每行提供启停开关,调用官方 `pluginManager` 远端的 `setPluginEnabled` 写入 profile 补丁层并热应用(带 HMR 的 profile 无需重启);官方 manager 判定为只读的行(`management-required` / `unaddressable`)显示为禁用开关并标明锁类型,本包不自建白名单;切换被接受后界面重读 Loader 确认状态,失败则按官方 `error.code` 呈现提示。
29
29
  - 在内置插件分组下方提供只读的「Agent 预设」区块,列出每个预设的组合行与状态(启用、停用、条件启用及表达式);由于预设行由组合决定,此处不提供启停开关。
30
30
 
31
31
  ## 安装
package/lib/client.js CHANGED
@@ -26,7 +26,7 @@ window.__ModuleLoader__.load({
26
26
  }
27
27
  //#endregion
28
28
  //#region \0dsh-css:packages/dsh-plugin-manager/src/client/plugin-manager.module.css.mjs
29
- const css = ".ZsMDKq_section{max-width:760px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:10px;display:flex}.ZsMDKq_title{margin:0;font-size:13px;font-weight:600;line-height:20px}.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_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}.ZsMDKq_actionRow{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.ZsMDKq_button{font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm,6px);color:var(--dsw-alias-label-primary);background:0 0;padding:5px 12px;font-size:12.5px;line-height:18px}.ZsMDKq_button:hover:enabled{background:var(--dsw-alias-interactive-bg-hover)}.ZsMDKq_button:disabled{cursor:default;opacity:.55}.ZsMDKq_button:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.ZsMDKq_primary{color:var(--dsw-alias-label-primary-foreground);background:var(--dsw-alias-button-primary-fill);border-color:var(--dsw-alias-button-primary-fill)}.ZsMDKq_primary:hover:enabled{background:var(--dsw-alias-button-primary-hover);border-color:var(--dsw-alias-button-primary-hover)}.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_ok{color:var(--dsw-alias-state-success-primary);margin:0;font-size:12px}.ZsMDKq_error{color:var(--dsw-alias-label-danger);word-break:break-word;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{transform-origin:0;width:100%;height:100%;transform:scaleX(var(--plugin-manager-progress,0));background:var(--dsw-alias-state-business-primary);transition:transform .2s}.ZsMDKq_progressBar[data-indeterminate=true]{width:40%;animation:1.2s ease-in-out infinite ZsMDKq_pluginManagerIndeterminate;transform:none}@keyframes ZsMDKq_pluginManagerIndeterminate{0%{transform:translate(-100%)}to{transform:translate(250%)}}@media (prefers-reduced-motion:reduce){.ZsMDKq_progressBar{transition:none}.ZsMDKq_progressBar[data-indeterminate=true]{width:40%;animation:none;transform:none}}.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_mount{align-self:center;margin-left:auto;position:relative}.ZsMDKq_toolbar{color:var(--dsw-alias-label-primary);align-items:center;gap:8px;font-size:12.5px;line-height:18px;display:flex;position:relative}.ZsMDKq_toolbarButton{font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm,6px);color:var(--dsw-alias-label-primary);background:0 0;padding:3px 10px}.ZsMDKq_toolbarButton:hover:enabled{background:var(--dsw-alias-interactive-bg-hover)}.ZsMDKq_toolbarButton:disabled{cursor:default;opacity:.55}.ZsMDKq_toolbarButton:focus-visible,.ZsMDKq_toolbarSummary:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.ZsMDKq_toolbarSummary{font:inherit;cursor:pointer;color:var(--dsw-alias-label-secondary);background:0 0;border:0;padding:3px 2px}.ZsMDKq_toolbarSummary:hover{color:var(--dsw-alias-label-primary)}.ZsMDKq_toolbarHint{max-width:320px;color:var(--dsw-alias-label-tertiary)}.ZsMDKq_panel{z-index:40;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);width:max-content;min-width:260px;max-width:min(440px,60vw);max-height:320px;box-shadow:var(--dsw-shadow-lv3,0 8px 24px #00000024);text-align:left;border-radius:10px;flex-direction:column;gap:8px;padding:12px;display:flex;position:absolute;top:calc(100% + 6px);right:0;overflow:auto}.ZsMDKq_panelActions{justify-content:flex-end;gap:8px;display:flex}.ZsMDKq_panelList{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_panelRow{flex-wrap:wrap;align-items:baseline;gap:6px;display:flex}.ZsMDKq_panelName{font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);word-break:break-all;font-size:12px}.ZsMDKq_panelVersion{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px}.ZsMDKq_restartRequired{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_restartRequiredLine{color:var(--dsw-alias-label-secondary);font-size:12px}.ZsMDKq_builtinMount{min-width:0}.ZsMDKq_builtinGroup{min-width:0;color:var(--dsw-alias-label-primary);flex-direction:column;gap:8px;display:flex}.ZsMDKq_builtinHead{align-items:center;gap:8px;min-width:0;display:flex}.ZsMDKq_builtinTitle{min-width:0;margin:0;font-size:14px;font-weight:500;line-height:22px}.ZsMDKq_builtinCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:12px;line-height:18px}.ZsMDKq_builtinScope{font:inherit;cursor:pointer;color:var(--dsw-alias-label-secondary);background:0 0;border:0;flex:none;margin-inline-start:auto;padding:3px 2px;font-size:12px;line-height:18px}.ZsMDKq_builtinScope:hover{color:var(--dsw-alias-label-primary)}.ZsMDKq_builtinScope:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.ZsMDKq_builtinList{flex-direction:column;gap:2px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_builtinRow{border-bottom:.5px solid var(--dsw-alias-border-l2);align-items:flex-start;gap:12px;min-width:0;padding:12px 2px;display:flex}.ZsMDKq_builtinRow:last-child{border-bottom:0}.ZsMDKq_builtinMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.ZsMDKq_builtinName{overflow-wrap:anywhere;font-size:13px;line-height:20px}.ZsMDKq_builtinModule{font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere;font-size:12px;line-height:18px}.ZsMDKq_builtinOwner{color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere;font-size:12px;line-height:18px}.ZsMDKq_builtinReason{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;font-size:12px;line-height:18px}.ZsMDKq_presetGroup{border-top:.5px solid var(--dsw-alias-border-l2);flex-direction:column;gap:6px;min-width:0;padding-top:12px;display:flex}.ZsMDKq_presetTitle{margin:0;font-size:13px;font-weight:500;line-height:20px}.ZsMDKq_presetList{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_presetCard{flex-direction:column;gap:2px;min-width:0;display:flex}.ZsMDKq_presetHead{align-items:baseline;gap:6px;min-width:0;display:flex}.ZsMDKq_presetName{overflow-wrap:anywhere;font-size:13px;line-height:20px}.ZsMDKq_presetTag{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.ZsMDKq_presetRows{flex-direction:column;gap:2px;margin:0;padding:0 0 0 12px;list-style:none;display:flex}.ZsMDKq_presetRow{align-items:baseline;gap:8px;min-width:0;font-size:12px;line-height:18px;display:flex}.ZsMDKq_presetRowName{font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}.ZsMDKq_presetRowState{color:var(--dsw-alias-label-tertiary);flex:none}";
29
+ const css = ".ZsMDKq_section{max-width:760px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:10px;display:flex}.ZsMDKq_title{margin:0;font-size:13px;font-weight:600;line-height:20px}.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_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px}.ZsMDKq_actionRow{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.ZsMDKq_button{font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm,6px);color:var(--dsw-alias-label-primary);background:0 0;padding:5px 12px;font-size:12.5px;line-height:18px}.ZsMDKq_button:hover:enabled{background:var(--dsw-alias-interactive-bg-hover)}.ZsMDKq_button:disabled{cursor:default;opacity:.55}.ZsMDKq_button:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.ZsMDKq_primary{color:var(--dsw-alias-label-primary-foreground);background:var(--dsw-alias-button-primary-fill);border-color:var(--dsw-alias-button-primary-fill)}.ZsMDKq_primary:hover:enabled{background:var(--dsw-alias-button-primary-hover);border-color:var(--dsw-alias-button-primary-hover)}.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_ok{color:var(--dsw-alias-state-success-primary);margin:0;font-size:12px}.ZsMDKq_error{color:var(--dsw-alias-label-danger);word-break:break-word;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{transform-origin:0;width:100%;height:100%;transform:scaleX(var(--plugin-manager-progress,0));background:var(--dsw-alias-state-business-primary);transition:transform .2s}.ZsMDKq_progressBar[data-indeterminate=true]{width:40%;animation:1.2s ease-in-out infinite ZsMDKq_pluginManagerIndeterminate;transform:none}@keyframes ZsMDKq_pluginManagerIndeterminate{0%{transform:translate(-100%)}to{transform:translate(250%)}}@media (prefers-reduced-motion:reduce){.ZsMDKq_progressBar{transition:none}.ZsMDKq_progressBar[data-indeterminate=true]{width:40%;animation:none;transform:none}}.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_mount{align-self:center;margin-left:auto;position:relative}.ZsMDKq_toolbar{color:var(--dsw-alias-label-primary);align-items:center;gap:8px;font-size:12.5px;line-height:18px;display:flex;position:relative}.ZsMDKq_toolbarButton{font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm,6px);color:var(--dsw-alias-label-primary);background:0 0;padding:3px 10px}.ZsMDKq_toolbarButton:hover:enabled{background:var(--dsw-alias-interactive-bg-hover)}.ZsMDKq_toolbarButton:disabled{cursor:default;opacity:.55}.ZsMDKq_toolbarButton:focus-visible,.ZsMDKq_toolbarSummary:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.ZsMDKq_toolbarSummary{font:inherit;cursor:pointer;color:var(--dsw-alias-label-secondary);background:0 0;border:0;padding:3px 2px}.ZsMDKq_toolbarSummary:hover{color:var(--dsw-alias-label-primary)}.ZsMDKq_toolbarHint{max-width:320px;color:var(--dsw-alias-label-tertiary)}.ZsMDKq_panel{z-index:40;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);width:max-content;min-width:260px;max-width:min(440px,60vw);max-height:320px;box-shadow:var(--dsw-shadow-lv3,0 8px 24px #00000024);text-align:left;border-radius:10px;flex-direction:column;gap:8px;padding:12px;display:flex;position:absolute;top:calc(100% + 6px);right:0;overflow:auto}.ZsMDKq_panelActions{justify-content:flex-end;gap:8px;display:flex}.ZsMDKq_panelList{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_panelRow{flex-wrap:wrap;align-items:baseline;gap:6px;display:flex}.ZsMDKq_panelName{font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);word-break:break-all;font-size:12px}.ZsMDKq_panelVersion{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px}.ZsMDKq_restartRequired{flex-direction:column;gap:4px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_restartRequiredLine{color:var(--dsw-alias-label-secondary);font-size:12px}.ZsMDKq_builtinMount{min-width:0}.ZsMDKq_builtinGroup{min-width:0;color:var(--dsw-alias-label-primary);flex-direction:column;gap:8px;display:flex}.ZsMDKq_builtinHead{align-items:center;gap:8px;min-width:0;display:flex}.ZsMDKq_builtinTitle{min-width:0;margin:0;font-size:14px;font-weight:500;line-height:22px}.ZsMDKq_builtinCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:12px;line-height:18px}.ZsMDKq_builtinScope{font:inherit;cursor:pointer;color:var(--dsw-alias-label-secondary);background:0 0;border:0;flex:none;margin-inline-start:auto;padding:3px 2px;font-size:12px;line-height:18px}.ZsMDKq_builtinScope:hover{color:var(--dsw-alias-label-primary)}.ZsMDKq_builtinScope:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.ZsMDKq_builtinTools{align-items:stretch;width:100%;min-width:0;padding:6px 0 4px;display:flex}.ZsMDKq_builtinTools .ZsMDKq_builtinSearch{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md,8px);width:auto;min-width:0;max-width:none;min-height:34px;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);flex:1 1 0;padding:6px 12px;font-size:12px;line-height:18px}.ZsMDKq_builtinTools .ZsMDKq_builtinSearch:hover{border-color:var(--dsw-alias-border-l3)}.ZsMDKq_builtinTools .ZsMDKq_builtinSearch::placeholder{color:var(--dsw-alias-label-tertiary)}.ZsMDKq_builtinTools .ZsMDKq_builtinSearch:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.ZsMDKq_builtinList{flex-direction:column;gap:2px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_builtinRow{border-bottom:.5px solid var(--dsw-alias-border-l2);align-items:flex-start;gap:12px;min-width:0;padding:12px 2px;display:flex}.ZsMDKq_builtinRow:last-child{border-bottom:0}.ZsMDKq_builtinPagination{flex-wrap:wrap;justify-content:center;align-items:center;gap:8px 16px;padding:12px 2px 6px;display:flex}.ZsMDKq_builtinPageInfo{text-align:center;min-width:140px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:0 auto;padding:0 4px;font-size:12px;line-height:18px}.ZsMDKq_builtinMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.ZsMDKq_builtinName{overflow-wrap:anywhere;font-size:13px;line-height:20px}.ZsMDKq_builtinModule{font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere;font-size:12px;line-height:18px}.ZsMDKq_builtinOwner{color:var(--dsw-alias-label-tertiary);overflow-wrap:anywhere;font-size:12px;line-height:18px}.ZsMDKq_builtinReason{color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;font-size:12px;line-height:18px}.ZsMDKq_presetGroup{border-top:.5px solid var(--dsw-alias-border-l2);flex-direction:column;gap:6px;min-width:0;padding-top:12px;display:flex}.ZsMDKq_presetTitle{margin:0;font-size:13px;font-weight:500;line-height:20px}.ZsMDKq_presetList{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.ZsMDKq_presetCard{flex-direction:column;gap:2px;min-width:0;display:flex}.ZsMDKq_presetHead{align-items:baseline;gap:6px;min-width:0;display:flex}.ZsMDKq_presetName{overflow-wrap:anywhere;font-size:13px;line-height:20px}.ZsMDKq_presetTag{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.ZsMDKq_presetRows{flex-direction:column;gap:2px;margin:0;padding:0 0 0 12px;list-style:none;display:flex}.ZsMDKq_presetRow{align-items:baseline;gap:8px;min-width:0;font-size:12px;line-height:18px;display:flex}.ZsMDKq_presetRowName{font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}.ZsMDKq_presetRowState{color:var(--dsw-alias-label-tertiary);flex:none}";
30
30
  const tagId = "@linxin666/dsh-client-ui-plugin-manager/packages/dsh-plugin-manager/src/client/plugin-manager.module.css";
31
31
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
32
32
  const tag = document.createElement("style");
@@ -46,10 +46,14 @@ window.__ModuleLoader__.load({
46
46
  "builtinMount": "ZsMDKq_builtinMount",
47
47
  "builtinName": "ZsMDKq_builtinName",
48
48
  "builtinOwner": "ZsMDKq_builtinOwner",
49
+ "builtinPageInfo": "ZsMDKq_builtinPageInfo",
50
+ "builtinPagination": "ZsMDKq_builtinPagination",
49
51
  "builtinReason": "ZsMDKq_builtinReason",
50
52
  "builtinRow": "ZsMDKq_builtinRow",
51
53
  "builtinScope": "ZsMDKq_builtinScope",
54
+ "builtinSearch": "ZsMDKq_builtinSearch",
52
55
  "builtinTitle": "ZsMDKq_builtinTitle",
56
+ "builtinTools": "ZsMDKq_builtinTools",
53
57
  "button": "ZsMDKq_button",
54
58
  "compatBlocked": "ZsMDKq_compatBlocked",
55
59
  "compatHint": "ZsMDKq_compatHint",
@@ -545,6 +549,8 @@ window.__ModuleLoader__.load({
545
549
  * a host diagnostic can carry an absolute path — and is logged instead.
546
550
  */
547
551
  const FALLBACK_CODE = "operation-error";
552
+ /** Keep the expanded inventory bounded: the full result stays available to search. */
553
+ const BUILTIN_PAGE_SIZE = 20;
548
554
  /** Log one caught failure where a developer can read it, naming what failed. */
549
555
  function warnFailure(what, error) {
550
556
  console.warn(`plugin-manager: ${what}`, error);
@@ -678,23 +684,36 @@ window.__ModuleLoader__.load({
678
684
  * row's enablement, so a reader can widen the list without the Loader moving.
679
685
  */
680
686
  const [scope, setScope] = (0, react.useState)("default");
687
+ const [query, setQuery] = (0, react.useState)("");
688
+ const [page, setPage] = (0, react.useState)(1);
681
689
  const listId = (0, react.useId)();
682
690
  const ready = state.kind === "ready" ? state : void 0;
683
691
  const rows = ready === void 0 ? [] : scope === "all" ? ready.allRows : ready.rows;
684
692
  /** Rows the default scope leaves out: what the scope control would add. */
685
693
  const ownedCount = ready === void 0 ? 0 : ready.allRows.length - ready.rows.length;
686
694
  const presets = ready === void 0 ? [] : ready.presets;
695
+ const normalizedQuery = query.trim().toLowerCase();
696
+ const filteredRows = normalizedQuery === "" ? rows : rows.filter((row) => [
697
+ rowTitle(row, resolveText),
698
+ row.moduleName,
699
+ row.entryId,
700
+ row.ownedBy ?? ""
701
+ ].some((text) => text.toLowerCase().includes(normalizedQuery)));
702
+ const pageCount = Math.max(1, Math.ceil(filteredRows.length / BUILTIN_PAGE_SIZE));
703
+ const currentPage = Math.min(page, pageCount);
704
+ const pageStart = (currentPage - 1) * BUILTIN_PAGE_SIZE;
705
+ const visibleRows = filteredRows.slice(pageStart, pageStart + BUILTIN_PAGE_SIZE);
687
706
  /**
688
707
  * The visible label of each row: its name, and the line under it — the module, or
689
708
  * the entry id when the name already is that module. Two rows carrying the same
690
709
  * pair read identically, which is the only case where the row has to say which
691
710
  * entry it is; a title two rows share is exactly that case, and so is a module
692
- * several rows name. Counted over the list on screen, so each scope answers for
693
- * itself and switching scope neither reads nor writes anything.
711
+ * several rows name. Counted over the filtered result, so paging cannot hide
712
+ * the other half of a collision; each scope still answers for itself.
694
713
  */
695
714
  const labels = /* @__PURE__ */ new Map();
696
715
  const labelCounts = /* @__PURE__ */ new Map();
697
- for (const row of rows) {
716
+ for (const row of filteredRows) {
698
717
  const title = rowTitle(row, resolveText);
699
718
  const label = `${title}\u0000${title === row.moduleName ? row.entryId : row.moduleName}`;
700
719
  labels.set(row.entryId, label);
@@ -764,8 +783,8 @@ window.__ModuleLoader__.load({
764
783
  }),
765
784
  ready !== void 0 && ready.bundles === "confirmed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
766
785
  className: plugin_manager_module_css_default.builtinCount,
767
- "data-builtin-count": rows.length,
768
- children: rows.length
786
+ "data-builtin-count": filteredRows.length,
787
+ children: filteredRows.length
769
788
  }),
770
789
  ownedCount > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
771
790
  type: "button",
@@ -775,6 +794,7 @@ window.__ModuleLoader__.load({
775
794
  "aria-controls": listId,
776
795
  onClick: () => {
777
796
  setScope(scope === "all" ? "default" : "all");
797
+ setPage(1);
778
798
  },
779
799
  children: t(scope === "all" ? "builtinScopeCollapse" : "builtinScopeExpand", { count: String(ownedCount) })
780
800
  })
@@ -810,10 +830,39 @@ window.__ModuleLoader__.load({
810
830
  className: plugin_manager_module_css_default.hint,
811
831
  children: t("builtinEmpty")
812
832
  }),
833
+ rows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
834
+ className: plugin_manager_module_css_default.builtinTools,
835
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
836
+ className: plugin_manager_module_css_default.builtinSearch,
837
+ type: "search",
838
+ value: query,
839
+ spellCheck: false,
840
+ autoComplete: "off",
841
+ "aria-label": t("builtinSearchLabel"),
842
+ "aria-controls": listId,
843
+ placeholder: t("builtinSearchPlaceholder"),
844
+ "data-builtin-search": true,
845
+ onChange: (event) => {
846
+ setQuery(event.target.value);
847
+ setPage(1);
848
+ },
849
+ onKeyDown: (event) => {
850
+ if (event.key === "Escape" && query !== "") {
851
+ setQuery("");
852
+ setPage(1);
853
+ }
854
+ }
855
+ })
856
+ }),
857
+ rows.length > 0 && filteredRows.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
858
+ className: plugin_manager_module_css_default.hint,
859
+ role: "status",
860
+ children: t("builtinSearchEmpty")
861
+ }),
813
862
  rows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
814
863
  className: plugin_manager_module_css_default.builtinList,
815
864
  id: listId,
816
- children: rows.map((row) => {
865
+ children: visibleRows.map((row) => {
817
866
  const title = rowTitle(row, resolveText);
818
867
  const reason = writeReason(row.write, t);
819
868
  const locked = row.write !== "writable";
@@ -862,6 +911,39 @@ window.__ModuleLoader__.load({
862
911
  }, row.entryId);
863
912
  })
864
913
  }),
914
+ filteredRows.length > BUILTIN_PAGE_SIZE && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
915
+ className: plugin_manager_module_css_default.builtinPagination,
916
+ "data-dsh-part": "pagination",
917
+ children: [
918
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
919
+ type: "button",
920
+ className: plugin_manager_module_css_default.button,
921
+ disabled: currentPage === 1,
922
+ onClick: () => {
923
+ setPage(currentPage - 1);
924
+ },
925
+ children: t("builtinPagePrevious")
926
+ }),
927
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
928
+ className: plugin_manager_module_css_default.builtinPageInfo,
929
+ "aria-live": "polite",
930
+ children: t("builtinPageInfo", {
931
+ page: String(currentPage),
932
+ pages: String(pageCount),
933
+ count: String(filteredRows.length)
934
+ })
935
+ }),
936
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
937
+ type: "button",
938
+ className: plugin_manager_module_css_default.button,
939
+ disabled: currentPage === pageCount,
940
+ onClick: () => {
941
+ setPage(currentPage + 1);
942
+ },
943
+ children: t("builtinPageNext")
944
+ })
945
+ ]
946
+ }),
865
947
  presets.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
866
948
  className: plugin_manager_module_css_default.presetGroup,
867
949
  "data-dsh-part": "preset-group",
@@ -1557,6 +1639,12 @@ window.__ModuleLoader__.load({
1557
1639
  "builtinUnconfirmed": "无法读取已安装组合包的行清单,这里按全部 Loader 条目列出。",
1558
1640
  "builtinScopeExpand": "显示已归属组合包的行({count})",
1559
1641
  "builtinScopeCollapse": "隐藏已归属组合包的行({count})",
1642
+ "builtinSearchLabel": "搜索内置插件",
1643
+ "builtinSearchPlaceholder": "搜索名称、包名或行 id",
1644
+ "builtinSearchEmpty": "没有匹配的内置插件。",
1645
+ "builtinPagePrevious": "上一页",
1646
+ "builtinPageNext": "下一页",
1647
+ "builtinPageInfo": "第 {page} / {pages} 页,共 {count} 项",
1560
1648
  "builtinOwnedBy": "来自 {name}",
1561
1649
  "builtinToggle": "启用插件 {name}",
1562
1650
  "builtinFailedEnable": "启用失败:{reason}",
@@ -1632,6 +1720,12 @@ window.__ModuleLoader__.load({
1632
1720
  "builtinUnconfirmed": "The installed bundles could not be read, so every Loader entry is listed here.",
1633
1721
  "builtinScopeExpand": "Show the rows these bundles own ({count})",
1634
1722
  "builtinScopeCollapse": "Hide the rows these bundles own ({count})",
1723
+ "builtinSearchLabel": "Search built-in plugins",
1724
+ "builtinSearchPlaceholder": "Search by name, package, or entry id",
1725
+ "builtinSearchEmpty": "No built-in plugins match this search.",
1726
+ "builtinPagePrevious": "Previous",
1727
+ "builtinPageNext": "Next",
1728
+ "builtinPageInfo": "Page {page} of {pages} · {count} items",
1635
1729
  "builtinOwnedBy": "From {name}",
1636
1730
  "builtinToggle": "Enable plugin {name}",
1637
1731
  "builtinFailedEnable": "Could not enable it: {reason}",
@@ -1917,7 +2011,7 @@ window.__ModuleLoader__.load({
1917
2011
  /** The building package's version, when the bundle carries it. */
1918
2012
  function bakedVersion() {
1919
2013
  try {
1920
- return "0.4.19";
2014
+ return "0.4.20";
1921
2015
  } catch {
1922
2016
  return;
1923
2017
  }