openclaw/src/plugins/providers.ts

20 lines
650 B
TypeScript
Raw Normal View History

import { createSubsystemLogger } from "../logging/subsystem.js";
2026-01-30 03:15:10 +01:00
import { loadOpenClawPlugins, type PluginLoadOptions } from "./loader.js";
import { createPluginLoaderLogger } from "./logger.js";
import type { ProviderPlugin } from "./types.js";
2026-01-16 00:39:22 +00:00
const log = createSubsystemLogger("plugins");
export function resolvePluginProviders(params: {
config?: PluginLoadOptions["config"];
2026-01-16 00:39:22 +00:00
workspaceDir?: string;
}): ProviderPlugin[] {
2026-01-30 03:15:10 +01:00
const registry = loadOpenClawPlugins({
2026-01-16 00:39:22 +00:00
config: params.config,
workspaceDir: params.workspaceDir,
logger: createPluginLoaderLogger(log),
2026-01-16 00:39:22 +00:00
});
return registry.providers.map((entry) => entry.provider);
}