fix(cli): resolve message channel plugin scopes

This commit is contained in:
Peter Steinberger
2026-04-27 21:02:00 +01:00
parent 0c305596a2
commit 5e49e8590d
7 changed files with 98 additions and 10 deletions

View File

@@ -98,7 +98,7 @@ describe("runMessageAction", () => {
expect(ensurePluginRegistryLoaded).toHaveBeenCalledWith({
scope: "configured-channels",
onlyPluginIds: ["discord"],
onlyChannelIds: ["discord"],
});
expect(exitMock).toHaveBeenCalledOnce();
expect(exitMock).toHaveBeenCalledWith(0);
@@ -117,7 +117,7 @@ describe("runMessageAction", () => {
expect(ensurePluginRegistryLoaded).toHaveBeenCalledWith({
scope: "configured-channels",
onlyPluginIds: ["telegram"],
onlyChannelIds: ["telegram"],
});
});

View File

@@ -34,14 +34,14 @@ async function runPluginStopHooks(): Promise<void> {
function resolveMessagePluginLoadOptions(
opts: Record<string, unknown>,
): { scope: PluginRegistryScope; onlyPluginIds?: string[] } | undefined {
): { scope: PluginRegistryScope; onlyChannelIds?: string[] } | undefined {
const scopedChannel = resolveMessageSecretScope({
channel: opts.channel,
target: opts.target,
targets: opts.targets,
}).channel;
if (scopedChannel) {
return { scope: "configured-channels", onlyPluginIds: [scopedChannel] };
return { scope: "configured-channels", onlyChannelIds: [scopedChannel] };
}
return { scope: "configured-channels" };
}