mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-10 08:41:13 +00:00
refactor(plugins): separate activation from enablement (#59844)
* refactor(plugins): separate activation from enablement * fix(cli): sanitize verbose plugin activation reasons
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { normalizeProviderId } from "../agents/provider-id.js";
|
||||
import { withBundledPluginVitestCompat } from "./bundled-compat.js";
|
||||
import { normalizePluginsConfig, resolveEffectiveEnableState } from "./config-state.js";
|
||||
import { normalizePluginsConfig, resolveEffectivePluginActivationState } from "./config-state.js";
|
||||
import type { PluginLoadOptions } from "./loader.js";
|
||||
import { loadPluginManifestRegistry } from "./manifest-registry.js";
|
||||
|
||||
@@ -53,12 +53,12 @@ export function resolveEnabledProviderPluginIds(params: {
|
||||
(plugin) =>
|
||||
plugin.providers.length > 0 &&
|
||||
(!onlyPluginIdSet || onlyPluginIdSet.has(plugin.id)) &&
|
||||
resolveEffectiveEnableState({
|
||||
resolveEffectivePluginActivationState({
|
||||
id: plugin.id,
|
||||
origin: plugin.origin,
|
||||
config: normalizedConfig,
|
||||
rootConfig: params.config,
|
||||
}).enabled,
|
||||
}).activated,
|
||||
)
|
||||
.map((plugin) => plugin.id)
|
||||
.toSorted((left, right) => left.localeCompare(right));
|
||||
@@ -111,12 +111,12 @@ export function resolveNonBundledProviderPluginIds(params: {
|
||||
(plugin) =>
|
||||
plugin.origin !== "bundled" &&
|
||||
plugin.providers.length > 0 &&
|
||||
resolveEffectiveEnableState({
|
||||
resolveEffectivePluginActivationState({
|
||||
id: plugin.id,
|
||||
origin: plugin.origin,
|
||||
config: normalizedConfig,
|
||||
rootConfig: params.config,
|
||||
}).enabled,
|
||||
}).activated,
|
||||
)
|
||||
.map((plugin) => plugin.id)
|
||||
.toSorted((left, right) => left.localeCompare(right));
|
||||
@@ -137,12 +137,12 @@ export function resolveCatalogHookProviderPluginIds(params: {
|
||||
.filter(
|
||||
(plugin) =>
|
||||
plugin.providers.length > 0 &&
|
||||
resolveEffectiveEnableState({
|
||||
resolveEffectivePluginActivationState({
|
||||
id: plugin.id,
|
||||
origin: plugin.origin,
|
||||
config: normalizedConfig,
|
||||
rootConfig: params.config,
|
||||
}).enabled,
|
||||
}).activated,
|
||||
)
|
||||
.map((plugin) => plugin.id);
|
||||
const bundledCompatPluginIds = resolveBundledProviderCompatPluginIds(params);
|
||||
|
||||
Reference in New Issue
Block a user