mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:20:42 +00:00
feat(plugins): refresh registry after plugin mutations
This commit is contained in:
@@ -36,6 +36,7 @@ import {
|
||||
import { setPluginEnabledInConfig } from "./plugins-config.js";
|
||||
import { runPluginInstallCommand } from "./plugins-install-command.js";
|
||||
import { formatPluginLine } from "./plugins-list-format.js";
|
||||
import { refreshPluginRegistryAfterConfigMutation } from "./plugins-registry-refresh.js";
|
||||
import { resolvePluginUninstallId } from "./plugins-uninstall-selection.js";
|
||||
import { runPluginUpdateCommand } from "./plugins-update-command.js";
|
||||
import { promptYesNo } from "./prompt.js";
|
||||
@@ -498,6 +499,13 @@ export function registerPluginsCli(program: Command) {
|
||||
nextConfig: next,
|
||||
...(snapshot.hash !== undefined ? { baseHash: snapshot.hash } : {}),
|
||||
});
|
||||
await refreshPluginRegistryAfterConfigMutation({
|
||||
config: next,
|
||||
reason: "policy-changed",
|
||||
logger: {
|
||||
warn: (message) => defaultRuntime.log(theme.warn(message)),
|
||||
},
|
||||
});
|
||||
logSlotWarnings(slotResult.warnings);
|
||||
if (enableResult.enabled) {
|
||||
defaultRuntime.log(`Enabled plugin "${id}". Restart the gateway to apply.`);
|
||||
@@ -522,6 +530,13 @@ export function registerPluginsCli(program: Command) {
|
||||
nextConfig: next,
|
||||
...(snapshot.hash !== undefined ? { baseHash: snapshot.hash } : {}),
|
||||
});
|
||||
await refreshPluginRegistryAfterConfigMutation({
|
||||
config: next,
|
||||
reason: "policy-changed",
|
||||
logger: {
|
||||
warn: (message) => defaultRuntime.log(theme.warn(message)),
|
||||
},
|
||||
});
|
||||
defaultRuntime.log(`Disabled plugin "${id}". Restart the gateway to apply.`);
|
||||
});
|
||||
|
||||
@@ -645,6 +660,13 @@ export function registerPluginsCli(program: Command) {
|
||||
nextConfig: result.config,
|
||||
...(snapshot.hash !== undefined ? { baseHash: snapshot.hash } : {}),
|
||||
});
|
||||
await refreshPluginRegistryAfterConfigMutation({
|
||||
config: result.config,
|
||||
reason: "source-changed",
|
||||
logger: {
|
||||
warn: (message) => defaultRuntime.log(theme.warn(message)),
|
||||
},
|
||||
});
|
||||
|
||||
const removed: string[] = [];
|
||||
if (result.actions.entry) {
|
||||
|
||||
Reference in New Issue
Block a user