mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-01 04:11:03 +00:00
23 lines
705 B
TypeScript
23 lines
705 B
TypeScript
import type { ReplyPayload } from "../../auto-reply/types.js";
|
|
import type { OpenClawConfig } from "../../config/config.js";
|
|
import { getChannelPlugin, normalizeChannelId } from "./registry.js";
|
|
|
|
export function shouldSuppressLocalExecApprovalPrompt(params: {
|
|
channel?: string | null;
|
|
cfg: OpenClawConfig;
|
|
accountId?: string | null;
|
|
payload: ReplyPayload;
|
|
}): boolean {
|
|
const channel = params.channel ? normalizeChannelId(params.channel) : null;
|
|
if (!channel) {
|
|
return false;
|
|
}
|
|
return (
|
|
getChannelPlugin(channel)?.execApprovals?.delivery?.shouldSuppressLocalPrompt?.({
|
|
cfg: params.cfg,
|
|
accountId: params.accountId,
|
|
payload: params.payload,
|
|
}) ?? false
|
|
);
|
|
}
|