mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:10:44 +00:00
refactor(plugins): drop provider discovery alias
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
runProviderCatalog,
|
||||
runProviderStaticCatalog,
|
||||
} from "./provider-discovery.js";
|
||||
import * as providerDiscoveryModule from "./provider-discovery.js";
|
||||
import { cleanupTrackedTempDirs, makeTrackedTempDir } from "./test-helpers/fs-fixtures.js";
|
||||
import type { ProviderCatalogResult, ProviderDiscoveryOrder, ProviderPlugin } from "./types.js";
|
||||
|
||||
@@ -179,6 +180,10 @@ describe("resolveInstalledPluginProviderContributionIds", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("does not keep exporting the ambiguous runtime-discovery alias", () => {
|
||||
expect(Object.keys(providerDiscoveryModule)).not.toContain("resolvePluginDiscoveryProviders");
|
||||
});
|
||||
|
||||
it("reads provider ids from the installed plugin index without importing runtime entries", () => {
|
||||
const candidate = createProviderContributionCandidate({
|
||||
pluginId: "demo",
|
||||
|
||||
@@ -79,18 +79,6 @@ export async function resolveRuntimePluginDiscoveryProviders(
|
||||
.filter((provider) => resolveProviderCatalogOrderHook(provider));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Runtime-backed provider discovery must be explicit at call sites.
|
||||
* Use `resolveRuntimePluginDiscoveryProviders(...)` for paths that intentionally
|
||||
* import provider plugin runtime, or `resolveInstalledPluginProviderContributionIds(...)`
|
||||
* for cold installed-index reads.
|
||||
*/
|
||||
export async function resolvePluginDiscoveryProviders(
|
||||
params: ResolveRuntimePluginDiscoveryProvidersParams,
|
||||
): Promise<ProviderPlugin[]> {
|
||||
return resolveRuntimePluginDiscoveryProviders(params);
|
||||
}
|
||||
|
||||
export function groupPluginDiscoveryProvidersByOrder(
|
||||
providers: ProviderPlugin[],
|
||||
): Record<ProviderDiscoveryOrder, ProviderPlugin[]> {
|
||||
|
||||
Reference in New Issue
Block a user