feat(plugins): refresh registry after plugin mutations

This commit is contained in:
Vincent Koc
2026-04-25 04:30:21 -07:00
parent 53c3c949d0
commit 0cc2b0e283
5 changed files with 72 additions and 0 deletions

View File

@@ -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) {