mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 14:02:55 +00:00
Extract shared normalization/coercion helpers into private @openclaw/normalization-core workspace package while preserving existing plugin SDK helper subpaths.\n\nAlso keeps direct normalization-core imports internal, wires UI/build/loader resolution, and replaces the slow PR network CodeQL lane with a fast added-line boundary scan while retaining full CodeQL for scheduled/manual runs.\n\nVerification: local moved tests, plugin SDK boundary tests, extension loader tests, agents-support shard, UI build/test, build artifacts, lint, workflow guards, autoreview, and GitHub CI passed on PR head 963d893715.
24 lines
587 B
TypeScript
24 lines
587 B
TypeScript
import { isRecord } from "@openclaw/normalization-core/record-coerce";
|
|
|
|
type PluginWebSearchConfigCarrier = {
|
|
plugins?: {
|
|
entries?: Record<
|
|
string,
|
|
{
|
|
config?: unknown;
|
|
}
|
|
>;
|
|
};
|
|
};
|
|
|
|
export function resolvePluginWebSearchConfig(
|
|
config: PluginWebSearchConfigCarrier | undefined,
|
|
pluginId: string,
|
|
): Record<string, unknown> | undefined {
|
|
const pluginConfig = config?.plugins?.entries?.[pluginId]?.config;
|
|
if (!isRecord(pluginConfig)) {
|
|
return undefined;
|
|
}
|
|
return isRecord(pluginConfig.webSearch) ? pluginConfig.webSearch : undefined;
|
|
}
|