mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 13:50:42 +00:00
29 lines
992 B
TypeScript
29 lines
992 B
TypeScript
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
|
import { resolveRuntimePluginRegistry } from "../plugins/loader.js";
|
|
import { getActivePluginRuntimeSubagentMode } from "../plugins/runtime.js";
|
|
import { resolveUserPath } from "../utils.js";
|
|
|
|
export function ensureRuntimePluginsLoaded(params: {
|
|
config?: OpenClawConfig;
|
|
workspaceDir?: string | null;
|
|
allowGatewaySubagentBinding?: boolean;
|
|
}): void {
|
|
const workspaceDir =
|
|
typeof params.workspaceDir === "string" && params.workspaceDir.trim()
|
|
? resolveUserPath(params.workspaceDir)
|
|
: undefined;
|
|
const allowGatewaySubagentBinding =
|
|
params.allowGatewaySubagentBinding === true ||
|
|
getActivePluginRuntimeSubagentMode() === "gateway-bindable";
|
|
const loadOptions = {
|
|
config: params.config,
|
|
workspaceDir,
|
|
runtimeOptions: allowGatewaySubagentBinding
|
|
? {
|
|
allowGatewaySubagentBinding: true,
|
|
}
|
|
: undefined,
|
|
};
|
|
resolveRuntimePluginRegistry(loadOptions);
|
|
}
|