mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 01:31:08 +00:00
31 lines
934 B
TypeScript
31 lines
934 B
TypeScript
import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";
|
|
import type { OpenClawConfig } from "./config.js";
|
|
import {
|
|
configMayNeedPluginAutoEnable,
|
|
resolveConfiguredPluginAutoEnableCandidates,
|
|
resolvePluginAutoEnableManifestRegistry,
|
|
type PluginAutoEnableCandidate,
|
|
} from "./plugin-auto-enable.shared.js";
|
|
|
|
export function detectPluginAutoEnableCandidates(params: {
|
|
config?: OpenClawConfig;
|
|
env?: NodeJS.ProcessEnv;
|
|
manifestRegistry?: PluginManifestRegistry;
|
|
}): PluginAutoEnableCandidate[] {
|
|
const env = params.env ?? process.env;
|
|
const config = params.config ?? ({} as OpenClawConfig);
|
|
if (!configMayNeedPluginAutoEnable(config, env)) {
|
|
return [];
|
|
}
|
|
const registry = resolvePluginAutoEnableManifestRegistry({
|
|
config,
|
|
env,
|
|
manifestRegistry: params.manifestRegistry,
|
|
});
|
|
return resolveConfiguredPluginAutoEnableCandidates({
|
|
config,
|
|
env,
|
|
registry,
|
|
});
|
|
}
|