fix: include setup cli backends in plugin lookup

This commit is contained in:
Shakker
2026-04-27 07:37:59 +01:00
parent 5228b24927
commit b2deb74694
2 changed files with 13 additions and 0 deletions

View File

@@ -94,6 +94,9 @@ function buildOwnerMaps(plugins: readonly PluginManifestRecord[]): PluginLookUpT
for (const cliBackendId of plugin.cliBackends) {
appendOwner(cliBackends, cliBackendId, plugin.id);
}
for (const cliBackendId of plugin.setup?.cliBackends ?? []) {
appendOwner(cliBackends, cliBackendId, plugin.id);
}
for (const setupProvider of plugin.setup?.providers ?? []) {
appendOwner(setupProviders, setupProvider.id, plugin.id);
}

View File

@@ -244,6 +244,9 @@ describe("plugin registry facade", () => {
expect(resolveProviderOwners({ lookUpTable, providerId: "DEMO" })).toEqual(["demo"]);
expect(resolveChannelOwners({ lookUpTable, channelId: "demo-chat" })).toEqual(["demo"]);
expect(resolveCliBackendOwners({ lookUpTable, cliBackendId: "demo-cli" })).toEqual(["demo"]);
expect(resolveCliBackendOwners({ lookUpTable, cliBackendId: "demo-setup-cli" })).toEqual([
"demo",
]);
expect(resolveSetupProviderOwners({ lookUpTable, setupProviderId: "demo-setup" })).toEqual([
"demo",
]);
@@ -254,6 +257,13 @@ describe("plugin registry facade", () => {
matches: "demo-command",
}),
).toEqual(["demo"]);
expect(
resolvePluginContributionOwners({
lookUpTable,
contribution: "cliBackends",
matches: "demo-setup-cli",
}),
).toEqual(["demo"]);
expect(
resolvePluginContributionOwners({
lookUpTable,