Files
openclaw/src/agents/runtime-plugins.ts
2026-04-25 02:01:48 +01:00

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);
}