mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 10:41:23 +00:00
refactor: share plugin runtime load context
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { applyPluginAutoEnable } from "../config/plugin-auto-enable.js";
|
||||
import { resolveRuntimePluginRegistry } from "./loader.js";
|
||||
import { getMemoryRuntime } from "./memory-state.js";
|
||||
import {
|
||||
buildPluginRuntimeLoadOptions,
|
||||
resolvePluginRuntimeLoadContext,
|
||||
} from "./runtime/load-context.js";
|
||||
|
||||
function ensureMemoryRuntime(cfg?: OpenClawConfig) {
|
||||
const current = getMemoryRuntime();
|
||||
if (current || !cfg) {
|
||||
return current;
|
||||
}
|
||||
const autoEnabled = applyPluginAutoEnable({ config: cfg, env: process.env });
|
||||
resolveRuntimePluginRegistry({
|
||||
config: autoEnabled.config,
|
||||
activationSourceConfig: cfg,
|
||||
autoEnabledReasons: autoEnabled.autoEnabledReasons,
|
||||
});
|
||||
resolveRuntimePluginRegistry(
|
||||
buildPluginRuntimeLoadOptions(resolvePluginRuntimeLoadContext({ config: cfg })),
|
||||
);
|
||||
return getMemoryRuntime();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user