mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-01 11:43:31 +00:00
22 lines
792 B
TypeScript
22 lines
792 B
TypeScript
/** Resolves the source config snapshot used for plugin activation policy decisions. */
|
|
import {
|
|
getRuntimeConfigSnapshot,
|
|
getRuntimeConfigSourceSnapshot,
|
|
} from "../config/runtime-snapshot.js";
|
|
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
|
|
|
/** Resolves the source config used for plugin activation policy decisions. */
|
|
export function resolvePluginActivationSourceConfig(params: {
|
|
config?: OpenClawConfig;
|
|
activationSourceConfig?: OpenClawConfig;
|
|
}): OpenClawConfig {
|
|
if (params.activationSourceConfig !== undefined) {
|
|
return params.activationSourceConfig;
|
|
}
|
|
const sourceSnapshot = getRuntimeConfigSourceSnapshot();
|
|
if (sourceSnapshot && params.config === getRuntimeConfigSnapshot()) {
|
|
return sourceSnapshot;
|
|
}
|
|
return params.config ?? {};
|
|
}
|