mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 22:00:43 +00:00
* fix: address issue * fix: address review feedback * fix: finalize issue changes * fix: address PR review feedback * address build faiure * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import type { OpenClawConfig } from "../../config/types.openclaw.js";
|
|
import { loadOpenClawPlugins } from "../loader.js";
|
|
import { hasExplicitPluginIdScope } from "../plugin-scope.js";
|
|
import type { PluginRegistry } from "../registry.js";
|
|
import type { PluginLogger } from "../types.js";
|
|
import { buildPluginRuntimeLoadOptions, resolvePluginRuntimeLoadContext } from "./load-context.js";
|
|
|
|
export function loadPluginMetadataRegistrySnapshot(options?: {
|
|
config?: OpenClawConfig;
|
|
activationSourceConfig?: OpenClawConfig;
|
|
env?: NodeJS.ProcessEnv;
|
|
logger?: PluginLogger;
|
|
workspaceDir?: string;
|
|
onlyPluginIds?: string[];
|
|
loadModules?: boolean;
|
|
}): PluginRegistry {
|
|
const context = resolvePluginRuntimeLoadContext(options);
|
|
|
|
return loadOpenClawPlugins(
|
|
buildPluginRuntimeLoadOptions(context, {
|
|
throwOnLoadError: true,
|
|
cache: false,
|
|
activate: false,
|
|
mode: "validate",
|
|
loadModules: options?.loadModules,
|
|
...(hasExplicitPluginIdScope(options?.onlyPluginIds)
|
|
? { onlyPluginIds: options?.onlyPluginIds }
|
|
: {}),
|
|
}),
|
|
);
|
|
}
|