feat(plugin-inventory): live plugin activation, mirror install, and toggle lists
Installing a plugin now activates it without a restart: the CLI boot provides a dshReloadProfile handle that re-runs the profile composition and applies it to the running root Include, and the install/uninstall Remotes recompose live when the handle is present (restartRequired: false). Registry installs try the ordered INSTALL_REGISTRIES mirrors with the official npm registry as the final fallback, erroring only when every source is unreachable. The enable/disable guard splits into a REQUIRED_PLUGINS blacklist and a USER_TOGGLEABLE_PLUGINS whitelist (default toggleable) generated from the running plugin list, and the offline optional-bundle catalog is emptied (default bundles are not installable/uninstallable). The plugin-list tab becomes a registry install form and shows immediate-activation instead of a restart notice. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
每条条目带 `protected` 标记。`src/required.ts` 中的守卫默认开放,含两个可由代码编辑的名单:`REQUIRED_PLUGINS`(黑名单,即不可停用的承重核心——入口树、Remote RPC 主干、session 与 agent 主干)与 `USER_TOGGLEABLE_PLUGINS`(白名单,覆盖黑名单、对显式可开关的插件生效);未列入任何名单的插件默认可切换。随包 base bundle 的完整依赖图分类见 [`docs/plugin-system.md`](../../../docs/plugin-system.md)。`setEnabled` 拒绝停用必需插件;启用后会校验 fiber 变为 active(依赖缺失的启用会回滚)。Web 插件列表 tab 渲染单一扁平列表,包含所有条目:每项按真实启用状态显示,可切换插件带"启用"或"停用"按钮(这样 bundle 默认禁用的插件也能重新启用),必需插件只显示只读说明。
|
||||
|
||||
网关还通过 `availableBundles`/`install`/`uninstall` 管理安装。`availableBundles` 列出 `src/bundles.ts`(`AVAILABLE_BUNDLES`)中策展的离线可安装可选 bundle,每项在存在于 profile 的 `dsh.profile.bundles` 时标记为已安装。`install` 把离线 bundle 组合进该列表(无需网络);对 registry spec 则用内置 Node 与 vendored pnpm 在可写的 profile 目录运行 pnpm——registry 安装受 `dshAllowPluginInstall` 上下文标志门禁,仅桌面启动会开启。这些写入持久化 profile 清单,需重启生效。公开 payload 类型位于 `./types`,Typert 生成由 `./typert` 与 `./remote` 导出的 Host 和 Client Remote 产物。
|
||||
网关还通过 `availableBundles`/`installPlugin`/`uninstall` 管理安装。`availableBundles` 列出 `src/bundles.ts`(`AVAILABLE_BUNDLES`)中策展的离线可安装可选 bundle;该目录目前为空,直到有可选 bundle 随包——profile 的默认 bundle(`dsh-base`、`dsh-web-app`、`dsh-image-recognition-bundle`)是部署的一部分,非可选插件,`uninstall` 拒绝移除它们。`installPlugin` 对 registry 包 spec 用内置 Node 与 vendored pnpm 在可写的 profile 目录运行 pnpm(设置页插件列表 tab 以"安装插件"表单提供此入口);registry 安装受 `dshAllowPluginInstall` 上下文标志门禁,仅桌面启动会开启。它会依次尝试 `src/install.ts` 中排序的 `INSTALL_REGISTRIES` 镜像源列表,直到其中一个成功——官方 npm 源排在最后作为保底,只有所有镜像源都不可达才报错。当 boot 提供了 `dshReloadProfile` 句柄时,网关在写入后重组合运行中的树,使插件立即生效(`restartRequired: false`);否则安装持久化 profile 清单,需重启生效(`restartRequired: true`)。公开 payload 类型位于 `./types`,Typert 生成由 `./typert` 与 `./remote` 导出的 Host 和 Client Remote 产物。
|
||||
|
||||
该服务仅供 Remote 使用,刻意不声明同进程 Cordis `Context` merge。Client 包通过显式的 [`api-remotes`](../../api/remotes/README.md) 组合消费它,而不导入 Host 实现。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user