mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:30:42 +00:00
fix: include setup cli backends in plugin lookup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user