mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-03 17:53:34 +00:00
17 lines
547 B
TypeScript
17 lines
547 B
TypeScript
/** Manifest fields that control default plugin enablement. */
|
|
export type PluginDefaultEnablement = {
|
|
enabledByDefault?: boolean;
|
|
enabledByDefaultOnPlatforms?: readonly string[];
|
|
};
|
|
|
|
/** True when a plugin should be enabled by default for a platform. */
|
|
export function isPluginEnabledByDefaultForPlatform(
|
|
plugin: PluginDefaultEnablement,
|
|
platform: NodeJS.Platform = process.platform,
|
|
): boolean {
|
|
if (plugin.enabledByDefault === true) {
|
|
return true;
|
|
}
|
|
return plugin.enabledByDefaultOnPlatforms?.includes(platform) === true;
|
|
}
|